﻿//获得焦点，头部图片放大
//document.getElementById("click_ad_SY_SYTB").onmouseover=function(){
	//document.getElementById("click_ad_SY_SYTB").style.display="none";
	//document.getElementById("click_ad_SY_SYTB_none").style.display="block";
//}

//失去焦点，头部图片缩小
//document.getElementById("click_ad_SY_SYTB_none").onmouseout=function(){
	//document.getElementById("click_ad_SY_SYTB_none").style.display="none";
	//document.getElementById("click_ad_SY_SYTB").style.display="block";
//}

//导航菜单切换 
var navv = document.getElementById("navMenu").getElementsByTagName("li");
var navz = document.getElementById("hotspot").getElementsByTagName("div");
for(var i=0;i<navv.length;i++){
	navv[i].onmouseover=function(){
		window.zznav1=true;
		for(ii=0;ii<navv.length;ii++){
			if(this==navv[ii]){navz[ii].style.display="block"}
			else{navz[ii].style.display="none";}
		}
	}
	
}
document.getElementById("navMenu").onmouseover=function(){
		window.zznav1=true;
	document.getElementById("hotspot").style.display="block";
}
document.getElementById("navMenu").onmouseout=function(){
		window.zznav1=false;
if(!window.zznav2)
document.getElementById("hotspot").style.display="none";

}
document.getElementById("hotspot").onmouseover=function(){
		window.zznav2=true;
	document.getElementById("hotspot").style.display="block";
}
document.getElementById("hotspot").onmouseout=function(){
window.zznav2=false;
if(!window.zznav1)
document.getElementById("hotspot").style.display="none";
}
//下拉列表跳转
function jumpMenu(targ,selObj,restore){
	window.open(selObj.options[selObj.selectedIndex].value,targ);
   	if (restore) selObj.selectedIndex=0;
}

//站内搜索
function sekey(){
	if(window.event.keyCode==13)
 		return seyan();
}
function seyan(){
	var j=0;
	for(var i=0;i<document.formse.q.value.length;i++){
		if(document.formse.q.value.charAt(i)!=" "){
			j=1;
			break;
		}					

	}

	if(j==0){
		alert("请输入关键字！");
		document.formse.q.focus();
		return false;
	}
}

//限制标题长度
function getTitle(sSource, iLen)
{ 
    if(sSource.replace(/[^\x00-\xff]/g,"xx").length <= iLen)
    {
        return sSource;
    }

    var str = "";
    var l = 0;
    var schar;
    for(var i=0; schar=sSource.charAt(i); i++)
    {
        str += schar;
        l += (schar.match(/[^\x00-\xff]/) != null ? 2 : 1);
        if(l >= iLen)
        { str+="..";
            break;
        }
    }
    return str;
}

//规范链接地址
function chghref(obj){
       // alert(obj);
        if (obj == undefined || obj.href == undefined) return;
	var str = obj.href;
	
        if(str==undefined) return;
	str= str.replace("/wps/wcm/connect/hamobileweb/hachinamobile","");
	obj.href=str;
	
}


//读xml文件预处理

var rootDoc;
var infos;
var browse = "";
function loadxml(fileRoute){
// 加载xml文件的方法，对ie和firefox均做了处理

if (window.ActiveXObject)  // ie下面的处理
{
	rootDoc = new ActiveXObject('MSXML2.DOMDocument.3.0');  // 实例化rootDoc对象
    rootDoc.async = false;  // 设置异步处理。本函数不需要在XML文件读取完成之前进行任何操作，因此关闭异步处理功能。
	// async属性可规定XML文件的下载是否应当被同步处理：True意味着load()方法可在下载完成之前向调用程序返回控制权；False意味着在调用程序取回控制权之前下载必须被完成。
	rootDoc.load(fileRoute);   // 加载xml文件
	infos = rootDoc.selectNodes("/root/info")  // 读取xml节点
	browse="ie";
}
else if (document.implementation && document.implementation.createDocument)  // firfox下面的处理
{
    
	rootDoc = document.implementation.createDocument('', '', null);   // 火狐不支持ActiveXObject(不兼容的原因就在这儿)
	rootDoc.async = false;
    rootDoc.load(fileRoute);
   infos = rootDoc.getElementsByTagName("info");
browse="ff";
}
else{
	alert( '对不起，未做与该浏览器的兼容！');
}
}







//Wap网址下发
function sendPushInfo()
{
	document.getElementById("PushInfo").src="http://www.ha.chinamobile.com/magazine/push/sendPushInfo.jsp";
}

//业务Wap办理地址下发
function sendPushInfo2(ywName, ywWap)  
{
	//alert("ywName:" +ywName+ "，ywWap:" +ywWap);
	var url = "http://www.ha.chinamobile.com/magazine/push/sendPushInfo2.jsp?ywName=" +ywName+ "&ywWap=" +ywWap;
	if (ywName == "呼叫等待与保持")
	{
		//alert("呼叫等待与保持--特殊处理");
		url = "http://www.ha.chinamobile.com/magazine/push/sendPushInfo2.jsp?ywName=呼叫等待&ywWap=http://wap.ha.chinamobile.com/yyt/16ya.jsp";
		encodeSend();
		url = "http://www.ha.chinamobile.com/magazine/push/sendPushInfo2.jsp?ywName=呼叫保持&ywWap=http://wap.ha.chinamobile.com/yyt/16yb.jsp";
		encodeSend();
	}
	else {	
		//alert("其他业务");
		encodeSend();
	}
	
	function encodeSend() {
		url = encodeURI(url);
		url = encodeURI(url);
		document.getElementById("PushInfo").src = url;
	}
}

document.writeln("<div style=\"display:none\">");
document.writeln("<iframe id=\"PushInfo\" src=\"\"><\/iframe>");
document.writeln("<\/div>")



