function SetCookie(name,value,expires,path,domain,secure){
	document.cookie = name + "=" + escape(value) + ((expires)? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
}
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;		var flag = '';
while (i<clen) {			var j = i + alen;			if (document.cookie.substring(i,j) == arg) flag = getCookieVal(j);			i = document.cookie.indexOf(" ",i) + 1;			if (i == 0) break;		}
		return flag;
}
function initializeLHPage()
{
	var vMode=0;var rL=document.referrer;	var expdate = new Date();	expdate.setTime(expdate.getTime() + (1000*60*60*24*365));
	if (rL)	{		if (rL.toLocaleLowerCase().indexOf("http://www.gov.cn",0) >=0)	{			vMode=1;		}
		else		{			vMode=0;		}
	}	else	{		vMode=0;	}
	SetCookie('LHZB_MS',vMode,expdate,'/','xinhuanet.com');
}
function displayLogo()
{
	document.writeln("<table width=\"773\" border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("  <tr> ");
	document.writeln("    <td bgcolor=\"#970C00\" height=\"5\"></td>");
	document.writeln("  </tr>");
	document.writeln("</table>");
	document.writeln("<table width=\"773\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
	document.writeln("  <tr> ");	var nMode=GetCookie('LHZB_MS');	if(!nMode) nMode=0;
	if(nMode ==0)	{		document.writeln("    <td height=\"109\" bgcolor=\"#FFFFFF\"><img src=\"http://imgs.xinhuanet.com/icon/newscenter/07lh/2007lh_lhzb.gif\" width=\"773\" height=\"109\"></td>");	}
	else	{		document.writeln("    <td height=\"109\" bgcolor=\"#FFFFFF\"><img src=\"http://www.gov.cn/icon/2007_lhzb_gov_banner.gif\" width=\"773\" height=\"109\"></td>");	}
	document.writeln("  </tr>");	document.writeln("</table>");
}
function displayLogobyid(idn)
{
	var timg = document.getElementById(idn);
	if(timg)	{		var nMode=GetCookie('LHZB_MS');	if(!nMode) nMode=0;
		if(nMode ==0) {		timg.src="http://imgs.xinhuanet.com/icon/newscenter/07lh/2007lh_lhzb.gif";		}
		else {		timg.src="http://www.gov.cn/icon/2007_lhzb_gov_banner.gif";		}	}
}
