function newProduct(root) {
	var emailFilter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; emailAlert="Please enter a valid Email address";
	document.getElementById("Product").action="http://"+root+"/ssi/productSend.asp";
	bgColor("ProductName","#ffffff"); bgColor("ContactName","#ffffff"); bgColor("ContactEmail","#ffffff"); bgColor("ContactPhone","#ffffff")
	fDestination=document.getElementById("Destination"); fProductName=document.getElementById("ProductName"); fProductType=document.getElementById("ProductType"); 
	fContactName=document.getElementById("ContactName"); fContactEmail=document.getElementById("ContactEmail"); fContactPhone=document.getElementById("ContactPhone"); 
	if (fDestination.value=="") {alert("Please select a Destination"); fDestination.focus(); return false; }
	if (fProductName.value=="") {alert("Please enter the Product Name"); bgColor("ProductName","#d6ebf5"); fProductName.focus(); return false; }
	if (fProductType.value=="") {alert("Please select a Product Type"); fProductType.focus(); return false; }
	if (fContactName.value=="") {alert("Please enter your Name"); fContactName.focus(); bgColor("ContactName","#d6ebf5"); return false; }
	if (!emailFilter.test(fContactEmail.value)) {alert(emailAlert); bgColor("ContactEmail","#d6ebf5"); fContactEmail.focus(); return false;}
	if (fContactPhone.value=="") {alert("Please enter your Phone Number"); bgColor("ContactPhone","#d6ebf5"); fContactPhone.focus(); return false; }
	//replace line breaks with tag
	//for (var num=0;num<=12;num++) {
	//	if (document.getElementById("ParaTxt"+num)) {
	//		if (document.getElementById("ParaTxt"+num).value!="") {document.getElementById("ParaTxt"+num).value=document.getElementById("ParaTxt"+num).value.replace(/\r\n|\r|\n/g,"<br>");}}
	//}
	if (document.getElementById("Comments").value!="") {document.getElementById("Comments").value=document.getElementById("Comments").value.replace(/\r\n|\r|\n/g,"<br>");}
	//display status bar
	displayStatus("Product")
}

function submitList() {
	if (document.getElementById("Submit")) {document.getElementById("Submit").value="False";}
	if (document.getElementById("Product")) {document.getElementById("Product").action="index.asp"; document.getElementById("Product").submit();}
}

function submitNewProduct() {
	if (document.getElementById("Submit")) {document.getElementById("Submit").value="True";}
}

function displayStatus(frm) {
	if (document.getElementById("statusTbl")) {document.getElementById("statusTbl").style.display="block"; }
	if (document.getElementById(frm)) {document.getElementById(frm).style.display="none"; }
	statusBar()
}

//status bar
var strSchBarTbl="<table bgcolor='#cccccc' align='left' style='border-top:1px solid #ffffff;border-bottom:1px solid #ffffff;border-left:1px solid #ffffff'><tr><td><img src='/img/gfk0.gif' style='height:2px;width:8px;'><br></td></tr></table>"; var statusMax=14; var statusNum=0; var statusTme;

function statusBar(){
	if (document.getElementById("status")) {
		var spanHTM=strSchBarTbl
		document.getElementById("status").innerHTML=document.getElementById("status").innerHTML+spanHTM
		statusNum=statusNum+1; statusTme=setTimeout("statusBar()",140)
		if (statusNum==statusMax) {document.getElementById("status").innerHTML=spanHTM; statusNum=0}
	}
}

function bgColor(id,col) {
	if (document.getElementById(id)) {document.getElementById(id).style.backgroundColor=col;}
}
