function load()
{	

	if(document.cookie.indexOf("StiffyYes")<=-1)
	{
	window.location="index.php";
	}
}
// JavaScript Document
function alpha(value,length)
{
	chkl="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	for(i=0;i<length;i++)
	{
		chl=value.charAt(i);
		rtn1=chkl.indexOf(chl);

		if(rtn1==-1)
		return false;
	
	}
	return true;
}

function number(value,length)
{
	chkl="0123456789";
	for(i=0;i<length;i++)
	{
		chl=value.charAt(i);
		rtn1=chkl.indexOf(chl);

		if(rtn1==-1)
		return false;
	
	}
	return true;
	
}

function evaluateEmail(f)
{
	var value = f;
	if (value.length == 0) 
		return true;        
	var rx = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.\w{2,8}$/;
	var matches = rx.exec(value);	
	return (matches != null);
}
	
function checkall()
{
	
	var rs=(document.frmlist.abc.checked)?true:false;

	
	for(i=0;i<document.frmlist.elements.length;i++)
	{
			if(document.frmlist.elements[i].id=='iId')
			{
				
				document.frmlist.elements[i].checked=rs;
			}
			
	
	}
	
	
}

function add1()
{

	if(alpha(document.frmadd.name.value,document.frmadd.name.value.length)==false || document.frmadd.name.value=="")
	{
		document.frmadd.name.focus();
		alert("Invalid Name");
		return false;
	}	
	else if(evaluateEmail(document.frmadd.email.value)==false)
	{
		document.frmadd.email.focus()
		alert("Invalid Email");
		return false;
	}

	else if(number(document.frmadd.mobile.value,document.frmadd.mobile.value.length)==false)
	{
		document.frmadd.mobile.focus();
		alert("Invalid mobile number");
		return false;
	}
	
document.frmadd.submit();
}

function load_win(path,title,w,h)
{
testwindow=window.open('','CocktailRecipes','toolbar=0,resizable=0,width=330,height=640');
testwindow.document.write('<img src="product/deep_purple_2.gif" width="314" height="640"/>');
testwindow.moveTo(100,100);
}
