function chk(maxpage)<!--如果不是数字，或是大于最大值时。的方法-->
{
 if (parseInt(document.myform.pagenum.value)>maxpage||isNaN(document.myform.pagenum.value))
 {
  document.myform.pagenum.value=1;
  return false;
  }
 else return true; 
}

function show(object)
{
	var menu=document.getElementById(object);
	if (menu.style.display=="none")
	 {
		 menu.style.display="block";
	 }
}

function hidden(object)
{
	var menu=document.getElementById(object);
	if (menu.style.display=="block")
	 {
		 menu.style.display="none";
	 }
}

function clickImg(object,id)
{
	var imgObj="img_"+object;
	var imgSrc=document.getElementById(imgObj).src;
	if (imgSrc.indexOf('plus.gif')!=-1)
	 {
		 if (id==0)
		 {
			 document.getElementById(imgObj).src="chat/images/nofollow.gif";
		 }
		 else
		 {
			 document.getElementById(imgObj).src="images/nofollow.gif";
		 }
		 flag="show";
	 }
	else if (imgSrc.indexOf('nofollow.gif')!=-1) 
	{    
	    if (id==0)
		{
		 document.getElementById(imgObj).src="chat/images/plus.gif";
		}
		else
		{
		 document.getElementById(imgObj).src="images/plus.gif";
		}
		 flag="hidden";
	}
	if (flag=="show")
	 {
		 show(object);
	 }
	else
	{
		hidden(object);
	}
}

function hotCity() //单选框为不选中
{
 for (x=0;x<document.getElementsByName("hotCity").length;x++)
  {
   if (document.getElementsByName("hotCity")[x].checked==true)
    {
	 document.getElementsByName("hotCity")[x].checked=false;
	}
  }
}

function clearHotSort() //输入所在的城市的名称时，其余的两项为空
{
 hotCity();
 document.getElementById("bSorts").selectedIndex=0;
 changelocation(0);
}

function clearCity() //选中下拉框中的值时，其余的两项为空
{
 hotCity();
 document.getElementById("hCity").value="";
}

function clrCity() //选中单选框中的值时，其余的两项为空
{
 document.getElementById("hCity").value="";
 document.getElementById("bSorts").selectedIndex=0;
 changelocation(0);
}

function chkhotel(maxpage)<!--如果不是数字，或是大于最大值时。的方法-->
{
 if (parseInt(document.form1.pagenum.value)>maxpage||isNaN(document.form1.pagenum.value))
 {
  document.form1.pagenum.value=1;
  return false;
  }
 else return true; 
}
function chknofree(maxpage)<!--如果不是数字，或是大于最大值时。的方法-->
{
 if (parseInt(document.nofree.pagenum.value)>maxpage||isNaN(document.nofree.pagenum.value))
 {
  document.nofree.pagenum.value=1;
  return false;
  }
 else return true; 
}
function chkfree(maxpage)<!--如果不是数字，或是大于最大值时。的方法-->
{
 if (parseInt(document.free.pagenum.value)>maxpage||isNaN(document.free.pagenum.value))
 {
  document.free.pagenum.value=1;
  return false;
  }
 else return true; 
}
function chkmath(object,sTime,eTime)
{
	if (object.value=="")
	 {
		  alert("不能为空！");
		  object.select();
		  return false;
	 }
	else if(object.value=="0"||isNaN(object.value)) 
	 {
		  alert("请输入有效数字！");
		  object.select();
		  return false;
	 }
    else chkEDate(sTime,eTime,sDate,eDate);
}
function chkselect(object)
{
	object.select();
}

function chkinput(object)
{
	if (object.xingming.value=="")
	{
		 alert("请输入您的真实姓名！");
		 object.xingming.focus();
		 return false;
	}
	else if ((object.tel.value=="")&&(object.mobile.value==""))
	{
		 alert("请至少输入一种您的联系方式！");
		 return false;
	}
	else if (object.addr.value=="")
	{
		 alert("请输入您的详细地址！");
		 object.addr.focus();
		 return false;
	}
	else if (object.email.value=="")
	{
		 alert("请输入您的email，以方便我们与您联系！");
		 object.email.focus();
		 return false;
	}
}


