
jQuery.preloadContent=function(){for(var i=0;i<arguments.length;i++)
{jQuery("<div>").html(arguments[i]);}}
$(function(){$("#headerImg").append();$.preloadContent("images/header-banners/2.jpg","images/header-banners/3.jpg","images/header-banners/4.jpg","images/header-banners/5.jpg","images/header-banners/6.jpg");$('#headerImg').cycle({timeout:10000});$(".teams .call").click(function(){$(this).hide("slow");$(".callme").hide();$(".shortInfo").show();$(".call").show();$(this).parent().find(".shortInfo").hide("slow");$(this).parent().find(".callme").show();return false;});$(".teams .close").click(function(){var parent=$(this).parent().parent().parent();parent.find(".callme").hide("slow");parent.find(".shortInfo").show("slow");parent.find(".call").show("slow");return false;});$(".lastNews .pleasecallme").click(function(){$(this).parent().parent().hide();$(".callme").hide();$(this).parent().parent().parent().find(".callme").show("slow");return false;});$(".lastNews .close").click(function(){var parent=$(this).parent().parent().parent();parent.find(".callme").hide();parent.find(".callButton").show();return false;});$("#header :submit").click(function(){$('form').submit(function(){return false;});$("#label").hide();$("#confirmation").html("Please wait...");$("#confirmation").show();formAction=$("form").attr("action");emailId=formAction.replace("http://livealchemy2.createsend.com/t/y/s/","");emailId=emailId.replace("/","");emailId=emailId+"-"+emailId;if(!checkEmail(emailId)){alert("Please enter a valid email address");$("#confirmation").hide();$("#label").show();return;}
var str=$("form").serialize();final=str+"&action="+formAction;$.ajax({url:"ajaxproxy.php",type:"POST",data:final,success:function(html){if(html.indexOf("You have successfully subscribed to this list.")==-1){$("#confirmation").html("There was a problem subscribing. Please try again later.");}else{$("#confirmation").html("Thank you for subscribing.");var pageTracker=_gat._getTracker("UA-9643883-1");pageTracker._trackPageview("/subscribe.htm");}},failure:function(html){$("#confirmation").html("There was a problem. Please try again later.");}});});});function checkEmail(email)
{var pattern=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;var emailVal=$("#"+email).val();return pattern.test(emailVal);}