function open_win(awindowname) {
	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
		window.open(awindowname,'quickhighNetMeeting','fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0');
	}
}	
function trim(str) {
    if ((str == null)||(str == "")) return "";
    if((str.charAt(0) != ' ')&&(str.charAt(str.length-1) != ' ')){
        return str;
    }
    while(str.charAt(0)  == ' '){
        str = '' + str.substring(1,str.length);
    }
    while(str.charAt(str.length-1)  == ' '){
        str = '' + str.substring(0,str.length-1);
    }
    return str;
}

function isNumeric(str){
    if ((str == null)||(str == "")){
        return false;
    }
    var len = str.length;
    for(var i = 0; i < len; i++){
        if (str.charAt(i)>"9" || str.charAt(i)<"0")
            return false;
    }
    return true;
}


/*function show(me,top,divName,divNum) {
	var div=document.all(divName);
	var divall=divName.substring(0,divName.length-1)
	var i;
	i=divNum;
	while (i>=1){
		document.all(divall + i).style.display="none";
		i=i-1;
	}
	div.style.posTop=top;
	div.style.display = "";
}
*/
//
function getLength(str)
{
	count = 0;
	for(var i = 0; i < str.length; i++) {
		if(escape(str.charAt(i)).length > 4) count++;
		count++;
	}
	return count;
}

/*20030611 add
yyyy||yyyy/mm||yyyy/mm/dd||mm||mm/dd||dd
@param  strDate
@return  true
*/
function DcheckDate(strDate, strFormat){
	var strYear;
	var strMonth;
	var strDay;
	strYear = 0;
	strMonth = 0;
	strDay = 0;
	
	strFormat = strFormat.toLowerCase();
	switch(strFormat){
		case "yyyy":
			if(strDate.length != 4) return false;
			if(!isNumeric(strDate)) return false;
			break;
		case "yyyy/mm":
			if(strDate.length != 7 || strDate.charAt(4) != "/") return false;
			strYear = parseInt(strDate.substring(0,4),10);
			strMonth =  parseInt(strDate.substring(5,7),10);
			if(!isNumeric(strYear.toString()) || !isNumeric(strMonth.toString())) return false;
			if(strMonth<=0 || strMonth>12) return false;
			break;
		case "yyyy/mm/dd":
			if(strDate.length != 10 || strDate.charAt(4) != "/" || strDate.charAt(7) != "/") return false;
			strYear =  parseInt(strDate.substring(0,4),10);
			strMonth =  parseInt(strDate.substring(5,7),10);
			strDay =  parseInt(strDate.substring(8,10),10);
			if(!isNumeric(strYear.toString()) || !isNumeric(strMonth.toString()) || !isNumeric(strDay.toString())) return false;
			if(strMonth<=0 || strMonth>12) return false;
			if(strMonth == 2){
			if(strDay <= 0) return false;
			if(strYear == 0 && strDay > 29) return false;
			if((strYear % 4 == 0 && strYear % 100 != 0) || (strYear % 400 == 0)){
				if(strDay > 29) return false;
				}
				else{
				if(strDay > 28) return false;
				}
			}
			else if(strMonth == 1 || strMonth == 3 || strMonth == 5 || strMonth == 7 || strMonth == 8 || strMonth == 10 || strMonth == 12)
			{
				if(strDay <= 0 || strDay > 31) return false;
			}
			else{
				if(strDay <= 0 || strDay > 30) return false;
			}
			break;
		case "mm":
			if(strDate.length != 2) return false;
			strMonth =  parseInt(strDate,10);
			if( !isNumeric(strMonth.toString())) return false;
			if(strMonth<=0 || strMonth>12) return false;
			break;
		case "mm/dd":
			if(strDate.length != 5 || strDate.charAt(2) != "/") return false;
			strMonth =  parseInt(strDate.substring(0,2),10);
			strDay =  parseInt(strDate.substring(3,5),10);
			if(!isNumeric(strYear.toString()) || !isNumeric(strMonth.toString()) || !isNumeric(strDay.toString())) return false;
			if(strMonth<=0 || strMonth>12) return false;
			if(strMonth == 2){
				if(strDay <= 0) return false;
				if(strDay > 29) return false;
			}else if(strMonth == 1 || strMonth == 3 || strMonth == 5 || strMonth == 7 || strMonth == 8 || strMonth == 10 || strMonth == 12){
				if(strDay <= 0 || strDay > 31) return false;
			}else{
				if(strDay <= 0 || strDay > 30) return false;
			}
			break;
		case "dd":
			if(strDate.length != 2) return false;
			strDay =  parseInt(strDate,10);
			if( !isNumeric(strDay.toString())) return false;
			if(strDay<=0 || strDay>31) return false;
			break;
		default:
			return false;
	}
	return true;
}
	
	
/*
*/
function DCompDate(strDate1,strFormat1,strDate2,strFormat2){
	//
	if(strDate1=="" || strDate1==null) return false;
	if(strDate2=="" || strDate2==null) return false;
	
	strFormat1 = strFormat1.toLowerCase();
	strFormat2 = strFormat2.toLowerCase();	
	//
	if(strFormat1!=strFormat2) return false;
	switch (strFormat1){
		case "yyyy":
			break;
		case "yyyy/mm":
			strDate1=strDate1.substring(0,4)+strDate1.substring(5,7); 
			strDate2=strDate2.substring(0,4)+strDate2.substring(5,7);
			break;
		case "yyyy/mm/dd":
			strDate1=strDate1.substring(0,4)+strDate1.substring(5,7) +strDate1.substring(8,10);
			strDate2=strDate2.substring(0,4)+strDate2.substring(5,7) +strDate2.substring(8,10);
			break;
		case "mm":
			break;
		case "mm/dd":
			strDate1=strDate1.substring(0,2)+strDate1.substring(3,5); 
			strDate2=strDate2.substring(0,2)+strDate2.substring(3,5); 
			break;
		case "dd":
			break;
		default:
			return false;
	}
	intDate1=parseInt(strDate1,10);
	intDate2=parseInt(strDate2,10);
	if(intDate1>intDate2) return false;
	return true;
}

	 function TrimMoney(strMoney){
		if (strMoney.substring(0,1)=="\\"){
			strMoney=strMoney.replace("\\","")
		}
		return strMoney
	 }
