﻿//***********全局JS*************
var showendTimeNum=3000;
//***********去前后空格(开始)*************
String.prototype.trim  =  function()
{
	return this.replace(/(^\s*)|(\s*$)/g,  "");
}
//***********去前后空格(结束)*************

//***********去所有空格(开始)*************
String.prototype.trimall  =  function()
{
	return this.replace(/( |　)/g,  "");
}
//***********去所有空格(结束)*************

//***********字符长度(开始)*************
String.prototype.strlen=function ()
{
	var strLen=this.length;
	var binLen=0;
	for(var iCnt=0;iCnt<strLen;iCnt++)
	{
		binLen++;
		if(this.charCodeAt(iCnt)>128)	binLen++;
	}
	return binLen;
}
//***********字符长度(结束)*************

//*********检测浏览器(开始)******************
var isie=false;
if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1) isie=true;
//*********检测浏览器(结束)******************

//***********检查E-mail(开始)*************
function checkemail(str)
{
	str=str.toLowerCase();
	if (str.length>50)	return false;
	var renr=true;
	var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$";
	var re = new RegExp(regu);
	if (str.search(re)== -1)
	{
		renr=false;
	}
	return renr;
}
//***********检查E-mail(结束)*************

//***************IE+Firefox frames(开始)*****************
function getdocument(win){ return (win?win:window).document;}
function getdocumentgetElementById(i,win) {return getdocument(win).getElementById(i);}
function getframe(sID,win) //for firefox
{	
    if( sID == "" || sID == null ) return null;
    var frame = getdocumentgetElementById(sID,win);
    if( !frame) return null;
    return frame.contentWindow?frame.contentWindow:(win?win:window).frames[sID];
}
//***************IE+Firefox frames(结束)*****************

//***********去除html代码(开始)*************
function nohtml(str)
{
	str = str.replace(/</g,"&lt;");	
	str = str.replace(/>/g,"&gt;");
	return str;
}


//***********去除html代码(开始)*************
function replacehtml(str) {
	str = str.replace(/\r/g,"");
	str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
	str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
	str = str.replace(/<a[^>]+href="([^"]+)"[^>]*>(.*?)<\/a>/ig,"[url=$1]$2[/url]");
	str = str.replace(/<font[^>]+size=([^ >]+)[^>]*>(.*?)<\/font>/ig,"[size=$1]$2[/size]");
	str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"[color=$1]$2[/color]");
	str = str.replace(/<div[^>]+align=([^ >]+)[^>]*>(.*?)<\/div>/ig,"[align=$1]$2[/align]");
	str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"[img]$1[/img]");
	str = str.replace(/<([\/]?)b>/ig,"[$1b]");
	str = str.replace(/<([\/]?)strong>/ig,"[$1b]");
	str = str.replace(/<([\/]?)u>/ig,"[$1u]");
	str = str.replace(/<([\/]?)i>/ig,"[$1i]");
	str = str.replace(/&nbsp;/g," ");
	str = str.replace(/&amp;/g,"&");
	str = str.replace(/&quot;/g,"\"");
	str = str.replace(/&lt;/ig,"<");	
	str = str.replace(/&gt;/g,">");
	str = str.replace(/<br>/ig,"\n");
	str = str.replace(/<br \/>/ig,"\n");
	str = str.replace(/<[^>]*?>/g,"");
	str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
	str = str.replace(/\n+/g,"\n");
	return str;
}
function replacebadhtml(str) {
	str = str.replace(/\r/g,"");
	str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
	str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
	//str = str.replace(/&nbsp;/g," ");
	//str = str.replace(/&amp;/g,"&");
	//str = str.replace(/&quot;/g,"\"");
	//str = str.replace(/&lt;/ig,"<");	
	//str = str.replace(/&gt;/g,">");
	//str = str.replace(/<br>/ig,"\n");
	//str = str.replace(/<br \/>/ig,"\n");
	//str = str.replace(/<[^>]*?>/g,"");
	//str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
	str = str.replace(/\n+/g,"\n");
	return str;
}
//***********去除html代码(结束)*************

