<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->

var timerOn = false; 
var timecount = 1000; 

function startTime() 
{  
	if (timerOn == false) 
	{   
		timerID=setTimeout( "hideAll()" , timecount);   
		timerOn = true;   
	}  
} 

function stopTime() 
{  
	if (timerOn) 
	{   
		clearTimeout(timerID);   
		timerID = null;   
		timerOn = false;   
	}  
} 

function hideAll() 
{ 
	MM_showHideLayers('div_sta','','hide','aca_pro','','hide','admissions','','hide','news','','hide','education','','hide','pat_car','','hide')
}

function open_win(pic)
{
	var win = window.open(pic, "WIN", "top=0,left=0,width=130,height=183");
	win.focus();
	return false;
}

function trim(s)
{
    while (s.substring(0,1) == ' ') 
    {
        s = s.substring(1,s.length);
    }   

    while (s.substring(s.length-1,s.length) == ' ') 
    {
        s = s.substring(0,s.length-1);
    }
    
    return s;
}

function check_empty(ctrl, form, ctrlname)
{
	obj = eval("document." + form + "." + ctrl)
    the_obj = trim(obj.value)	

    if (!obj)
	{
		alert (ctrl + " is not an object!")
		return 0
	}

    if (the_obj == '')
	{
		alert ("Kindly fill in your " + ctrlname + ".")
		obj.focus();
		return 1
	}
	
	return 0
}

function check_email(ctrl, form) 
{
    obj = eval("document." + form + "." + ctrl)
    
	if (!obj)
    {
		alert (ctrl + " is not an object!")
		return 0
    }

    // Return false if email field does not contain an '@' and a '.'.
    if (obj.value.indexOf ('@',0) == -1 || obj.value.indexOf ('.',0) == -1)
    {
        alert("Invalid email address.");
		obj.focus();
        return 1
    }
    
	return 0
}