function chkinput1(object,sDate,eDate)
   
{
	if (object.startDate.value=="")
	{
		 alert("请输入入住日期！");
		 object.startDate.focus();
		 return false;
	}
	else if (!isDateString(object.startDate.value))
	{
		alert("输入的入店日期格式不规范！");
		object.startDate.focus();
		return false;
	}
	else if (object.startDate.value<sDate)
	{
		alert("入店日期不能小于"+sDate+"！");
		object.startDate.focus();
		return false;
	}
	else if (object.endDate.value=="")
	{
		 alert("请输入离店日期！");
		 object.endDate.focus();
		 return false;
	}
	else if (!isDateString(object.endDate.value))
	{
		alert("输入的离店日期格式不规范！");
		object.endDate.focus();
		return false;
	}
	else if (object.endDate.value>eDate)
	{
		alert("离店日期不能大于"+eDate+"！");
		object.endDate.focus();
		return false;
	}
	else if (object.startDate.value>object.endDate.value)
	{
		alert("入店日期不能小于离店日期！");
		object.startDate.focus();
		return false;
	}
	else if (object.xingming.value=="")
	{
		 alert("请输入您的真实姓名！");
		 object.xingming.focus();
		 return false;
	}
	else if ((object.tel.value=="")&&(object.mobile.value==""))
	{
		 alert("请至少输入一种您的联系方式！");
		 return false;
	}
	else if (object.addr.value=="")
	{
		 alert("请输入您的详细地址！");
		 object.addr.focus();
		 return false;
	}
	else if (object.email.value=="")
	{
		 alert("请输入您的email，以方便我们与您联系！");
		 object.email.focus();
		 return false;
	}
}

function chkNearHomeNofree(object) //查询国内参团游,周边游
{
	if (object.nearHomeNofreeAnclass.value=="")
	{
		 alert("请选择要查询的分类！");
		 object.nearHomeNofreeAnclass.focus();
		 return false;
	}
	else if (object.nearHomeNofreeNclass.value=="")
	{
		 alert("请选择要查询的城市/景点名称！");
		 object.nearHomeNofreeNclass.focus();
		 return false;
	}
	else if (object.nofreeDateHomeNear.value!="")
	{
		if (!isDateString(object.nofreeDateHomeNear.value))
		 {
		  alert("输入的出发日期格式不规范！");
		  object.nofreeDateHomeNear.focus();
		  return false;
		 }
	}
	else if (isNaN(object.days.value))
	{
		alert("请输入有效数字！");
		object.days.focus();
		return false;
	}
}

function chkFarHomeNofree(object) //查询国内参团游,国内游
{
	if (object.farHomeNofreeAnclass.value=="")
	{
		 alert("请选择要查询的分类！");
		 object.farHomeNofreeAnclass.focus();
		 return false;
	}
	else if (object.farHomeNofreeNclass.value=="")
	{
		 alert("请选择要查询的城市/景点名称！");
		 object.farHomeNofreeNclass.focus();
		 return false;
	}
	else if (object.nofreeDateHomeFar.value!="")
	{
		if (!isDateString(object.nofreeDateHomeFar.value))
		 {
		  alert("输入的出发日期格式不规范！");
		  object.nofreeDateHomeFar.focus();
		  return false;
		 }
	}
	else if (isNaN(object.days.value))
	{
		alert("请输入有效数字！");
		object.days.focus();
		return false;
	}
}

