$(document).ready(function() {
	
	//jQuery for email field
	$("#txtEmail").focus(function(){
		if($("#txtEmail").attr("value") == "Enter your email address")
		{
			$("#txtEmail").attr("value","");
		}
		return false;
	});
					
	//jQuery for modals
	$(".modal").hide();
	
	
	$(".navKeyFeatures").click(function(){
		$("#keyFeatures").modal({opacity:50,closeHTML:'<a href="#" id="btnModalClose">Close</a>', maxHeight:229, maxWidth:504});
		return false;
	});
	
	$(".navTerms").click(function(){
		$("#fullTerms").modal({opacity:50,closeHTML:'<a href="#" id="btnModalClose">Close</a>', maxHeight:229, maxWidth:504});
		return false;
	});
	
	$("#whyChooseCTA").click(function(){
		$("#whyChoose").modal({opacity:50,closeHTML:'<a href="#" id="btnModalClose">Close</a>', maxHeight:229, maxWidth:504});
		return false;
	});
	
	//jQuery for summary box
	$("#sbSource").hide();					   
						   
	$("#btnMore_1").click(function(){
		html = $("#sb1").html();
		$("#sbInfoInner").html(html);
		sbSlideOut();
		return false;
	});
	$("#btnMore_2").click(function(){
		html = $("#sb2").html();
		$("#sbInfoInner").html(html);
		sbSlideOut();
		return false;
	});
	$("#btnMore_3").click(function(){
		html = $("#sb3").html();
		$("#sbInfoInner").html(html);
		sbSlideOut();
		return false;
	});
	$("#btnMore_4").click(function(){
		html = $("#sb4").html();
		$("#sbInfoInner").html(html);
		sbSlideOut();
		return false;
	});
	
	$("#btnClose").click(function(){
		sbSlideIn();
		return false;
	});
	
	function sbSlideOut()
	{
		$("#summaryBox").css({'z-index':'200'});
		$("#beforeApplying").css({'z-index':'100'});
		$("#sbInfo").animate({'right':'0px'}, 1000);	
	}
	
	function sbSlideIn()
	{
		
		$("#sbInfo").animate({'right':'-466px'}, 1000);
		setTimeout(function()
			 { 
				$("#summaryBox").css({'z-index':'100'});
				$("#beforeApplying").css({'z-index':'200'}); 
			 }, 1000);
		
	}
	
});

