//var NS4=(document.layers)?1:0; 
var IE=(document.all)?1:0;
//var NS6=((document.getElementById)&&(navigator.appName=='Netscape'))?1:0;
function showMenu(name){
  newname = name;
  //setButn(newname);
  if(document.layers){
    for(i=0; i<length; i++){
        document.layers.document.layers.visibility = 'hide';
    }
  document.layers.np.document.layers[newname].visibility = 'show';
 
  }
}

function openPopUp(url, newwindow, w_width, w_height){
	xpos	= (screen.width - w_width)/2;
	ypos	= (screen.height - w_height)/2;
	window.open(url, newwindow, "width="+w_width+", height="+w_height+", left="+xpos+", top="+ypos);
}
function disclaimer() {
window.open("disclaimer.asp","","height=600,width=598,scrollbars=yes,resizable=no,statusbar=yes,menubar=no,toolbar=no,dependent=yes")

}


//function open_pop(url, newwindow, w_width, w_height) {
//	xpos	= (screen.width - w_width)/2;
//	ypos	= (screen.height - w_height)/2;
//	window.open(url, new_window, "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0","width="+w_width+", height="+w_height+", left="+xpos+", top="+ypos");
//}
function changeSubmit(source,image)
{
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		window.event.srcElement.src = image;
	}
}
//function submitform()
 //{
	
	// document.frmUser.action ="send_it.asp"
	// document.frmUser.submit();

 //}
function check(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){
			return (false);
		}
	}
	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
			return (-1);
		}
	}
}

function checkF(f){
	if(f.firstname.value < 1 || f.firstname.value == 'Firstname'){
		f.firstname.focus();
		alert("Please enter your first name.");
		if(document.all || document.getElementById){
			f.firstname.style.background = "#B9CB9D";
			f.lastname.style.background = "#FFFFFF";
			f.institution.style.background = "#FFFFFF";
		 	f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.lastname.value < 1 || f.lastname.value == 'LastName'){
		f.lastname.focus();
		alert("Please enter your last name.");
		if(document.all || document.getElementById){
			f.lastname.style.background = "#B9CB9D";
			f.firstname.style.background = "#FFFFFF";
			f.institution.style.background = "#FFFFFF";
		 	f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.institution.value < 1 || f.institution.value == 'Insititution'){
		f.institution.focus();
		alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.institution.style.background = "#B9CB9D";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
		 	f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.praddress.value < 1 || f.praddress.value == 'PrAddress'){
	 	f.praddress.focus();
	 	alert("Please enter your primary address.");
		if(document.all || document.getElementById){
			f.praddress.style.background = "#B9CB9D";
			f.institution.style.background = "#FFFFFF";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.city.value < 1 || f.city.value == 'City'){
	 	f.city.focus();
	 	alert("Please enter your city.");
		if(document.all || document.getElementById){
			f.city.style.background = "#B9CB9D";
			f.institution.style.background = "#FFFFFF";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
			f.praddress.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.state.value < 1 || f.state.value == 'State'){
	 	f.state.focus();
	 	alert("Please enter your state.");
		if(document.all || document.getElementById){
			f.state.style.background = "#B9CB9D";
			f.institution.style.background = "#FFFFFF";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
			f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.zip.value < 1 || f.zip.value == 'Zip'){
	 	f.zip.focus();
	 	alert("Please enter your zip code.");
		if(document.all || document.getElementById){
			f.zip.style.background = "#B9CB9D";
			f.institution.style.background = "#FFFFFF";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
			f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(f.phone.value < 1 || f.phone.value == 'Phone'){
	 	f.phone.focus();
	 	alert("Please enter your phone number.");
		if(document.all || document.getElementById){
			f.phone.style.background = "#B9CB9D";
			f.institution.style.background = "#FFFFFF";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
			f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF";
		}
		return (false);
	}
	if(!check(f.email.value)){
		alert("Please enter a valid Email address.");
		f.email.focus();
		if(document.all || document.getElementById){
			f.email.style.background = "#B9CB9D";
			f.firstname.style.background = "#FFFFFF";
			f.lastname.style.background = "#FFFFFF";
			f.institution.style.background = "#FFFFFF";
			f.praddress.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
		}
		return (false);
	}
	var blnCheck=false;
	
	if (document.checkf.salesrep.checked){
	    blnCheck=true;
	}
	if (document.checkf.distributorlist.checked){
	    blnCheck=true;
	}
	if (document.checkf.sample.checked){
	    blnCheck=true;
	}
	
	if (blnCheck==false){
	    alert ("Please make a selection.")
		return (false);
	}
}
