var boo1024;
	if (screen.width >= 1024) {boo1024=true;} else {boo1024=false;}
	
	if (boo1024)
	{document.write(unescape('%3CLINK%20href%3D%22http://www.cry.org/newsite/style/cry1024.css%22%20rel%3D%22stylesheet%22%20type%3D%22text/css%22%20/%3E%3C/script%3E'));}
	else
	{document.write(unescape('%3CLINK%20href%3D%22http://www.cry.org/newsite/style/cry800.css%22%20rel%3D%22stylesheet%22%20type%3D%22text/css%22%20/%3E%3C/script%3E'));}

var strFontSize;
strFontSize = "S";

function changeFontSize()
{
	if (strFontSize == "S") 
	{
		document.getElementById("maincontent").className = "mc_l";
		//document.getElementById("print_content").className = "mc_l";
		
		document.getElementById("header1").className = "header1_l";
		document.getElementById("header2").className = "header2_l";
		document.getElementById("body1").className = "body1_l";
		document.getElementById("body2").className = "body2_l";
		//document.getElementById("crysiteselect").className = "crysiteselect_l";
		document.getElementById("maincontent").className = "mc_l";
		document.getElementById("footer2").className = "footer2_l";
		strFontSize = "L"
	}
	else
	{
		document.getElementById("maincontent").className = "mc_s";
		//document.getElementById("print_content").className = "mc_s";
		
		document.getElementById("header1").className = "header1_s";
		document.getElementById("header2").className = "header2_s";
		document.getElementById("body1").className = "body1_s";
		document.getElementById("body2").className = "body2_s";
		//document.getElementById("crysiteselect").className = "crysiteselect_s";
		document.getElementById("maincontent").className = "mc_s";
		document.getElementById("footer2").className = "footer2_s";
		strFontSize = "S"
	}
}

function Clickheretoprint()
{ 
	var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,"; 
	disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25"; 
	var content_vlue = document.getElementById("print_content").innerHTML; 
	
	var docprint ;
	docprint = window.open("","",disp_setting); 
	docprint.document.open(); 
	docprint.document.write('<html><head><title>CRY-India</title>'); 
	docprint.document.write('<LINK href=http://www.cry.org/resources/style/cryprint.css rel=STYLESHEET type=text/css>'); 
	docprint.document.write('</head><body onLoad="self.print()">');  
	//docprint.document.write('<center><input type=button name=print value="Print" onclick="self.print()"></center><br>');        
	docprint.document.write('</head><body>');          
	docprint.document.write(content_vlue);          
	docprint.document.write('</body></html>'); 
	//docprint.document.write('<br><center><input type=button name=print value="Print" onclick="self.print()"></center></body></html>'); 
	docprint.document.close(); 
	docprint.focus(); 
}
function SendMail()
{
	//mailTo
}

var objPrevBranch = null;

function showOption(branch)
{
	var objBranch;
	if (objPrevBranch != null) {objBranch = objPrevBranch.style; objBranch.display="none";}
	objBranch = document.getElementById(branch).style;
	if(objBranch.display == "block")
	   objBranch.display="none";
	else
	   objBranch.display="block";
	 objPrevBranch = document.getElementById(branch);
}
	
function popupImg(imgObj)
{ 
	var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,"; 
	disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25"; 
	var imgname;
	imgname = imgObj.src;
	imgname = imgname.substring(0,imgname.length - 4) + "_p.jpg";

	var content_vlue = "<img src=" + imgname + " border=0>";
	
	var docprint ;
	docprint = window.open("","",disp_setting); 
	docprint.document.open(); 
	docprint.document.write('<html><head><title>GAIL</title>'); 
	docprint.document.write('<LINK href=style/gailprint.css rel=STYLESHEET type=text/css>'); 
	docprint.document.write('</head><body >');  
	docprint.document.write('</head><body>');          
	docprint.document.write(content_vlue);          
	docprint.document.write('</body></html>'); 
	docprint.document.close(); 
	docprint.focus(); 
}		
function popImage(imgname)
{ 
	var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,"; 
	disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25"; 

	var content_vlue = "<img src='" + imgname + "' border=0>";
	
	var docprint ;
	docprint = window.open("","",disp_setting); 
	docprint.document.open(); 
	docprint.document.write('<html><head><title>CRY</title>'); 
	docprint.document.write('<LINK href=style/cryprint.css rel=STYLESHEET type=text/css>'); 
	docprint.document.write('</head><body >');  
	docprint.document.write('</head><body>');          
	docprint.document.write(content_vlue);          
	docprint.document.write('</body></html>'); 
	docprint.document.close(); 
	docprint.focus(); 
}
function doBookmark()
{
	
	window.external.AddFavorite(document.location, "CRY-" + document.location);
}

