var HEADER = {
	W:null,
	openHandle:function(url,name,width,height,autop,xargs,modal){
		var w = window.open(url,name,'width='+width+',height='+height+',scrollbars=yes',true);
		HEADER.W = w;
		w.focus();
		return;
	},
	openHandle_old:function(url,name,width,height,autop,xargs,modal){
		var a = "";
		if (height)	a += "height=" + height + ",";
		if (width)	a += "width=" + width + ",";
		if (xargs)	a += xargs + ",";
		if (modal)	a += "dependent,";
		var l=0;
		var t=0;
		// If screenLeft property is not available, center to middle of entire screen
		try{
			if ( window.screenLeft )
			{
				/*
				l = Math.floor( window.screenLeft + (document.body.offsetWidth / 2) - (width/2) );
				t = Math.floor( window.screenTop + (document.body.offsetHeight / 2) - 20 - (height/2) );
				*/
				l = Math.floor( window.screenLeft + (document.body.offsetWidth / 2) - (width/2) );
				t = Math.floor( window.screenTop + (document.body.offsetHeight / 2) - 20 - (height/2) );
			} else {
				l = Math.floor( (window.screen.width - width) / 2);
				t = Math.floor( (window.screen.height - height - 40) / 2);
			}
		}catch(err){}
		// auto position for IE
		if ( autop )
			a+= "left="+l+",top="+t+",";	
		//alert(a);
		a = a + ",resizable=yes"
		var win;
		if(url){
			HEADER.W = window.open(url,name,a);
			HEADER.W.focus();
		}
	}
}

function checkEmail (s) 
{
	if (s.length > 100)
	{
		window.alert("email地址长度不能超过100位!");
		return false;
	}
	
	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 (s.search(re) != -1) {
		return true;
	} else {
		window.alert ("请输入有效合法的E-mail地址 ！")
		return false;
	}
}
function setCurrTime(obj){
	if(obj!=null){
		try{
			obj.innerHTML = formatDate();
		}catch(e){}
	}
}
var timeObj = null;
function refreshTime(obj){
	if(obj!=null)
		timeObj = obj;
	if(timeObj!=null){
		timeObj = obj;
		setTimeout('refreshTime()',1000);	
		setCurrTime(timeObj);
	}
}
function formatDate(){
   var d, s = "<b>当前时间:</b>";           // 声明变量。
   d = new Date();                           // 创建 Date 对象。
   s += d.getYear()+ "年";                          // 获取年份。
   s += (d.getMonth() + 1) + "月";            // 获取月份。
   s += d.getDate()+"日 ";                   // 获取日。
   s += d. getHours()+":";  
   s += d. getMinutes()+":";  
   s += d. getSeconds()+"";  
   return(s);                                // 返回日期。
}
