﻿//***********全局JS*************

//***********去空格(开始)*************
String.prototype.trim  =  function()
{
	return this.replace(/(^\s*)|(\s*$)/g,  "");
}
//***********去空格(结束)*************

//***********字符长度(开始)*************
String.prototype.binaryLength=function ()
{
	var strLen=this.length;
	var binLen=0;
	for(var iCnt=0;iCnt<strLen;iCnt++)
	{
		binLen++;
		if(this.charCodeAt(iCnt)>128)	binLen++;
	}
	return binLen;
}
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;
//alert(navigator.userAgent.toLowerCase());
if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1) isie=true;
//*********检测浏览器(结束)******************

function checkchinese(str) //检查是否为中文
{
    if (str==null) str="";
    var patrn=/[\u4e00-\u9fa5]$/;
    if (!patrn.exec(str)) return false;
    return 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(结束)*************

//***********去除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 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);
}
function formatnum(str)
{
	var retxt="";
	if (str=="" || str==null) retxt="0";
	else
	{
		for (var i=0; i<str.length; i++)
		{
			if (isNaN(str.substr(i,1))==false) retxt=retxt+str.substr(i,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;
}
//***********取得鼠标所在位置对象(结束)*************

function Info(str)
{
    if (document.getElementById(str)) return document.getElementById(str);
    else return null;
}


//加入收藏
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;
}



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 check_login_keydown(e)
{
	e = window.event||e;
	if (e.keyCode==13) checklogin();
}
function checklogin() //检查登陆
{
    if (Info("cardnum").value.trim()=="")
    {
        alert("请键入手机号码");
        Info("cardnum").focus();
        Info("cardnum").select();
        return false;
    }
    if (isNaN(Info("cardnum").value) || Info("cardnum").value.length!=11)
    {
        alert("手机号码不正确");
        Info("cardnum").focus();
        Info("cardnum").select();
        return false;
    }
    if (Info("userpwd").value=="")
    {
        alert("请键入密码");
        Info("userpwd").focus();
        Info("userpwd").select();
        return false;
    }
    if (isie)
    {
        Info("loginsubmitinner").parentNode.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
        Info("loginsubmitinner").parentNode.filters[0].Apply();
    }
    Info("loginsubmitinner").innerHTML="<img src=\"imgs/ajax.gif\" alt=\"\" stlye=\"width:16px;height:16px;\" />&nbsp;正在检查中...";
    if (isie)
    {
        Info("loginsubmitinner").parentNode.filters[0].Play();
    }
	var xmlhttpobj=new xmlhttp;
	var xmlobj=null;
	xmlhttpobj.go("checklogin.aspx?act=login",true);
	xmlhttpobj.content="cardnum="+Info("cardnum").value+"&userpwd="+Info("userpwd").value;
	xmlhttpobj.send();
	xmlhttpobj.callback=function(xmlobj)
		{
			var retxt=unescape(xmlobj.responseText);
			xmlobj=null;
			xmlhttpobj=null;
			if (retxt=="ok")
			{
			    if (isie)
                {
                    Info("loginsubmitinner").parentNode.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
                    Info("loginsubmitinner").parentNode.filters[0].Apply();
                }
				Info("loginsubmitinner").innerHTML="<img src=\"imgs/ajax.gif\" alt=\"\" stlye=\"width:16px;height:16px;\" />&nbsp;登入成功,正在更新数据...";
				if (isie)
                {
                    Info("loginsubmitinner").parentNode.filters[0].Play();
                }
				window.location.reload();
				return false;
			}
			else
			{
		    	var newretxt=retxt;
		    	if (isie)
                {
                    Info("loginsubmitinner").parentNode.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
                    Info("loginsubmitinner").parentNode.filters[0].Apply();
                }
				Info("loginsubmitinner").innerHTML="<input onclick=\"checklogin()\" type=\"button\" value=\"登陆\" style=\"border:1px solid #666666;width:50px;height:20px;\" />&nbsp;&nbsp;<a href=\"getpassword.aspx\" target=\"_blank\">获取密码</a>&nbsp;&nbsp;<a href=\"reg.aspx\" target=\"_blank\">注册</a>";
				alert(newretxt);
				if (isie)
                {
                    Info("loginsubmitinner").parentNode.filters[0].Play();
                }
				return false;
			}
		}
}
function showframe(str)
{
    var alldivwidth=document.body.clientWidth;
    if (document.body.clientWidth<document.documentElement.clientWidth) alldivwidth=document.documentElement.clientWidth;
    var alldivheight=document.body.clientHeight;
    if (document.body.clientHeight<document.documentElement.clientHeight) alldivheight=document.documentElement.clientHeight;
    
    var alldiv=document.createElement("div");
    alldiv.id="screendiv";
    document.body.appendChild(alldiv);
    if (isie)
    {
        alldiv.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
        alldiv.filters[0].Apply();
    }
    alldiv.style.position="absolute";
    alldiv.style.zIndex="1";
    alldiv.style.left="0px";
    alldiv.style.top="0px";
    alldiv.style.width=parseInt(alldivwidth)+"px";
    alldiv.style.height=parseInt(alldivheight)+"px";
    alldiv.style.backgroundColor="#999999";
    if (isie==true) alldiv.style.filter="Alpha(Opacity=50)";
	else alldiv.style.MozOpacity = 0.5;
	if (isie)
    {
        alldiv.filters[0].Play();
    }
	
	var neidiv=document.createElement("div");
	neidiv.id="addfrienddiv";
	document.body.appendChild(neidiv);
	if (isie)
    {
        neidiv.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
        neidiv.filters[0].Apply();
    }
    neidiv.style.position="absolute";
    neidiv.style.zIndex="2";
    neidiv.style.width="200px";
    neidiv.style.height="130px";
    neidiv.style.border="1px solid #666666";
    neidiv.style.backgroundColor="#FFFFFF";
    neidiv.style.textAlign="left";
    neidiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)+parseInt(document.documentElement.scrollLeft))/2-parseInt(neidiv.style.width)/2)+"px";
    neidiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)+parseInt(document.documentElement.scrollTop))/2-parseInt(neidiv.style.height)/2)+"px";
    if (str==null) str="";
    neidiv.innerHTML=str;
    if (isie)
    {
        neidiv.filters[0].Play();
    }
}

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 beginmoveinfodiv(e)
{
    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)
        {
            movinginfodiv(e);
        };
    document.body.onmouseup=function(e)
        {
            stopmoveinfodiv(e);
        };
    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(Info("addfrienddiv").style.top);
    begin_objleft=parseInt(Info("addfrienddiv").style.left);
    divmoveing=true;
}
function movinginfodiv(e)
{
    if (!divmoveing)
    {
        stopmoveinfodiv(e);
        return false;
    }
    e = window.event||e;
    if (e.button != 1 && e.button != 0)
    {
        stopmoveinfodiv(e);
        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;
    
    if (Info("screendiv"))
    {
        if (nowobjtop+parseInt(Info("addfrienddiv").offsetHeight)>parseInt(Info("screendiv").style.height))
        {
            nowobjtop=parseInt(Info("screendiv").style.height)-parseInt(Info("addfrienddiv").offsetHeight);
        }
        if (nowobjleft+parseInt(Info("addfrienddiv").offsetWidth)>parseInt(Info("screendiv").style.width))
        {
            nowobjleft=parseInt(Info("screendiv").style.width)-parseInt(Info("addfrienddiv").offsetWidth);
        }
    }
    
    Info("addfrienddiv").style.top=nowobjtop+"px";
    Info("addfrienddiv").style.left=nowobjleft+"px";
}
function stopmoveinfodiv(e)
{
    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;
    return false;
}

function GetXMLItemValue(obj)
{
    if (obj==null) return "";
    if (isie) return obj.text;
    else return obj.firstChild.nodeValue;
}

function check_allsearchsubmit_keydown(e)
{
    e = window.event||e;
    if (e.keyCode==13) allsearchsubmit();
}
function allsearchsubmit()
{
    Info("allsearchkeyword").value=Info("allsearchkeyword").value.trim();
    Info("allsearchsubmitinner").style.fontSize="12px";
    Info("allsearchsubmitinner").innerHTML="<img src=\"imgs/ajax.gif\" alt=\"\" stlye=\"width:16px;height:16px;\" />";
    window.location.href="class.aspx?keyword="+escape(Info("allsearchkeyword").value);
}

//***************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(结束)*****************


//    function lookboard(num)
//    {

//        if (num==null || isNaN(num) || parseInt(num)==0) return false;
//        var reval="";
//        reval+="<ul>\n";
//        reval+="    <li onmousedown=\"beginmoveinfodiv(event)\" style=\"background-color:#666666;height:20px;\">\n";
//        reval+="        <table cellpadding=\"0\" style=\"width:100%; border-collapse:collapse;color:#FFFFFF;height:20px;\">\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"width:95%;\">&nbsp;查看留言</td>\n";
//        reval+="                <td style=\"width:5%;\"><img class=\"hand\" onmousedown=\"hidegbframe()\" src=\"images/close.gif\" alt=\"关闭\" style=\"width:14px;height:14px;\" /></td>\n";
//        reval+="            </tr>\n";
//        reval+="        </table>\n";
//        reval+="    </li>\n";
//        reval+="    <li style=\"margin:10px 10px 10px 10px;\">\n";
//        reval+="        <table cellpadding=\"0\" style=\"border-collapse:collapse;\">\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"width:12%;height:20px;font-weight:bold;\">&nbsp;作者:</td>\n";
//        reval+="                <td style=\"width:88%;height:20px;\">"+Info("author"+num).innerHTML+"</td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:2px;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:1px;border-top:dashed 1px #99999;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:2px;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"width:12%;height:20px;font-weight:bold;\">&nbsp;时间:</td>\n";
//        reval+="                <td style=\"width:88%;height:20px;\">"+Info("createtime"+num).innerHTML+"</td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:2px;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:1px;border-top:dashed 1px #99999;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:2px;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"width:12%;vertical-align:top;line-height:120%;font-weight:bold;\">&nbsp;内容:</td>\n";
//        reval+="                <td style=\"width:88%;word-break:break-all;line-height:120%;\">"+Info("Context"+num).innerHTML+"</td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:2px;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:1px;border-top:dashed 1px #99999;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"height:2px;\" colspan=\"2\"></td>\n";
//        reval+="            </tr>\n";
//        reval+="            <tr>\n";
//        reval+="                <td style=\"width:12%;vertical-align:top;line-height:120%;font-weight:bold;\">&nbsp;回复:</td>\n";
//        reval+="                <td style=\"width:88%;word-break:break-all;line-height:120%;\">"+Info("Reply"+num).innerHTML+"</td>\n";
//        reval+="            </tr>\n";
//        reval+="        </table>\n";
//        reval+="    </li>\n";
//        reval+="</ul>\n";
//        showgbframe(reval);
//    }

 function lookboard(num)
    {

        if (num==null || isNaN(num) || parseInt(num)==0) return false;
        var reval="";
        reval+="<ul class=\"alert_ul\">\n";
        reval+="    <li onmousedown=\"beginmoveinfodiv(event)\" class=\"alert_li\">\n";
        reval+="        <table cellpadding=\"0\" class=\"alert_title\">\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"title_megs\">&nbsp;查看留言</td>\n";
        reval+="                <td class=\"shut_wid\"><img class=\"img_width\" onmousedown=\"hidegbframe()\" src=\"images/close.gif\" alt=\"关闭\"/></td>\n";
        reval+="            </tr>\n";
        reval+="        </table>\n";
        reval+="    </li>\n";
        reval+="    <li class=\"alert_contem\">\n";
        reval+="        <table cellpadding=\"0\" class=\"conten_border\">\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"conten_title\">&nbsp;作者:</td>\n";
        reval+="                <td class=\"conten_center\">"+Info("author"+num).innerHTML+"</td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"top_line\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"conten_title\">&nbsp;时间:</td>\n";
        reval+="                <td class=\"conten_center\">"+Info("createtime"+num).innerHTML+"</td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"top_line\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"main_title\">&nbsp;内容:</td>\n";
        reval+="                <td class=\"main_center\"><div style=\"overflow:hidden; width:100%;\">"+Info("Context"+num).innerHTML+"</div></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"top_line\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"main_title\">&nbsp;回复:</td>\n";
        reval+="                <td class=\"main_center\"><div style=\"overflow:hidden; width:100%;\">"+Info("Reply"+num).innerHTML+"</div></td>\n";
        reval+="            </tr>\n";
        reval+="        </table>\n";
        reval+="    </li>\n";
        reval+="</ul>\n";
        showgbframe(reval);
    }
    
    function Enlookboard(num)
    {

        if (num==null || isNaN(num) || parseInt(num)==0) return false;
        var reval="";
        reval+="<ul class=\"alert_ul\">\n";
        reval+="    <li onmousedown=\"beginmoveinfodiv(event)\" class=\"alert_li\">\n";
        reval+="        <table cellpadding=\"0\" class=\"alert_title\">\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"title_megs\">&nbsp;View messages</td>\n";
        reval+="                <td class=\"shut_wid\"><img class=\"img_width\" onmousedown=\"hidegbframe()\" src=\"images/close.gif\" alt=\"关闭\"/></td>\n";
        reval+="            </tr>\n";
        reval+="        </table>\n";
        reval+="    </li>\n";
        reval+="    <li class=\"alert_contem\">\n";
        reval+="        <table cellpadding=\"0\" class=\"conten_border\">\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"conten_title\">&nbsp;Author:</td>\n";
        reval+="                <td class=\"conten_center\">"+Info("author"+num).innerHTML+"</td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"top_line\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"conten_title\">&nbsp;Time:</td>\n";
        reval+="                <td class=\"conten_center\">"+Info("createtime"+num).innerHTML+"</td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"top_line\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"main_title\">&nbsp;Content:</td>\n";
        reval+="                <td class=\"main_center\"><div style=\"overflow:hidden; width:100%;\">"+Info("Context"+num).innerHTML+"</div></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"top_line\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"lin_height\" colspan=\"2\"></td>\n";
        reval+="            </tr>\n";
        reval+="            <tr>\n";
        reval+="                <td class=\"main_title\">&nbsp;Reply:</td>\n";
        reval+="                <td class=\"main_center\"><div style=\"overflow:hidden; width:100%;\">"+Info("Reply"+num).innerHTML+"</div></td>\n";
        reval+="            </tr>\n";
        reval+="        </table>\n";
        reval+="    </li>\n";
        reval+="</ul>\n";
        showgbframe(reval);
    }

    function showgbframe(str)
    {
        var alldivwidth=document.body.clientWidth;
        if (document.body.clientWidth<document.documentElement.clientWidth) alldivwidth=document.documentElement.clientWidth;
        var alldivheight=document.body.clientHeight;
        if (document.body.clientHeight<document.documentElement.clientHeight) alldivheight=document.documentElement.clientHeight;
        
        var alldiv=document.createElement("div");
        alldiv.id="screendiv";
        document.body.appendChild(alldiv);
        if (isie)
        {
            alldiv.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
            alldiv.filters[0].Apply();
        }
        alldiv.style.position="absolute";
        alldiv.style.zIndex="1";
        alldiv.style.left="0px";
        alldiv.style.top="0px";
        alldiv.style.width=parseInt(alldivwidth)+"px";
        alldiv.style.height=parseInt(alldivheight)+"px";
        alldiv.style.backgroundColor="#999999";
        if (isie==true) alldiv.style.filter="Alpha(Opacity=50)";
	    else alldiv.style.MozOpacity = 0.5;
	    if (isie)
        {
            alldiv.filters[0].Play();
        }
    	
	    var neidiv=document.createElement("div");
	    neidiv.id="addfrienddiv";
	    document.body.appendChild(neidiv);
	    if (isie)
        {
            neidiv.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5);";
            neidiv.filters[0].Apply();
        }
        neidiv.style.position="absolute";
        neidiv.style.zIndex="99999";
        neidiv.style.width="400px";
        //neidiv.style.height="130px";
        neidiv.style.border="1px solid #666666";
        neidiv.style.backgroundColor="#FFFFFF";
        neidiv.style.textAlign="left";

        if (str==null) str="";
        neidiv.innerHTML=str;
        neidiv.style.left=parseInt((parseInt(document.documentElement.clientWidth)+parseInt(document.documentElement.scrollLeft))/2-parseInt(neidiv.style.width)/2)+"px";
        neidiv.style.top=parseInt((parseInt(document.documentElement.clientHeight)+parseInt(document.documentElement.scrollTop))/2-parseInt(neidiv.offsetHeight)/2)+"px";
        if (isie)
        {
            neidiv.filters[0].Play();
        }
    }
    function hidegbframe()
    {
        if (Info("addfrienddiv")) document.body.removeChild(Info("addfrienddiv"));
        if (Info("screendiv")) document.body.removeChild(Info("screendiv"));
    }
    function boardsubmit()
    {
        $("#message").css("color","#000000"); 
        $("#message").text("正在加载中, 请稍等....");
        $.blockUI({ message: $('#pnlPopup') });  
        Info("author").value = Info("author").value.replace(/(　| |\r\n|\n)/ig,'');
        if (Info("author").value =="")
        {
            $("#message").css("color","red");
            $("#message").text("请键入您的姓名......");
            setTimeout(function(){$.unblockUI();},1000); 
            Info("author").focus();
            Info("author").select();
            return false;
        }
        if (Info("author").value.length>10)
        {
            $("#message").css("color","red");
            $("#message").text("键入的姓名长度不能超过10个字符(5个汉字)......");
            setTimeout(function(){$.unblockUI();},1000); 
            Info("author").focus();
            Info("author").select();return false;
         }
        Info("context").value=Info("context").value.replace(/(　| |\r\n|\n)/ig,'');
         if (Info("context").value =="")
         {
             $("#message").css("color","red");
             $("#message").text("请键入内容......");
             setTimeout(function(){$.unblockUI();},1000); 
             Info("context").focus();
             Info("context").select();
             return false;
         }
         if (Info("context").value.length>400)
         {
             $("#message").css("color","red");
             $("#message").text("键入的内容长度不能超过400个字符(200个汉字)......");
             setTimeout(function(){$.unblockUI();},1000); 
             Info("context").focus();
             Info("context").select();
             return false;
         }
         var xmlhttpobj=new xmlhttp;
         var xmlobj;xmlhttpobj.go("?act=check",true);
         var sendcontent="";
         sendcontent+="&author="+escape(Info("author").value);
         sendcontent+="&context="+escape(Info("context").value);
         xmlhttpobj.content=sendcontent;
         xmlhttpobj.send();
         xmlhttpobj.callback=function(xmlobj)
         {
             var retxt=unescape(xmlobj.responseText);
             xmlobj=null;
             xmlhttpobj=null;
             var retxt_xiang=retxt.split('|');
             if (retxt_xiang[0]=="ok")
             {
                $("#message").text("发表留言成功......");
                setTimeout(function(){$.unblockUI();window.location.reload();},1000); 
             }
             else
             {
                $("#message").css("color","red");
                $("#message").text("留言失败,请查看网络是否连通......");
                setTimeout(function(){$.unblockUI();},1000); 
             }
         }
     }
     
    function Enboardsubmit()
    {
        $("#message").css("color","#000000"); 
        $("#message").text("Loading, please wait....");
        $.blockUI({ message: $('#pnlPopup') });  
        Info("author").value = Info("author").value.replace(/(　| |\r\n|\n)/ig,'');
        if (Info("author").value =="")
        {
            $("#message").css("color","red");
            $("#message").text("Please enter your name......");
            setTimeout(function(){$.unblockUI();},1000); 
            Info("author").focus();
            Info("author").select();
            return false;
        }
        if (Info("author").value.length>10)
        {
            $("#message").css("color","red");
            $("#message").text("Length can not enter the names of more than 10 characters (5 characters)......");
            setTimeout(function(){$.unblockUI();},1000); 
            Info("author").focus();
            Info("author").select();return false;
         }
        Info("context").value=Info("context").value.replace(/(　| |\r\n|\n)/ig,'');
         if (Info("context").value =="")
         {
             $("#message").css("color","red");
             $("#message").text("Enter content......");
             setTimeout(function(){$.unblockUI();},1000); 
             Info("context").focus();
             Info("context").select();
             return false;
         }
         if (Info("context").value.length>400)
         {
             $("#message").css("color","red");
             $("#message").text("The content can not enter the length of more than 400 characters (200 characters)......");
             setTimeout(function(){$.unblockUI();},1000); 
             Info("context").focus();
             Info("context").select();
             return false;
         }
         var xmlhttpobj=new xmlhttp;
         var xmlobj;xmlhttpobj.go("?act=check",true);
         var sendcontent="";
         sendcontent+="&author="+escape(Info("author").value);
         sendcontent+="&context="+escape(Info("context").value);
         xmlhttpobj.content=sendcontent;
         xmlhttpobj.send();
         xmlhttpobj.callback=function(xmlobj)
         {
             var retxt=unescape(xmlobj.responseText);
             xmlobj=null;
             xmlhttpobj=null;
             var retxt_xiang=retxt.split('|');
             if (retxt_xiang[0]=="ok")
             {
                $("#message").text("Message delivered successfully......");
                setTimeout(function(){$.unblockUI();window.location.reload();},1000); 
             }
             else
             {
                $("#message").css("color","red");
                $("#message").text("Failure of the message, check whether the network connectivity......");
                setTimeout(function(){$.unblockUI();},1000); 
             }
         }
     }
     
     function ClickObj(obj)
    {
        if (isie) obj.click();
        else
        {
            var en=document.createEvent("MouseEvents");  
            en.initEvent("click",false,false);   
            obj.dispatchEvent(en);
        }
    }



