
function checkPostCode()
{
	if(jQuery("input#input-postcode").val()=="")
	{
		 jQuery("#dialog4").dialog();
	}
	else
	{
		var checker = 0;
		jQuery("div.postcode-info").each(function search(){
			var postcode = jQuery("div.Postcode",this).text();
			if(postcode==jQuery("input#input-postcode").val())
			{
				if(jQuery("div.Run",this).text()!="DO NOT DELIVER")
				{
					checker+=1;
					
				}
			}
		});
		if(checker==0)
		{
			 $("#dialog3").dialog();
			 
		
			 t=setTimeout(function (){
		
			 window.location.href = "/newsletter.htm";
			},2000);
			 
		}
		else
		{
			 $("#dialog2").dialog();
		
			t=setTimeout(function (){
			window.location.href = "/order-now.htm";
				
			},2000);
			
		}
	}
}

jQuery(document).ready(function(){

	
		
	
	currentpath= document.location.href;
	if(currentpath=="http://eatfitfood1.digitalofficebuilder.com.au/home.htm#unautorized-access")
	{
	  $("#dialog").dialog();
	}
	if(currentpath=="http://www.eatfitfood.com.au/home.htm#unautorized-access")
	{
	  $("#dialog").dialog();
	}
	
	if(currentpath=="https://eatfitfood1.worldsecuresystems.com/home.htm#unautorized-access")
	{
	  $("#dialog").dialog();
		
	}
	
	if(currentpath=="http://eatfitfood1.digitalofficebuilder.com.au/home.htm#registered-already")
	{
	  $("#dialog5").dialog();
	}
	if(currentpath=="http://www.eatfitfood.com.au/home.htm#registered-already")
	{
	  $("#dialog5").dialog();
	}
	
	if(currentpath=="https://eatfitfood1.worldsecuresystems.com/home.htm#registered-already")
	{
	  $("#dialog5").dialog();
		
	}
	
	if(currentpath=="https://eatfitfood1.worldsecuresystems.com/Default.aspx?Error=Thank+you+for+logging+in." )
	{
		//$("#dialog").dialog();
		if(get_cookie("currentProgram")=="Healthy Eating")
		{
			window.location.href = "https://eatfitfood1.worldsecuresystems.com/healthy-eating-program.htm";
		}
		else if(get_cookie("currentProgram")=="Weight Loss")
		{
			window.location.href = "https://eatfitfood1.worldsecuresystems.com/weight-loss-program.htm";
		}
		else if(get_cookie("currentProgram")=="10Days Detox")
		{
			if(get_cookie("detoxdays")=="20 Days"){
				$(window.location).attr('href', 'https://eatfitfood1.worldsecuresystems.com/20day-overhaul-program.htm');
			}
			else{
				 $(window.location).attr('href', 'https://eatfitfood1.worldsecuresystems.com/10day-detox-program.htm');
			}
		}
		else if(get_cookie("currentProgram")=="5Days Cleanse")
		{
			window.location.href = "https://eatfitfood1.worldsecuresystems.com/5day-cleanse-program.htm";
		}
	}
	
	
	if(currentpath=="http://eatfitfood1.digitalofficebuilder.com.au/Default.aspx?Error=Thank+you+for+logging+in.")
	 {

			window.location.href = "https://eatfitfood1.worldsecuresystems.com/Default.aspx?Error=Thank+you+for+logging+in.";
	
	 }
	
	if(currentpath=="http://www.eatfitfood.com.au/Default.aspx?Error=Thank+you+for+logging+in.")
	 {

			window.location.href = "https://eatfitfood1.worldsecuresystems.com/Default.aspx?Error=Thank+you+for+logging+in.";
	
	 }
	
	
	
	if(currentpath=="https://eatfitfood1.worldsecuresystems.com/home.htm")
	{
		window.location.href = "http://www.eatfitfood.com.au/home.htm";
	}
	
	
	
	jQuery("td.photogalleryItem").each(function (){
	
		if(jQuery(this).html()=="")
		{
			jQuery(this).hide();
		}
	});
	
	jQuery("div.programs").hover(function(){
		jQuery("a",this).css("color","#fff");
	},function(){
		jQuery("a",this).css("color","#373737");
	});
	
	
	
	
	
	jQuery("div#healthyEatingProgram").click(function(){
		//$("#dialog6").dialog();
		window.location.href = "https://eatfitfood1.worldsecuresystems.com/healthy-eating-program.htm";
	});
	
	jQuery("div#weightLossProgram").click(function(){
		//$("#dialog6").dialog();
		window.location.href = "https://eatfitfood1.worldsecuresystems.com/weight-loss-program.htm";
	});
	
	jQuery("div#5DayCleanseProgram").click(function(){
		//$("#dialog6").dialog();
		window.location.href = "https://eatfitfood1.worldsecuresystems.com/5day-cleanse-program.htm";
	});
	
	jQuery("div#10DayDetoxProgram").click(function(){
		//$("#dialog6").dialog();
		window.location.href = "https://eatfitfood1.worldsecuresystems.com/10day-detox-program.htm";
	});
	
	jQuery("div#20DayOverhaulProgram").click(function(){
		 //$("#dialog6").dialog();
		window.location.href = "https://eatfitfood1.worldsecuresystems.com/20day-overhaul-program.htm";
	});
	
	
	
	
	
	var latestNews = jQuery("#latest-blog h2.post-title a").attr("href");
	jQuery("#innews a").attr("href",latestNews);
	
	
	
	jQuery("#newsletter img").hover(function(){
	jQuery(this).attr("src","/img/subscribebutton-hover.jpg");
},function(){
	jQuery(this).attr("src","/img/subscribebutton.jpg");
});

jQuery("#announcement div:first-child img").hover(function(){
	jQuery(this).attr("src","/img/facebook-hover2.jpg");
},function(){
	jQuery(this).attr("src","/img/facebook.jpg");
});

jQuery("#announcement div:nth-child(2) img").hover(function(){
	jQuery(this).attr("src","/img/twitter-hover.jpg");
},function(){
	jQuery(this).attr("src","/img/twitter.jpg");
});

jQuery("#contact-form #catwebformbutton").hover(function(){
	jQuery(this).css("background-image","url(/img/submitbutton-hover.jpg)");
},function(){
	jQuery(this).css("background-image","url(/img/submitbutton.jpg)");
});

jQuery("#subscribe-form #catwebformbutton").hover(function(){
	jQuery(this).css("background-image","url(/img/subscribe-but-hover.jpg)");
},function(){
	jQuery(this).css("background-image","url(/img/subscribe-but.jpg)");
});

jQuery("#payment-form #catwebformbutton").hover(function(){
	jQuery(this).css("background-image","url(/img/submitbutton-hover.jpg)");
},function(){
	jQuery(this).css("background-image","url(/img/submitbutton.jpg)");
});


jQuery("div.order-now-button").hover(function(){
	jQuery(this).css("background","url(/img/order-now-button-hover.jpg)");
},function(){
	jQuery(this).css("background","url(/img/order-now-button.jpg)");
});

jQuery("div.order-now").hover(function(){
	jQuery("div.order-now-button").css("background","url(/img/order-now-button-hover.jpg)");
},function(){
	jQuery("div.order-now-button").css("background","url(/img/order-now-button.jpg)");
});




window.onload=function(){
	jQuery('.banner-but').show();
	jQuery('.med-magazine').show();	
	
    //jQuery('.banner-picture').each(
	//jQuery('div.banner-picture').show();
}

});
