function OpenWindow(url)
{
 paramString = "width=" + Math.round(.75 * screen.width) + 
               ", innerWidth=" + Math.round(.75 * screen.width) + 
               ", outerWidth=" + Math.round(.75 * screen.width + 50) +  
               ", height=" + Math.round(.75 * screen.height) + 
               ", innerHeight=" + Math.round(.75 * screen.height) + 
               ", outerHeight=" + Math.round(.75 * screen.height+ 50) + 
               ", left=" + Math.round(.1 * screen.width) + 
               ", screenX=" + Math.round(.1 * screen.width) +
               ", top=" + Math.round(.05 * screen.height) + 
               ", screenY=" + Math.round(.05 * screen.width) +
               ', toolbar=yes, menubar=yes, titlebar=yes, status=yes, resizable=yes, location=yes, scrollbars=yes';
 
 if ( document.all )
  win = window.open(url,'displaywin',paramString);
 else
  win = window.open(url,'displaywin',"width=600,height=500,screenX=20,screenY=20,resizable,scrollbars");

 win.focus();
 
 return false;
}

function OpenDisplayWindow(url)
{
 paramString = "width=" + Math.round(.7 * screen.width) + 
               ", innerWidth=" + Math.round(.7 * screen.width) + 
               ", outerWidth=" + Math.round(.7 * screen.width + 50) +  
               ", height=" + Math.round(.8 * screen.height) + 
               ", innerHeight=" + Math.round(.8 * screen.height) + 
               ", outerHeight=" + Math.round(.8 * screen.height+ 50) + 
               ", left=" + Math.round(.15 * screen.width) + 
               ", screenX=" + Math.round(.15 * screen.width) +
               ", top=" + Math.round(.05 * screen.height) + 
               ", screenY=" + Math.round(.05 * screen.width) +
               ", toolbar=no, menubar=no, titlebar=no, status=no, resizable=yes, location=no, scrollbars=yes";

 if ( document.all )
  win = window.open(url,'displaywin',paramString);
 else
  win = window.open(url,'displaywin',"width=600,height=500,screenX=20,screenY=20,resizable,scrollbars");
 
 win.focus();

 return false;
}

function OpenPopupWindow(url)
{
 win = window.open(url,'displaywin',"width=250,height=250,screenX=50,screenY=50,top=50,left=50");
 win.focus();
 
 return false;
}

function OpenAccountWindow(url)
{
 win = window.open(url,'displaywin',"width=530,height=530,screenX=50,screenY=50,top=50,left=50");
 win.focus();
 
 return false;
}

function ValidateOrderForm()
{
 if ( !document.order.Name.value )
  alert('Please enter your name.');
 else if ( !document.order.Address1.value )
  alert('Please enter your address.');
 else if ( !document.order.CSZ.value )
  alert('Please enter your city, state, and zip code.');
 else if ( !document.order.Area.value || !document.order.Prefix.value || !document.order.Suffix.value )
  alert('Please enter your phone number.');
 else if ( !document.order.Email.value )
  alert('Please enter your email address.');
 else if ( !document.order.EmailConfirm.value )
  alert('Please confirm your email address.');
 else if ( document.order.Email.value != document.order.EmailConfirm.value )
  alert('Email addresses do not match.');
 else if ( !document.order.AccountType[0].checked && !document.order.AccountType[1].checked && !document.order.AccountType[2].checked )
  alert('Please select account type.');
 else if ( !document.order.AccountName.value )
  alert('Please enter primary account name.');
 else if ( !document.order.Subdomain.value )
  alert('Please enter subdomain.');
 else if ( document.order.DomainName.checked && !document.order.DomainType[0].checked && !document.order.DomainType[1].checked )
  alert('Please select either the purchase a new domain or the transfer an existing domain.');
 else if ( document.order.DomainName.checked && document.order.DomainType[0].checked && !document.order.NewDomain.value )
  alert('Please enter the name of the new domain you wish to purchase.');
 else if ( document.order.DomainName.checked && document.order.DomainType[1].checked && !document.order.TransferDomain.value )
  alert('Please enter the name of the existing domain you wish to transfer.');
 else if ( document.order.Diskspace.checked && ( !document.order.DiskspaceAmt.value || document.order.DiskspaceAmt.value <= 0 ) )
  alert('Please enter the number of extra 5 MB chunks of disk space.');
 else if ( document.order.WebDesign.checked && !document.order.WebDesignInfo.value )
  alert('Please enter the description of your website.');
 else
  document.order.submit();

 return false;
}
