
/*HM_Loader.js
* by Peter Belesis. v4.0.8 010405
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
*/

//var lctn =  "\\/pushkar\/satptmp\/satporgtp\/"
//var lctn1= "\\/pushkar\/satptmp\/"
//var lctn =  "\/satptmp\/satporgtp\/"
//var lctn1= "\/satptmp\/"
//var lctn1= "http:\/\/192.168.0.2\/"
//var lctn = "http:\/\/192.168.0.2\/satporgtp\/"
var lctn = "http:\/\/www.satp.org\/satporgtp\/"
var lctn1 = "http:\/\/www.satp.org\/"

function down()
{
if(document.all)
{
search.style.visibility="visible";
//special.style.visibility="hidden";
hotnews.style.visibility="hidden";
}
else{
document.getElementById("search").style.visibility ="visible";
//document.getElementById("special").style.visibility ="hidden";
document.getElementById("hotnews").style.visibility ="hidden";
}
}
function up()
{
if(document.all)
	{
search.style.visibility="hidden";
//special.style.visibility="visible";
hotnews.style.visibility="visible";
}
else
{
document.getElementById("search").style.visibility ="hidden";
//document.getElementById("special").style.visibility ="visible";
document.getElementById("hotnews").style.visibility ="visible";
}
}

function Gosearch()
{
if(document.searchbox.keyword.value == "")
	{
		alert("Please enter the keyword for the search");
    	    document.searchbox.keyword.select();
		return false;
	}
	document.searchbox.action=lctn+"MISsearch.asp";
	}

function Gosearch2()
{	
	
	b=document.searchbox2.date3.value;
	r1=document.searchbox2.date3.value.length;
	l=document.searchbox2.date3.value.length;
	yy=b.substr(0,4);
	yy=parseInt(yy)
	e=document.searchbox2.date3.value.indexOf("/");
		d=b.substr(5,r1);	
		c=d.indexOf("/");
		r1=d.length;
		r1=r1-1
	mm1=d.substr(0,c);
		//mm=parseInt(mm)
		if(mm1.indexOf("0")==-1)
	{
		mm=parseInt(mm1)
				}
	else
	{
		if(mm1.indexOf("0")>0)
	{
		mm=parseInt(mm1)
	}
		else
		{
			
		mm=mm1.substr(1,1)
		mm=parseInt(mm)
			
		}
	}
		
		c=c+1
		r1=r1-1
	
	dd1=d.substr(c,r1);
	if(dd1.indexOf("0")==-1)
	{
		dd=parseInt(dd1)
				}
	else
	{
		if(dd1.indexOf("0")>0)
	{
		dd=parseInt(dd1)
	}
		else
		{
		dd=dd1.substr(1,1)
		dd=parseInt(dd)
		}
	}
	if(document.searchbox2.date3.value == "")
	{
		alert("Please enter the date for Terrorism Update");
    	    document.searchbox2.date3.select();
		return false;
	}
		if(l>10)
		{
		alert ("Date Format must be YYYY/MM/DD")
			document.searchbox2.date3.select();
		return false;
		}
	
	if(e!=4)
		{
		alert ("Year must be YYYY")
			document.searchbox2.date3.select();
		return false;
		}
if(yy>=2000)
{
if(!((yy==2000)&& (mm<3)))
{
	if((mm>0) && (mm<13))
	{
		if((dd>0) && (dd<32))
		{
				if(mm==2)
			{
					if(((yy%4)>0) && (dd>28))
					{
					alert("Invalid date  should be <=28 for Feburary");
					document.searchbox2.date3.select();
					return false;
					}
					else if (dd>29)
					{
					alert("Invalid date should be <=29 for Feburary");
					document.searchbox2.date3.select();
						return false;
					}
			}
			 if( (mm==4 || mm==6 || mm==9 || mm==11) && (dd>30))
				{	
					alert("Invalid date should be <=30 for Month you had selected");
					document.searchbox2.date3.select();
					return false;
				}
			
		}
	else
		{
	alert("Invalid date should be <=31for Month you had selected");
	document.searchbox2.date3.select();
		return false;
		}
}
else
		{
	alert("Invalid Month should be <=12");
	document.searchbox2.date3.select();
		return false;
		}
		document.searchbox2.action=lctn+"detailed_news3.asp";
}
else
		{
	alert("Archives are Available From March 2000 to till Date");
	document.searchbox2.date3.select();
		return false;
	}
}
else
		{
	alert("Archives are Available From March 2000 to till Date");
	document.searchbox2.date3.select();
		return false;
	}
}

