<!--

function popup(PopURL, PopName) { 
var newwin = window.open( PopURL, PopName, "toolbar=1,location=1,scrollbars=1,directories=1,resizable=1,width=640,height=400"); 
if(navigator.appName=="Netscape") newwin.focus(); 
} 


function popupgallery(PopURL, PopName) { 
var newwingal = window.open( PopURL, PopName, "toolbar=0,location=0,scrollbars=1,resizable=0,width=600,height=600"); 
if(navigator.appName=="Netscape") newwin.focus(); 
}

function popupgallery2(PopURL, PopName) { 
var newwingal = window.open( PopURL, PopName, "toolbar=0,location=0,scrollbars=1,resizable=0,width=300,height=200"); 
if(navigator.appName=="Netscape") newwin.focus(); 
}


function popupregions(PopURL, PopName) { 
var newwingal = window.open( PopURL, PopName, "toolbar=0,location=0,scrollbars=1,resizable=0,width=540,height=600"); 
if(navigator.appName=="Netscape") newwin.focus(); 
} 

function showemail(PopURL, PopName) { 
var newwingal = window.open( PopURL, PopName, "toolbar=0,location=0,scrollbars=1,resizable=0,width=300,height=150"); 
if(navigator.appName=="Netscape") newwin.focus(); 
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_validateForm() { //v2.0
//------ Customize this string if needed ------
var RefString="1234567890-()+.";
//---------------------------------------------
  var i,objStr,field,theCheck,atPos,theNum,colonPos,min,max,errors='';
  for (i=0; i<(MM_validateForm.arguments.length-2); i+=3) {
    objStr = MM_validateForm.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.substring(0,objStr.lastIndexOf('.')).
                 lastIndexOf('.'),objStr.length);  //fix layer ref if not supp
    field = eval(objStr);
    field.name = (field.name)?field.name:objStr;
    theCheck = MM_validateForm.arguments[i+2];
    if (field.value) { //IF NOT EMPTY FIELD
      if (theCheck.indexOf('isEmail') != -1) { //CHECK EMAIL
        atPos = field.value.indexOf('@');
        if (atPos < 1 || atPos == (field.value.length - 1))
          errors += '- '+field.name+' must contain an e-mail address.\n';
      } else if (theCheck != 'R') { //START NUM CHECKS
	thisNum=field.value;
	
	for (Count=0; Count < thisNum.length; Count++)  {
           TempChar= thisNum.substring (Count, Count+1);
           if (RefString.indexOf (TempChar, 0)==-1) { 
                theNum = '' ;}
	   else {
		theNum = thisNum;
	   }
        }
	if (field.value != ''+theNum) errors += '- '+field.name+' must contain a number.\n';
	theNum = parseFloat(field.value);
	if (theCheck.indexOf('inRange') != -1) { //CHECK RANGE
          colonPos = theCheck.indexOf(':');
          min = theCheck.substring(8,colonPos);
          max = theCheck.substring(colonPos+1,theCheck.length);
          if (theNum < min || max < theNum || field.value != ''+theNum) //bad range
            errors += '- '+field.name+' must contain a number between '+min+' and '+max+'.\n';
    } } }
    else if (theCheck.charAt(0) == 'R') errors += '- '+field.name+' is required.\n';
  }
  if (errors) alert('The following error(s) occurred:\n'+
                    errors);
  document.MM_returnValue = (errors == '')
}


function CountClicks(URL) {

   window.open(URL,'new','toolbar=1,menubar=yes,location=1,scrollbars=1,resizable=1,status=1'); 
   

    //if (document.all)
        var xMax = screen.width, yMax = screen.height;
    //else
        //if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        //else
         //  var xMax = 640, yMax=480;

   // var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;

    //window.open(URL,'new','screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+''); 
    
}

//used for category jump menu
function jump(theForm) 
{ 
    newURL = theForm.urls.options[theForm.urls.selectedIndex].value ; 
    if (newURL != "") location.href = newURL; 
} 













