function initIndex(){
	//$("#loginFormDIV").load("/module/iLoginPage3.0.vm");
	$.ajax({
	   cache: false,
	   url: "/userFrontScript.do?method=scoreSearchInLogin",//"/module/iLoginPage3.0.vm",
	   success: function(cValue){
			document.getElementById("loginFormDIV").innerHTML = cValue;
			setTimeout("loadTicket()",2000);
	   }
	});
	//$("#loginInfo").load("/module/iLoginInfo.vm");
	$.ajax({
	   cache: false,
	   url: "/module/iLoginInfo.vm",
	   success: function(cValue){
			document.getElementById("loginInfo").innerHTML = cValue;
	   }
	});
}

	function showCHSearchForm(pars){
		try{
//			new Ajax.Updater("showWSearchForm",'/module/worldSearchForm3.0.vm', {asynchronous:true, evalScripts:true, onComplete:showCHSearchFormed});
			$.ajax({
			   type: "POST",
			   url: "/module/worldSearchForm3.0.vm",
//			   data: "name=John&location=Boston",
			   success: function(cValue){
				   	var tagdiv = document.getElementById("showWSearchForm");
				   	tagdiv.innerHTML = cValue;	
				   	_tagCnID = "placeToS";
					_tagID = "placeTo";
					try{document.getElementById("searchDate").value=getDateCC(new Date(),-1);}catch(e){}
					try{document.getElementById("returnDate").value=getDateCC(new Date(),-30);}catch(e){}
					//alert(getCookie("placeToS"));
					if(getCookie("placeToS")!=""){
						document.getElementById("placeToS").value = getCookie("placeToS");
						document.getElementById("placeTo").value = getCookie("placeTo");
						document.getElementById("contentType").value = getCookie("contentType");
					}
					ZZ.module.searchBox.init();
			   }
			});
		}catch(e){window.status=(e.description);}
	}
	
/**
*	异步发送小纸条给指定人员
*/
function sendNoteToAdmin(noteTitle,noteBody,recieverId) {
	if(noteTitle == "" || noteBody == "") {
		alert("你未填写标题或内容");
	} else {
		// checkLength(str,len) 来自script/common.js
		if(checkLength(noteTitle,50) && checkLength(noteBody,400)) {
			var postData = "recieverId="+recieverId+"&noteTitle=" + noteTitle + "&noteBody=" + noteBody ;
//			new Ajax.Updater('noteComplete', '/littleNote.do?method=sendLN', {method:'post',postBody:postData,onComplete:showSuccess ,asynchronous:true, evalScripts:true});
			
			$.ajax({
			   type: "POST",
			   url: "/littleNote.do?method=sendLN",
			   data: postData,
			   success: function(cValue){
//					try{setTimeout("parent.document.getElementById('fillSubmitForm').style.display = 'none'",1500);}catch(e){}
			   }
			});			
			 
		} else {
			alert("提交内容过多,请缩减字数!");
		}
	}
}

/*
$(document).click(function(){
		try{
			var o = window.event.srcElement;
			alert(o.name+"\n id:"+o.id);
			if(o.name!="choosePlace"){
				var x = document.getElementById('hotCity').style.display;
				funCloseAllPlacePanel();
			}
		}catch(e){}
	}
);*/

