function SwitchVisibleState(element){
	var div = element;
	while(div!=null && div.tagName!="DIV")
		div = div.parentElement;
	if(div!=null){
		div = div.nextSibling;
		if(div!=null)
			if(div.style.display=="none")
				div.style.display = "";
			else
				div.style.display = "none";
	}
}
function owin(url){
//window.showModelessDialog(url,window,'dialogWidth=700px;dialogHeight=500px;status=0;scroll=yes');
var win =window.showModalDialog(url,window,'dialogWidth=700px;dialogHeight=600px;status=0;scroll=yes');
window.opener.location.reload();
}
function hwin(moid){
var win =window.open("/everyone/help.aspx?moid="+moid+"&type=p",'popupnav', 'scrollbars=yes,resizable=yes,status=no,width=800,height=600');
//var win =window.showModalDialog("/everyone/help.aspx?moid="+moid+"&type=p",window,'dialogWidth=700px;dialogHeight=600px;status=0;scroll=yes');
}
function $(obj) {return document.getElementById(obj);}

function totime(d){
	var now = new Date(d);
	var hours  =  now.getHours();
	var minutes  =  now.getMinutes();
	var seconds  =  now.getSeconds();
	var timeValue  = now.getYear()+"/"+(now.getMonth()+1)+"/"+now.getDate();
	timeValue  +=  (hours  >=  12)  ?  " PM"  :  " AM " ;
	timeValue  +=  ((hours  >  12)  ?  hours  -  12  :  hours);
	timeValue  +=  ((minutes  <  10)  ?  ":0"  :  ":")  +  minutes;
	timeValue  +=  ((seconds  <  10)  ?  ":0"  :  ":")  +  seconds;
	return timeValue  ;
}
function Trim(info){//剔除两边的空格
	return info.replace(/(^\s*)|(\s*$)/g, "");
}
function   lockMsg(obj,t){
	if (typeof(document.getElementById("Layer1")) !="object" ||document.getElementById("Layer1")==null){
	var lst='<div id="Layer1" style="position:absolute;top:0px;filter:alpha(opacity=60);background-color:#777;z-index:2;left:0px; display: none;"></div>';
	lst+='<div id="Layer2" align="center" style="position: absolute; z-index: 3; left:expression((document.body.offsetWidth-440)/2); top: expression((document.body.offsetHeight-170)/2);background-color: #fff; display: none;" >'
	+ '<table width="340" border="0" cellpadding="0" cellspacing="0" style="border: 0   solid   #e7e3e7;border-collapse: collapse"><tr><td style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px;font-weight: bold; font-size: 14px;" height="27" valign="middle">[&nbsp;提示&nbsp;]</td></tr><tr><td height="60" align="center">'+obj+'</td></tr><tr><td height="20" align="center"><input id="closemsg" type="button" value=" 确定 " onClick="clocjmsg();"></td></tr></table></div>';
	document.body.insertAdjacentHTML("beforeEnd",lst);
//	 $("closemsg").onclick =();
	}
	document.getElementById("Layer1").style.display="block";   
	document.getElementById("Layer1").style.width=document.body.clientWidth;   
	document.getElementById("Layer1").style.height=document.body.clientHeight;   
	document.getElementById("Layer2").style.display='block';
	if (t!=null&& t>0) setTimeout("document.getElementById('Layer1').style.display='none';document.getElementById('Layer2').style.display='none';",t);
}   
function clocjmsg(){
	document.getElementById("Layer1").style.display='none';
	document.getElementById("Layer2").style.display='none';
}
function marquee(dem,dem2,dem1){
	var MyMar;	
	function setval(){
		function quee(){
		if(dem2.offsetWidth-dem.scrollLeft<=0)
			dem.scrollLeft-=dem1.offsetWidth;
		else{
			tempL=dem.scrollLeft;
			dem.scrollLeft++;
			if(tempL==dem.scrollLeft) 
			dem.scrollLeft-=dem1.offsetWidth;
			}
		}
		MyMar=setInterval(quee,30)
	};
	this.ini=function(){
		dem2.innerHTML=dem1.innerHTML;
		dem.onmouseover=function(){	clearInterval(MyMar);};
		dem.onmouseout=function (){setval()};
	};	
	setval();
}
