<!--Begin hiding JavaScript
function chknum(s)
{
	var num;
	s=trim(s);
	if (s=="0")
		return true;
	if (s=="")
		return false;
	s=s.replace(/^0*/,"");
	num=parseInt(s);
	if (s!=''+num) 
		return false;
	else 
		return true;
}
function trim(s)
{	
	s=s.replace(/^ */,"");
	return s.replace(/ *$/,"");
}
function checkDate(sDate)
{
	if(sDate.length!=8) return false;
	if (!chknum(sDate)) return false;
    var aYear,aMonth,aDay
	aYear=parseInt(sDate.substring(0,4));
	if (aYear<1900 ||aYear>2222) return false;
	aMonth=parseInt(sDate.substring(4,6),10);
	if (aMonth<1 ||aMonth>12) return false;
	aDay=parseInt(sDate.substring(6,8),10);
	if ((aDay<1) || (aDay >31) )
		return false;
	else
	{
		
		switch (aMonth)
		{
		case 4,6,9,11 :
			if (aDay==31)
				return false;
		case 2 :
			{
				if (aDay>29)
					return false;
				if (!((aYear%4==0 && aYear%100!=0) || (aYear%400==0)) && (aDay==29))
					return false;
				else
					return true;
			}
		default :
			return true;
		}
		return true;
	}
}
function checkZipcode(sZip)
{
    if(sZip.length!=6) return false;
	if (!chknum(sZip)) return false;
	return true;
}
function isEmpty(s)
{  
	if(s==null) return true;
	else if(trim(s)=="") return true;
	else return false;
}
function trimValue(o)
{
	o.value=trim(o.value);
}
function autoClearForm(oForm)
{
	var control,o;
    with (oForm) 
	{
        for (o in elements.tags('INPUT')) 
		{
            control = elements[o];
			if (control.type=="text")
				control.value="";
        }
		for (o in elements.tags('TEXTAREA')) 
		{
            control = elements[o];
				control.value="";
        }
    }
}
function autoCheckForm(oForm)
{
	var control,o;
    with (oForm) {
        for (o in elements.tags('INPUT')) {
            control = elements[o];
			if(!trimAndCheck(control)) return false;
        }
    }
	with (oForm) {
        for (o in elements.tags('TEXTAREA')) {
            control = elements[o];
			if(!trimAndCheck(control)) return false;
        }
    }
    return true;
}
function trimAndCheck(source)
{
	if(source.needTrim) trimValue(source);
	return check(source);
}
function count(src,obj){
	var i=0;
	var l=src.length;
	var c=0;
	for(i=0;i<l;i++){
		if((i=src.indexOf(obj,i))==-1) break;
		else c++;
	}
	return c;
}
function isEmail(s)
{
	var i=0;
	var end=s.length-1;
	var n=count(s,"@");
	if(count(s,"@")!=1	|| (i=s.indexOf("@"))==0 
			|| i==end  		|| count(s,".")==0
			|| s.charAt(i+1)=='.' || s.lastIndexOf(".")==end)
			return false;
	return true;
}
function setFocus(obj)
{
	if(obj.type && obj.type!="hidden")
		obj.focus();
}
function check(source){
	if(source.needValue){
		if(isEmpty(source.value)){
			alert("请输入"+source.showName+"!");
			setFocus(source);
			return false;
		}
	} 
	if(isEmpty(source.value)) return true;
	if(source.name.substring(0,3)=="col")
	{
		
		if(source.value.length>500)
		{
			alert(source.showName+"不能超过500个字符!");
			setFocus(source);
			return false;
		}
	}

	if(!source.checkType)
		return true;
	else if("isEmail"==source.checkType){
		if(!isEmail(source.value)){
			alert("请输入正确的email!");
			setFocus(source);
			return false;
		}
	} else if("isNum"==source.checkType){
		if(!chknum(source.value))
		{
			alert(source.showName+"必须是数字,请输入正确的值!");
			setFocus(source);
			return false;
		}
	} else if("isDate"==source.checkType){
		if(!checkDate(source.value))
		{
			alert("请输入正确的日期!");
			setFocus(source);
			return false;
		}
	} else if("isZipcode"==source.checkType){
		if(!checkZipcode(source.value))
		{
			alert("请输入正确的邮政编码!");
			setFocus(source);
			return false;
		}
	}



	return true;
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function preLoadImgIndex() {
  MM_preloadImages('images/rollimage/1.gif','images/rollimage/2.gif','images/rollimage/3.gif',
       'images/rollimage/4.gif','images/rollimage/5.gif','images/rollimage/6.gif','images/rollimage/7.gif',
       'images/rollimage/8.gif','images/rollimage/9.gif');
  MM_preloadImages('images/01zsdw1.gif','images/02jgsz1.gif','images/03tyxw1.gif',
       'images/04cgtz1.gif','images/05cgdx1.gif','images/06xzsp1.gif','images/07zcfg1.gif',
       'images/08tyjs1.gif','images/09tylt1.gif','images/10ywwl1.gif','images/11tyjy1.gif',
       'images/12zwdt1.gif','images/13tycy1.gif','images/14tyz1.gif','images/15yqlj1.gif');
}

function cgdxopen(name)
{
        win = window.open(name,'_blank' ,'left=0,top=0,width='+(window.screen.width-10)+',height='+(window.screen.height-30)+',resizable=no,channelmode=no,directories=no,location=no,menubar =no,status =no,titlebar=no,toolbar =no ');
        win.focus();
}


//End hiding JavaScript-->