/*
-------------------------------------------------------------
*****************  乐度网上商店系统(lodoeshop)  *****************

作者：福州市好格网络技术有限公司
网站：http://www.lodoeshop.com
版权：版权属于福州市好格网络技术有限公司，不得拷贝、修改，侵权必究。

*************************************************************
-------------------------------------------------------------
*/
function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + 'px,height=' + height + 'px,resizable=1,scrollbars=yes,menubar=no,status=no' );
}
function getEvent()
{
    var   i   =   0;
    if(document.all) return   window.event;
    func = getEvent.caller;
    while(func != null)
    {
        var   arg0 = func.arguments[0];
        if(arg0)
        {
            if(arg0.constructor == MouseEvent)
            {
                return   arg0;
            }
        }
        func = func.caller;
    }
    return   null;
}
//***********默认设置定义.*********************
tPopWait=30;//停留tWait毫秒后显示提示。
tPopShow=5000;//显示tShow毫秒后关闭提示
showPopStep=20;
popOpacity=99;
bgcolor="#f7f7f7";
bordercolor="#BCBCBC";

//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;
document.write("<style type=\"text/css\" id=\"defaultPopStyle\">");
document.write(".cPopText {  background-color: " + bgcolor + "; border: 1px " + bordercolor + " solid; font-size: 12px; padding-right: 4px; padding-left: 4px;  padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id=\"ncpopLayer\" style=\"position:absolute;z-index:1000;word-break:break-all;\" class=\"cPopText\"></div>");

function showPopupText(){
var event=getEvent();
var o=event.srcElement;
if (!o){o = event.target;}
if(o.className=="thickbox"){return;}
	MouseX = event.x ? event.x : event.pageX;
	MouseY = event.y ? event.y : event.pageY;
	
	if(o.alt!=null && o.alt!=""){o.ncpop=o.alt;o.alt=""};
    if(o.title!=null && o.title!=""){o.ncpop=o.title;o.title=""};
	if(o.ncpop!=sPop) {
			sPop=o.ncpop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);
			if(sPop==null || sPop=="") {
				document.getElementById("ncpopLayer").innerHTML="";
				if(document.getElementById("ncpopLayer").style.filter){
				document.getElementById("ncpopLayer").style.filter="Alpha()";}
				if(document.getElementById("ncpopLayer").filters){
				document.getElementById("ncpopLayer").filters.Alpha.opacity=0;}
				}
			else {
				if(o.dyclass!=null) {popStyle=o.dyclass}else {popStyle="cPopText";}
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		document.getElementById("ncpopLayer").className=popStyle;
		document.getElementById("ncpopLayer").innerHTML=sPop;
		popWidth=document.getElementById("ncpopLayer").clientWidth;
		popHeight=document.getElementById("ncpopLayer").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;}
		document.getElementById("ncpopLayer").style.left=(MouseX+12+document.body.scrollLeft)+"px";
		document.getElementById("ncpopLayer").style.top=(MouseY+12+scrollPos()+popTopAdjust)+"px";
		document.getElementById("ncpopLayer").style.filter="Alpha(Opacity=0)";
		fadeOut();
}



function fadeOut(){
	if(document.getElementById("ncpopLayer").filters)
	{
	if(document.getElementById("ncpopLayer").filters.Alpha.opacity<popOpacity) {
		document.getElementById("ncpopLayer").filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			document.getElementById("ncpopLayer").filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
	}
}

function fadeIn(){
	if(document.getElementById("ncpopLayer").filters.Alpha.opacity>0) {
		document.getElementById("ncpopLayer").filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=function(){showPopupText();};
