// JavaScript Document

/******************************************************************************************************
	script by team-inertia Technologies (2003 -04)
	contactus@teaminertia.com
	www.teaminertia.com		
*******************************************************************************************************/


//To enlarge a image
	function openwinpic(pid,ht,wt,tp)
	{
		wt=parseInt(wt)+400;
		ht=parseInt(ht)+400;	
		wtx = eval(wt);
		htx = eval(ht);
		info="pic_disp.php?id="+pid+"&type="+tp;
		window.open(info,"oy","scrollbars,menubars=0,width="+wtx+",height="+htx+",left=100,top=100");	
	}
	
	function openwindoc(path,ht,wt)
	{
		//wt=parseInt(wt)+400;
		//ht=parseInt(ht)+400;	
		wtx = eval(wt);
		htx = eval(ht);
		//alert(wtx);
		//	alert(htx);
	//	info="docs_disp.php?id="+docid+"&type="+tp;
		window.open(path,"oy","menubars=0,width="+wt+",height="+ht+",left=50,top=10,resizable=yes");
		
	
	}
	
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 ("Email ID Is Not Valid");
		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 ("Invalid email id");
		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 checkSpace(box)
{
	var val = box.value
	var carCode = event.keyCode;
	
	if(val=="")
	{			
		if ( carCode == 32) 
		{			
			event.cancelBubble = true;
			event.returnValue = false;
			return;
		}
	}	
}