function chkboardNofree(object) //查询国际参团游
{
	if (object.boardNofreeAnclass.value=="")
	{
		 alert("请选择要查询的分类！");
		 object.boardNofreeAnclass.focus();
		 return false;
	}
    else if (object.boardNofreeNclass.value=="")
	{
		 alert("请选择要查询的城市/景点名称！");
		 object.boardNofreeNclass.focus();
		 return false;
	}
	else if (object.nofreeDateBoard.value!="")
	{
		if (!isDateString(object.nofreeDateBoard.value))
		{
		 alert("输入的出发日期格式不规范！");
		 object.nofreeDateBoard.focus();
		 return false;
		}
	}
	else if (isNaN(object.days.value))
	{
		alert("请输入有效数字！");
		object.days.focus();
		return false;
	}
}

function chkhomefree(object) //查询国内自由行
{
    if (object.freeNclassHome.value=="")
	{
		 alert("请选择要查询的城市/景点名称！");
		 object.freeNclassHome.focus();
		 return false;
	}
	else if (isNaN(object.days.value))
	{
		alert("请输入有效数字！");
		object.days.focus();
		return false;
	}
}

function chkboardfree(object) //查询国际自由行
{
    if (object.freeNclassBoard.value=="")
	{
		 alert("请选择要查询的城市/景点名称！");
		 object.freeNclassBoard.focus();
		 return false;
	}
	else if (isNaN(object.days.value))
	{
		alert("请输入有效数字！");
		object.days.focus();
		return false;
	}
}


function showLine(object)
{
	//更换图像
	var img1=document.getElementById("lines");
    if (object=="aboard") //出境游	
	{
		img1.src="images/nofree2_aboard.jpg";
	}
	else if (object=="home") //国内游
	{
		img1.src="images/nofree2_home.jpg";
	}
	//else if (object=="club_div") //国内游
	//{
	//	img1.src="images/club.jpg";
	//}
	else  //自由行
	{
		img1.src="images/free2.jpg";
	}
	//显示层
	if (object=="aboard") //出境游
	{
		document.getElementById("nofree2_aboard").style.display="block";
		document.getElementById("nofree2_home").style.display="none";
		//document.getElementById("nofree2_club").style.display="none";
		document.getElementById("free2").style.display="none";
	}
	else if (object=="home") //国内游
	{
		document.getElementById("nofree2_aboard").style.display="none";
		document.getElementById("nofree2_home").style.display="block";
		//document.getElementById("nofree2_club").style.display="none";
		document.getElementById("free2").style.display="none";
	}
	else if (object=="club_div") //俱乐部
	{
		document.getElementById("nofree2_aboard").style.display="none";
		document.getElementById("nofree2_home").style.display="none";
		//document.getElementById("nofree2_club").style.display="block";
		document.getElementById("free2").style.display="none";
	}
	else //自由行
	{
		document.getElementById("nofree2_aboard").style.display="none";
		document.getElementById("nofree2_home").style.display="none";
		//document.getElementById("nofree2_club").style.display="none";
		document.getElementById("free2").style.display="block";
	}
}

