//***********默认设置定义.*********************
tPopWait=100;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=2000;
popOpacity=99;
//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;
var tSrcElementTags=new Array()
tSrcElementTags[0]="a"
tSrcElementTags[1]="images"
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #FFFFCC;color:#000000; border: 1px #000000 solid;font-color: 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='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
document.write("<div id='menuDiv' style='Z-INDEX: 2; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #009900; visibility: hidden;'></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.ShowIt!=null && o.ShowIt!=""){o.dypop=o.ShowIt;o.ShowIt=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			//sPop=ReplaceDemo(sPop);
			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.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-=1000;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
function ReplaceDemo(sPop1){
   var r, re, ss;                // 声明变量。
   ss=sPop1;
   re = /\"/g;                   // 创建正则表达式模式。
   r = ss.replace(re, "'");      // 用 "A" 替换 "The"。
   return(r);                    // 返回替换后的字符串。
}
document.onmouseover=showPopupText;
//下拉菜单相关代码
 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = -2;
 var space = 1;
 var isvisible;
 var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色
 var global = window.document
 global.fo_currentMenu = null
 global.fo_shadows = new Array
 document.write("<style type='text/css'>");
 document.write(".ft {font-size: 12px;}");
 document.write("</style>");
function HideMenu() 
{
 var mX;
 var mY;
 var vDiv;
 var mDiv;
	if (isvisible == true)
{
		vDiv = document.all("menuDiv");
		mX = window.event.clientX + document.body.scrollLeft;
		mY = window.event.clientY + document.body.scrollTop;
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
}
}
function ShowMenu(vMnuCode,tWidth) {
	vSrc = window.event.srcElement;
	var tttWidth=tWidth-28
	vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=1 bgcolor=#f5f5f5 style='width:"+tWidth+"' class='tableboard' border=0 onmouseout='HideMenu()'><tr><td bgcolor=#ffffff><table cellspacing=0 cellpadding=1 width=100% bgcolor=#ffffff border=0><tr><td width=28  background='images/dvmenubg1.gif'></td><td nowrap align=left bgcolor='#E4E8EF' style='width:"+tttWidth+"'>" + vMnuCode + "</td></tr></table></td></tr></table>";
	h = vSrc.offsetHeight;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+2;
	t = vSrc.offsetTop + topMar + h + space-2;
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}
	menuDiv.innerHTML = vMnuCode;
	menuDiv.style.top = t;
	menuDiv.style.left = l;
	menuDiv.style.visibility = "visible";
	isvisible = true;
    //makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)
}
function makeRectangularDropShadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
}
//一般标题过滤
function htmlencode(str)
{
	if (str!='')
	{	
		str=str.replace(/ /gi,"&nbsp;")
		str=str.replace(/>/gi,"&#62;")
		str=str.replace(/</gi,"&#60;")
		str=str.replace("/","&#47;")
		str=str.replace(/\r/gi,"")
		str=str.replace(/\n/gi,"")
		str=str.replace(/\'/gi,"&#39;")
		str=str.replace(/\"/gi,'&#34;')
		str=str.replace(/'/gi,"&#39;")
		str=str.replace(/"/gi,'&#34;')
	}
	else
	{
		str='';
	}return(str);
}
