
<!--//


function goto(there) {
	var location = there.options[there.selectedIndex].value;
	window.location.href = location;
}

var who = document.title;
if(who=='Untitled Document'){ who = 'dailyLuxe'; }else{ who = 'dailyLuxe - ' + who; }


function show_image(strPath, strImageName) {
 imgSrc = new Image();
 imgSrc.src = strPath + strImageName;
 document.getElementById('large_image').src = imgSrc.src;
}


function popUnder(l,w,h){
 if(!(window.popunder)){
  var popunder = window.open(l,'popunder','width='+w+',height='+h);
  popunder.blur();
 }
}

function setHomepage(url){
 document.body.style.behavior='url(#default#homepage)';
 document.body.setHomePage(url);
}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}






var allowSubmit=1;
var origButton='';

function resetForm(frm){
 frm=document.orderForm;
 allowSubmit=1;
 frm.submitButton.value=origButton;
 alert('Order did not properly submit, please try it again.');
}

function submitForm(frm){
 if(allowSubmit){
  if(validateForm(frm)){
   allowSubmit=0;
   setTimeout('resetForm('+frm+');',60000);
   origButton=frm.submitButton.value;
   frm.submitButton.value='Processing ...';
   frm.submit();
  }
 }else{
  alert('Please wait a minute before trying again, the form is currently in process');
 }
}

function validateForm(frm){
 var strWork='';
 var bitResults=true;
 var strNotice='';

 strWork=frm.first_name.value;
 if(!(strWork.length>0)){
  strNotice+=(strNotice ? '\n' : '')+'Please Enter your First Name';
  bitResults=false;
 }

 strWork=frm.last_name.value;
 if(!(strWork.length>0)){
  strNotice+=(strNotice ? '\n' : '')+'Please Enter your Last Name';
  bitResults=false;
 }

 strWork=frm.address_primary.value;
 if(!(strWork.length>5)){
  strNotice+=(strNotice ? '\n' : '')+'Please Enter your Address';
  bitResults=false;
 }

 strWork=frm.city.value;
 if(!(strWork.length>5)){
  strNotice+=(strNotice ? '\n' : '')+'Please Enter your City';
  bitResults=false;
 }

 strWork=frm.state.selectedIndex;
 if(!(strWork>0)){
  strNotice+=(strNotice ? '\n' : '')+'Please Select your State';
  bitResults=false;
 }

 strWork=frm.postal_code.value;
 if(!(strWork.length>2 && strWork.length<9)){
  strNotice+=(strNotice ? '\n' : '')+'Please Enter your Postal Code';
  bitResults=false;
 }

 if(frm.is_bank_card){
  if(frm.is_bank_card[0].checked){

   strWork=frm.bank_name.value;
   if(!(strWork.length>3)){
    strNotice+=(strNotice ? '\n' : '')+'Please Enter a Valid Bank Name ( example: San Diego County Credit Union )';
    bitResults=false;
   }

   strWork=frm.routing_number.value;
   if(!(strWork.length>4)){
    strNotice+=(strNotice ? '\n' : '')+'Please Enter a Valid Bank Routing Number ( notes: routing numbers should be greater than 4 numbers )';
    bitResults=false;
   }

   strWork=frm.account_number.value;
   if(!(strWork.length>4)){
    strNotice+=(strNotice ? '\n' : '')+'Please Enter a Valid Bank Account Number ( notes: bank account numbers should be greater than 4 numbers )';
    bitResults=false;
   }

   strWork=frm.check_number.value;
   if(!(strWork>0)){
    if(confirm('Press OK to Allow a Random Check Number to be Created')){
     var now=new Date();
     frm.check_number.value=now.getHours() * 1000;
    }else{
     strNotice+=(strNotice ? '\n' : '')+'Please Enter a Check Number';
     bitResults=false;
    }
   }

  }else if(frm.is_bank_card[1].checked){

   strWork=frm.card_number.value;
   if(!(strWork.length>12 && strWork.length<17)){
    strNotice+=(strNotice ? '\n' : '')+'Please Enter a Valid Credit Card Number ( notes: credit card numbers should be greater than 12 and less than 17 numbers )';
    bitResults=false;
   }

   strWork=frm.card_verification.value;
   if(strWork.length>4 || strWork.length<3){
    strNotice+=(strNotice ? '\n' : '')+'Please Enter a Valid Credit Card CVV Number ( notes: CVV numbers are 3 or 4 digits long )';
    bitResults=false;
   }

   var thisDate = new Date();
   strWork=frm.card_expiration_year[frm.card_expiration_year.selectedIndex].value;
   if(thisDate.getYear()>strWork){
    strNotice+=(strNotice ? '\n' : '')+'The Credit Card Expiration Date has Already Past';
    bitResults=false;
   }else{
    if(thisDate.getYear()==strWork){
     strWork=frm.card_expiration_month[frm.card_expiration_month.selectedIndex].value;
     strWork=strWork-1;
     if(strWork<=thisDate.getMonth()){
      strNotice+=(strNotice ? '\n' : '')+'The Credit Card Expiration Date is, or Soon Will be Past';
      bitResults=false;
     }
    }
   }

  }else{
   strNotice+=(strNotice ? '\n' : '')+'Please Choose Billing Method';
   bitResults=false;
  }
 }

 if(!(bitResults)){
  alert('There were some Errors in the Form\n--------------------------------------------------------\n'+strNotice);
 }
 return bitResults;
}

function confirmReset(frm){
 if(confirm('Are you sure you want to RESET this form?')){
  frm.reset();
 }
}

//-->