function show4Img(object)
{
	//更换背景图像
	if (object=="nofree1") //参团游
	 {
		document.getElementById("nofree1").style.backgroundImage="url(images/nofreered.jpg)";
		document.getElementById("free1").style.backgroundImage="url(images/freeblue.jpg)";
		document.getElementById("hotel").style.backgroundImage="url(images/hotelblue.jpg)";
		document.getElementById("search").style.backgroundImage="url(images/searchblue.jpg)";
	 }
	else if (object=="free1") //自由行
	{
		document.getElementById("nofree1").style.backgroundImage="url(images/nofreeblue.jpg)";
		document.getElementById("free1").style.backgroundImage="url(images/freered.jpg)";
		document.getElementById("hotel").style.backgroundImage="url(images/hotelblue.jpg)";
		document.getElementById("search").style.backgroundImage="url(images/searchblue.jpg)";
	}
	else if (object=="hotel") //度假酒店
	{
		document.getElementById("nofree1").style.backgroundImage="url(images/nofreeblue.jpg)";
		document.getElementById("free1").style.backgroundImage="url(images/freeblue.jpg)";
		document.getElementById("hotel").style.backgroundImage="url(images/hotelred.jpg)";
		document.getElementById("search").style.backgroundImage="url(images/searchblue.jpg)";
	}
	else if (object=="search") //个性搜索
	{
		document.getElementById("nofree1").style.backgroundImage="url(images/nofreeblue.jpg)";
		document.getElementById("free1").style.backgroundImage="url(images/freeblue.jpg)";
		document.getElementById("hotel").style.backgroundImage="url(images/hotelblue.jpg)";
		document.getElementById("search").style.backgroundImage="url(images/searchred.jpg)";
	}
	else if (object=="hotelN") //国内酒店
	{
		document.getElementById("hotelW").style.backgroundImage="url(images/hotelWblue.jpg)";
		document.getElementById("hotelN").style.backgroundImage="url(images/hotelNred.jpg)";
	}
	else if (object=="hotelW") //境外酒店
	{
		document.getElementById("hotelW").style.backgroundImage="url(images/hotelWred.jpg)";
		document.getElementById("hotelN").style.backgroundImage="url(images/hotelNblue.jpg)";
	}
	
	//显示层
	if (object=="nofree1") //参团游
	 {
		document.getElementById("div_nofree").style.display="block";
		document.getElementById("div_free").style.display="none";
		document.getElementById("div_hotel").style.display="none";
		document.getElementById("div_search").style.display="none";
	 }
	else if (object=="free1") //自由行
	{
		document.getElementById("div_nofree").style.display="none";
		document.getElementById("div_free").style.display="block";
		document.getElementById("div_hotel").style.display="none";
		document.getElementById("div_search").style.display="none";
	}
	else if (object=="hotel") //度假酒店
	{
		document.getElementById("div_nofree").style.display="none";
		document.getElementById("div_free").style.display="none";
		document.getElementById("div_hotel").style.display="block";
		document.getElementById("div_search").style.display="none";
	}
	else if (object=="search") //个性搜索
	{
		document.getElementById("div_nofree").style.display="none";
		document.getElementById("div_free").style.display="none";
		document.getElementById("div_hotel").style.display="none";
		document.getElementById("div_search").style.display="block";
	}
	else if (object=="hotelW") //境外酒店
	{
		document.getElementById("div_hotelN").style.display="none";
		document.getElementById("div_hotelW").style.display="block";
	}
	else if (object=="hotelN") //国内酒店
	{
		document.getElementById("div_hotelW").style.display="none";
		document.getElementById("div_hotelN").style.display="block";
	}
}

	function  CheckInput1() {
		var flag=0;
		for(i=0;i<searchFormQ1.planMoney.length;i++)
		if(searchFormQ1.planMoney[i].checked==true){
		flag=1;
		break;
		}
		if(!flag){
			alert("请选择出行预算!");
			return false;
			}
		}
		
	function  CheckInput2() {
		var flag=0;
		for(i=0;i<searchFormQ2.planMoney.length;i++)
		if(searchFormQ2.planMoney[i].checked==true){
		flag=1;
		break;
		}
		if(!flag){
			alert("请选择出行预算!");
			return false;
			}
		}
