/* font size changer */
function doZoom(obj_target,size)
{
	document.getElementById(obj_target).style.fontSize=size+"px";
}
/* china search */
function checkSouInput()
{   
	var searchtype = document.souform.searchtype.value;   
	switch(parseInt(searchtype))
	{
		case 1:document.souform.action="http://sou.china.com/result.php";break; 
		case 2:document.souform.action="http://xinwen.china.com/result.php";document.souform.newstype.value = 1;break;
		case 3:document.souform.action="http://music.china.com/result.php";document.souform.newstype.value = 1;break;  
		case 4:document.souform.action="http://pic.china.com/result.php";break;         
		case 5:document.souform.action="http://forum.china.com/result.php";break;         
	}
	//document.souform.submit();
}
	/* endpage side search*/
function sideSearch()
{
	var theform=document.queryForm2;	
	if (theform.query.value=="")	
	{	
		alert("请输入查询内容");	
		theform.query.focus();	
		return false;	
	}	
	else
	{	
			theform.action="http://sou.china.com/site/result.php";	return true;	
	}
}/* relatedLink checker */
function relatedLink_checker()
{	
	var relatedLinks_cont=document.getElementById("chan_relatedLink").innerHTML;	
	if (relatedLinks_cont.indexOf("<li>")==-1 && relatedLinks_cont.indexOf("<LI>")==-1)
	{		
		document.getElementById("chan_relatedLink").style.display="none";	
	}
}

/* google search*/



/* onload functions*/
function onload_function()
{	
	relatedLink_checker();	
//	picSizeFixer();	
//	set_hiddenVar();
}

/* hidden var. */
function set_hiddenVar()
{	
	var CONTENTKEYWORD=document.getElementById("CONTENTKEYWORD").innerHTML;	
	document.souform.query.value=CONTENTKEYWORD;	
}

/* detail pic fixer */
function picSizeFixer(){
   var doc=document.getElementById("chan_newsDetail").getElementsByTagName("img");
   for (i=0; i<doc.length; i++){
      var imgLink=doc[i].src;
      var bigImgLink=imgLink.replace(/r_|_S/g, "");
      if (imgLink.indexOf("_S")!=-1 || imgLink.indexOf("r_")!=-1){
         doc[i].setAttribute("title", "点击查看原图");
         if (navigator.appName=="Microsoft Internet Explorer"){
            doc[i].setAttribute("name", bigImgLink);
            doc[i].onclick=function(){
               window.open('/zh_cn/etc/endpage/showPic.html?'+this.name);
            }
            doc[i].style.cursor="hand";
         }
         else {
            doc[i].setAttribute("onclick", "window.open('/zh_cn/etc/endpage/showPic.html?"+bigImgLink+"','')");
            doc[i].style.cursor="pointer";
         }
      }
      if (doc[i].width>500){
         doc[i].width=500;
      }
   }
}
/* mail login */
function validmail()
{
	//window.open('http://mail.china.com/extend/gb/notice.html','noticewin','width=360,height=300');
	if (document.maillogin.LoginName.value == "")
	{
		window.open("http://mail.china.com/");return false;
		}
	else 
	{
		if (document.maillogin.LoginName.value !== "")
		{
			if (document.maillogin.passwd.value == "")
			{window.open("http://mail.china.com/");return false;
				//document.maillogin.passwd.focus();
				//alert ("请输入密码");return false;
			}
			if(document.maillogin.mailtype[0].selected || document.maillogin.mailtype[1].selected)
			{
				if (document.maillogin.LoginName.value.indexOf("*") != -1) 
				{
					window.open("http://mail.china.com/");
					return false;
				}
				else 
				{
					document.maillogin.action="http://mail.china.com/coremail/fcg/login";
					document.maillogin.user.value = document.maillogin.LoginName.value;
					document.maillogin.pass.value = document.maillogin.passwd.value;
					document.maillogin.language.value="";
					document.maillogin.submit();
					setTimeout('document.maillogin.reset()',1000);
					return false;
				}
			}
			if(document.maillogin.mailtype[2].selected)
			{
				if (document.maillogin.LoginName.value.indexOf("*") != -1) 
				{
					window.open("http://freemail.china.com/");
					return false;
				}
				else 
				{
					document.maillogin.action="http://freemail.china.com/extend/gb/NULL/NULL/NULL/SignIn.gen";
					document.maillogin.submit();
					setTimeout('document.maillogin.reset()',1000);return false;
				}
			}
	}
}
}
