	//打开新窗口
	//url:打开窗口的Url,如果需要跟随参数，可以把参数一起写到url中．如:url="Delete.aspx?id={0}"
	//w：打开窗口的宽度,如果为空width=640;
	//h：打开窗口的高度,如果为空height=480
	function openNewWin(url,w,h){ 
		var width=w;
		var height=h;
		if (width=="")
			width=640;
		if(height=="")
			height=480;
			
		var left=(screen.width - width)/2;
		var top=(screen.height - height)/2;
		var objWin;
		
		objWin=window.open(url,"openNewWin","width="+width+",height="+height+",top="+top+",left="+left+",menubar=no,location=no,status=no,dierctories=no,scrollbars=yes,fullscreen=0,resizable=yes");
		objWin.focus();
	}
	
	
	//打开新窗口以添加信息
	//url:打开窗口的Url,如果需要跟随参数，可以把参数一起写到url中．如:url="Delete.aspx?id={0}"
	//w：打开窗口的宽度,如果为空width=640;
	//h：打开窗口的高度,如果为空height=480
	function openAddWin(url,w,h){ 
		var width=w;
		var height=h;
		if (width=="")
			width=640;
		if(height=="")
			height=480;
			
		var left=(screen.width - width)/2;
		var top=(screen.height - height)/2;
		var objWin;
		
		objWin=window.open(url,"AddWin","width="+width+",height="+height+",top="+top+",left="+left+",menubar=no,location=no,status=no,dierctories=no,scrollbars=yes,fullscreen=0,resizable=yes");
		objWin.focus();
	}
	//打开新窗口,一般用于显示新闻信息等内容时使用
	//url:打开窗口的Url,如果需要跟随参数，可以把参数一起写到url中．如:url="Delete.aspx?id={0}"
	//w：打开窗口的宽度,如果为空width=640;
	//h：打开窗口的高度,如果为空height=480
	function openViewWin(url,w,h){ 
		var width=w;
		var height=h;
		if (width=="")
			width=640;
		if(height=="")
			height=480;
		
		var objWin;
		
		objWin=window.open(url,"ViewWin","width="+width+",height="+height+",left=20,top=30,menubar=no,location=no,status=no,dierctories=no,scrollbars=yes,fullscreen=0,resizable=yes");
		objWin.focus();
	}
	
	function openMovieWin(w,h){ 
		var width=w;
		var height=h;
		if (width=="")
			width=640;
		if(height=="")
			height=480;
		
		var objWin;
		
		objWin=window.open("MediaContainer.aspx","MovieWin","width="+width+",height="+height+",left=0,top=0,menubar=0,location=0,status=0,dierctories=0,scrollbars=0,fullscreen=0,resizable=0");
		objWin.focus();
	}
	//删除记录，在删除之前询问是否真的要采取删除操作．
	//提示次数根据参数Important的值而定，最多两遍
	//参数:url:转向地址,如果需要跟随参数，可以把参数一起写到url中．如:url="Delete.aspx?id={0}"
	//参数：important：bool表达式：True,提示两遍;False:提示一遍
	//
	function deleteRec(url,important){
		if(important==true){ 
			if(confirm("确定要删除该记录吗？")){
				if(confirm("即将删除记录，确定吗？")){
					document.location.href=url;
				}
			}
		}
		else
		{
			if(confirm("确定要删除该记录吗？")){
				document.location.href=url;
			}
		}
		
	}
	
	
	//打开模态对话框进行记录查询！
	
	function doCX(url,w,h){
	
	}
	function isemail (s)
	{
        if (s.length > 100)
        {
                window.alert("email地址长度不能超过100位!");
                return false;
        }
		s = s.toLowerCase()
		 var regu = "^(([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|name|NAME)$";
		 var re = new RegExp(regu);
         if (s.search(re) != -1) {
               return true;
         } else {
               window.alert ("请输入有效合法的E-mail地址 ！");
               return false;
         }
	}
	
	function Jtrim(str)
	{

        var i = 0;
        var len = str.length;
        if ( str == "" ) return( str );
        j = len -1;
        flagbegin = true;
        flagend = true;
        while (( flagbegin == true) && (i< len))
        {
           if ( str.charAt(i) == " " )
                {
                  i=i+1;
                  flagbegin=true;
                }
                else
                {
                   flagbegin=false;
                }
        }

        while  ((flagend== true) && (j>=0))
        {
            if (str.charAt(j)==" ")
                {
                        j=j-1;
                        flagend=true;
                }
                else
                {
                        flagend=false;
                }
        }

        if ( i > j ) return ("");

        trimstr = str.substring(i,j+1);
        return trimstr;
	}
	
	
	function isValidDate( year, month, day )
	{
		year  = parseInt(year,10);
		month = parseInt(month,10);
		day   = parseInt(day,10);

		if (( month==4) || (month==6) || (month==9) || (month==11) )
		{ if (( day < 1) || (day > 30) )
			{ alert( "日期在1 - 30之间" );
			return (false);
			}
		}
		else
		{ if ( month!=2 )
			{ if ( (day < 1) || (day > 31 ))
			{  alert( "日期在1 - 31之间" );
				return (false);
			}
			}
			else
			{ // month == 2
			if ( ( year % 100 ) != 0 && (year % 4 == 0) || ( year % 100 ) == 0 && ( year % 400) == 0 )
			{ if ( day > 29 )
				{  alert( "日期在1 - 29之间" );
					return (false);
				}
			}
			else
			{ if ( day > 28 )
				{ alert( "日期在1 - 28之间" );
				return (false);
				}
			}
			}
		}
		return (true);
	}
	
	function printPage(){
		print(document);
	}
	function ShowContent(totalCount,curID){
    for(var i=0;i<totalCount;i++){
      if(i==curID){
        document.getElementById("tbody" + curID).style.display='block';
      }
      else
      	document.getElementById("tbody" + i).style.display="none";
    } 
}