function Gosearch1()
{	b=document.searchbox1.date1.value;
	r1=document.searchbox1.date1.value.length;
	l=document.searchbox1.date1.value.length;
	yy=b.substr(0,4);
		yy=parseInt(yy)
	e=document.searchbox1.date1.value.indexOf("/");
		d=b.substr(5,r1);	
		c=d.indexOf("/");
		r1=d.length;
		r1=r1-1
	mm1=d.substr(0,c);
		//mm=parseInt(mm)
		if(mm1.indexOf("0")==-1)
	{
		mm=parseInt(mm1)
				}
	else
	{
		if(mm1.indexOf("0")>0)
	{
		mm=parseInt(mm1)
	}
		else
		{
			
		mm=mm1.substr(1,1)
		mm=parseInt(mm)
			
		}
	}
		
		c=c+1
		r1=r1-1
	
	dd1=d.substr(c,r1);
	if(dd1.indexOf("0")==-1)
	{
		dd=parseInt(dd1)
				}
	else
	{
		if(dd1.indexOf("0")>0)
	{
		dd=parseInt(dd1)
	}
		else
		{
		dd=dd1.substr(1,1)
		dd=parseInt(dd)
		}
	}
if(document.searchbox1.keyword.value == "")
	{
		alert("Please enter the keyword for the search");
    	    document.searchbox1.keyword.select();
		return false;
	}
	
		if(l>10)
		{
		alert ("Date Format must be YYYY/MM/DD")
			document.searchbox1.date1.select();
		return false;
		}
	
	if(e!=4)
		{
		alert ("Year must be YYYY")
			document.searchbox1.date1.select();
		return false;
		}

if((mm>0) && (mm<13))
{
	if((dd>0) && (dd<32))
	{
		if(mm == 2)
			{
				if(yy % 4>0 && dd>28)
					{
					alert("Invalid date  should be <=28 for Feburary");
					document.searchbox1.date1.select();
					return false;
					}
					else if (dd>29)
					{
					alert("Invalid date should be <=29 for Feburary");
					document.searchbox1.date1.select();
						return false;
					}
			}
			if((mm==4 || mm==6 || mm==9 ||  mm==11) && dd>30)
				{	
					alert("Invalid date should be <=30 for Month you had selected");
					document.searchbox1.date1.select();
					return false;
				}
			
		}
	else
		{
	alert("Invalid date should be <=31for Month you had selected");
	document.searchbox1.date1.select();
		return false;
		}
}
else
		{
	alert("Invalid Month should be <=12");
	document.searchbox1.date1.select();
		return false;
		}
		b=document.searchbox1.date2.value;
	r1=document.searchbox1.date2.value.length;
	l=document.searchbox1.date2.value.length;
	yy=b.substr(0,4);
	yy=parseInt(yy)
	e=document.searchbox1.date2.value.indexOf("/");
		d=b.substr(5,r1);	
		c=d.indexOf("/");
		r1=d.length;
		r1=r1-1
	mm1=d.substr(0,c);
		//mm=parseInt(mm)
		if(mm1.indexOf("0")==-1)
	{
		mm=parseInt(mm1)
				}
	else
	{
		if(mm1.indexOf("0")>0)
	{
		mm=parseInt(mm1)
	}
		else
		{
			
		mm=mm1.substr(1,1)
		mm=parseInt(mm)
			
		}
	}
		
		c=c+1
		r1=r1-1
	
	dd1=d.substr(c,r1);
	if(dd1.indexOf("0")==-1)
	{
		dd=parseInt(dd1)
				}
	else
	{
		if(dd1.indexOf("0")>0)
	{
		dd=parseInt(dd1)
	}
		else
		{
		dd=dd1.substr(1,1)
		dd=parseInt(dd)
		}
	}
	if(l>10)
		{
		alert ("Date Format must be YYYY/MM/DD")
			document.searchbox1.date2.select();
		return false;
		}
	
	if(e!=4)
		{
		alert ("Year must be YYYY")
			document.searchbox1.date2.select();
		return false;
		}

if((mm>0) && (mm<13))
{
	if((dd>0) && (dd<32))
	{
		if(mm == 2)
			{
				if(yy % 4>0 && dd>28)
					{
					alert("Invalid date  should be <=28 for Feburary");
					document.searchbox1.date2.select();
					return false;
					}
					else if (dd>29)
					{
					alert("Invalid date should be <=29 for Feburary");
					document.searchbox1.date2.select();
						return false;
					}
			}
			 if( (mm==4 || mm==6 || mm==9 || mm==11) && dd>30)
				{	
					alert("Invalid date should be <=30 for Month you had selected");
					document.searchbox1.date2.select();
					return false;
				}
			
		}
	else
		{
	alert("Invalid date should be <=31for Month you had selected");
	document.searchbox1.date2.select();
		return false;
		}
}
else
		{
	alert("Invalid Month should be <=12");
	document.searchbox1.date2.select();
		return false;
		}
	document.searchbox1.action=lctn+"search_news.asp";
}

   HM_DOM = (document.getElementById) ? true : false;
   HM_NS4 = (document.layers) ? true : false;
    HM_IE = (document.all) ? true : false;
   HM_IE4 = HM_IE && !HM_DOM;
   HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
  HM_IE4M = HM_IE4 && HM_Mac;
