	var rq_appraisementlist ; 
	var appraisementlist_url ;

	//show video cut photo
	function ShowCutPhotoTable(table_id){
	   try{
	     table_obj=document.getElementById(table_id);
	     table_obj.style.display="block";
	   }catch(ex){
	   }	   
	}	
    function showCutPhotoTables(){
       try{
           var appraisementids=document.getElementById("appraisementIDS");
	       ids=appraisementids.innerText;
	       if (ids!=""){
	           arr_id=ids.split(",");
	           for (i=0;i<arr_id.length-1;i++){  
	             ShowCutPhotoTable("table_"+arr_id[i])
	           }
       		}
       }catch(e){
       }
     
    } 
    	
	//xml http request ,show the appraisement list
	function showAppraisementList(city,storeId,iscate) {
		if (iscate ==1) {
			appraisementlist_url = "/store/include/cateappraisementpagerlist.html?city="+city+"&storeId="+storeId;
		}	
		else {
			appraisementlist_url = "/store/include/appraisementpagerlist.html?city="+city+"&storeId="+storeId;
		}	
		rq_appraisementlist = new RemoteRequest(appraisementlist_url, setAppraisementList);	
	}
	function setAppraisementList() {
		document.getElementById("appraisementinfo").innerHTML = "<img src=\"/images/common/icon/icon_loading.gif\" />" ;
		try {
			var state = rq_appraisementlist.page_currentxmlhttpobject.readyState;
			if(state == 4){
				document.getElementById("appraisementinfo").innerHTML = rq_appraisementlist.page_currentxmlhttpobject.responseText;
				showCutPhotoTables();
				/*
				if(post_success == 1){
				  popdialog.openWithIframe('','/cate/activity/appraisementprompt.html?city='+post_city,550,250);
				  post_success = 0;
				}
				*/
				
			}
		}catch(e) {}
	}
	function showApprisementFormFromQuestion(city,storeId,iscate) {
		if (iscate == 1) {
			showCateAppraisementForm(city,storeId);
		} else {
			showAppraisementForm(city,storeId);		
		}
	}
	//appraisement pagination callback 
	function pagination(pageNo,url) {
	    document.getElementById("appraisementinfo").innerHTML = "<img src=\"/images/common/icon/icon_loading.gif\" />" ;
		rq_appraisementlist = new RemoteRequest(url+"&pageNo="+pageNo, setAppraisementList);		
	}
	//xml http request , get the channel question list
	var rq_channelquestion ; 
	var question_url ;
	function showChannelQuestionList(storeId,city) {
		document.getElementById("appraisementform").innerHTML = "" ;
		question_url = "/store/include/storequestionlist.html?storeId="+storeId+"&city="+city ;
		document.getElementById("appraisementinfo").innerHTML = "<img src=\"/images/common/icon/icon_loading.gif\" />";
		rq_channelquestion= new RemoteRequest(question_url, setChannelQuestionList);
	}	
	function setChannelQuestionList() {
		try {
			var state = rq_channelquestion.page_currentxmlhttpobject.readyState;
			if(state == 4){
				document.getElementById("appraisementinfo").innerHTML = rq_channelquestion.page_currentxmlhttpobject.responseText;
				 showCutPhotoTables();  
			}
		}catch(e) {}
	}
	//xml http post ,post the question
	var rq_postquestion ;
	var question_params ;
	function postChannelQuestion() {
	    question_params = "question.adid=" + document.getElementById("question_infoid").value ; 
	    question_params +="&city=" + document.getElementById("city").value;
		question_params = question_params + "&question.type=0&question.parentid=0";
		var detail = document.getElementById("question_detail").value;
		var username = ""; 
		try {
			username = document.getElementById("autologin_username").value ; 
		} catch(e){}
		var temp = new Array(username,detail);
		try {			
			var password = document.getElementById("autologin_password").value ; 
				question_params = question_params + "&autologin_password=" + password ;		
		} catch(e)	{}
		JWebContentBean.URLEncodeArray(afterPostChannelQuestion, temp);
	}
	function afterPostChannelQuestion(data) {
		if(data[0] && data[0]!="")
			question_params += "&autologin_username="+data[0];
		if(data[1] && data[1]!="")
			question_params += "&question.detail="+data[1];
		rq_postquestion = new RemoteRequest("/store/include/poststorequestion.html", postquestioncallback, true, "POST", question_params);
	}
	function postquestioncallback() {
		 
		try {
			var state = rq_postquestion.page_currentxmlhttpobject.readyState;
			
			if(state == 4){
				document.getElementById("appraisementinfo").innerHTML = rq_postquestion.page_currentxmlhttpobject.responseText;
				showCutPhotoTables();  
			}
		}catch(e) {}	
	}
	//xml http request ,question pagination
	function  questionpagination(pageNo,url) {
		document.getElementById("appraisementinfo").innerHTML = "<span class='red'>数据加载中...</span>" ;
		rq_channelquestion = new RemoteRequest(url+"&pageNo="+pageNo, setChannelQuestionList);
	}
	//xml http post ,post answer
	var postanswer_params ; 
	function postanswer(infoid,parentid,detail) {
		if (detail == "" || detail.length < 5 || detail.length > 1000)  {
			alert("你的回应内容必须在5至1000字之间!");			
			return ;
		}
		postanswer_params = "question.adid=" + infoid ; 
		postanswer_params = postanswer_params + "&question.type=1&question.parentid="+parentid;

		JWebContentBean.URLEncode(afterpostanswer, detail);

	}
	function afterpostanswer(data) {
		postanswer_params += "&question.detail="+data;
		rq_postquestion = new RemoteRequest("/store/include/poststorequestion.html", postquestioncallback, true, "POST", postanswer_params);
	    
	}
	//////////////////////////////////////////////
	var rq_appraisementjudge; 
    var appraisementjudge_appid; 
    var appraisementjudge_type; 
    
    function operatorappraisementjudge(appraisementid,appraisementjudgetype)
    {
        appraisementjudge_appid = appraisementid;
        appraisementjudge_type = appraisementjudgetype;
        var url = "/store/include/appraisementJudge.html?appraisementId=" + appraisementjudge_appid + "&type=" + appraisementjudge_type;
        rq_appraisementjudge = new RemoteRequest(url,afteroperatorappraisementjudg);	
    }
    
	function operatorfooddeityleveljudge(appraisementid,appraisementjudgetype,city)
	{
	    appraisementjudge_appid = appraisementid;
        appraisementjudge_type = appraisementjudgetype;
        var url = "/store/include/judgeoperator.html?appraisementId=" + appraisementjudge_appid + "&type=" + appraisementjudge_type + "&city=" + city;
	    
	}
	
	
	function afteroperatorappraisementjudg()
	{
	   try {
			var state = rq_appraisementjudge.page_currentxmlhttpobject.readyState;
			if(state == 4){
				document.getElementById(appraisementjudge_appid + "_" + appraisementjudge_type).innerHTML = rq_appraisementjudge.page_currentxmlhttpobject.responseText;
			}
		}catch(e) {
		
		 
		}
	}