function findobj(n, d) {
	var p, i, x;
	if(!d) d = document;
	if((p = n.indexOf("?"))>0 && parent.frames.length) {
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0, p);
	}
	if(x != d[n] && d.all) x = d.all[n];
	for(i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
	for(i = 0; !x && d.layers && i < d.layers.length; i++) x = findobj(n, d.layers[i].document);
	if(!x && document.getElementById) x = document.getElementById(n);
	return x;
}

function window.onload(){
//	var ob, d = document;
//	d.ondragstart = new Function("return false;");
//	d.oncontextmenu = new Function("return false;");
//	d.onselectstart = new Function("return false;");
/*
	if (screen.width > 1000) {
		if (ob = findobj('maindiv')) ob.className += '1k';
		if (ob = findobj('btmdiv')) ob.className += '1k';
		if (ob = findobj('btldiv')) ob.className += '1k';
		if (ob = findobj('btl2div')) ob.className += '1k';
	}
*/
}

function f_announce(str,name,xx,yy,ww,hh) { /* no scrollbars */
	var features='left='+xx+',top='+yy+',width='+ww+',height='+hh+',resizable=0,status=0,menubar=0,scrollbars=0';
	window.open(str,name, features);
}

function f_new_window(str,name,xx,yy,ww,hh) { /* with scrollbars */
	var features='left='+xx+',top='+yy+',width='+ww+',height='+hh+',resizable=0,status=0,menubar=0,scrollbars=1';
	window.open(str,name, features);
}

function f_close_window() { /* 强制关闭window */
    if(document.all) {
        if(parseFloat(window.navigator.appVersion.substr(window.navigator.appVersion.indexOf("MSIE")+5, 3)) < 5.5) {
            var str  = '<object id=meizzMax classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
                str += '<param name="Command" value="Close"></object>';
            document.body.insertAdjacentHTML("beforeEnd", str);
            document.all.meizzClose.Click();
        } else {
            window.opener = "meizz";
            window.close();
        }
    } else window.close();
}

/* 导航菜单 */

var gsm_width	= 120;
var gsm_height	= 180;
var gsm_left	= 0;
var gsm_top		= 0;
var gsm_delay	= 500;

var g_oLastStyle, g_iFlag, g_oLastOn, g_iFader;

// 显示菜单
function fnShowMenu(oMenu, oSub){
	var oStyle;

	fnKeepMenu();
	fnHideMenu();

	oStyle = oSub.style;
	oStyle.left = oMenu.offsetLeft + gsm_left;
	oStyle.top = oMenu.offsetTop + oMenu.offsetHeight + gsm_top;
	oStyle.width = gsm_width;
	oStyle.height = gsm_height;
	oStyle.display = "block";

	g_oLastStyle = oStyle;
	g_iFlag = 1;
	if (g_oLastOn)
		g_oLastOn.className='mmenu_on';
}

function fnFadeMenu(){
	if (g_iFader == null)
		g_iFader = window.setTimeout("fnHideMenu();", gsm_delay);
}

function fnHideMenu(){
	if(g_oLastStyle != null){
		g_oLastStyle.display = "none";
		g_oLastStyle = null;
		g_iFlag = 0;
		if (g_oLastOn)
			g_oLastOn.className='mmenu';
	}
}

function fnKeepMenu(){
	if (g_iFader){
		window.clearTimeout(g_iFader);
		g_iFader = null;
	}
}
function fnRowOn(ob) {
	ob.className='subrow_on';
}
function fnRowOut(ob) {
	ob.className='subrow';
}
function fnRowUrl(url) {
	location.href = url;
}
function fnMenuOn(ob, oSub) {
	ob.className='mmenu_on';
	if (g_oLastOn)
		g_oLastOn.className='mmenu';
	g_oLastOn = ob;
	fnShowMenu(ob, oSub);
}
function fnMenuOut(ob) {
	if (0 == g_iFlag)
		ob.className='mmenu';
	fnFadeMenu();
}



// Alt 信息
var sPop = null;
var postSubmited = false;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { font-family: Tahoma, Verdana; background-color: #FFFFCC; border: 1px #000000 solid; font-size: 12px; padding-right: 4px; padding-left: 4px; line-height: 18px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80)}");

document.write("</style>");
document.write("<div id='popLayer' style='position:absolute;z-index:1000' class='cPopText'></div>");

function showPopupText(event) {
	if(event.srcElement) o = event.srcElement; else o = event.target;
	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("popLayer").style.visibility="hidden";        
		} else {
			if(o.dyclass!=null) popStyle=o.dyclass; else popStyle="cPopText";
			document.getElementById("popLayer").style.visibility="visible";
			showIt();
		}
	}
}

function showIt() {
	document.getElementById("popLayer").className=popStyle;
	//document.getElementById("popLayer").innerHTML=sPop.replace(/<(.*)>/g,"&lt;$1&gt;").replace(/\n/g,"<br>");
	document.getElementById("popLayer").innerHTML=sPop.replace(/\n/g,"<br>");
	popWidth=document.getElementById("popLayer").clientWidth;
	popHeight=document.getElementById("popLayer").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("popLayer").style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
	document.getElementById("popLayer").style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
}

if(!document.onmouseover) {
	document.onmouseover = function(e) {
		if (!e) showPopupText(window.event); else showPopupText(e);
	};
}
