function submitonce(theform)
{
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById)
	{
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++)
		{
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase() == "submit"
				|| tempobj.type.toLowerCase() == "reset")
			{
				//disable em
				tempobj.disabled=true;
			}
		}
	}
}

function copyText(obj) {
    var rng = document.body.createTextRange();
    rng.moveToElementText(obj);
    rng.scrollIntoView();
    rng.select();
    rng.execCommand("Copy");
    rng.collapse(false);
}

function openScript(url, width, height)
{
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}

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; 
	}
}

//************* 双脚鼠标滚动屏幕 ********************************
var timer;
function initialize() { timer=setInterval("scrollwindow()",10);} 
function sc(){clearInterval(timer);}
function scrollwindow(){currentpos=document.body.scrollTop;window.scroll(0,++currentpos);if (currentpos != document.body.scrollTop) sc();} 
document.onmousedown=sc
document.ondblclick=initialize


//************* 获取客户端操作系统及浏览器类型 *********************
var __userAgent = window.navigator.userAgent.toLowerCase();
var __platform = window.navigator.platform.toLowerCase();
function getUserPlatform()
{
    var os = "未知";
    if(__platform.indexOf('win') != -1)
    {
        os = "win";
    }
    else if (__platform.indexOf('mac') != -1)
    {
        os = "Macintosh";
    }
    else if (__platform.indexOf('sun') != -1)
    {
        os = "Solaris";
    }
    else if (__platform.indexOf('hp-ux') != -1)
    {
        os = "HP Unix";
    }
    else if (__platform.indexOf('linux') != -1)
    {
        os = "Linux";
    }
    else if (__platform.indexOf('unix') != -1)
    {
        os = "Unix";
    }
    else
    {
        os = "未知";
    }
    //对Windows的处理
    if(os == "win")
    {
        if (__userAgent.indexOf('windows 95') != -1)
        {
            os = "Windows 95";
        }
        else if (__userAgent.indexOf('windows 98') != -1)
        {
            os = "Windows 98";
        }
        else if (__userAgent.indexOf('win 9x') != -1)
        {
            os = "Windows Me";
        }
        else if (__userAgent.indexOf('nt 5.0') != -1)
        {
            os = "Windows 2000";
        }
        else if (__userAgent.indexOf('nt 5.1') != -1)
        {
            os = "Windows XP";
        }
        else
        {
            os = "Windows";
        }
    }
    return os;
}

function getUserNavigator()
{
    var browser = "未知";
    var p1 = 0;
    var p2 = 0;
    if (__userAgent.indexOf('msie') != -1)
    {
        browser = "Microsoft Internet Explorer";
        p1 = __userAgent.indexOf("msie");
        p2 = __userAgent.indexOf(";", p1);
        browser += __userAgent.substring(p1 + 4, p2);
    }
    else if (__userAgent.indexOf('opera') != -1)
    {
        browser = "Opera";
    }
    else if (__userAgent.indexOf('mozilla') != -1)
    {
        browser = "Netscape";
    }
    else if (__userAgent.indexOf('aol') != -1)
    {
        browser = "AOL";
    }
    else if (__userAgent.indexOf('hotjava') != -1)
    {
        browser = "Sun HotJava";
    }
    else
    {
        browser = "未知";
    }
    return browser;
}



//*********** 以下为弹出文字提示框 *********************
tPopWait=50;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;

sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css' id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #F8F8F5;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>");

function showPopupText()
{
    var o=event.srcElement;
if(o!=null)
{
    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.dypop!=sPop)
    {
        sPop=o.dypop;
        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-=1;
        tFadeIn=setTimeout("fadeIn()",1);
    }
}

document.onmouseover=showPopupText;