// JavaScript Document
function validate(field,msg)
{ 
	if(fname.value.length=="")
	{
		alert(msg);
		fname.focus();
		return false;
	}	
	else
	{
	   return true;
	}
}
function isNumeric(field,msg)
{
	var numericExpression = /^[0-9]+$/;
	if(field.value.match(numericExpression))
	{
	return true;
	}
	else
	{
	alert(msg);
	field.focus();
	return false;
	}
}
function isAlphabet(field,msg)
{
	var alpExpression = /^[a-zA-Z]+$/;
	if(field.value.match(alpExpression))
	{
	return true;
	}
	else
	{
	alert(msg);
	field.focus();
	return false;
	}
}
function isAlphaNumeric(field,msg)
{
	var alpNumExp = /^[0-9a-zA-Z]+$/;
	if(field.value.match(alpNumExp))
	{
	return true;
	}
	else
	{
	alert(msg);
	field.focus();
	return false;
	}
}
function MakeSelection(field,msg)
{
	if(field.value=="Choose")
	{
	alert(msg);
	field.focus();
	return false;	
	}
	else
	{
	return true;
	}
}
function drop(msg,gotourl)
{
	var answer = confirm("Do you want to delete "+msg+"?");
	if(answer)
	{
		openWin4(gotourl);
		return true;
	}
	else
	{
		return false;
	}
}
function droparticle(msg)
{
	var answer = confirm("Do you want to delete "+msg+"?");
	if(answer)
	{
		return true;
	}
	else
	{
		return false;
	}
}
function openWin3() 
{
myWin= open("", "displayWindow",
"width=380,height=150,status=no,toolbar=no,menubar=no,resizable = 0,left=300,top=250");
// open document for further output
myWin.document.open();
// create document
myWin.document.write("<html><head><title>On-the-fly");
myWin.document.write("</title></head><body>");
myWin.document.write("<center><font size=+3>");
myWin.document.write("This HTML-document has been created ");
myWin.document.write("with the help of JavaScript!");
myWin.document.write("</font></center>");
myWin.document.write("</body></html>");
// close the document - (not the window!)
myWin.document.close();
}
function openWin4(gotourl) 
{
myWin= open(gotourl, "displayWindow",
"width=380,height=150,status=no,toolbar=no,menubar=no,resizable = 0,left=300,top=250");
}
function refwindow(msg)
{
	top.opener.document.location.reload();
	top.close();
}