function Math() 
{

//Parties
var a=(document.form.p1.value)*1;
var b=(document.form.p2.value)*1;
var c=(document.form.p3.value)*1;
var d=(document.form.p4.value)*1;
var e=(document.form.p5.value)*1;

//Stationary
var f=(document.form.s1.value)*1;
var g=(document.form.s2.value)*1;
var h=(document.form.s3.value)*1;
var i=(document.form.s4.value)*1;
var j=(document.form.s5.value)*1;
var k=(document.form.s6.value)*1;

//Bridal
var l=(document.form.b1.value)*1;
var m=(document.form.b2.value)*1;
var n=(document.form.b3.value)*1;
var o=(document.form.b4.value)*1;
var p=(document.form.b5.value)*1;
var q=(document.form.b6.value)*1;
var r=(document.form.b7.value)*1;
var s=(document.form.b8.value)*1;
var t=(document.form.b9.value)*1;

//Photography / video
var u=(document.form.ph1.value)*1;
var v=(document.form.ph2.value)*1;
var w=(document.form.ph3.value)*1;
var x=(document.form.ph4.value)*1;
var y=(document.form.ph5.value)*1;
var z=(document.form.ph6.value)*1;
var aa=(document.form.ph7.value)*1;

//flowers
var bb=(document.form.f1.value)*1;
var cc=(document.form.f2.value)*1;
var dd=(document.form.f3.value)*1;
var ee=(document.form.f4.value)*1;
var ff=(document.form.f5.value)*1;
var gg=(document.form.f6.value)*1;

//reception
var hh=(document.form.r1.value)*1;
var ii=(document.form.r2.value)*1;
var jj=(document.form.r3.value)*1;
var kk=(document.form.r4.value)*1;
var ll=(document.form.r5.value)*1;
var mm=(document.form.r6.value)*1;
var nn=(document.form.r7.value)*1;
var oo=(document.form.r8.value)*1;

//Music
var pp=(document.form.m1.value)*1;
var qq=(document.form.m2.value)*1;
var rr=(document.form.m3.value)*1;

//Transportation
var ss=(document.form.t1.value)*1;
var tt=(document.form.t2.value)*1;

//Gifts
var uu=(document.form.g1.value)*1;
var vv=(document.form.g2.value)*1;
var ww=(document.form.g3.value)*1;
var xx=(document.form.g4.value)*1;
var yy=(document.form.g5.value)*1;
var zz=(document.form.g6.value)*1;

//Fees
var aaa=(document.form.fee1.value)*1;
var bbb=(document.form.fee2.value)*1;
var ccc=(document.form.fee3.value)*1;

//Miscellaneous
var ddd=(document.form.mi1.value)*1;
var eee=(document.form.mi2.value)*1;
var fff=(document.form.mi3.value)*1;
var ggg=(document.form.mi4.value)*1;
var hhh=(document.form.mi5.value)*1;
var iii=(document.form.mi6.value)*1;
var jjj=(document.form.mi7.value)*1;
var kkk=(document.form.mi8.value)*1;
var lll=(document.form.mi9.value)*1;
var mmm=(document.form.mi10.value)*1;
var nnn=(document.form.mi11.value)*1;

//Honeymoon
var ooo=(document.form.h1.value)*1;
var ppp=(document.form.h2.value)*1;
var qqq=(document.form.h3.value)*1;
var rrr=(document.form.h4.value)*1;
var sss=(document.form.h5.value)*1;

//other
var ttt=(document.form.o1.value)*1;
var uuu=(document.form.o2.value)*1;
var vvv=(document.form.o3.value)*1;
var www=(document.form.o4.value)*1;


var total=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+aa+bb+cc+dd+ee+ff+gg+hh+ii+jj+kk+ll+mm+nn+oo+pp+qq+rr+ss+tt+uu+vv+ww+xx+yy+zz+aaa+bbb+ccc+ddd+eee+fff+ggg+hhh+iii+jjj+kkk+lll+mmm+nnn+ooo+ppp+qqq+rrr+sss+ttt+uuu+vvv+www  ;
document.form.total.value =total;
}

function Save(){
 
   if (document.form.total.value=="")
   {
    alert("Please calculate the total"); 
    document.form.total.focus();
    return (false);
   }   
   
  if (document.form.Name.value=="")
   {
    alert("Please enter your name"); 
    document.form.Name.focus();
    return (false);
   }

   
   if (document.form.Email.value=="")
   {
    alert("Please enter your Email - it will be used to sign in, and access your worksheet"); 
    document.form.Email.focus();
    return (false);
   }

   if (document.form.Password.value=="")
   {
    alert("Please enter a Password"); 
    document.form.Password.focus();
    return (false);
   }

  document.form.action="wedding_worksheet2.asp";
  document.form.target="_self";
  document.form.method="POST"
  document.form.submit();
}

