//***********默认设置定义.*********************
tPopWait=10;//停留tWait毫秒后显示提示。
tPopShow=30000;//显示tShow毫秒后关闭提示
showPopStep=20;
popOpacity=99;

//***************内部变量定义*****************
sPop = null;
curShow = null;
tFadeOut = null;
tFadeIn = null;
tFadeWaiting = null;

var MouseX = 0;
var MouseY =  0;

document.write("<style type='text/css' id='defaultPopStyle'>");
document.write(".cPopText {color: #000000;word-break: break-all;background-color: #ffffff; border: 1px #000000 solid; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='PopMsg' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText(){
	var o=event.srcElement;
	MouseX=event.clientX;
	MouseY=event.clientY;
	if(o.alt!=null && o.alt!=""){o.MyPop=o.alt;o.alt=""};
	if(o.title!=null && o.title!=""){o.MyPop=o.title;o.title=""};
	if(o.MyPop!=sPop) {
			sPop=o.MyPop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				PopMsg.innerHTML="";
				PopMsg.style.filter="Alpha()";
				PopMsg.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
	PopMsg.style.width='';
	PopMsg.className=popStyle;
	PopMsg.innerHTML=sPop;
	popWidth=PopMsg.clientWidth;
	popHeight=PopMsg.clientHeight;
	if(popWidth>=198){PopMsg.style.width='200px';popWidth=198;}
	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;
	PopMsg.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
	PopMsg.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
	PopMsg.style.filter="Alpha(Opacity=0)";
	fadeOut();
}

function fadeOut(){
	if(PopMsg.filters.Alpha.opacity<popOpacity) {
		PopMsg.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
	}
	else {
		PopMsg.filters.Alpha.opacity=popOpacity;
		tFadeWaiting=setTimeout("fadeIn()",tPopShow);
	}
}

function fadeIn(){
	if(PopMsg.filters.Alpha.opacity>0) {
		PopMsg.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
	}
}
function bbimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}
function openwindow(url, winName, width, height ,property){
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 )){
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
	}
	theproperty= "width=" + width + "," 
	+ "height=" + height + "," 
	+ "screenx=" + xposition + "," //仅适用于Netscape
	+ "screeny=" + yposition + "," //仅适用于Netscape
	+ "left=" + xposition + "," //IE
	+ "top=" + yposition; //IE 
	if (property) theproperty += ","+property;
	window.open(url,winName,theproperty);
}
document.onmouseover=showPopupText;