//***************随机数(开始)*****************
function rnd()
{
    var rnddate=new Date();
    var rndseed=rnddate.getTime();
    rndseed = (rndseed*9301+49297) % 233280;
    return rndseed/(233280.0);
}
function sjs(number)
{
    return Math.ceil(rnd()*number);
}
//***************随机数(结束)*****************


var now = function ()
    {
        var d = new Date();
        var vYear = d.getFullYear();
        var vMonth = d.getMonth()+1;
        var vDay = d.getDate();
        var vHour = d.getHours();
        var vMin = d.getMinutes();
        var vSec = d.getSeconds();
	    return {
	      'yy': vYear.toString().substr(2,2),
	      'M': vMonth,
	      'd': vDay,
	      'H': vHour,
	      'm': vMin,
	      's': vSec,
	      'yyyy': vYear,
	      'MM': vMonth<10 ? "0" + vMonth : vMonth,
	      'dd': vDay<10 ? "0" + vDay : vDay,
	      'HH': vHour<10 ? "0" + vHour : vHour,
	      'mm': vMin<10 ? "0" + vMin : vMin,
	      'ss': vSec<10 ?  "0"+ vSec : vSec
	    };
    };


//***********图片放大缩小(开始)*************
function imgzoom(obj)
{
	if(event.ctrlKey) {
		var zoom = parseInt(obj.style.zoom, 10) || 100;
		zoom -= event.wheelDelta / 12;
		if(zoom > 0) {
			obj.style.zoom = zoom + '%';
		}
		return false;
	} else {
		return true;
	}
}
//***********图片放大缩小(结束)*************
//***********取控件的坐标(开始)*************
function getobjxy(e)
{
	var t=parseInt(e.offsetTop);
	var l=parseInt(e.offsetLeft);
	while(e=e.offsetParent)
	{
		t+=parseInt(e.offsetTop);
		l+=parseInt(e.offsetLeft);
	}
	return t+","+l;
}
//***********取控件的坐标(结束)*************
//***********格式化数字(开始)*************
function cnum(str)
{
    if (str==null) str="0";
    var strnum=str.toString();
	var retxt="";
	if (strnum=="" || strnum==null) retxt="0";
	else
	{
		for (var cnumi=0; cnumi<strnum.length; cnumi++)
		{
			if (isNaN(strnum.substr(cnumi,1))==false) retxt=retxt+strnum.substr(cnumi,1);
		}
		if (retxt=="" || isNaN(retxt)==true) retxt="0";
	}
	return parseInt(retxt);
}
//***********格式化数字(结束)*************

//***********取得鼠标所在位置对象(开始)*************
if(navigator.product=="Gecko")
{
    Document.prototype.elementFromPoint = function(x, y)
    {
        this.addEventListener("mousemove", this.elementFromPoint__handler, false);
        var event = this.createEvent("MouseEvents");
        var box = this.getBoxObjectFor(this.documentElement);
        var screenDelta = { x: box.screenX, y: box.screenY };
        event.initMouseEvent("mousemove", true, false, this.defaultView, 0,
        x + screenDelta.x, y + screenDelta.y, x, y,
        false, false, false, false, 0, null);
        this.dispatchEvent(event);
        this.removeEventListener("mousemove", this.elementFromPoint__handler, false);
        return this.elementFromPoint__target;
    }
    Document.prototype.elementFromPoint__handler = function (event)
    {
        this.elementFromPoint__target = event.explicitOriginalTarget;

        if (this.elementFromPoint__target.nodeType == Node.TEXT_NODE)
        this.elementFromPoint__target = this.elementFromPoint__target.parentNode;

        if (this.elementFromPoint__target.nodeName.toUpperCase() == "HTML" && this.documentElement.nodeName.toUpperCase() == "HTML")
        this.elementFromPoint__target = this.getElementsByTagName("BODY").item(0);
        if ( this.elementFromPoint__target.nodeName=="#document" )
        {
            rp = event.rangeParent;
            alert("event.rangeParent = " + rp);
            if ( event.rangeParent.nodeType == Node.TEXT_NODE )
            this.elementFromPoint__target = event.rangeParent.parentNode.parentNode;
            else if ( event.rangeParent.nodeName == 'div' )
            this.elementFromPoint__target = event.rangeParent.parentNode;
        }
        event.preventDefault();
        event.stopPropagation();
    }
    Document.prototype.elementFromPoint__target = null;
}
//***********取得鼠标所在位置对象(结束)*************

