//***************自定义title & alt 层显示效果*****************
sPop=null;

document.write("<style type='text/css'>");
document.write(".cPopText{font-family:Tahoma,Verdana;background:#cc9;border:1px #900 dashed;font-size:12px;padding:2px 4px; line-height:18px;visibility:hidden;filter:Alpha(Opacity=80);opacity: 0.8;}.cPopText img{padding:2px 2px;}");
document.write("</style>");
document.write("<div id='ODFpopLayer' style='position:absolute;z-index:1000' class='cPopText'></div>");

function showPopupText(event) {

	if(event.srcElement) o = event.srcElement;
	else o = event.target;

	if(!o || o.name=="xxxxxx_123456789") {return;}
	
	MouseX = event.clientX;
	MouseY = event.clientY;
	
	if(o.alt != null && o.alt != '' ) {o.pop = o.alt;o.alt = '';}
	
	if(o.title != null && o.title != '') {o.pop = o.title;o.title = '';}
	
	if(o.pop != sPop) {
		sPop = o.pop;
		if(sPop == null || sPop == '') {
			document.getElementById("ODFpopLayer").style.visibility = "hidden";
		}
		else {
			popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
			document.getElementById("ODFpopLayer").style.visibility = "visible";
			showIt();
		}
	}
}

function showIt() {
	document.getElementById("ODFpopLayer").className = popStyle;
	//document.getElementById("ODFpopLayer").innerHTML = sPop.replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>");
	document.getElementById("ODFpopLayer").innerHTML = sPop
	var bodySL, bodyST;
	if(window.pageXOffset){
		bodySL=window.pageXOffset;
	}
	else if(document.documentElement&&document.documentElement.scrollLeft){
		bodySL=document.documentElement.scrollLeft;
	}
	else if(document.body){
		bodySL=document.body.scrollLeft; //author: meizz
	}

	if(window.pageYOffset){
		bodyST=window.pageYOffset;
	}
	else if(document.documentElement&&document.documentElement.scrollTop){
		bodyST=document.documentElement.scrollTop;
	}
	else if(document.body){
	bodyST=document.body.scrollTop;
	}

	var bodyCW, bodyCH; 
	if(window.innerWidth){
		bodyCW=window.innerWidth;
	}
	else if(document.documentElement&&document.documentElement.clientWidth){ 
		bodyCW=document.documentElement.clientWidth;
	}
	else if(document.body){
		bodyCW=document.body.clientWidth; //author: meizz
	}

	if(window.innerHeight){
		bodyCH=window.innerHeight;
	}
	else if(document.documentElement&&document.documentElement.clientHeight){ 
		bodyCH=document.documentElement.clientHeight; 
	}
	else if(document.body){
		bodyCH=document.body.clientHeight;
	}

	if(document.getElementById("ODFpopLayer").clientWidth>300){
		var popWidth = 300;
	}
	else{
		var popWidth = document.getElementById("ODFpopLayer").clientWidth;
	}

	var popWidth = document.getElementById("ODFpopLayer").clientWidth;
	var popHeight = document.getElementById("ODFpopLayer").clientHeight;
	var popLeftAdjust = MouseX + 12 + popWidth > bodyCW ? -popWidth - 24 : 0;
	var popTopAdjust = MouseY + 12 + popHeight > bodyCH ? -popHeight - 24 : 0;
	document.getElementById("ODFpopLayer").style.left = (MouseX + 12 + bodySL + popLeftAdjust) + 'px';
	document.getElementById("ODFpopLayer").style.top = (MouseY + 12 + bodyST + popTopAdjust) + 'px';
}

/*showIt()函数结束，一下是函数调用开始*/

if(!document.onmouseover) {
	document.onmouseover = function(e) {
	var event = e ? e : window.event;
	showPopupText(event);
	}
}
//*********层显示效果结束*********//

/*function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall') e.checked = form.chkall.checked; 
   }
}
*/function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
//document.execCommand("BackgroundImageCache", false, true);
