//onMouseOver
function onBorderColor(td)
{
	td.style.border='';
	td.style.backgroundColor='#EEEADE';
	td.style.color='#3D4F7A';
}

//onMouseOut
function offBorderColor(td)
{
	td.style.border='';
	td.style.backgroundColor='';
	td.style.color='';
}

function trim(obj){
return obj.replace(/(^\s*)|(\s*$)/g, "");
}

function ConfirmDel(form){
    for (var i=0;i<form.elements.length;i++){
        if(form.elements(i).type=='checkbox' && form.elements(i).checked)
		{if (confirm("你确定要删除吗? 否刚请取消!"))
		{return true;}
		return false;}}
        window.alert('你没有选择要删除的对象!');
        return false;
}

function isNumber(str)
{ 
	var trueChar="0123456789"; 
	//if(""==str){ return 0; } 
	if(str!=""){
		for(var i=0;i<=str.length;i++){ 
			var c=str.charAt(i); 
			if(i==0){ 
				if(c!="-"&&(trueChar.indexOf(c)==-1)){ return 0; }
				else if(c=="-"&&str.length==1)	{ return 0; } 
			}else {
				if(trueChar.indexOf(c)==-1)	{ return 0; } 
			}
		} 
	}
	return 1; 
} 

function CheckIsNumber(theform) 
{
 	if ((isNumber(theform.value)==0) )
	{	
	   //theform.value="";
		alert("请填写正确的数字");
	   theform.value="0";
	   theform.select();
		return false;
	}
} 

function isNumber1(str)
{ 
	var trueChar="0123456789"; 
	if(str!=""){
		for(var i=0;i<=str.length;i++){
			var c=str.charAt(i);
			if(trueChar.indexOf(c)==-1) return false; 
		} 
		return true; 
	} 
} 

function isNumber2(str)
{ 
	var trueChar="0123456789"; 
	if(""==str){ return 0; } 
	for(var i=0;i<=str.length;i++){
		var c=str.charAt(i);
		if(trueChar.indexOf(c)==-1) return false; 
	} 
	return true; 
} 

function isUserid(str)
{ 
	var trueChar="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"; 
	if(""==str)
	{
		return false;
	} 
	for(var i=0;i<=str.length;i++)
	{
		var c=str.charAt(i);
		if(trueChar.indexOf(c)==-1) return false; 
	} 
	return true; 
} 

function isValidEmailAddress(strEmail)
{
	var i, strDomain, cChar;
	var nDotCount=0;
	var bFindAlpha=false;
	var bLastIsDot=false;
	var strValid="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.";

	if(strEmail=="") return false;
	i=strEmail.indexOf("@");
	if(i==-1 || i==0 || i==strEmail.length-1) return false;
	strDomain = strEmail.substring(i+1,strEmail.length);

	if(strDomain.indexOf("@")!=-1) return false;
	if(strDomain.charAt(0)==".") return false;
	if(strDomain.charAt(strDomain.length-1)==".") return false;

	for(i=0;i<strDomain.length;i++) {
		cChar = strDomain.charAt(i);
		if(strValid.indexOf(cChar)==-1) return false;
		if(cChar==".") {
			if(bLastIsDot) return false;
			bLastIsDot=true;
			nDotCount++;
		}else bLastIsDot=false;
		if( (("a"<=cChar) && (cChar<="z")) || (("A"<=cChar)&&(cChar<="Z")) )
		bFindAlpha=true;
	}

	if(bFindAlpha && (0==nDotCount)) return false;
	return true;
}

function openwindow(page,h,w,t,l,n)
{
	window.open (page, n, 'height='+h+', width='+w+', top='+t+', left='+l+', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') 
}