//***********在firefox下模拟children的属性(开始)*************
if(typeof(HTMLElement)!="undefined" && !window.opera)
{
    HTMLElement.prototype.__defineGetter__("children",function()
        {
            for(var a=[],j=0,n,i=0; i<this.childNodes.length; i++)
            {
                n=this.childNodes[i];
                if(n.nodeType==1)
                {
                    a[j++]=n;
                    if(n.name)
                    {
                        if(!a[n.name]) a[n.name]=[];
                        a[n.name][a[n.name].length]=n;
                    }
                    if(n.id) a[n.id]=n;
                }
            }
            return a;
        });
}
//***********在firefox下模拟children的属性(结束)*************

//*************在firefox下模拟click()事件(开始)(由于跨主机头的问题,所以写在MasterPage里面了)**************
if(!isie)
{
    HTMLElement.prototype.click = function()
        {
            var evt = this.ownerDocument.createEvent("MouseEvents");
            evt.initMouseEvent("click", true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
            this.dispatchEvent(evt);
        }
}
//*************在firefox下模拟click()事件(结束)**************



var setInnerHTML = function (el, htmlCode)
	{   
		var ua = navigator.userAgent.toLowerCase();   
		if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0) {   
			htmlCode = '<div style="display:none">for IE</div>' + htmlCode;   
			htmlCode = htmlCode.replace(/<script([^>]*)>/gi,   
										'<script$1 defer>');   
			el.innerHTML = htmlCode;   
			el.removeChild(el.firstChild);   
		} else {   
			var el_next = el.nextSibling;   
			var el_parent = el.parentNode;   
			el_parent.removeChild(el);   
			el.innerHTML = htmlCode;   
			if (el_next) {   
				el_parent.insertBefore(el, el_next)   
			} else {   
				el_parent.appendChild(el);   
			}   
		}   
	}

function $(str)
{
    return document.getElementById(str);
}

//加入收藏
function addBookmark()
{
    var title=document.title;
    var url=location.href;
    if (window.sidebar)
    { 
        window.sidebar.addPanel(title, url,""); 
    }
    else if(document.all)
    {
        window.external.AddFavorite( url, title);
    }
    else if(window.opera && window.print)
    {
        return true;
    }
}


function replacedateyestono(str)
{
    //2007-07-06 转 20070706
    if (str==null) return "0";
    str = str.trim();
    str = str.replace(/(\d+)\-(\d+)\-(\d+)/ig, "$1$2$3");
    if (isNaN(str)) return "0";
    return str;
}

function ClickObj(obj)
{
    if (isie) obj.click();
    else
    {
        var en=document.createEvent("MouseEvents");  
        en.initEvent("click",false,false);   
        obj.dispatchEvent(en);
    }
}

var getAbsoluteCoords = function (e)
    {
	    var width = e.offsetWidth;
	    var height = e.offsetHeight;
	    var left = e.offsetLeft;
	    var top = e.offsetTop;
	    while (e=e.offsetParent)
	    {
		    left += e.offsetLeft;
		    top  += e.offsetTop;
	    };
	    var right = left+width;
	    var bottom = top+height;
	    return {
	      'width': width,
	      'height': height,
	      'left': left,
	      'top': top,
	      'right': right,
	      'bottom': bottom
	    };
    };
    
function ApplyFilters(obj)
{
    if (isie)
    {
        obj.style.filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
        obj.filters[0].Apply();
    }
}
function PlayFilters(obj)
{
    if (isie) obj.filters[0].Play();
}
function ChangeInputColor(obj)
{
	obj.style.border='solid 1px #ffcc33';
	obj.style.backgroundImage='url(/imgs/bg/bg_formTextField3.gif)';
	obj.style.backgroundColor='#fffaea';
}
function ChangeInputColor2(obj)
{
	obj.style.border='solid 1px #ffcc33';
	obj.style.backgroundImage='none';
	obj.style.backgroundColor='#fffaea';
}
function ChangeInputColor3(obj)
{
	obj.style.backgroundImage='url(/imgs/bg/bg_formTextField3.gif)';
}
function RecoverInputColor(obj)
{
	obj.style.border='solid 1px #aaaaaa';
	obj.style.backgroundImage='url(/imgs/bg/bg_formTextField.gif)';
}
function RecoverInputColor2(obj)
{
	obj.style.border='solid 1px #aaaaaa';
	obj.style.backgroundColor='#ffffff';
}

