// ======================================================
//	CORE.JS
//	The Core Javascript Library for 
//	Bureau of Naviks
//	created : 01 Dec 2006
//	
// =====================================================

var strservice;
var keepcolor;
var vfontcolor;

// PNO Check on Unit Home Page 
function checkpno()
			{
					
			var message = "";
			if (document.pno.vars.value.length == 0 )
				message = message + "Please Enter EP personnel number without suffix for search Example: 01204\n" ;
			if (document.pno.vars.value.length > 5)
				message = message + "EP PNO can not be more that 5 Characters.\n" ;
			if (document.pno.vars.value.length < 5)
				message = message + "Personal Number of EP Should be 5 Characters without suffix Example: 01204\n" ;
			if (message.length > 0 )
					{
					alert (message);
					return false ;
					}
					else 
					{
					return true ;
					}
			} 

// Change Cursor to Hand rom default
function mOvr(src) {
		if (!src.contains(event.fromElement)) {
		vfontcolor = src.style.color;
		src.style.color = '#ff0000'; 
		}
	}

// Change Cursor to Default rom Hand 
function mOut(src) {
		if (!src.contains(event.toElement)) {
		src.style.color = vfontcolor;
		}
	}
	
// Open SSL Connection Window for private area
function openloginnewwindow(svctype)
{
	if(svctype!='')
	{
		strservice = svctype;
		var strpath;
		if(strservice=='cgep')
			{
			strpath='http://www.buvik.nic.in/secure/cgep/epentry.asp';
			}
			else if(strservice=='unit')
			{
			strpath='http://www.buvik.nic.in/secure/unit/unitentry.asp';
			}
			else if(strservice=='cgmain')
			{
			strpath='http://www.indiancoastguard.nic.in';
			}
else if(strservice=='gov')
{
strpath='http://www.india.gov.in';
}
			window.open(strpath, "" ,"width=790,height=515,scrollbars=yes,menubar=no,status=yes,directories=false,location=false, resizable=yes,left=0,top=0");
			}
}	

// POPUP Window For Details 
// Only One window is used for all detail pages on Home 
// If window is already open then contents are reloaded in same
function myopenwindow(myurl)
	{
		var gourl;
		gourl=myurl;
		newwindow=window.open(gourl,"","width=700,height=400,scrollbars=yes,menubar=no,status=no,resizable=yes,directories=false,location=false,left=75,top=85");
		newwindow.focus();
	}	

// POPUP Window For Documents PDF 
function docpopup(vdoc)
{
		var docurl;
		docurl=vdoc;
		window.open(docurl,"","width=700,height=400,scrollbars=yes,menubar=no,status=no,resizable=yes,directories=false,location=false,left=75,top=85");
		
}
	
// System Date 	
function getCurDate(){
   var d, s = "";           //Declare variables.
   d = new Date();                           //Create Date object.
   s += d.getDate() + "/";                   //Get day
   s += (d.getMonth() + 1) + "/";            //Get month
   s += d.getFullYear() ;                     	//Get year.
   return(s);                              //Return date.
}