function chkIndexHotel(object) //查询首页的度假酒店
{
	var flag1,flag2;
	flag1=false;
	flag2=false;
	if (object.bSorts.value=="")
	{
		alert("请选择要查询的国家名称！");
		object.bSorts.focus();
		return false;
	}
	if (object.sSorts.value=="")
	{
		alert("请选择要查询的城市名称！");
		object.sSorts.focus();
		return false;
	}
	if (object.startDate.value!="")
	{
		if (!isDateString(object.startDate.value))
		 {
		   alert("输入的入店日期格式不规范！");
		   object.startDate.focus();
		   return false;
		 }
		else flag1=true; 
	}
	if (object.endDate.value!="")
	{
		if (!isDateString(object.endDate.value))
		 {
		   alert("输入的离店日期格式不规范！");
		   object.endDate.focus();
		   return false;
		 }
		 else flag2=true;
	}
	   if (flag1==true&&flag2==true)
	   {
		if (stringToDate(object.startDate.value,true)>stringToDate(object.endDate.value,true))
	    {
		  alert("入店日期不能大于离店日期！");
		  object.startDate.focus();
		  return false;
	    }
	   }
}
function isDateString(sDate) //判断输入的日期是否为合法
{	var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
	var iaDate = new Array(3)
	var year, month, day

	if (arguments.length != 1) return false
	iaDate = sDate.toString().split("-")
	if (iaDate.length != 3) return false
	if (iaDate[1].length > 2 || iaDate[2].length > 2) return false
	if (isNaN(iaDate[0])||isNaN(iaDate[1])||isNaN(iaDate[2])) return false

	year = parseFloat(iaDate[0])
	month = parseFloat(iaDate[1])
	day=parseFloat(iaDate[2])

	if (year < 1900 || year > 2100) return false
	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
	if (month < 1 || month > 12) return false
	if (day < 1 || day > iaMonthDays[month - 1]) return false
	return true
}

function stringToDate(sDate, bIgnore) //字符转换为日期函数
{	var bValidDate, year, month, day
	var iaDate = new Array(3)
	
	if (bIgnore) bValidDate = true
	else bValidDate = isDateString(sDate)
	
	if (bValidDate)
	{  iaDate = sDate.toString().split("-")
		year = parseFloat(iaDate[0])
		month = parseFloat(iaDate[1]) - 1
		day=parseFloat(iaDate[2])
		return (new Date(year,month,day))
	}
	else return (new Date(1900,1,1))
}

function showHomeBoardNofree(para) //参团游中的国际和国内的层的show or hidden
{
	if (para==0) //周边游
	{
		document.getElementById("div_nofree_homeNear").style.display="block";
		document.getElementById("div_nofree_homeFar").style.display="none";
		document.getElementById("div_nofree_board").style.display="none";
	}
	else if (para==1) //国内游
	{
		document.getElementById("div_nofree_homeNear").style.display="none";
		document.getElementById("div_nofree_homeFar").style.display="block";
		document.getElementById("div_nofree_board").style.display="none";
	}
	else if (para==2) //出境游
	{
		document.getElementById("div_nofree_homeNear").style.display="none";
		document.getElementById("div_nofree_homeFar").style.display="none";
		document.getElementById("div_nofree_board").style.display="block";
	}
}

function showHomeBoardfree(para) //自由行中的国际和国内的层的show or hidden
{
	if (para==0)
	{
		document.getElementById("div_free_home").style.display="block";
		document.getElementById("div_free_board").style.display="none";
	}
	else
	{
		document.getElementById("div_free_home").style.display="none";
		document.getElementById("div_free_board").style.display="block";
	}
}

function showSearch() //搜索条件中的层的show or hidden
{
	if (document.getElementById("div_search_1").style.display=="none")
	{
		document.getElementById("div_search_1").style.display="block";
		document.getElementById("div_search_2").style.display="none";
	}
	else
	{
		document.getElementById("div_search_1").style.display="none";
		document.getElementById("div_search_2").style.display="block";
	}
}

<!--begin:图片轮换开始-->
var imgUrl=new Array();
var imgLink=new Array();
var imgAlt=new Array();
var buttonShow=1;
var adNum=7;     //图片数量
var dakularCode="";



imgUrl[6]="/images/clubmed.jpg";
imgLink[6]="http://www.uzai.com/subject/clubmed";
imgAlt[6]="地中海俱乐部夏日嘉年华";


imgUrl[5]="/images/jiang.jpg";
imgLink[5]="http://www.uzai.com/subject/guzhen";
imgAlt[5]="江南古镇一日游";