function isletter(c)
{
	if (((c>='a') && (c<='z')) || ((c>='A') && (c<='Z')))
		return true;
	else
		return false;
}

function isnumber(c)
{
	if ((c>='0') && (c<='9'))
		return true;
	else
		return false;
}
function checkloginname(s){
	for (i=0; i<s.length; i++)
	{
		n = s.substr(i, 1)
		if (!(isletter(n) || isnumber(n) || (n=='_')))
		{
			return false;
		}
	}
	return true;
}
function checknickname(s){
	var invalidchar=new Array(" ","\'","\"","\t","&","<",">","+","(",")","\\","%","\255");
	var t="";
	for (i=0; i<s.length; i++)
	{
		n = s.substr(i, 1);
		for(j=0;j<invalidchar.length;j++)
		{
			if (n==invalidchar[j])
			{
			 t+=n;
			}
			
		}
				
	}
	if(t!="") {return false;}
	else return true;
}
function checkemail(email)
{
	var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/; 
    flag = pattern.test(email); 

	if(flag) 
	{ 
	return true; 
	} 
	else 
	{ 
	return false; 
	}     
}	 

	function sel_WriteValue(P_selName,P_selValue){
		//让下拉列表框里显示从数据库中读出的值
		if(P_selName!=""){
			document.getElementById(P_selName).value=P_selValue
		}
		
	}
	function conChkEmpty(PObjName,Palert){
		if(trim(document.getElementById(PObjName).value)==""){
			alert(Palert)
			document.getElementById(PObjName).focus()
			return false;
		}else{
			return true;
		}
	}
/*
　　var currentpos,timer;
　　function initialize()
　　{
　	　timer=setInterval("scrollwindow()",10);
　　}
　　function sc(){
　　	 clearInterval(timer);
　　}
　　function scrollwindow()
　　{
	　　currentpos=document.body.scrollTop;
	　　window.scroll(0,++currentpos);
	　　if (currentpos != document.body.scrollTop)
	　　sc();
　　}
　　document.onmousedown=sc
　　document.ondblclick=initialize
*/
/*改变状态栏
function scrollit_r2l(seed)
{ var m1  = "" ;
 var m2  = "" ;
       var msg=m1+m2;
       var out = " "; 
       var c = 1; 
 var speed  = 120;
if (seed > 100)
{                seed-=2;
                var cmd="scrollit_r2l(" + seed + ")";   
             timerTwo=window.setTimeout(cmd,speed);}     
    else if (seed <= 100 && seed > 0)
     {                for (c=0 ; c < seed ; c++)
                      {       out+=" ";}   
       out+=msg;         seed-=2;      
   var cmd="scrollit_r2l(" + seed + ")";      
   window.status=out;         
 timerTwo=window.setTimeout(cmd,speed); }        
      else if (seed <= 0) 
{                if (-seed < msg.length) 
                  { 
                       out+=msg.substring(-seed,msg.length);        
                       seed-=2;                        
                       var cmd="scrollit_r2l(" + seed + ")";         
                       window.status=out;                     
       timerTwo=window.setTimeout(cmd,speed);}
       else {               window.status=" ";       
                 timerTwo=window.setTimeout("scrollit_r2l(100)",speed);
}
}
}
scrollit_r2l(10);
/*改变状态栏*/
