function thnxpage(x)
{
	document.location.href=x;	
}

function check2()
{
	var inventory_url=document.form1.inventory_url.value;
	var category=document.form1.category.options[document.form1.category.selectedIndex].value;
	var oname=document.form1.oname.value;
	var cname=document.form1.cname.value;
	var email=document.form1.email.value;
	var email2=document.form1.email2.value;
	
	if (inventory_url=="")
	{
		alert("Please enter your inventory url");
		document.form1.inventory_url.focus();
		return false;
	}
	if (category=="")
	{
		alert("Please select your category");
		document.form1.category.focus();
		return false;
	}
	if (oname=="")
	{
		alert("Please enter your organization name");
		document.form1.oname.focus();
		return false;
	}
	if (cname=="")
	{
		alert("Please enter contact name");
		document.form1.cname.focus();
		return false;
	}
	if (email=="")
	{
		alert("Please enter your email");
		document.form1.email.focus();
		return false;
	}
	if (email!=email2)
	{
		alert("Please re-enter your email");
		document.form1.email2.focus();
		return false;
	}
	return true;
}

function check()
{
	var fname=document.form1.fname.value;
	var phone=document.form1.phone.value;
	var email=document.form1.email.value;
	var email2=document.form1.email2.value;
	var oname=document.form1.oname.value;
	var street=document.form1.street.value;
	var city=document.form1.city.value;
	var zip=document.form1.zip.value;	
	var country=document.form1.country.options[document.form1.country.selectedIndex].value;
	var ophone=document.form1.ophone.value;
	var tax_class=document.form1.tax_class.value;
	var bus_name=document.form1.bus_name.value;
	var bus_url=document.form1.bus_url.value;
	var contact_name=document.form1.contact_name.value;
	
	if (fname=="")
	{
		alert("Please enter your name");
		document.form1.fname.focus();
		return false;
	}
	if (phone=="")
	{
		alert("Please enter your phone");
		document.form1.phone.focus();
		return false;
	}
	if (email=="")
	{
		alert("Please enter your email");
		document.form1.email.focus();
		return false;
	}
	if (email!=email2)
	{
		alert("Please re-enter your email");
		document.form1.email2.focus();
		return false;
	}
	if (oname=="")
	{
		alert("Please enter your organization name");
		document.form1.oname.focus();
		return false;
	}
	if (street=="")
	{
		alert("Please enter your street address");
		document.form1.street.focus();
		return false;
	}
	if (city=="")
	{
		alert("Please enter your city");
		document.form1.city.focus();
		return false;
	}
	if (zip=="")
	{
		alert("Please enter your zip");
		document.form1.zip.focus();
		return false;
	}
	if (country=="")
	{
		alert("Please enter your country");
		document.form1.country.focus();
		return false;
	}
	if (ophone=="")
	{
		alert("Please enter your organization phone number");
		document.form1.ophone.focus();
		return false;
	}
	if (tax_class=="")
	{
		alert("Please enter your tax classification");
		document.form1.tax_class.focus();
		return false;
	}
	if (bus_name=="")
	{
		alert("Please enter your business name");
		document.form1.bus_name.focus();
		return false;
	}
	if ((bus_url=="") || (bus_url=="http://"))
	{
		alert("Please enter your business url");
		document.form1.bus_url.focus();
		return false;
	}
	if (contact_name=="")
	{
		alert("Please enter your business contact name");
		document.form1.contact_name.focus();
		return false;
	}
	return true;
}



function check_form(){
	if (document.form1.fnameone.value=="")
	{
		alert("Provide name of first reference.")
		document.form1.fnameone.focus()
		return false
	}
	if (document.form1.femailone.value=="")
	{
		alert("Provide email address of first reference.")
		document.form1.femailone.focus()
		return false
	}

 
	if (document.form1.fnametwo.value=="")
	{
		alert("Provide name of second reference.")
		document.form1.fnametwo.focus()
		return false
	}
	if (document.form1.femailtwo.value=="")
	{
		alert("Provide email address of second reference.")
		document.form1.femailtwo.focus()
		return false
	}
	
  
	if (document.form1.fnamethree.value=="")
	{
		alert("Provide name of third reference.")
		document.form1.fnamethree.focus()
		return false
	}
	if (document.form1.femailthree.value=="")
	{
		alert("Provide email address of third reference.")
		document.form1.femailthree.focus()
		return false
	}
	
  
}

