// $Id: site.js,v 1.7 2006/02/06 02:13:33 lludwig Exp $
// Written by: Larry Ludwig (lludwig@empoweringmedia.com)

var IE = (document.all) ? 1:0;
var NN = (document.layers) ? 1:0;
/* This is modified a bit so that you can declare any layer you want to hide. 
YOu can also create a "showLayer" function using the exact same code 
only switching "hidden" to "visible" */

function setmainwindow()
{
    window.name='hostasite';
}

// Credit Card Security Code Pop Up Window
function ccsecuritypopup() {  
  window.open("/signup/ccsecurity.html", "ccsecurity", "width=560,height=320,menubar=no,location=no,scrollbars=no,resizable=no,toolbar=no");
}

// Screenshots Pop Up Window
function screenshotspopup(title,url,initimg) {
  window.open("/plans/standardfeatures/screenshots/?title="+title+"&url="+url+"&initimg="+initimg, "screenshots", "width=470,height=500,menubar=no,location=no,scrollbars=no,resizable=no,toolbar=no");
}

function cpcontact() {
  // copy info
  document.forms[0].firstname.value = document.forms[0].cfirstname.value;
  document.forms[0].lastname.value = document.forms[0].clastname.value;
  document.forms[0].organization.value = document.forms[0].corganization.value;
  document.forms[0].addressa.value = document.forms[0].caddressa.value;
  document.forms[0].addressb.value = document.forms[0].caddressb.value;
  document.forms[0].city.value = document.forms[0].ccity.value;
  document.forms[0].stateprov.value = document.forms[0].cstateprov.value;
  document.forms[0].postalcode.value = document.forms[0].cpostalcode.value;
  document.forms[0].country.value = document.forms[0].ccountry.value;
  document.forms[0].telephone.value = document.forms[0].ctelephone.value;
  document.forms[0].email.value = document.forms[0].cemail.value;
}

function OpenCertDetails()
{
  thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=USEMPO7', 'anew', config='height=510,width=500,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');
}

function select_row(what, num) {
var select_class = "tablerowcolor1";
var off_class = "tablewhite";

  if (IE) {
    row = document.all[what + "_row" + num.toString()];
    if(!row) return;
    row.className=select_class;
  
    var i = 0;
    while(i < 10) {
      if(!document.all[what + "_row" + i.toString()]) break;
  
      if(i != num)
      {
        row = document.all[what + "_row" + i.toString()];
        row.className=off_class;
      }
      i++;
    }
  }
  else {
    row = document.getElementById(what + "_row" + num.toString());
    if(!row) return;
    row.className=select_class;

    rows = document.getElementsByName(what + "_row");
    for(var i = 0; i < rows.length; i++) {
      if(i != num) rows[i].className = off_class;
    }
  }
}

function paypalselected() {
  if (document.forms[0].paymenttype.options[document.forms[0].paymenttype.selectedIndex].value=='PAY') {
    document.forms[0].ccnumber.value='';
    document.forms[0].ccsecuritycode.value='';
    document.forms[0].ccmonth.value='';
    document.forms[0].ccyear.value='';
    document.forms[0].ccnumber.disabled=true;
    document.forms[0].ccsecuritycode.disabled=true;
    document.forms[0].ccmonth.disabled=true;
    document.forms[0].ccyear.disabled=true;

    if (IE){
      document.all.ccnum.style.visibility="hidden";
      document.all.securitycode.style.visibility="hidden";
      document.all.expdate.style.visibility="hidden";
    }
    else {
      document.ccnum.visibility="hidden";
      document.securitycode.visibility="hidden";
      document.expdate.visibility="hidden";
    }
  }
  else {
    document.forms[0].ccnumber.disabled=false;
    document.forms[0].ccsecuritycode.disabled=false;
    document.forms[0].ccmonth.disabled=false;
    document.forms[0].ccyear.disabled=false;
    if (IE){
      document.all.ccnum.style.visibility="visible";
      document.all.securitycode.style.visibility="visible";
      document.all.expdate.style.visibility="visible";
    }
    else if (NN){
      document.ccnum.visibility="show";
      document.securitycode.visibility="show";
      document.expdate.visibility="show";
    }
  }
}

function disablenext() {
   document.forms[0].faction.disabled=true;
}
