// JScript 文件
String.prototype.Trim = function() 
{ 
    return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 

function IsMail(mail) 
{ 
	var patrn = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 
	if (!patrn.test(mail)) 
		return false; 
	else 
		return true; 
} 

function showmsg(msg,controlid)
{
    alert(msg);
    controlid.focus();
    return false;
}

var currentcolor;

function oMouse(t)
{
    currentcolor=t.style.backgroundColor;
    t.style.backgroundColor="#FFFF80";
}

function oOut(t)
{
    t.style.backgroundColor=currentcolor;
}

function delid(url)
{
    if(confirm("确定要删除吗？"))
        location.href=url;
}

//js Cookie
function setCookie(name,value)
{
    var Days = 1;
    var exp  = new Date();
        exp.setTime(exp.getTime() + Days*24*60*60*1000);
        document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

function getCookie(name)
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
        if(arr=document.cookie.match(reg)) return unescape(arr[2]);
        else return null;
}

function delCookie(name)
{
    var exp = new Date();
        exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
        if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}

//js 提示
document.write("<div id='divMask' style='BACKGROUND-COLOR: white; FILTER: alpha(opacity=75); LEFT: 0px; POSITION:absolute; TOP: 0px;'></div>");
document.write("<div id='divMsg' style='background-color:#F7F7DE;height:35px;line-height:35px; width:200px; vertical-align:middle; border:solid 1px #eee;font-size:12px;POSITION: absolute;left:0px;top:0px;DISPLAY: none;z-index:49;'>");
document.write("<marquee behavior=alternate><span id='spanMsg'></span></marquee></div>");

function divMsg(title)
{
    var divMsg=document.getElementById("divMsg");
    spanMsg.innerHTML=title;
    divMsg.style.display="block";
    divMsgResizeModal();
    window.onresize = divMsgResizeModal;
}

function divMsgResizeModal()
{
    var divMsg=document.getElementById("divMsg");
    divMask.style.width = document.body.scrollWidth;
    divMask.style.height = document.body.scrollHeight;
    divMsg.style.left = ((document.documentElement.clientWidth - divMsg.offsetWidth) / 2);
    divMsg.style.top = (document.documentElement.scrollTop+(document.documentElement.clientHeight - divMsg.offsetHeight) / 2);
}
//==============================================================================================================================

//swf调用，带参数
var epzk = {
	
    playswf : function (sFile,sWidth,sHeight,sValue){
		   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" id="links" name="links" width="'+ sWidth +'" height="'+ sHeight +'">  ');
		   document.write(' <param name="movie" value="'+ sFile +'">  ');
		   document.write(' <param name="FlashVars" value="parastr='+ sValue +'" /> ');
		   document.write(' <param name="quality" value="high">  ');
		   document.write(' <param name="wmode" value="Transparent">  ');
		   document.write(' <embed src="'+ sFile +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ sWidth +'" height="'+ sHeight +'" wmode="Transparent"></embed>  ');
		   document.write('</object> ');
	  }
}

//调整内容图片大小
function ResetContentImg(sWidth)
{
	var img_obj=document.getElementsByTagName("IMG");
	for(i=0;i<img_obj.length;i++)
	{
		if(img_obj[i].width>sWidth)
		{
			var temp=img_obj[i].width/sWidth;
			var height=img_obj[i].height/temp
			img_obj[i].width=sWidth;
			img_obj[i].height=height;
		}
	}
}