function checkBlank(el, name){
	var value = document.getElementById(el).value;
	if(value == ""){
		document.getElementById(el).value=name;	
	}
}

function pageLoad (page, scripts) {
	$("<div></div>").attr("id","newDiv").css("position","absolute").css("zIndex","9999").insertBefore("#ajax-wrapper");
	$("#ajax-wrapper .Page").clone().appendTo("#newDiv");
	$("#ajax-wrapper").load(page+" .Page",'',function(){
		$.getScript(scripts, function(){
			$("#newDiv").fadeOut("1000", function() {
				$("#newDiv").empty().remove();								  
			});	
		});
	});
}

$(document).ready(function(){
	$('.obfuscate').nospam({ filterLevel: 'low' });
	/*$(".about").mousemove(function(){
		$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_about3.jpg' alt='' />");								
	});
	
	$(".experience").mousemove(function(){
		$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_experience2.jpg' alt='' />");								
	});
	
	$(".creativeteam").mousemove(function(){
		$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_creativeteam4.jpg' alt='' />");								
	});
	
	$(".ourplace").mousemove(function(){
		$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_ourplace2.jpg' alt='' />");								
	});
	
	$(".ourapproach").mousemove(function(){
		$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_ourapproach.jpg' alt='' />");								
	});
	
	$(".highfives").mousemove(function(){
		$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_highfives3.jpg' alt='' />");								
	});*/
	
	$("html").mousemove(function(){
		if ($("#preload").html() == '') {
			$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_about3.jpg' alt='' />");
			$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_experience2.jpg' alt='' />");
			$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_creativeteam4.jpg' alt='' />");
			$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_ourplace2.jpg' alt='' />");
			$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_ourapproach.jpg' alt='' />");	
			$("#preload").html("<img src='http://images.adventuresdesign.com/bg_page_highfives3.jpg' alt='' />");	
		}
	});
	
	
	$("#SignLinks #about").click(function(){
		pageLoad("seattle-graphic-web-design-firm.php", "js/obfuscate.js");
	});
	
	$("#SignLinks #experience").click(function(){
		pageLoad("advertising-industry-experience.php", "js/obfuscate.js");
	 });
	 
	 $("#SignLinks #creativeteam").click(function(){
		pageLoad("creative-team.php","js/custom_creativeteam.js")	;																  
	 });
	
	$("#SignLinks #ourplace").click(function(){
		pageLoad("seattle-office-location.php", "js/custom_ourplace.js");
	 });	
	
	$("#SignLinks #ourapproach").click(function(){
		pageLoad("design-development-approach.php","js/custom_ourapproach.js");
	});
	
	$("#SignLinks #highfives").click(function(){
		pageLoad("your-appreciation-high-fives.php","js/custom_highfives.js");																  
	});
						   
	$('ul#Primary').superfish();
	
	$("#SignLinks a").append("<img src='site/clear.gif' alt='' class='invisible' />");
	
	$("#SignLinks a").each(function() {
		$(this).click(function(){
			if ($(this).hasClass("Active")) {
				return true;
			} else {
				$("#SignLinks a").removeClass("Active");		   
				$(this).addClass("Active");
			
				return false;
			
			}
		});
	});

	
	$.preloadCssImages();
	
	
});
