function tabit(btn){
	var idname = new String(btn.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_")+1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 1));
	var tabNumber = btn.parentNode.childNodes.length;
	for(i=0;i<tabNumber;i++){
			document.getElementById(tabName+"_div_"+i).style.display = "none";
			document.getElementById(tabName+"_btn_"+i).className = "";
	
			document.getElementById(tabName+"_div_"+id).style.display = "block";
			btn.className = "curr";
		};
};

function runEx(cod1)  {
	 cod=document.getElementById(cod1)
	  var code=cod.value;
	  if (code!=""){
		  var newwin=window.open('','','');  
		  newwin.opener = null 
		  newwin.document.write(code);  
		  newwin.document.close();
	}
}
//复制代码
function doCopy(ID) { 
	if (document.all){
		 textRange = document.getElementById(ID).createTextRange(); 
		 textRange.execCommand("Copy"); 
	}
	else{
		 alert("此功能只能在IE上有效")
	}
}

//***********默认定义Title样式*********************
tPopWait=0;		//停留tWait豪秒后显示提示。
tPopShow=1000;		//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=95;
fontcolor="#000000";
bgcolor="#FFFFCC";
bordercolor="#007db5";

//***************内部变量定义*****************
sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: " + bgcolor + ";color:" + fontcolor + "; border: 1px " + bordercolor + " solid;font-color: font-size: 12px; padding: 2px;  height: 12px;filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;font-size:12px;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		//dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		//dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.left=MouseX+12+document.documentElement.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.documentElement.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;

//**********自动加版权*************
document.writeln("<body>");
document.writeln("<script>");
document.writeln("document.body.oncopy = function () { ");
document.writeln("  setTimeout( function () { ");
document.writeln("    var text = clipboardData.getData(\"text\");");
document.writeln("    if (text) { ");
document.writeln("      text = text + \" ⊕本文来自: 爱问CPU学习网(www.iwcpu.com) 详细出处参考：\"+location.href; clipboardData.setData(\"text\", text);");
document.writeln("    } ");
document.writeln("        }, 100 ) ");
document.writeln("}");
document.writeln("<\/script>");
document.writeln("<\/body>");
document.writeln("")


//************屏蔽js错误****************
document.writeln("<SCRIPT LANGUAGE=\'JavaScript\'> ");
document.writeln("<!-- ");
document.writeln("function ResumeError() { ");
document.writeln("return true; ");
document.writeln("} ");
document.writeln("window.onerror = ResumeError; ");
document.writeln("\/\/ --> ");
document.writeln("<\/SCRIPT>")
//***************去掉天气预报的链接************
function qdiaolinks() { 


if (!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
//anchors.length
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href")) {
     //anchor.target = "_blank";	 
	 var tq='http://www.hinan.com.cn';
	 c = anchor.href.substring(0,23);
	 cha = encodeURI(anchor.innerHTML);
	 if(c==tq){
		anchor.title = "查看未来三天"+anchor.innerHTML+"天气";
		anchor.href= "http://www.iwcpu.com/tools/tqyb/?city="+cha;
		//anchor.href= "http://www.iwcpu.com/tools/tqyb/";
		var a = document.getElementById("tqyb");
		var src = anchor.href;
		a.attachEvent("onclick", function(){window.open(src,"_blank");});
		a.title=anchor.title;
		a.style.cursor="hand";
	 }
	// alert(anchor.innerHTML);
}

} 
} 
window.onload = qdiaolinks;
//**************图片缩放*******************
function zoomimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}