function searchersub(){
var f=document.search;
	if(f.Search.value == ""){
		alert("Please enter a search string");
	}else{
		f.submit()
	}
}
function checklogin(){
	var valid = true;
	var f=document.loginbox;
	if((f.UserName.value == "" || f.UserName.value.indexOf('@') == -1 || f.UserName.value.indexOf('.') == -1)&& (valid == true)){
		valid = false;
		alert("Please enter a valid email address");
	}
	if((f.Password.value == "")&& (valid == true)){
		valid = false;
		alert("Please enter a valid password");
	}
	if((f.Password.value.match(/\W/))&& (valid == true)){
		valid = false;
		alert("You may only use valid characters (a-z 0-9) in your password");
	}
	return valid;
}
function gototheurl(URL){
	window.location.href = URL;
}
function emaillink(PreFixer,PostFixer){
	document.location = "mailto:" + PreFixer + "@" + PostFixer;
}
function openawinder(URL,H,W){
	var winl = (screen.width - W) / 2;
	var wint = (screen.height - H) / 2;
	window.open(URL,"winNew",'top='+wint+',left='+winl+',true toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height='+H+',width='+W);
}
function calcuit(){
	var f=document.prodcal;
	var P=parseFloat(f.PBore.value);
	var L=parseFloat(f.SLength.value);
	var S=parseFloat(f.SPM.value);
	var E=parseFloat(f.EFF.value);
	var T=Math.pow(P*0.0254,2)*3.1416/4*L*0.0254*S*60*24*E;
	var Rone=Math.round(T*10)/10;
	var Rtwo=Math.round(T*6.255*10)/10;
	document.getElementById("R1").innerHTML=Rone;
	document.getElementById("R2").innerHTML=Rtwo;
}
function resetcal(){
	var f=document.prodcal;
	f.PBore.value=0;
	f.SLength.value=0;
	f.SPM.value=0;
	document.getElementById("R1").innerHTML="";
	document.getElementById("R2").innerHTML="";
}
function showcal(D){
	document.getElementById("cal").style.display = D;
}
function addemail(C){
	var theTable = document.all.FriendTable;
	var TableRows=theTable.getElementsByTagName("TR");
	for (j=TableRows.length; j<=C-1; j++) {
		NewID="Row_" + j;
		var newRow = theTable.insertRow(theTable.rows.length);
		newRow.id =NewID;
		var newCell
		newCell = newRow.insertCell(0)
		newCell.innerHTML='Name:';
		newCell = newRow.insertCell(1)
		newCell.innerHTML='<input type="text" name="name_' + j +  '" value="" size="20" maxlength="255">';
		newCell = newRow.insertCell(2)
		newCell.innerHTML='E-Mail:';
		newCell = newRow.insertCell(3)
		newCell.innerHTML='<input type="text" name="email_' + j +  '" value="" size="20" maxlength="255">';
	}
	if(C < TableRows.length){
		d=(TableRows.length-C)-1;
		for (i=0; i<=d; i++) {
			var killRow = theTable.deleteRow(TableRows.length-1);
		}
	}
 }
