
	var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
 				
    if(pos=="random"){     
        LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
        TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
    }
    
    if(pos=="center"){
        LeftPosition=(screen.width)?(screen.width-w)/2:100;
        TopPosition=(screen.height)?(screen.height-h)/2:100;
    }
    
    else if((pos!="center" && pos!="random") || pos==null){
        LeftPosition=0;TopPosition=20;
    }
		 settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
		 
		 win=window.open(mypage,myname,settings)

	}

function resize(){

	top.window.moveTo(100,100);
	 top.window.outerHeight = screen.availHeight/1.5;
       	 	
	top.window.outerWidth = screen.availWidth/1.5;

	}

function checkIt(whatForm){
	archstyle = -1
	for (i=0; i< whatForm.archstyle.length; i++){
		if (whatForm.archstyle[i].checked){
			archstyle = i
		}
	}
	if(archstyle == -1){
		alert("Please choose an \"Archstyle Type\" to begin the process.");
    	whatForm.focus();
   		 return (false);
  }
   return (true);
}
	
	
function validator(theForm){

  if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.name.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.name.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }

  if (theForm.address.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.address.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }

  if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.city.focus();
    return (false);
  }

  if (theForm.city.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"City\" field.");
    theForm.city.focus();
    return (false);
  }

  if (theForm.city.value.length > 20)
  {
    alert("Please enter at most 20 characters in 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.state.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"State\" field.");
    theForm.state.focus();
    return (false);
  }

  if (theForm.state.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"State\" field.");
    theForm.state.focus();
    return (false);
  }

  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Zipcode\" field.");
    theForm.zip.focus();
    return (false);
  }

  if (theForm.zip.value.length < 5)
  {
    alert("Please enter at least 5 numerals in the \"Zipcode\" field.");
    theForm.zip.focus();
    return (false);
  }

  if (theForm.zip.value.length > 9)
  {
    alert("Please enter at most 9 numerals in the \"Zipcode\" field.");
    theForm.zip.focus();
    return (false);
  }
  pos = theForm.email.value.indexOf(".");
  if (theForm.email.value == ""){
  
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.indexOf('@') < 0) {	
  	alert("Please enter a @ address in the \"Email\" field.");
    theForm.email.focus();
	return (false);
		}
	
	if (theForm.email.value.indexOf(".") < 0 ){
			alert("Please enter a \".\" in the \"Email\" field.");
    		theForm.email.focus();
			return (false);
			}
			
	if (pos+3 > theForm.email.value.length){
			alert("Please enter a proper end suffix in the \"Email\" field.");
    		theForm.email.focus();
			return (false);
			
	}
	
	  if (theForm.phone.value == "")
	  {
		alert("Please enter a value for the \"Phone\" field.");
		theForm.phone.focus();
		return (false);
	  }
	
	  if (theForm.phone.value.length < 7)
	  {
		alert("Please enter at least 10 characters in the \"Phone\" field.");
		theForm.phone.focus();
		return (false);
	  }
	
	  if (theForm.phone.value.length > 15)
	  {
		alert("Please enter at most 15 characters in the \"Phone\" field.");
		theForm.phone.focus();
		return (false);
	  }
	  	  if (theForm.co.value == "")
	  {
		alert("Please enter a value for the \"Company\" field.");
		theForm.co.focus();
		return (false);
	  }
	
	  if (theForm.co.value.length < 5)
	  {
		alert("Please enter at least 5 characters in the \"Company\" field.");
		theForm.co.focus();
		return (false);
	  }
	
	  if (theForm.co.value.length > 15)
	  {
		alert("Please enter at most 15 characters in the \"Company\" field.");
		theForm.co.focus();
		return (false);
	  }
	   if (theForm.dob.value == "")
	  {
		alert("Please enter a value for the \"Date of birth\" field.");
		theForm.dob.focus();
		return (false);
	  }
	
	  if (theForm.dob.value.length < 6)
	  {
		alert("Please enter at least 6 characters in the \"Date of birth\" field.");
		theForm.dob.focus();
		return (false);
	  }
	
	  if (theForm.dob.value.length > 10)
	  {
		alert("Please enter at most 10 characters in the \"Date of birth\" field.");
		theForm.dob.focus();
		return (false);
	  }
		
  return (true);
  
}