function isValidDate(dd, mm, yyyy){
	var chk    = 0;
	var maxDay = 0;

	if((mm == 4) || (mm == 6) || (mm == 9) || (mm == 11)){	
		maxDay = 30;
	}else if(mm == 2){
		maxDay = (yyyy % 4 == 0) ? 29 : 28;    
	}else{
		maxDay = 31;
	}

	if((dd <= 0) || (dd > maxDay)){	chk = 1;}
	else if((mm <= 0) || (mm > 12)){
		chk = 1;
	}else if((yyyy <= 0)){
	chk = 1;
	}	

   return chk;
}

function dateLessThenXDays(pMMDDYYDate, pXNum){
	var today	= new Date();
	var date	= new Date(pMMDDYYDate);

	if ((today.getTime()+(pXNum * 1000 * 24 * 60 * 60)) > date.getTime()){
		return false;
	}else {
		return true;
	}
}

//// ORDER FORM VALIDATION //////////////////////////////////////////////////////////////////////////////////////
function formvalid(checkVFom){
	document.form1.topic.value = document.form1.topic.value.replace(/'/g,"`");
	document.form1.detail.value = document.form1.detail.value.replace(/'/g,"`");
	document.form1.reqfor.value = document.form1.reqfor.value.replace(/'/g,"`");
	document.form1.name.value = document.form1.name.value.replace(/'/g,"`");
	
	//***** CHECK FOR TOPIC *************
	if (document.form1.topic.value==""){
  		alert("Provide your topic.")
  		document.form1.topic.focus()
  		return false
	}
	
	
	//***** CHECK FOR DETAIL OF TOPIC *************
	if (document.form1.detail.value==""){
  		alert("Provide the details about your topic.")
  		document.form1.detail.focus()
  		return false;
	}
	
  
	//***** CHECK FOR DEADLINE *************
	if(isValidDate(document.form1.day.value, document.form1.month.value, document.form1.year.value) || !dateLessThenXDays(document.form1.month.value + "/" + document.form1.day.value + "/" + document.form1.year.value, 1)){
		alert("Provide no less than 48 hours for the delivery of your order.")
		document.form1.day.focus()
		return false
	}

	//***** CHECK FOR NAME *************
	if(document.form1.name.value==""){
		alert("Please enter Name.")
		document.form1.name.focus()
		return false
	}

	//***** CHECK FOR EMAIL *************
	if(document.form1.email.value==""){
		alert("Please enter a valid email address.")
		document.form1.email.focus()
		return false
	}

}

function formvalid2()
{
  if (document.form1.topic.value=="")
  {
  	alert("Provide your topic")
  	document.form1.topic.focus()
  	return false
  }
  if (document.form1.detail.value=="")
  {
  	alert("Provide the details about your topic.")
  	document.form1.detail.focus()
  	return false
  }

  if(document.form1.email.value=="")
  {
    alert("Please enter a valid email address.")
    document.form1.email.focus()
    return false
   }

}

function handle_input_display(){
	if(document.form1.fromwhere[0].checked || document.form1.fromwhere[1].checked || document.form1.fromwhere[2].checked){
		seachengine.style.display	= 'none';
		document.form1.vfrom.value	= '';
	}else{
		seachengine.style.display = '';
		if(document.form1.fromwhere[3].checked){
			document.form1.vfrom.value = 'Specify search engine.';
		}else{
			document.form1.vfrom.value = 'Specify please.';
		}
		document.form1.vfrom.focus();
	}
}

function frmvalid()
{
	if (document.form1.name.value=="")
	{
		alert("Provide your name")
		document.form1.name.focus()
		return false
	}
	if (document.form1.email.value=="")
	{
		alert("Provide your email address")
		document.form1.email.focus()
		return false
	}
	
}

<!-- Begin
// test variables
var myHeight = 500;
var isResizable = true;

function createTarget(form) 
{
var	tempDateVar		= new Date();
var	winName			= '_newMyOwnWindow_' + tempDateVar.getTime();
var _refToWindow	= window.open('', winName, 'width=100, height=100, resizable=yes, scrollbars=yes');
_refToWindow.resizeTo(500, myHeight);
form.target = winName;
_refToWindow.focus();
maximizeMyYesMyWindow (_refToWindow);

return true;
}
//  End -->


<!--
function form_member()
{
	if (document.form1.name.value=="")
	{
		alert("Provide your name")
		document.form1.name.focus()
		return false
	}
	if (document.form1.email.value=="")
	{
		alert("Provide your email address")
		document.form1.email.focus()
		return false
	}
	
}
//-->

function calcu()
{
	var a=225
	var b=document.form1.dsize.value  
	var c=b * a
	document.form1.nofwords.value=c
	document.form1.nofwords.disabled = true;

return true
}

<!--

function maximizeMyYesMyWindow(winRef) 
{
 if (parseInt(navigator.appVersion)>3) 
 {
  if (navigator.appName=="Netscape") 
  {
   if (winRef.screenX>0 || winRef.screenY>0) winRef.moveTo(0,0);
   if (winRef.outerWidth < screen.availWidth)
      winRef.outerWidth=screen.availWidth;
   if (winRef.outerHeight < screen.availHeight) 
      winRef.outerHeight=screen.availHeight;
  }
  else 
  {
   winRef.moveTo(-4,-4);
   winRef.resizeTo(screen.availWidth+8,screen.availHeight+8);
  }
 }
}

function maximizeWindow() 
{
 if (parseInt(navigator.appVersion)>3) 
 {
  if (navigator.appName=="Netscape") 
  {
   if (top.screenX>0 || top.screenY>0) top.moveTo(0,0);
   if (top.outerWidth < screen.availWidth)
      top.outerWidth=screen.availWidth;
   if (top.outerHeight < screen.availHeight) 
      top.outerHeight=screen.availHeight;
  }
  else 
  {
   top.moveTo(-4,-4);
   top.resizeTo(screen.availWidth+8,screen.availHeight+8);
  }
 }
}
// -->
//// FEEDBACK FORM VALIDATION //////////////////////////////////////////////////////////////////////////////////////
function feedback_formvalid()
{
  if (document.thisform.mailfrom.value=="")
 {
  alert("Provide your Email Address")
  document.thisform.mailfrom.focus()
  return false
 }

 if (document.thisform.subject.value=="")
 {
  alert("Provide Subject for the mail")
  document.thisform.subject.focus()
  return false
 }
 if (document.thisform.message.value=="")
 {
  alert("Provide your message here ")
  document.thisform.message.focus()
  return false
 }
 
}

//// REVISE FORM VALIDATION //////////////////////////////////////////////////////////////////////////////////////
function revise_formvalid()
{
  if (document.form1.ref.value=="")
 {
  alert("Provide Ref")
  document.form1.ref.focus()
  return false
 }
 if (document.form1.email.value=="")
 {
  alert("Provide your Email Address")
  document.form1.email.focus()
  return false
 }
 
 if (document.form1.reason.value=="")
 {
  alert("Provide Reason here ")
  document.form1.reason.focus()
  return false
 }
 
}

function order_formvalid()
{
if (document.form1.topic.value=="")
  {
  	alert("Provide your topic")
  	document.form1.topic.focus()
  	return false
  }
  if (document.form1.detail.value=="")
  {
  	alert("Provide your Detail")
  	document.form1.detail.focus()
  	return false
  }
  
  if(document.form1.email.value=="")
  {
    alert("Please provide the emailaddress")
    document.form1.email.focus()
    return false
   }

}

<!--
//// MEMBERSHIP 2 FORM VALIDATION //////////////////////////////////////////////////////////////////////////////////////
function mcode_formvalid()
{
	if (document.form1.fnameone.value=="")
	{
		alert("Provide name of first reference.")
		document.form1.fnameone.focus()
		return false
	}
	if (document.form1.femailone.value=="")
	{
		alert("Provide email address of first reference.")
		document.form1.femailone.focus()
		return false
	}

 
	if (document.form1.fnametwo.value=="")
	{
		alert("Provide name of second reference.")
		document.form1.fnametwo.focus()
		return false
	}
	if (document.form1.femailtwo.value=="")
	{
		alert("Provide email address of second reference.")
		document.form1.femailtwo.focus()
		return false
	}
	
  
	if (document.form1.fnamethree.value=="")
	{
		alert("Provide name of third reference.")
		document.form1.fnamethree.focus()
		return false
	}
	if (document.form1.femailthree.value=="")
	{
		alert("Provide email address of third reference.")
		document.form1.femailthree.focus()
		return false
	}
}
//-->

//// MEMBERSHIP 1 FORM VALIDATION //////////////////////////////////////////////////////////////////////////////////////
<!--
function mem_formvalid()
{
	if (document.form1.name.value=="")
	{
		alert("Provide your name")
		document.form1.name.focus()
		return false
	}
	if (document.form1.email.value=="")
	{
		alert("Provide your email address")
		document.form1.email.focus()
		return false
	}
	
}
//-->
//// STATUS FORM VALIDATION //////////////////////////////////////////////////////////////////////////////////////
function status_formvalid()
{
  if (document.form1.ref.value=="")
 {
  alert("Provide your Ref #")
  document.form1.ref.focus()
  return false
 }
 
 if (document.form1.email.value=="")
 {
  alert("Provide your Email Address")
  document.form1.email.focus()
  return false
 }
}

function chknumber(txtbox, txtname){
  if (!chknull(txtbox, txtname)) return false;  
  if (!chkchr(txtbox,txtname)) return false;    
  return true; 
}

function chknull(txtbox, txtname)
{
  if (txtbox.value == '')
  {
    alert('Please enter ' + txtname + '.');
    txtbox.focus();
    return false;	
  }else{
	if (!chkonlyspaces(txtbox, txtname)) return false;	
  }	

  return true;
}

function chkchr(txtbox, txtname)
{
    if (chknum(txtbox.value)!=false)
    {
      alert("Character not allowed in " + txtname + ".");
      txtbox.focus();
      return false;	
    }	
  return true;
}

function chkonlyspaces(txtbox,txtname){
  var spaceCounter = 0;
	
  if (txtbox.value.length > 0) {
    for (i=0;i<txtbox.value.length;i++){
      if(txtbox.value.charAt(i)==' '){
		spaceCounter++;
      }	  
    }	
    if(spaceCounter == txtbox.value.length){
	alert("Only Spaces are not allowed in "+txtname+".");
	txtbox.focus();
	return false;
    }	
  }         
  return true;
}

function chknum(strNumber)
{
	if(isNaN(strNumber)) return true;
	if(strNumber.indexOf('e') != -1) return true;
	if(strNumber.indexOf('-') != -1) return true;
	if(strNumber.indexOf('+') != -1) return true;
	if(strNumber.indexOf(' ') != -1) return true;
	return false;
}

/// VALIDATION FOR MAIN2.ASP  //////////////////////////////////////////////////////////////////////////
function validatemain2(){

	if(	isValidDate(document.form1.day[document.form1.day.selectedIndex].value , document.form1.month[document.form1.month.selectedIndex].value, document.form1.year[document.form1.year.selectedIndex].value) || ! dateLessThenXDays(document.form1.month[document.form1.month.selectedIndex].text + "/" + document.form1.day[document.form1.day.selectedIndex].text + "/" + document.form1.year[document.form1.year.selectedIndex].text, 1)){
		alert("Please enter a valid deadline of minimum 48 hrs.")
		document.form1.day.focus();
		return false;
	}
	
	if( !chknull(document.form1.detail,"additional comments")  || !chknull(document.form1.name,"your name")  || !chknull(document.form1.email,"your email") ){
			return false;
	}		
	
	return true;
}
//***** NEW MEMBERSHIP FORM VALIDATION ************************************************************************
function validate_membership(){
	if(	
				!chknull(document.form1.name,"name") 
		||	!chknull(document.form1.email,"email")
		||	!chknull(document.form1.fnameone,"first name") 
		||	!chknull(document.form1.femailone,"first email") 
		||	!chknull(document.form1.fnametwo,"second name") 
		||	!chknull(document.form1.femailtwo,"second email")
		||	!chknull(document.form1.fnamethree,"third name") 
		||	!chknull(document.form1.femailthree,"third email")  
	){		
		return false;
	}
}


function openNewWindow(theURL) { 	
  var params = 'toolbar=no,location=no,directories=no,status=nomenubar=no,scrollbars=no,resizable=yes,width=350,height=450,left=0,top=0';
  var winRef	=  window.open(theURL,'',params);  
  maximizeMyYesMyWindow(winRef);
}