imgUrl[4]="/images/uzai_510_160_summer-holiday.jpg";
imgLink[4]="http://bj.uzai.com/uzai/product/summer_holiday?referrer=summer_holiday";
imgAlt[4]="暑期";

imgUrl[3]="/images/qinzi.jpg";
imgLink[3]="http://www.uzai.com/subject/qinzi";
imgAlt[3]="亲子游";

imgUrl[2]="/images/shatan.jpg";
imgLink[2]="http://www.uzai.com/subject/healthtrip";
imgAlt[2]="健康海岛游";

imgUrl[1]="/images/shuqi.jpg";
imgLink[1]="http://www.uzai.com/subject/shujia";
imgAlt[1]="暑期旅游";


var imgPre=new Array();
for (i=1;i<8;i++)
{
 imgPre[i]=new Image();
 imgPre[i].src=imgUrl[i];
 }
function setTransition()
{
 if (document.all)
 {
  imgUrlrotator.filters.revealTrans.Transition=23;//Math.floor(Math.random()*23)
  imgUrlrotator.filters.revealTrans.apply();
 }
}
function playTransition()
{
 if (document.all)
 imgUrlrotator.filters.revealTrans.play()
 }
function nextAd(toNum)
 {
 if(adNum<imgUrl.length-1)
 adNum++ ;
 else
 adNum=1;
   if(toNum!=null) adNum=toNum;
   setTransition();
 document.images.imgUrlrotator.src=imgUrl[adNum];
 document.images.imgUrlrotator.alt=imgAlt[adNum];
 playTransition();
 checkButton();
 if(toNum!=null)
  {toNum=null;theTimer=setTimeout("nextAd()", 7500);}
 else
 {theTimer=setTimeout("nextAd()", 7500);}
 }
function jump2url()
{
 jumpUrl=imgLink[adNum];jumpTarget='_blank';
 if (jumpUrl != '')
 {  if (jumpTarget != '')
            window.open(jumpUrl,jumpTarget);
  else location.href=jumpUrl;
   }
 }
function displayStatusMsg()
{
 status=imgLink[adNum];
    document.returnValue = true;
 }
function checkButton()
{
 for(i=1;i<=imgUrl.length-1;i++)
  {if(i==adNum)
   //document.getElementById('bt'+i).style.backgroundColor='#00FF00';
   eval("bt"+i+".style.backgroundColor='#CC0000';bt"+i+".style.color='#FFFFFF';");
  else
   eval("bt"+i+".style.backgroundColor='#3F393B';bt"+i+".style.color='#FFFFFF';");
  }
}
function dakularButtons()
{
if(buttonShow==1)
{

  for(i=1;i<=imgUrl.length-1;i++)
  {
   dakularCode=dakularCode+"<div id='bt"+i+"' style='display:inline; height:13px; width:20px; background-color:#f7f7f7; color:#000000;' align='center'; onMouseOver=this.style.backgroundColor='#FFFFFF';this.style.color='#000000';this.style.cursor='hand' onMouseOut=checkButton(); onClick='clearTimeout(theTimer);nextAd("+i+");' title="+imgAlt[i]+"><span>&nbsp;"+i+"&nbsp;</span></div><div style='display:inline;padding-right:1px;color:#FFFFFF'></div>";
  }
  dakularCode="<div style='display:inline; position:relative;float:right; top:166px; z-index:1;'>"+dakularCode+"</div>";
  document.write(dakularCode);
 }
}
function showCity(object) //上海出发,还是北京出发
{
	if (object==1)
	 {
		document.getElementById("div1").style.display="block";
		document.getElementById("div2").style.display="none";
	 }
	else if (object==2) 
	{
		document.getElementById("div1").style.display="none";
		document.getElementById("div2").style.display="block";
	}
}

