function rs3(u,w,h) {
   winStats='toolbar=no,location=no,directories=no,menubar=no,resizable=no'
   winStats+=',scrollbars=yes'
   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left=50,top=50,width=' + w + ',height=' + h;
    }else{
      winStats+=',screenX=50,screenY=50,width=' + w + ',height=' + h;
    }
   buyWindow=window.open(u,target='_blank',winStats)     
   buyWindow.focus()
}

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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

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_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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function FrontPage_Form2_Validator(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
   if (theForm.street.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.street.focus();
    return (false);
  }
   if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
   if (theForm.state.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.state.focus();
    return (false);
  }
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.zip.focus();
    return (false);
  }
   if (theForm.country.selectedIndex == 0)
  {
    alert("The first \"Country\" option is not a valid selection.  Please choose Your Country Name.");
    theForm.country.focus();
    return (false);
  }
  if (theForm.Name.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  
   if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"email\" field.");
    theForm.email.focus();
    return (false);
  }
   if (!isEmailAddr(theForm.email.value))
  {
    alert("Please enter a valid email address in the form: yourname@yourdomain.com");
    theForm.email.focus();
    return (false);
  }

  if (theForm.MobileNumber.value == "")
  {
    alert("Please enter a value for the Contact Number field.");
    theForm.MobileNumber.focus();
    return (false);
  }
  
  if (isNaN(theForm.MobileNumber.value))
  {
  alert("Please enter only Numerical Value.");
  theForm.MobileNumber.value="";
  theForm.MobileNumber.focus()
  return(false)
  }
  
  if (theForm.MobileNumber.value.length < 10)
  {
    alert("Please enter at least 10 characters in the Contact Number field.");
    theForm.MobileNumber.focus();
    return (false);
  }

  if (theForm.Model.selectedIndex == 0)
  {
    alert("The first \"Select Your Phone\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Model.focus();
    return (false);
  }

  if (theForm.Network.selectedIndex == 0)
  {
    alert("The first \"Network\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Network.focus();
    return (false);
  }

  if (theForm.IMEINumber.value == "")
  {
    alert("Please enter a value for the \"IMEINumber\" field.");
    theForm.IMEINumber.focus();
    return (false);
  }
  
   if (theForm.IMEINumber.value.length < 15)
  {
    alert("Please enter at least 15 digits in the \"IMEINumber\" field.");
    theForm.Name.focus();
    return (false);
  }

 if (theForm.legaldisclaimer.checked == false)
  {
    alert("You must agree to our Terms, Conditions & Legal Disclaimer.");
    theForm.legaldisclaimer.focus();
    return (false);
  }
  return (true);
}

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}