/**
 * Load the picture navigation when the DOM is loaded
 */
$(document).ready(function(){
	var so = new SWFObject("/swf/picsLeft.swf", "SBX", "210", "285", "8", "#FFFFFF");
	so.useExpressInstall('expressinstall.swf');
	so.addParam("wmode", "transparent");
	so.write("pics-left");

	so = new SWFObject("/swf/picsTop.swf", "SBX", "249", "152", "8", "#FFFFFF");
	so.useExpressInstall('expressinstall.swf');
	so.addParam("wmode", "transparent");
	so.write("pic-top");
	
	$('input.ab').focus(function(){
		$(this).animate({style: 'border:1px solid #9BB73E; background-color:#E9EEF4'},300);
	});
	$('input.ab').blur(function(){
		$(this).animate({style: 'border:1px solid #666666; background-color:#ffffff'},300);
	});
	$('#agreeCheckbox').click(function(){
		if(this.checked){
			$(this.parentNode).animate({opacity: 0.5}, 1000);
		}
		else{
			$(this.parentNode).animate({opacity: 1}, 1000);
		}
	});
});

/**
 * Open the first gallery object. If one doesn't exist fail silently
 */
function openGallery (){
	try{
		var firstImage = document.getElementById('gallery_1');
		tb_show(firstImage.title, firstImage.href, firstImage.rel);
	}catch(e){}
}

/**
 * Open the terms of service popup for the site with the given preferences
 */
function openTerms(){
	window.open("/plain/terms_of_service",null,"height=400,width=500,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");	
}