function AllObjBlur() //失焦所有控件
{
	var allblurobj;
	allblurobj=document.body.getElementsByTagName("a");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            allblurobj[i].blur();
        }
    }
    allblurobj=document.body.getElementsByTagName("input");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            allblurobj[i].blur();
        }
    }
    allblurobj=document.body.getElementsByTagName("textarea");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            allblurobj[i].blur();
        }
    }
    allblurobj=document.body.getElementsByTagName("select");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            allblurobj[i].blur();
        }
    }
    hide_select();
}

var event_x=0;
var event_y=0;
var begin_objtop=0;
var begin_objleft=0;
var nowobjtop=0;
var nowobjleft=0;
var divmoveing=false;
function beginmovediv(e,objid)
{
    if ($(objid)==null) return false;
    e = window.event||e;
    event_x=e.x?e.x:e.pageX;
    event_y=e.y?e.y:e.pageY;
    document.body.onmousemove=function(e)
        {
            movingdiv(e,objid);
        };
    document.body.onmouseup=function(e)
        {
            stopmovediv(e,objid);
        };
    document.body.onselectstart=function (e)
        {
            return false;
        };
    document.body.style.cursor="move";
    begin_x=parseInt(event_x);
    begin_y=parseInt(event_y);
    begin_objtop=parseInt($(objid).style.top);
    begin_objleft=parseInt($(objid).style.left);
    divmoveing=true;
    
    var newdiv=document.createElement("div");
    newdiv.id=objid+"_temp";
    newdiv.style.position="absolute";
    newdiv.style.zIndex="999";
    newdiv.style.border="solid 1px #666666";
    newdiv.style.left=(begin_objleft-1)+"px";
    newdiv.style.top=(begin_objtop-1)+"px";
    newdiv.style.width=parseInt($(objid).offsetWidth)+"px";
    newdiv.style.height=parseInt($(objid).offsetHeight)+"px";
    document.body.appendChild(newdiv);
}
function movingdiv(e,objid)
{
    if (!divmoveing)
    {
        stopmovediv(e,objid);
        return false;
    }
    e = window.event||e;
    if (e.button != 1 && e.button != 0)
    {
        stopmovediv(e,objid);
        return false;
    }
    event_x=e.x?e.x:e.pageX;
    event_y=e.y?e.y:e.pageY;
    now_x=parseInt(event_x);
    now_y=parseInt(event_y);
    nowobjtop=parseInt(begin_objtop)+parseInt(now_y)-parseInt(begin_y);
    nowobjleft=parseInt(begin_objleft)+parseInt(now_x)-parseInt(begin_x);
    
    if (nowobjtop<0) nowobjtop=0;
    if (nowobjleft<0) nowobjleft=0;
    
    var alldivwidth=parseInt(document.body.clientWidth);
    if (parseInt(document.body.clientWidth)<parseInt(document.documentElement.clientWidth)) alldivwidth=parseInt(document.documentElement.clientWidth);
    var alldivheight=parseInt(document.body.clientHeight);
    if (parseInt(document.body.clientHeight)<parseInt(document.documentElement.clientHeight)) alldivheight=parseInt(document.documentElement.clientHeight);
    
    if (nowobjtop+parseInt($(objid).offsetHeight)>alldivheight)
    {
        nowobjtop=alldivheight-parseInt($(objid).offsetHeight);
    }
    if (nowobjleft+parseInt($(objid).offsetWidth)>alldivwidth)
    {
        nowobjleft=alldivwidth-parseInt($(objid).offsetWidth);
    }
    
    if ($(objid+"_temp"))
    {
		$(objid+"_temp").style.top=nowobjtop+"px";
		$(objid+"_temp").style.left=nowobjleft+"px";
    }
}
function stopmovediv(e,objid)
{
    e = window.event||e;
    document.body.onmousemove=function(e)
        {
            
        };
    document.body.onmouseup=function(e)
        {
            
        };
    document.body.onselectstart=function (e)
        {
            
        };
    document.body.style.cursor="default";
    divmoveing=false;
    if ($(objid+"_temp"))
    {
		$(objid).style.top=parseInt($(objid+"_temp").style.top)+"px";
		$(objid).style.left=parseInt($(objid+"_temp").style.left)+"px";
		document.body.removeChild($(objid+"_temp"));
	}
    return false;
}
function hide_select()
{
	var allblurobj=document.body.getElementsByTagName("select");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            allblurobj[i].style.display="none";
        }
    }
    allblurobj=document.body.getElementsByTagName("object");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
			if (allblurobj[i].id!="mapobjid") allblurobj[i].style.display="none";
        }
    }
}
function show_select()
{
	var allblurobj=document.body.getElementsByTagName("select");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            allblurobj[i].style.display="";
        }
    }
    allblurobj=document.body.getElementsByTagName("object");
    if (allblurobj.length>0)
    {
        for (var i=0;i<allblurobj.length;i++)
        {
            if (allblurobj[i].id!="mapobjid") allblurobj[i].style.display="";
        }
    }
}
function show_screendiv()
{
	AllObjBlur();
    var alldivwidth=parseInt(document.body.clientWidth);
    if (alldivwidth<parseInt(document.documentElement.clientWidth)) alldivwidth=parseInt(document.documentElement.clientWidth);
    var alldivheight=parseInt(document.body.clientHeight);
    if (alldivheight<parseInt(document.documentElement.clientHeight)) alldivheight=parseInt(document.documentElement.clientHeight);
    if (alldivwidth<parseInt(document.documentElement.scrollWidth)) alldivwidth=parseInt(document.documentElement.scrollWidth);
    if (alldivheight<parseInt(document.documentElement.scrollHeight)) alldivheight=parseInt(document.documentElement.scrollHeight);
    
    var alldiv=document.createElement("div");
    alldiv.id="screendiv";
    alldiv.style.position="absolute";
    alldiv.style.zIndex="100";
    document.body.appendChild(alldiv);

    alldiv.style.left="0px";
    alldiv.style.top="0px";
    alldiv.style.width=alldivwidth+"px"
    alldiv.style.height=alldivheight+"px";
    alldiv.style.backgroundColor="#999999";
    if (isie==true) alldiv.style.filter="Alpha(Opacity=50)";
	else alldiv.style.MozOpacity = 0.5;

}