//=====================================================

	function showCHSearchForm1(pars){
		try{
//			new Ajax.Updater("showWSearchForm",'/AgentInfoSearch.do?method=searchForm&cReturn='+pars, {asynchronous:true, evalScripts:true, onComplete:showCHSearchFormed});
			new Ajax.Updater("showWSearchForm",'/module/worldSearchForm3.0.vm', {asynchronous:true, evalScripts:true, onComplete:showCHSearchFormed1});
		}catch(e){}
	}
		function showCHSearchFormed1(originalRequest){
			try{
				var cValue = originalRequest.responseText;
			    Calendar.setup({
			        inputField     :    "searchDate",     										
			        ifFormat       :    "%Y-%m-%d",     
			        button         :    "searchDateIMG",  	
			        align          :    "Bl",             	
			        singleClick    :    true    });
			    Calendar.setup({
			        inputField     :    "returnDate",     										
			        ifFormat       :    "%Y-%m-%d",     
			        button         :    "returnDateIMG",  	
			        align          :    "Bl",             	
			        singleClick    :    true    });
			}catch(e){}
		}
	
	function switchUserTip(curTip){
		try{
			for(var i=1;i<=5;i++){
				var o = "userTips_"+i
				var divObj = document.getElementById(o);
				if(o==curTip){
					divObj.className = "on";
				}else{
					divObj.className = "off";
				}
			}
		}catch(e){}
	}
	
	function switchFrom(from){
		setTimeout("switchF('"+from+"')",500);
	}
	function switchF(from){
		try{
/*			document.getElementById("CAN1").style.display="none";
			document.getElementById("CAN2").style.display="none";
			document.getElementById("HKG1").style.display="none";
			document.getElementById("HKG2").style.display="none";
			document.getElementById(from+"1").style.display="block";
			document.getElementById(from+"2").style.display="block";*/
			document.getElementById("CAN1").className="part1 ho";
			document.getElementById("CAN2").className="part2 ho";
			document.getElementById("HKG1").className="part1 ho";
			document.getElementById("HKG2").className="part2 ho";
			document.getElementById(from+"1").className="part1";
			document.getElementById(from+"2").className="part2";
			
			document.getElementById("tf_CAN").className = "button bg2";
			document.getElementById("tf_HKG").className = "button bg2";
			document.getElementById("tf_"+from).className = "button bg1";
			
		}catch(e){}
	}
	var _sc;
	function switchHotelFrom(city){
		_sc = setTimeout("switchHotel('"+city+"')",500);
	}
	function switchStop(){
		clearTimeout(_sc);
	}
		function switchHotel(city){
			var allCity = new Array("BJ","SH","GZ","SY","HZ","XA","CD");
//			var allCity = new Array("BJ","SH","GZ","SY","HZ","XA","ZZ","CD");
			for(var i=0;i<allCity.length;i++){
				//hidden title
				var t = document.getElementById("t_"+allCity[i]);
				t.className = "button bg2";
				//hidden content
				var c = document.getElementById("c_"+allCity[i]);
				c.className = "pick ho";
			}
			//show single title
			var t = document.getElementById("t_"+city);
			t.className = "button bg1";
			//show content
			var c = document.getElementById("c_"+city);
			c.className = "pick";
		}
/*	try{
		document.getElementById("HKG1").style.display="none";
		document.getElementById("HKG2").style.display="none";
	}catch(e){}*/
	
	function switchGlobalFrom(from){
		setTimeout("loadGlobalHotelByCity('"+from+"')",500);
	}

	function loadGlobalHotelByCity(id,countryCode){
	   $("#"+id).html("<img src='/images/loading.gif'/>loading...");
	   var url = "/globalHotel.do?method=jGetGlobalHotelByCountry&countryCode="+countryCode+"&hotelTotal=6";
	   $("#"+id).load(url);
	} 
	
	var _scGlobal;
	function switchGlobalHotelFrom(city){
		_scGlobal = setTimeout("switchGlobalHotel('"+city+"')",500);
	}
	function switchGlobalStop(){
		clearTimeout(_scGlobal);
	}
	
	 function switchGlobalHotel(city){
    	  var allCity = new Array("XN","LD","BL","SFS","NY","DLD");
    	  for(var i=0;i<allCity.length;i++){
        	  var t = document.getElementById("t_"+allCity[i]);
        	  t.className = "button bg2";
        	  try{
        		  var c = document.getElementById("showGlobalHotelList"+allCity[i]);
        		  c.style.display= "none";
        	  }catch(e){}
    	  }
    	  var t = document.getElementById("t_"+city);
    	  t.className = "button bg1";
    	  try{
    		  var c = document.getElementById("showGlobalHotelList"+city);
    		  c.style.display= "block";
    	  }catch(e){}
	 }

	
	