﻿//***********全局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;
var arVersion = navigator.appVersion.toLowerCase().split("msie");
var ieversion =0;
if (arVersion.length>1) ieversion=parseFloat(arVersion[1]);
//*********检测浏览器(结束)******************

//***********检查E-mail(开始)*************
function checkemail(str)
{
	if (str.length>50 || str.indexOf("@")<1 || str.indexOf("@")>str.length-4) return false;
	return true;
}
//***********检查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 IsNumber(str) 
{ 
	var i,j,strTemp; 
	strTemp=".0123456789"; 
	if (str.length== 0) return false;
	var IsHasDian=false;
	for (i=0;i<str.length;i++) 
	{
		j=strTemp.indexOf(str.charAt(i)); 
		if (j<0) return false;
		if (i==0 || i==str.length-1)
		{
			if (str.charAt(i)==".") return false;
		}
		else
		{
			if (str.charAt(i)==".")
			{
				if (!IsHasDian) IsHasDian=true;
				else return false;
			}
		}
	}
	return true; 
}

//***************随机数(开始)*****************
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)) || strnum.substr(cnumi,1)=="-") 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 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 pos = uuzo.getScrollPos();
   // newdiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)/2+pos.x)-parseInt(newdiv.style.width)/2)+"px";
    //newdiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)/2+pos.y)-parseInt(newdiv.style.height)/2)+"px";

    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);
    alldivwidth+=pos.x;
	alldivheight+=pos.y;
    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++)
        {
			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++)
        {
            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="#FFFFFF";

	uuzo.setOpacity(alldiv,50);
    //if (isie) 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 #A3BAC4";
    newdiv.style.background="url(/imgs/News_View_Bg.jpg) repeat-x 0px 27px #FFFFFF";
    newdiv.style.overflow="visible";
	reval+="<div";
	if (ismove) reval+=" onmousedown=\"beginmovediv(event,'showsubmitframedivobj')\"";
	reval+=" style=\"margin:1px 1px 1px 1px;height:25px;line-height:25px;font-size:14px;color:#FFFFFF;background-color:#A3BAC4;\">&nbsp;"+str1+"</div>\n";
	reval+="<div style=\"margin:7px 7px 0px 7px;background-color:#FFFFFF;height:"+(thisheight-40)+"px;border:solid 1px #A3BAC4;overflow:visible;\">\n";
    reval+="	<div";
    if (!ismove) reval+=" style=\"margin:30px 0px 0px 0px;color:#286FB5;font-size:14px;text-align:center;overflow:visible;\"";
    reval+="><span id=\"showsubmitframedivobjinner\">"+str2+"</span></div>\n";
    reval+="</div>\n";
    newdiv.innerHTML=reval;
	var pos = uuzo.getScrollPos();
    newdiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)/2+pos.x)-parseInt(newdiv.style.width)/2)+"px";
    newdiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)/2+pos.y)-parseInt(newdiv.style.height)/2)+"px";

}
var uuzo = {};
uuzo.getDocumentElement=function(doc) {
		doc = doc || document;
		return (doc.compatMode != "CSS1Compat") ? doc.body : doc.documentElement;
	};
uuzo.browser = (function() {
	var ua = navigator.userAgent.toLowerCase();
	return {
		VERSION: ua.match(/(msie|firefox|webkit|opera)[\/:\s](\d+)/) ? RegExp.$2 : '0',
		IE: (ua.indexOf('msie') > -1 && ua.indexOf('opera') == -1),
		GECKO: (ua.indexOf('gecko') > -1 && ua.indexOf('khtml') == -1),
		WEBKIT: (ua.indexOf('applewebkit') > -1),
		OPERA: (ua.indexOf('opera') > -1)
	};
})();
uuzo.getScrollPos=function() {
		var x, y;
		if (uuzo.browser.IE || uuzo.browser.OPERA) {
			var el = uuzo.getDocumentElement();
			x = el.scrollLeft;
			y = el.scrollTop;
		} else {
			x = window.scrollX;
			y = window.scrollY;
		}
		return {x : x, y : y};
	};
