// JavaScript Document
function confirmDel(msg,url) {
	if(confirm(msg))
	{
		window.location.href = url;
	}
}
function ltrim(s){
	return s.replace( /^\\s*/, "");
}
function rtrim(s){
	return s.replace( /\\s*$/, "");
}
function trim(s){
	return rtrim(ltrim(s));
}

function DoAction(smsid)
{
	if(smsid=="-1")
	{
		window.location.href = '/search.php';
	}
}
function gotoindex()
{
	window.location.href = "/";
}

function check()
{
	var tags = document.getElementById("tags").value;
	if(tags == '' )
	{
		window.alert("请输要搜索内容");
		document.wjl.tags.focus();
		return false;
	}
	return true;
}

function action()
{
	var name = document.getElementById("name").value;
	var pwd = document.getElementById("pwd").value;
	if(name == '')
	{
		window.alert("请输要用户名");
		document.form2.name.focus();
		return false;
	}
	if(pwd == '')
	{
		window.alert("请输入密码");
		document.form2.name.focus();
		return false;
	}
	return true;
}

function fastcheck()
{
	var pIndex = document.getElementById("pIndex").value;
	var provider = document.getElementById("provider").value;
	var pName = document.getElementById("pName").value;
	if(pIndex == '' && provider == 0 && pName == '')
	{
		window.alert("请输入查询条件");
		return false;
	}		
	return true;
}

// JavaScript Document
var initializationTime=(new Date()).getTime(); 
function showTime()
{
	var now=new Date();
	var year=now.getYear();
	var month=now.getMonth();
	var day=now.getDate();
	var hours=now.getHours();
	var minutes=now.getMinutes();
	var seconds=now.getSeconds();
	 
	var weekStr = new Array(7)
	weekStr[0] = "<font color=black>星期一</font>"
	weekStr[1] = "<font color=black>星期二</font>"
	weekStr[2] = "<font color=black>星期三</font>"
	weekStr[3] = "<font color=black>星期四</font>"
	weekStr[4] = "<font color=black>星期五</font>"
	weekStr[5] = "<font color=red>星期六</font>"
	weekStr[6] = "<font color=red>星期日</font>"
	
	var shortStr = 'AM'
	if(hours>=12){
		shortStr = 'PM'
	}
	
	//document.getElementById("time_box").innerHTML=year+"年"+month+"月"+day+"日 "+weekStr[now.getDay()-1]+" "+hours+":"+minutes+":"+seconds+" "+shortStr;
	document.getElementById("time_box").innerHTML= now.toLocaleString()+" "+shortStr;
	  
	 //一秒刷新一次显示时间 
	var timeID=setTimeout(showTime,1000);
	 //2009年3月29日 星期日 11:43pm 
}

function cl_notice(tag)
{
	var txt;
	switch (tag) {
	   case 'pName' :
		   txt = '--请输入英文名称--';
		   break;
	   case 'pIndex' :
		  txt = '--可输入一部分--';
		  break;
	   default :
		  txt = '';
		  break;
	}	
	var val=document.getElementById(tag).value;
	if(escape(val)==escape(txt)){
		document.getElementById(tag).value = '';		
	}	
}
function HiddenShow(orderNum)
{
	var i;
	var isshow = document.getElementById('tab_' + orderNum ).style.display;
	if(isshow == 'none')
	{
		document.getElementById('tab_' + orderNum ).style.display = 'block';
	}else{
		document.getElementById('tab_' + orderNum ).style.display = 'none';
	}

}

document.onkeydown = function()
 {
          if(event.keyCode==116) {
          event.keyCode=0;
          event.returnValue = false;
          }
}

document.oncontextmenu = function() {event.returnValue = false;}