HM_IsMenu = (HM_DOM || HM_NS4 || (HM_IE4 && !HM_IE4M));

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";

if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;



HM_GL_MenuWidth          = 180;
HM_GL_FontFamily         = "Arial,sans-serif";
HM_GL_FontSize           = 6;
HM_GL_FontBold           = false;
HM_GL_FontItalic         = false;
HM_GL_FontColor          = "black";
HM_GL_FontColorOver      = "white";
HM_GL_BGColor            = "transparent";
HM_GL_BGColorOver        = "transparent";
HM_GL_ItemPadding        = 3;

HM_GL_BorderWidth        = 1;
HM_GL_BorderColor        = "black";
HM_GL_BorderStyle        = "solid";
HM_GL_SeparatorSize      = 1;
HM_GL_SeparatorColor     = "yellow";
HM_GL_ImageSrc           = "tri.gif";
HM_GL_ImageSrcLeft       = "triL.gif";
HM_GL_ImageSize          = 5;
HM_GL_ImageHorizSpace    = 5;
HM_GL_ImageVertSpace     = 5;

HM_GL_KeepHilite         = false;
HM_GL_ClickStart         = false;
HM_GL_ClickKill          = 0;
HM_GL_ChildOverlap       = 40;
HM_GL_ChildOffset        = 10;
HM_GL_ChildPerCentOver   = null;
HM_GL_TopSecondsVisible  = .5;
HM_GL_StatusDisplayBuild = 0;
HM_GL_StatusDisplayLink  = 1;
HM_GL_UponDisplay        = null;
HM_GL_UponHide           = null;

//HM_GL_RightToLeft      = true;
HM_GL_CreateTopOnly      = HM_NS4 ? true : false;
HM_GL_ShowLinkCursor     = true;

// the following function is included to illustrate the improved JS expression handling of
// the left_position and top_position parameters
// you may delete if you have no use for it

MM_preloadImages('homeimage/search3.gif','homeimage/america2.jpg','homeimage/america3.jpg');

function HM_f_CenterMenu(topmenuid) {
	var TheMenu = HM_DOM ? document.getElementById(topmenuid) : HM_IE4 ? document.all(topmenuid) : eval("window." + topmenuid);
	var TheMenuWidth = HM_DOM ? parseInt(TheMenu.style.width) : HM_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;
	var TheWindowWidth = HM_IE ? document.body.clientWidth : window.innerWidth;
	return ((TheWindowWidth-TheMenuWidth) / 2);
}

if(HM_IsMenu) {
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='"+lctn1+"template/HM_Arrays.js' TYPE='text/javascript'><\/SCR" + "IPT>");
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='"+lctn+"template/HM_Script"+ HM_BrowserString +".js' TYPE='text/javascript'><\/SCR" + "IPT>");
}
var expDays = 1;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
var favColor = GetCookie('color');
if (favColor == null) {
favColor = "pink";
SetCookie('color', favColor, exp);
window.open("_introduction.htm",'intro','width=300,height=270');
}
function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}



