var mondelai;

//==============================
function fsOver(picturepath){
clearTimeout(mondelai);
var tmp=document.getElementById("fullphoto"); 
tmp.innerHTML='<img src="'+picturepath+'" onmouseover="HoldPicture()">';
/*
if(event.clientX!=null){x=event.clientX; }
else if(event.screenX!=null){x=event.screenX; }
else {x=500; }


if(x<450){tmp.style.left="500px";}
else { tmp.style.left="0px"; }
*/

tmp.style.display="block";
}

//==============================
function HidePicture(){
document.getElementById("fullphoto").style.display='none';
clearTimeout(mondelai);
}

//==============================
function fOut(){
clearTimeout(mondelai);
mondelai=setTimeout(HidePicture,1000);
}

//==============================
function HoldPicture(){
document.getElementById("fullphoto").style.display="block";
return true;
}

//==============================
function NoClick(){
alert("Thanks for Shopping at MaryPauline.com");
}



//=======================================
function BuyGiftCertificate(){
document.getElementById("mailinglist").innerHTML='<span class="darkred"><b>Send a Gift Certificate to a Friend or Loved One!</b></span><form action="'+SiteURL+'/cart/certificate.html" method="post" name="discountform" onsubmit="return ValidateGiftCertificate()" ><input type="hidden" name="todo"  value="buycertificate" /><input type="hidden" name="recipient"  value="" /><input type="hidden" name="senderemail"  value="" /><b>Gift Certificate Amount</b><br /><select name="giftamount" size="1"><option value="25.00">$25.00</option><option value="50.00" selected>$50.00</option><option value="75.00">$75.00</option><option value="100.00">$100.00</option><option value="125.00">$125.00</option><option value="150.00">$150.00</option><option value="175.00">$175.00</option><option value="200.00">$200.00</option></select><br /><b>Your Name</b><br /><input name="sender" type="text" size="20" maxlength="40" id="sender"/><br /><b>Recipient\'s Email address</b><br /><input name="recipientemail" type="text" size="20" maxlength="250" id="recipientemail" /><br /><input name="Submit" id="Submit" type="Submit" value="Buy Now"  /></form><br />';	
	
return true;
}

//=======================================
function GetDiscountCertificate(){
document.getElementById("mailinglist").innerHTML='<span class="darkred"><b>Get a 10% Discount  Now!</b></span><form action="'+SiteURL+'/cart/certificate.html" method="post" name="discountform" onsubmit="return ValidateNewDiscount()" ><input type="hidden" name="todo"  value="newdiscount" /><b>First Name</b><br /><input name="firstname" type="text" size="20" maxlength="40" id="firstname"/><br /><b>Email address</b><br /><input name="email" type="text" size="20" maxlength="250" id="email" /><br /><input name="Submit" id="Submit" type="Submit" value="Get it Now"  /></form>Discount Certificate to be sent to your email address. Redeemable<br />in Your Current Shopping Cart.<br />';	
	
return true;
}


//=======================================
function RedeemGiftCertificate(){
document.getElementById("mailinglist").innerHTML='<span class="darkred"><b>Redeem Your Gift Certificate!</b></span><form action="'+SiteURL+'/cart/certificate.html" method="post" name="discountform" onsubmit="return ValidateCertificate()" ><input type="hidden" name="todo"  value="redeemgift" /><b>Certificate ID</b><br /><input name="certificateid" type="text" size="20" maxlength="40" id="certificateid"/><br /><b>Email address</b><br /><input name="email" type="text" size="20" maxlength="250" id="email" /><br /><input name="Submit" id="Submit" type="Submit" value="Redeem"  /></form><br />';	
	
return true;	
}


//=======================================
function RedeemDiscountCertificate(){
document.getElementById("mailinglist").innerHTML='<span class="darkred"><b>Redeem Your Discount Certificate!</b></span><form action="'+SiteURL+'/cart/certificate.html" method="post" name="discountform" onsubmit="return ValidateCertificate()" ><input type="hidden" name="todo"  value="redeemdiscount" /><b>Certificate ID</b><br /><input name="certificateid" type="text" size="20" maxlength="40" id="certificateid"/><br /><b>Email address</b><br /><input name="email" type="text" size="20" maxlength="250" id="email" /><br /><input name="Submit" id="Submit" type="Submit" value="Redeem"  /></form><br />';	
	
return true;	
}

//========================================
function ValidateNewDiscount(){
var Msge, tmp;
tmp=document.discountform.firstname;
Msge="Please provide your first name";
if(!CheckField(tmp, Msge)){return false; }	
tmp=document.discountform.email;
Msge="Please provide your email address";
if(!CheckEmail(tmp, Msge)){return false; }	
	
return true;
}

//========================================
function ValidateGiftCertificate(){
var Msge, tmp;
tmp=document.discountform.sender;
Msge="Please provide your name";
if(!CheckField(tmp, Msge)){return false; }	
tmp=document.discountform.recipientemail;
Msge="Please provide the recipient's email address";
if(!CheckEmail(tmp, Msge)){return false; }		
	
	
return true;	
}


//========================================
function ValidateCertificate(){
var Msge, tmp;

tmp=document.discountform.certificateid;
Msge="Please provide your certificate id";
if(!CheckField(tmp, Msge)){return false; }
tmp=document.discountform.email;
Msge="Please provide the recipient\' email address";
if(!CheckEmail(tmp, Msge)){return false; }
	
return true;
}

//========================================
function ValidateWishList(){
var Msge, tmp;
tmp=document.wishlistform.email;
Msge="Please provide your  email address";
if(!CheckEmail(tmp, Msge)){return false; }
	
return true;
}

//========================================
function ValidateTellAFriend(){
var Msge, tmp;

tmp=document.tellafriendform.yourname;
Msge="Please provide your name";
if(!CheckField(tmp, Msge)){return false; }
tmp=document.tellafriendform.youremail;
Msge="Please provide your  email address";
if(!CheckEmail(tmp, Msge)){return false; }
tmp=document.tellafriendform.friendsemails;
Msge="Please enter your friends' email addresses";
if(!CheckField(tmp, Msge)){return false; }

return true;	
}


//========================================
function DoSearch(){
var Msge, tmp;

tmp=document.searchform.keywords;
Msge="Please enter your search keywords";
if(!CheckField(tmp, Msge)){return false; }

return true;
}