function showsubmitframediv(str1,str2,ismove,thiswidth,thisheight)
{
    if (str1==null) str1="";
    if (str2==null) str2="";
    hide_frame();
    show_screendiv();
    var reval="";
    var newdiv=document.createElement("div");
    newdiv.id="showsubmitframedivobj";
    newdiv.style.position="absolute";
    newdiv.style.zIndex="102";
    newdiv.style.textAlign="left";
    document.body.appendChild(newdiv);

    if (thiswidth==null) thiswidth=340;
    if (thisheight==null) thisheight=120;
    newdiv.style.width=thiswidth+"px";
    newdiv.style.height=thisheight+"px";
    newdiv.style.border="1px solid #CCCCCC";
    newdiv.style.backgroundColor="#CDE8F5";
    newdiv.style.overflow="visible";
    reval+="<ul>\n";
    reval+="    <li";
    if (ismove) reval+=" onmousedown=\"beginmovediv(event,'showsubmitframedivobj')\"";
    reval+=" style=\"margin:8px 7px 0px 7px;height:16px;line-height:16px;font-size:14px;color:#1A73C5;\">"+str1+"</li>\n";
    reval+="    <li style=\"margin:7px 7px 0px 7px;background-color:#FFFFFF;height:"+(thisheight-40)+"px;border:solid 1px #D9E9F9;overflow:visible;\">\n";
    reval+="        <div";
    if (!ismove) reval+=" style=\"margin:30px 0px 0px 0px;color:#1973C1;font-size:14px;text-align:center;overflow:visible;\"";
    reval+="><span id=\"showsubmitframedivobjinner\">"+str2+"</span></div>\n";
    reval+="    </li>\n";
    reval+="</ul>\n";
    newdiv.innerHTML=reval;
    newdiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)/2+parseInt(document.documentElement.scrollLeft))-parseInt(newdiv.style.width)/2)+"px";
    newdiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)/2+parseInt(document.documentElement.scrollTop))-parseInt(newdiv.style.height)/2)+"px";

}
function showsubmitframedivend(objid,str,isjs)
{
    hide_frame();
    if ($("showsubmitframedivobj")) document.body.removeChild($("showsubmitframedivobj"));
    if (objid)
    {
		if ($(objid))
		{
			if (str!=null && str!="")
			{
				if (isjs)
				{
					var newstr="";
					newstr+="<script";
					newstr+=" type=\"text/javascript\"";
					newstr+=">"+str+"</";
					newstr+="script>";
					setInnerHTML($(objid),newstr);
				}
				else
				{
					$(objid).innerHTML=str;
				}
			}
		}
	}
    return false;
}
function hide_frame()
{
    if ($("screendiv")) document.body.removeChild($("screendiv"));
    show_select();
}