uuzo.setOpacity=function(el, opacity) {
		if (typeof el.style.opacity == "undefined") {
			el.style.filter = (opacity == 100) ? "" : "alpha(opacity=" + opacity + ")";
		} else {
			el.style.opacity = (opacity == 100) ? "" : "0." + opacity.toString();
		}
	};
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 RunJsStr(objid,str)
{
    if (objid)
    {
		if ($(objid))
		{
			if (str!=null && str!="")
			{
				var newstr="";
				newstr+="<script";
				newstr+=" type=\"text/javascript\"";
				newstr+=">"+str+"</";
				newstr+="script>";
				setInnerHTML($(objid),newstr);
			}
		}
	}
}
function hide_frame()
{
    if ($("screendiv")) document.body.removeChild($("screendiv"));
    if ($("screendiv2"))
    {
    
    }
    else
    {
		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="#FFFFFF";
    uuzo.setOpacity(alldiv,50);

}

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 #A3BAC4";
    newdiv.style.background="url(/imgs/News_View_Bg.jpg) repeat-x 0px 27px #FFFFFF";
    newdiv.style.overflow="visible";
	reval+="<div";
	if (ismove) reval+=" onmousedown=\"beginmovediv(event,'showsubmitframedivobj2')\"";
	reval+=" style=\"margin:1px 1px 1px 1px;height:25px;line-height:25px;font-size:14px;color:#FFFFFF;background-color:#A3BAC4;\">&nbsp;"+str1+"</div>\n";
	reval+="<div style=\"margin:7px 7px 0px 7px;background-color:#FFFFFF;height:"+(thisheight-40)+"px;border:solid 1px #A3BAC4;overflow:visible;\">\n";
    reval+="	<div";
    if (!ismove) reval+=" style=\"margin:30px 0px 0px 0px;color:#286FB5;font-size:14px;text-align:center;overflow:visible;\"";
    reval+="><span id=\"showsubmitframedivobjinner2\">"+str2+"</span></div>\n";
    reval+="</div>\n";
    newdiv.innerHTML=reval;
	var pos = uuzo.getScrollPos();
    newdiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)/2+pos.x)-parseInt(newdiv.style.width)/2)+"px";
    newdiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)/2+pos.y)-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"));
    if ($("screendiv"))
    {
    
    }
    else
    {
		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)
{
	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 fixpng(imgobj) 
{
    if ((ieversion >= 5.5) && (ieversion < 7) && (document.body.filters)) 
    {
       var img = imgobj
	   var imgID = (imgobj.id) ? "id='" + imgobj.id + "' " : ""
	   var imgClass = (imgobj.className) ? "class='" + imgobj.className + "' " : ""
	   var imgTitle = (imgobj.title) ?  "title='" + imgobj.title  + "' " : "title='" + imgobj.alt + "' "
	   var imgStyle = "display:inline-block;" + imgobj.style.cssText
       if (img.align == "left") imgStyle = "float:left;" + imgStyle
       if (img.align == "right") imgStyle = "float:right;" + imgStyle
	   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle  
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + imgobj.width 
                  + "px; height:" + imgobj.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + imgobj.src + "\', sizingMethod='scale');\"></span>"
	   imgobj.outerHTML = strNewHTML	  
    }
}
function copyToClipBoard(str)
{ 
　　window.clipboardData.setData("Text",str); 
　　alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友"); 
}
function M_0_1_Title_onmouseover(num)
{
	for (var i=0;i<=1;i++)
	{
		$("ID_M_0_1_Title_"+i).className="M_0_1_Title_NoSelect";
		$("ID_M_0_1_Content_"+i).style.display="none";
	}
	$("ID_M_0_1_Title_"+num).className="M_0_1_Title_Select";
	$("ID_M_0_1_Content_"+num).style.display="inline";
}