function Show(){

   if (document.form.total.value=="")
   {
    alert("Please calculate the total"); 
    document.form.total.focus();
    return (false);
   }   

  document.form.action="show_worksheet.asp";
  document.form.target="_blank";
  document.form.method="GET"
  //used GET method because it is faster in netscape 4
  document.form.submit();
}


function Edit(){
 
   if (document.form.total.value=="")
   {
    alert("Please calculate the total"); 
    document.form.total.focus();
    return (false);
   }   
   
  if (document.form.Name.value=="")
   {
    alert("Please enter your name"); 
    document.form.Name.focus();
    return (false);
   }

   
   if (document.form.Email.value=="")
   {
    alert("Please enter your Email - it will be used to sign in, and access your worksheet"); 
    document.form.Email.focus();
    return (false);
   }

   if (document.form.Password.value=="")
   {
    alert("Please enter a Password"); 
    document.form.Password.focus();
    return (false);
   }

  document.form.action="edit_wedding_worksheet2.asp";
  document.form.target="_self";
  document.form.method="POST"
  document.form.submit();
}

function PaymentCoupon(){
 
   if (document.form6.Amount.value=="")
   {
    alert("Please calculate the Price first."); 
    document.form6.Amount.focus();
    return (false);
   }      

  document.form6.action="payment_coupon.asp";
  document.form6.target="_blank";
  document.form6.method="POST"
  document.form6.submit();
}


function CreditCard1(){
 
   if (document.form6.Amount.value=="")
   {
    alert("Please calculate the Price first."); 
    document.form6.Amount.focus();
    return (false);
   }      


  document.form6.action="https://siternetusa.com/secure/MAW.asp";
  document.form6.target="_blank";
  document.form6.method="POST"
  document.form6.submit();
}

function CreditCard2(){
 
   if (document.form6.Amount.value=="")
   {
    alert("Please calculate the Price first."); 
    document.form6.Amount.focus();
    return (false);
   }      

  document.form6.action="creditcard_coupon.asp";
  document.form6.target="_blank";
  document.form6.method="POST"
  document.form6.submit();
}

function CalculatePrice(){

//sets the price according to the ListingType - ListingType is an hidden field
if (document.form6.ListingType.value=="Standard" ){
Price=100;
}else if (document.form6.ListingType.value=="Enhanced" ){
Price=150;
}else if (document.form6.ListingType.value=="Expanded" ){
Price=275;
}
   
  Price2=Price
  
  // 40% discount
  if(document.form6.OfferCode.value=="RIW1"){
  Amount=eval(Price)*.60;
  Price2=Amount;
  }
  
  // 30% discount
  if(document.form6.OfferCode.value=="MAWG"){
  Amount=eval(Price)*.70;
  Price2=Amount;
  }
  
  // 20% discount
  if(document.form6.OfferCode.value=="1101"){
  Amount=eval(Price)*.80;
  Price2=Amount;
  }

  if(document.form6.OfferCode.value=="X174"){
  Amount=eval(Price)*.40;
  Price2=Amount;
  }
    
  if(document.form6.OfferCode.value=="WSD"){
  Amount=eval(Price)* 0;
  Price2=Amount;
  }
  
  
  if(document.form6.OfferCode.value=="3MF"){
  Amount=eval(Price)* 0;
  Price2=Amount;
  }

  if(document.form6.OfferCode.value=="1FM"){
  Amount=eval(Price)* 0;
  Price2=Amount;
  }

  if(document.form6.OfferCode.value=="FREE"){
  Amount=eval(Price)* 0;
  Price2=Amount;
  }
  
  
    
  Amount=Price2
  
 //if(document.form6.Link[0].checked==true ){
 //Amount= (Price2) - eval(Price2)*1 ;
 //}else{
 //Amount=Price2
 //}
  
  if(document.form6.Link[0].checked==true && document.form6.LinkURL.value=="" ){
  alert("Please enter an URL");
  document.form6.LinkURL.focus()
  return (false);
  
  } 
  
  document.form6.Amount.value="$" + Amount; 
  
}

//-->