function show_screendiv2()
{
	AllObjBlur();
    var alldivwidth=parseInt(document.body.clientWidth);
    if (alldivwidth<parseInt(document.documentElement.clientWidth)) alldivwidth=parseInt(document.documentElement.clientWidth);
    var alldivheight=parseInt(document.body.clientHeight);
    if (alldivheight<parseInt(document.documentElement.clientHeight)) alldivheight=parseInt(document.documentElement.clientHeight);
    if (alldivwidth<parseInt(document.documentElement.scrollWidth)) alldivwidth=parseInt(document.documentElement.scrollWidth);
    if (alldivheight<parseInt(document.documentElement.scrollHeight)) alldivheight=parseInt(document.documentElement.scrollHeight);
    var alldiv=document.createElement("div");
    alldiv.id="screendiv2";
    alldiv.style.position="absolute";
    alldiv.style.zIndex="200";
    document.body.appendChild(alldiv);

    alldiv.style.left="0px";
    alldiv.style.top="0px";
    alldiv.style.width=alldivwidth+"px"
    alldiv.style.height=alldivheight+"px";
    alldiv.style.backgroundColor="#999999";
    if (isie==true) alldiv.style.filter="Alpha(Opacity=50)";
	else alldiv.style.MozOpacity = 0.5;

}

function showsubmitframediv2(str1,str2,ismove,thiswidth,thisheight)
{
    if (str1==null) str1="";
    if (str2==null) str2="";
    hide_frame2();
    show_screendiv2();
    var reval="";
    var newdiv=document.createElement("div");
    newdiv.id="showsubmitframedivobj2";
    newdiv.style.position="absolute";
    newdiv.style.zIndex="202";
    newdiv.style.textAlign="left";
    document.body.appendChild(newdiv);

    if (thiswidth==null) thiswidth=340;
    if (thisheight==null) thisheight=120;
    newdiv.style.width=thiswidth+"px";
    newdiv.style.height=thisheight+"px";
    newdiv.style.border="1px solid #CCCCCC";
    newdiv.style.backgroundColor="#CDE8F5";
    newdiv.style.overflow="visible";
    reval+="<ul>\n";
    reval+="    <li";
    if (ismove) reval+=" onmousedown=\"beginmovediv(event,'showsubmitframedivobj2')\"";
    reval+=" style=\"margin:8px 7px 0px 7px;height:16px;line-height:16px;font-size:14px;color:#1A73C5;\">"+str1+"</li>\n";
    reval+="    <li style=\"margin:7px 7px 0px 7px;background-color:#FFFFFF;height:"+(thisheight-40)+"px;border:solid 1px #D9E9F9;overflow:visible;\">\n";
    reval+="        <div";
    if (!ismove) reval+=" style=\"margin:30px 0px 0px 0px;color:#1973C1;font-size:14px;text-align:center;overflow:visible;\"";
    reval+="><span id=\"showsubmitframedivobjinner2\">"+str2+"</span></div>\n";
    reval+="    </li>\n";
    reval+="</ul>\n";
    newdiv.innerHTML=reval;
    newdiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)/2+parseInt(document.documentElement.scrollLeft))-parseInt(newdiv.style.width)/2)+"px";
    newdiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)/2+parseInt(document.documentElement.scrollTop))-parseInt(newdiv.style.height)/2)+"px";

}
function showsubmitframedivend2(objid,str,isjs)
{
    hide_frame2();
    if ($("showsubmitframedivobj2")) document.body.removeChild($("showsubmitframedivobj2"));
    if (objid)
    {
		if ($(objid))
		{
			if (str!=null && str!="")
			{
				if (isjs)
				{
					var newstr="";
					newstr+="<script";
					newstr+=" type=\"text/javascript\"";
					newstr+=">"+str+"</";
					newstr+="script>";
					setInnerHTML($(objid),newstr);
				}
				else
				{
					$(objid).innerHTML=str;
				}
			}
		}
	}
    return false;
}
function hide_frame2()
{
    if ($("screendiv2")) document.body.removeChild($("screendiv2"));
    show_select();
}