function doDD(objDD)
{
	if (objDD.selectedIndex != 0) {window.location = objDD[objDD.selectedIndex].value;}
}

function doPopupDD(objDD)
{
	var disp_setting = ""; //toolbar=no,location=no,directories=no,menubar=no,"; 
	disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25"; 
	if (objDD.selectedIndex != 0)
	{
		window.open(objDD[objDD.selectedIndex].value,"CRY",disp_setting);
	}
}


function doPoll(intPoll)
{
	var intPollAnswer;
	var obj;
	var strName;
	var strUrl = "";
	var intCount = 0;
	for ( intCount=1; intCount <= 3; intCount++)
	{
		strName = "radio" + intCount;
		obj = document.getElementById(strName);
		if (obj.checked == true) intPollAnswer = intCount;
	}

	var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,"; 
	disp_setting += "scrollbars=yes,width=400, height=200, left=100, top=25"; 
	
	strUrl = "http://www.cry.org/mainapp/cryuserapps/poll.aspx?pollId=" + intPoll + "&pollAnswerId=" + intPollAnswer;
	//alert(strUrl);
	window.open(strUrl,"pollwindow",disp_setting); 
}

function writeACookie(cookieName, cookieValue, cookieFlag)
{
}

function readACookies(cookieName)
{
}

function writeAllCookies()
{
//Referer - This Page - for this along with tracking stuff write a js for setting the value of it like the pageId & Page Name
//time for knowing whenthis page was loaded

//

}

function readAllCookies()
{
}
	var objTopMenu;
	var objfirstLevelRow;
	var objsecondLevelRow;
function changeTopMenuColor(rowObj,strCursor)	
{rowObj.style.cursor=strCursor;if  (rowObj != objTopMenu) {if (rowObj.className == "divlmenu") {rowObj.className = "divbmenu";} else {rowObj.className = "divlmenu";}}}

function changefirstLevelRowColor(rowObj)	
{
	rowObj.style.cursor = 'hand';
	if  (rowObj != objfirstLevelRow) 
	{
		if (rowObj.className == "divlmenu") 
		{
			rowObj.className = "divbmenu";
		} 
		else 
		{
			rowObj.className = "divlmenu";
		}
	}
}

function changesecondLevelRowColor(rowObj)	
{
	rowObj.style.cursor = 'hand';
	if  (rowObj != objsecondLevelRow) 
	{
		if (rowObj.className == "divlmenu") 
		{
			rowObj.className = "divbmenu";
		} 
		else 
		{
			rowObj.className = "divlmenu";
		}
	}
}


function manageMenus(topMenu, firstLevelRow, secondLevelRow)
{

	var objGen;

	if (topMenu != "")
	{
		objTopMenu = document.getElementById(topMenu);
		//objTopMenu.className = "divbmenu"; 
	}

	if (firstLevelRow != "")
	{
		objfirstLevelRow = document.getElementById(firstLevelRow);
		objfirstLevelRow.className = "divbmenu";
	}
	if (secondLevelRow != "")
	{
		if (secondLevelRow == "TRUE") 
		{
			objGen = document.getElementById('branch' + firstLevelRow).style;objGen.display="block";
		}
		else
		{
		objGen = document.getElementById('branch' + firstLevelRow).style;
		objGen.display="block";
		objsecondLevelRow = document.getElementById(secondLevelRow);
		objsecondLevelRow.className = "divbmenu";
		}
		//var obj;
		//var strText;
		//obj = document.getElementById(firstLevelRow);
		//strText = obj.innerText;
		//strText = strText.replace("+", "-");
		//obj.innerText = strText;
	}
}

function manageFontSize()
{
	//read the cookie for font size
	//set the font size accordingly of the contents - this will be applicable only for the contents
}

function doddurl123(objDD)
{
	if (objDD.selectedIndex == 0)
	{
		return;
	}
	var strUrl;
	strUrl = objDD[objDD.selectedIndex].value;
	if (strUrl != "")
	{
		window.location = strUrl;	
	}
}

function init(topMenu, firstLevelRow, secondLevelRow)
{
	manageMenus(topMenu, firstLevelRow, secondLevelRow);
	manageFontSize();
}
