// JavaScript Document
function formValidation1()
{
	var returnValue=false;	
	string = document.form1.email.value;
	if (document.form1.name.value == "")
	{
    	alert("Please type your name in the \"your name\" field.");
		document.form1.name.focus();		
  	}
  	else if (document.form1.company.value == "")
 	{
    	alert("Please type your company name in the \"company\" field.");
	    document.form1.company.focus();
	}
	else if (document.form1.email.value == "")
	{
		alert("Please type your E-mail address in the \"E-mail\" field.");
		document.form1.email.focus();
	}
	else if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
	{
		alert('Please Enter your valid Email-ID in the "E-mail" field.');
		document.form1.email.focus();
	}
	else if (document.form1.phone.value == "")
	{
		alert("Please type your contact phone number in the \"phone\" field.");
		document.form1.phone.focus();	
	} 
	else if (document.form1.contactmethod.value == "0")
	{
		alert("Please select your preferred method of contact from the \"preferred method of contact\" drop down field.");
		document.form1.contactmethod.focus();
	}
	else
	{
		returnValue=true;
	}
	return returnValue;	
}

function formValidation2()
{
	var returnValue=false;	
	string1 = document.form2.email1.value;
	
	if (document.form2.name.value == "")
	{
    	alert("Please type your name in the \"your name\" field.");
		document.form2.name.focus();		
  	}  	
	else if (document.form2.email1.value == "")
	{
		alert("Please type your E-mail address in the \"E-mail\" field.");
		document.form2.email1.focus();
	}	
	else if (string1.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
	{
		alert('Please Enter your valid Email-ID in the "E-mail" field.');
		document.form2.email1.focus();
	}
	
	else
	{
		returnValue=true;
	}
	return returnValue;	
}

function showimage(path)
{
	document.getElementById('images').innerHTML="<img src='"+(path)+"'>";
}

function showimage1(path,i)
{
	document.getElementById('images' + i).innerHTML="<img src='"+(path)+"' >";
}


function showProd(cat_id)
{
	location.href = "info.php?op=product&cat_id="+cat_id;
}
function showProd2(manu)
{
	location.href = "info.php?op=product&manu="+manu;
}

function newWindow(str)
{
	
	window.open(str,'');
}