function  chat(y,nclass)  { //chat的无刷新pages技术...
   if (!y) {
     y=1;
   } 
   var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
             if(xmlhttp.status==200)  {
	            var yy=unescape(xmlhttp.responseText);
				     showPostsList(yy);
	         }else {
		       alert("error");
	         }
          }
		  else if (xmlhttp.readyState<4) //还没有完全loading时......
		  {
            document.getElementById("td_chat").innerHTML="<div style='border:1px solid #000000;background-color:#FFFFE1;width:160px;padding-left:2px;'>loading，请稍候......</div>";
		  }
		}  
	    xmlhttp.open("get","/showPostsList.asp?pagenum="+y+"&nclass="+nclass);
		xmlhttp.send(null);
    }		
}
function showPostsList(text) { //显示chat的列表
document.getElementById("td_chat").innerHTML=text;
}
//格式化数字函数如同:vb中的formatNumber函数
function FormatNumber(srcStr,nAfterDot){ 
   　　var srcStr,nAfterDot; 
   　　var resultStr,nTen; 
   　　srcStr = ""+srcStr+""; 
   　　strLen = srcStr.length; 
   　　dotPos = srcStr.indexOf(".",0); 
   　　if (dotPos == -1){ 
   　　　　resultStr = srcStr+"."; 
   　　　　for (i=0;i<nAfterDot;i++){ 
   　　　　　　resultStr = resultStr+"0"; 
   　　　　} 
   　　　　return resultStr; 
   　　} 
   　　else{ 
   　　　　if ((strLen - dotPos - 1) >= nAfterDot){ 
   　　　　　　nAfter = dotPos + nAfterDot + 1; 
   　　　　　　nTen =1; 
   　　　　　　for(j=0;j<nAfterDot;j++){ 
   　　　　　　　　nTen = nTen*10; 
   　　　　　　} 
   　　　　　　resultStr = Math.round(parseFloat(srcStr)*nTen)/nTen; 
   　　　　　　return resultStr; 
   　　　　} 
   　　　　else{ 
   　　　　　　resultStr = srcStr; 
   　　　　　　for (i=0;i<(nAfterDot - strLen + dotPos + 1);i++){ 
   　　　　　　　　resultStr = resultStr+"0"; 
   　　　　　　} 
   　　　　　　return resultStr; 
   　　　　} 
   　　} 
   } 

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function check()
{
   if(checkspace(document.searchform.searchkey.value)) {
	document.searchform.searchkey.focus();
    alert("搜索关键字不能为空，请重新输入！");
	return false;
  }  
}
function submitForm()
{
  var b = document.searchform.searchType.value;
  if(b == 2)
   {
     document.searchform.action="http://chat.uzai.com/search.html";	  
     document.searchform.method="post";
     document.searchform.target="_blank";
   }
  else
   {  
     document.searchform.action="/research.asp";	  
     document.searchform.method="post";
	 document.searchform.target="_self";
   }
}
function checkLogin()
{
   if(checkspace(document.login.wuserName.value)) {
	document.login.wuserName.focus();
    alert("用户名不能为空！");
	return false;
  } 
  if(checkspace(document.login.wuserPwd.value)) {
	document.login.wuserPwd.focus();
    alert("密码不能为空！");
	return false;
  }  
}

function checkReg()
{
  if(checkspace(document.userinfo.username.value)) {
	document.userinfo.username.focus();
    alert("Email不能为空，请重新输入！");
	return false;
  }
  else if(checkspace(document.userinfo.nickName.value)) {
	document.userinfo.nickName.focus();
    alert("昵称不能为空，请重新输入！");
	return false;
  }
  else if(checkspace(document.userinfo.userPwd.value)) {
	document.userinfo.userPwd.focus();
    alert("密码不能为空，请重新输入！");
	return false;
  }
  else if(checkspace(document.userinfo.userPwd1.value)) {
	document.userinfo.userPwd1.focus();
    alert("两次密码不一致，请重新输入！");
	return false;
  }
  else if(checkspace(document.userinfo.city.value)) {
	document.userinfo.city.focus();
    alert("请选择所在城市！");
	return false;
  }
}
