<!--
	function getTagValueByName__(tagName,fileurl){
		try{
			{
				if (window.ActiveXObject){
					var source = new ActiveXObject("Microsoft.XMLDOM");
				}else{
					if (document.implementation && document.implementation.createDocument){
						var source = document.implementation.createDocument("","",null);
					}
				}
				var sourceName=fileurl;
				source.async=false;
				source.load(sourceName);
				var root=source.documentElement;
				return root.getElementsByTagName(tagName)[0].firstChild.nodeValue;
			}
		}catch(e){
			alert(e.message);
		}
	}
	var hosturl = "";
	for(var i=0;i<location.pathname.split('/').length-2;i++){
		hosturl += "../";
	}
  var isSubmit=false;
  var timer;
  /**
  *
  */
  function clickSubmit(){
    if (!isSubmit && timer==null){
      isSubmit=true;
      timer=setTimeout("clearTime()",5000);
      return true;
    }else{
      return false;
    }
  }
  /**
  * 
  */
  function clearTime(){
   isSubmit=false;
   clearTimeout(timer);
   timer=null;
  }
  /**
  *
  */
  function onSubmit(formName){
    if (clickSubmit()){
    	document.forms[formName].submit();
    }
  }
  /**
  *
  */
  function onSubmitWithAction(formName,actionValue){ 
    if (clickSubmit()){
      document.forms[formName].action = actionValue;
      document.forms[formName].submit();
    }
  }
  /**
  * 
  */
  function analyzeUrl(actionValue){
     	//var url = document.location.href;
     	var url = document.location.href;      	
     	//part 1 of url   	
     	var section1;
     	//part 2 of url  
     	var section2;
     	//part 3 of url  
	 	var section3;
	 	//var https = "https://";
	 	if(getTagValueByName__("ssl_switch",hosturl+"js/common/config.xml") == "on"){
			var https = "https://";
		}else{
			var https = "http://";
		}
	 	//var https = "http://";
     	//find index of "/" in url
     	var indexOfUrl = url.indexOf("/");     	
     	//find index of "/" in action
     	var indexOfAction = actionValue.indexOf("/");
     	try{
	     	//"http://"
	     	section1 = url.substring(0,url.indexOf("/",indexOfUrl + 1)+1);
	     	//host name of the url    	
	     	section2 = url.substring(url.indexOf("/",indexOfUrl + 1)+1,url.indexOf("/",indexOfUrl + 2));
	     	//file path of the url
	     	section3 = url.substring(url.indexOf("/",indexOfUrl + 2),url.lastIndexOf("/")+1);
	     	if(indexOfAction == 0){
	     		return(https + section2 + actionValue); //if the index of "/" in action is 0,then return without section3
	     	}else{
	     		return(https + section2 + section3 + actionValue); //if the index of "/" in action is not 0,then return with section3
	     	}	
     	}catch (e){
			alert(e.toString());
		}    	
  }
  /**
  * When the form submit ,change to SSL.
  */
  function onSubmitChangeToSSL(formName){
    //var url = document.location.href;      		
	var action = document.forms[formName].action;
	//alert(action);
	var indexOfUrl = action.indexOf("/");  
	var action_processed = "";
			
	if(action.indexOf(":")!=-1){
		action_processed = action.substr(action.indexOf("/",indexOfUrl + 2));
	}else{
		action_processed = action;
	}
	
  	//result which analyzeUrl returned.
  	var formAction = analyzeUrl(action_processed);
  	//alert("action:   "+formAction);
  	document.forms[formName].action = formAction;
  	//alert(formAction);  	
    if (clickSubmit()){
      document.forms[formName].submit();
    }
  }
  
  /**
  * When the form submit ,change to SSL.
  */
  function onSubmitWithActionChangeToSSL(formName,actionValue){
  	//result which analyzeUrl returned.
  	var formAction = analyzeUrl(actionValue);
  	document.forms[formName].action = formAction;
  	//alert(formAction);  	
    if (clickSubmit()){
      document.forms[formName].submit();
    }
  }
  /**
  * The object of request
  * The getParameterByName is function which get the parameter from the URL by name
  */
  function request(){
	this.url = location.search;
	this.getParameterByName = function (val){
		var re = new RegExp("" +val+ "=([^&?]*)", "ig");
		var param = new Array();
		var urlmatch = this.url.match(re);	
		if(urlmatch){
		    for (var i = 0; i < urlmatch.length;i++){		    
				param[i] = urlmatch[i].substr(val.length+1);
			}
		}else{
			param =null;
		}
		return param;		
	}
  }
  /**
  * 
  * 
  */
  var layerNum=2;
	function getUrlPath(layerNum){
		var url=location.pathname;
		var urlElements=url.split('/');
		var urlReturn='';
		for(var i=0;i<=layerNum&&i<urlElements.length;i++){
			urlReturn+=urlElements[i]+'/';
		}
		return urlReturn;
	}
	  
	
	function getParentUrlPath(layerNum){
		var url=parent.location.pathname;
		var urlElements=url.split('/');
		var urlReturn='';
		for(var i=0;i<=layerNum&&i<urlElements.length;i++){
			urlReturn+=urlElements[i]+'/';
		}
		return urlReturn;
	}
	var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
	//extra height in px to add to iframe in FireFox 1.0+ browsers  
	var FFextraHeight=getFFVersion>=0.1? 16 : 0 ;
	function dyniframesize(iframename) {
	  var pTar = null; 
	  if (document.getElementById){   
	    pTar = document.getElementById(iframename); 
	  } 
	  else{
	    eval('pTar = ' + iframename + ';');
	  }	
	  if (pTar && !window.opera){
	    if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
	      //ns6 syntax
	      pTar.height = pTar.contentDocument.body.offsetHeight + FFextraHeight;
	    } 
	    else if (pTar.Document && pTar.Document.body.scrollHeight){
	      //ie5+ syntax 
	      pTar.height = pTar.Document.body.scrollHeight + 5;
	    }
	  }
	}
	
	function dynSizeInFrame(iframename) { 
	  var pTar = null;
	  if (document.getElementById){   
	    pTar = parent.document.getElementById(iframename);  
	  }else{
	    eval('pTar = ' + iframename + ';');  
	  }
	  if (pTar && !window.opera){     	  
	    if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
	      //ns6 syntax
	      pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight;  
	    }
	    else if (pTar.Document && pTar.Document.body.scrollHeight){
	      //ie5+ syntax
	      pTar.height = pTar.Document.body.scrollHeight; 
	    }
	  }
	}
	function findCarshape(carshape,type){
		switch(parseInt(type)){
			//be used in homepage or search index page or Atype shop page.
			case 1:
				location.href="/buy/carshape/"+carshape+"/searchList.html";
				break;
			//be used in Btype shop page.
			case 2:
				location.href = getUrlPath(layerNum)+"shopframe.html?carshape="+carshape+"&showType=0";
				break;
			default:
				location.href="/index.html";		
		}	
	}
	function goToSearchList(formName){
		var maker_code=document.forms[formName].maker.value;
		var syamei_code=document.forms[formName].type.value;
		if(maker_code==""&&syamei_code==""){
			location.href="/buy/searchList.php";
		}else if(maker_code!=""&&syamei_code==""){
			location.href="/buy/"+maker_code+"/searchList.html?showChance=-1";
		}else if(syamei_code!=""){
			location.href="/buy/"+maker_code+"/"+syamei_code+"/searchList.html?showChance=-1";
		}
	}
	//judge whether the browser is IE
	function isIE(){
	if(document.attachEvent) return true;
	else return false;
	}
-->