function checkEmail(x)
{
	a=new Array();
	s=x.value;
	for(i=0; i<s.length; i++)
	{
		a[i]=s.charAt(i);
	}
	
	dot = s.indexOf(".");
	at   = s.indexOf("@");
	
	if (dot == -1 || at == -1)
	{
		x.focus()
		alert ("Please Check Email Address");
		return 1;
	}

	str1=s.substring(dot+1,s.length);
	str2=s.substring(at+1, dot);
	str3=s.substring(0,at);

	if((str1.length==0)||(str2.length==0)||(str3.length==0))
	{
		x.focus()     
		alert ("Please Check Email Address");
		return 1;
	}

	return 0;
}


function WindowPosition(widthX,heightX)
{
	var width = (screen.width);
	var height = (screen.height - 25);
	var centerleft = 0;
	var centertop = 0;
	var centerleft = (width/2) - (widthX/2);
	var centertop = (height/2) - (heightX/2);
	var width=widthX;
	var height=heightX;
	window.moveTo(centerleft,centertop);
	window.resizeTo(width, height);
	window.focus();
}

function CheckIfImageFile(path)
{
	if(path!="")
	{
		index=path.lastIndexOf(".");
		ext=path.substr(index);
		if(ext!='.jpg'&&ext!='.gif'&&ext!='.jpeg'&&ext!='.png'&&ext!='.JPG'&&ext!='.PNG')
		{
			alert("Please Enter only Image files");
			return 1;
		}
	}
	return 0;

}

function openwindoc(path,ht,wt)
	{
		wt=parseInt(wt)+400;
		ht=parseInt(ht)+400;	
		wtx = eval(wt);
		htx = eval(ht);
		window.open(path,"oy","menubars=0,scrollbars,resizable,width="+wtx+",height="+htx+",left=50,top=10");	
	}