function loadjs(str)
{
	if (str==null) str="";
	if (str=="") return false;
	var headobj=document.getElementsByTagName("head").item(0);
    var scriptobj=document.createElement("script");
    scriptobj.src=str;
    scriptobj.type="text/javascript";
    scriptobj.defer=true;
    void(headobj.appendChild(scriptobj));
}

function replacemapsxy(num1,num2)//把Oracle库中的经纬度转换成标准的度分秒
{
	if (isNaN(num1) || isNaN(num2)) return [0,0];
	var Longitude=parseFloat(num1/10000000.00);
    var Longitude_angle=Math.round(Longitude);
    Longitude=parseFloat(Longitude-Longitude_angle)*100.00;
    var Longitude_Minute=Math.round(Longitude);
    var Longitude_Second=Math.round((Longitude-Longitude_Minute)*600);
    Longitude=(Longitude_angle+Longitude_Minute/60+Longitude_Second/60/60);
    
    var Latitude=parseFloat(num2/10000000.0);
    var Latitude_angle=Math.round(Latitude);
    Latitude=parseFloat(Latitude-Latitude_angle)*100.0;
    var Latitude_Minute=Math.round(Latitude);
    var Latitude_Second=Math.round((Latitude-Latitude_Minute)*600);
    Latitude=(Latitude_angle+Latitude_Minute/60+Latitude_Second/60/60);
    
    return [Longitude,Latitude];
}

function setHomePage(str)
{
	if (str==null || str=="") return false;
	if (isie)
	{
		return false;
	}
	else
	{
		if(window.netscape)
		{
			try
			{ 
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
			} 
			catch (e) 
			{ 
				alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
				return false;
			}
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',str);
	}
}
function OnLoadFocus(objstr)
{
	if ($(objstr))
	{
		$(objstr).focus();
	}
	else
	{
		setTimeout("OnLoadFocus('"+objstr+"')", 100);
	}
}
function Show_Logout()
{
	AllObjBlur();
	showsubmitframediv("登出",LoadingImg+"正在登出...");
	var xmlhttpobj=new xmlhttp;
    var xmlobj;
    xmlhttpobj.go("/User/Logout.html",true);
    xmlhttpobj.content="";
    xmlhttpobj.send();
    xmlhttpobj.callback=function(xmlobj)
	    {
		    var retxt=unescape(xmlobj.responseText);
		    xmlobj=null;
		    xmlhttpobj=null;
		    if (retxt=="ok")
		    {
		        $("showsubmitframedivobjinner").innerHTML="登出成功,正在更新数据...";
		        setTimeout("location.reload()", 2000);
		        return false;
		    }
		    else
		    {
				$("showsubmitframedivobjinner").innerHTML=retxt;
				setTimeout("showsubmitframedivend()", 2000);
				return false;
		    }
	    }
}

var locationurl=location.search;
	var Request=new Object();
	if (locationurl.indexOf("?")>-1)
	{
		var locationurlstr=locationurl.substr(1);
		var locationurlstrs=locationurlstr.split('&');
		var locationurlstrs2;
		for(var locationurli=0;locationurli<locationurlstrs.length;locationurli++)
		{
			locationurlstrs2=locationurlstrs[locationurli].split('=');
			if (locationurlstrs2.length>1) Request[locationurlstrs2[0]]=unescape(locationurlstrs2[1]);
			else Request[locationurlstrs2[0]]="";
		}
	} 
var LoadingImg="<img src='/imgs/loading.gif' alt='' style='margin-right:5px;' />";