	function advance_search(){
		searchForm.action = "advanceSearchLoad.do?" + refQueryString;
		searchForm.submit();
	}
	
	function ShowAddReference(){
		OpenInsetPage(400,200,"./addReferenceLoad.do?" + refQueryString);
	}
	
	function ShowRssSubscription(){
		OpenInsetPage(450,200,"./compRssSubscription.do?" + refQueryString);
	}
	
	function ShowCompFunlet(){
		formMain.action="./showCompFunlet.do?scope="+encodeURIComponent(refQueryString);
		return true;
	}
	
	function ShowGradeFunlet(){
		formMain.action="./showGradeFunlet.do?scope="+encodeURIComponent(refQueryString);
		return true;
	}
	
	function ShowAuctionFunlet(){
		formMain.action="./showAuctionFunlet.do?scope="+encodeURIComponent(refQueryString);
		return true;
	}
	
	function loadCompAuctionList(){
		writeLoadingInfo("tdCompAuctionList");
    	sendHttpRequest("./compAuctionList.do?" + refQueryString, showCompAuctionList,false);
   	}
   	
   	function ShowConfig(){
   		var width = 280;
   		var height = 310;
   		if(getElementById("hidIsLogonUser").value == 'true'){
   			width = 150;
   			height = 270;
   		}
		OpenInsetPage(width,height,"./compAuctionListConfig.do?compAuctionConfigId="+getElementById("hidCompAuctionConfigId").value+"&" + refQueryString);
	}
	
	function ShowDownloadAuction(){
		OpenInsetPage(400,230,"./downloadAuctionLoad.do?" + refQueryString);
	}
	
	function ShowCompAuctionRSS(){
		window.open("./compAuctionFeed.do?" + refQueryString + "&compAuctionConfigId="+getElementById("hidCompAuctionConfigId").value,"_blank");
	}
	
	function reIdentify(){
		if(confirm('Are you sure to re-identify the auctions?')){
			sendHttpRequest("./auctionReIdentify.do?" + refQueryString,reIdentifySuccess,false);
		}
	}
	
	function search(){
		//asdf.asdf();
 		getElementById("searchParameter").value = getElementById("txtSearch").value;
		searchForm.action="simpleSearch.do";
		searchForm.submit();
	}
	
	function inputBlur(defaltValue,object){
		if(getElementById(object).value==''){
			getElementById(object).style.color="#007dbd";
			getElementById(object).value=getElementById(defaltValue).value
		}else if(getElementById(object).value==getElementById(defaltValue).value){
			getElementById(object).style.color="#007dbd";
		}
	}
	
	function inputFocus(defaltValue,object){
		if(getElementById(object).value==getElementById(defaltValue).value){
			getElementById(object).style.color="#000000";
			getElementById(object).value='';
		}
	}
	
		
	function register(){
		window.open("userReg.do","_self");
	}
	
	function inviteMember(){
		OpenInsetPage(400,200,"inviteMember.do?action=load");
	}
	
	function ShowLogin(){
		var validateEmpty = getElementById("validateControlEmpty").value;
		var validateEMail = getElementById("validateEMail").value;
		var txtEmail = getElementById("loginEmail");
		if(txtEmail.value==getElementById("emailDefaultValue").value)
			txtEmail.value = '';
		if(!validateControlEmptyWithMsg(txtEmail, getElementById("rbEMail").value,validateEmpty)) {
			txtEmail.value=getElementById("emailDefaultValue").value
			return false;
		}
		if(!validateEmailWithMsg(txtEmail, getElementById("rbEMail").value,validateEMail)) return false;
		var txtPassword = getElementById("userPSW");
		if(txtPassword.value==getElementById("passwordDefaultValue").value) 
			txtPassword.value='';
		if(txtPassword.value==null || txtPassword.value==''){
			OpenInsetPage(350,150,"emailLogin.do?txtEmail="+txtEmail.value,30);
			txtPassword.value=getElementById("passwordDefaultValue").value;
		}else{
			formLogin.action="login.do?email="+encodeURIComponent(txtEmail.value)+"&passowrd="+encodeURIComponent(txtPassword.value);
			formLogin.submit();
		}
	}
	
	function showCompAuctionList(httpRequest){
   		if(isHttpRequestReady(httpRequest)){
			setControlContent("tdCompAuctionList", httpRequest.responseText);
		}
   	}
   	
   	function ShowModifyAuction(auctionid){
		OpenInsetPage(500,150,"./modifyAuction.do?auctionId="+auctionid);
	}
	
	function reIdentifySuccess(httpRequest){
		if(isHttpRequestReady(httpRequest)&&httpRequest.responseText!=""){
			if(httpRequest.responseText=='identify')
				alert("The system is indentifying the auctions, please wait a moment!");
			else if(httpRequest.responseText=='reIdentify')
				alert("The system is re-indentifying the auctions, please wait a moment!");
			else if(httpRequest.responseText=='beginReID'){
				alert("The system begins to re-identify the auctions!");
				return true;
			}else if(httpRequest.responseText=='noMapping')
				alert("No mapping is related to this catalog page!");
		}
		return false;
	}
	
	function FoldaWayDiv(){
		this.width = 1;
		this.height = 200;
		this.speed = 4;
		this.elementDiv = null;
		this.timer = 6;
		var thisObj = this;
		var pross = null;
		
		function _openHeight() {		
			var currentElementY = parseInt(this.elementDiv.style.height,10);		
			if(currentElementY < this.height) {
				this.elementDiv.style.height = (currentElementY + Math.ceil((this.height - currentElementY) / this.speed)) + "px";
			}else{			
				window.clearInterval(pross);
			}
		}
		
		function _closeHeight() {
			var currentElementY = parseInt(this.elementDiv.style.height, 10);	
			
			if(currentElementY > 1) {
			    var value=(currentElementY - Math.ceil(currentElementY / this.speed));
			    value = value == 0 ? 1 : value;
				this.elementDiv.style.height = value + "px";
			}else{
				window.clearInterval(pross);		
				this.elementDiv.style.display = "none";			
			}
		}
		
		this.openHeight=function() {
			if(this.elementDiv.style.display == "block") return;
			window.clearInterval(pross);
			this.elementDiv.style.display = "block";
			this.elementDiv.style.height = "1px";		
			pross=window.setInterval(function(){_openHeight.apply(thisObj)},this.timer);	
				
		}
		
		this.closeHeight=function() {
			if(this.elementDiv.style.display == "block") {			
				pross=window.setInterval(function(){_closeHeight.apply(thisObj)},this.timer);
			}
		}
	}
	
	function openInsetHeaderPage(divId,divWidth,divQSLeft){
		var divQSLeft = divQSLeft;
		var divWidth = divWidth;//button.width;
		//var control = button;
		//while(control=control.offsetParent){
	    //	divQSLeft += control.offsetLeft;
	    //}
		var loInsertDiv = getElementById(divId);
		
		loInsertDiv.style.left = divQSLeft;
		loInsertDiv.style.top = 0;
		loInsertDiv.style.height = 180;
		loInsertDiv.style.width = divWidth;
		
		var eleDiv = document.getElementById(divId);
		var foldWayDiv = new FoldaWayDiv();
		foldWayDiv.elementDiv = eleDiv;
		foldWayDiv.openHeight();
		getElementById(divId).isOpen = true;
		
		var flyoutIds = ['divJoinPage','divLoginPage','divSearchPage'];
		for (var index = 0; index < flyoutIds.length;index++){
			if (divId != flyoutIds[index] && getElementById(divId).isOpen != null && getElementById(divId).isOpen == true){
				if (getElementById(flyoutIds[index]) != null)
					closeInsetHeaderPage(flyoutIds[index]);
			}
		}
	}
	
	function closeInsetHeaderPage(divId){
		var eleDiv = document.getElementById(divId);
		var foldWayDiv = new FoldaWayDiv();
		foldWayDiv.elementDiv = eleDiv;
		foldWayDiv.closeHeight();
		getElementById(divId).isOpen = false;
	}
	
	function validateRegForm(){
		var validateEmpty = getElementById("validateControlEmpty").value;
		var validateEMail = getElementById("validateEMail").value;
		var txtEmail = getElementById("regEmail");
		var txtAlias = getElementById("regAlias");
		if(!validateControlEmptyWithMsg(txtEmail, getElementById("rbRegEmail").value,validateEmpty)) return false;
		if(!validateEmailWithMsg(txtEmail, getElementById("rbRegEmail").value,validateEMail)) return false;
		if(!validateControlEmptyWithMsg(txtAlias, getElementById("rbAlias").value,validateEmpty)) return false;
		
		//if(getElementById("checkAgreement").checked != true){
			//alert('<fmt:message key="userReg.checkAgreement" bundle="${usis}"/>');
			//return false;
		//}
		return true;
	}
	
	function register(){
		if(!validateRegForm()) return false;
		formJoin.action="userRegSave.do?regEmail="+encodeURIComponent(getElementById("regEmail").value)+"&alias="+encodeURIComponent(getElementById("regAlias").value);
		formJoin.submit();
		return true;
	}
