//js function ,hidden or show story
function showStory(){
	if (document.getElementById("story").style.display == "") {
		document.getElementById("story").style.display = "none" ;
	}  else {
		document.getElementById("story").style.display = "";
	}
}
//set visit cookie 
var rq_visitcookie ; 
function setVisitCookie(storeId) {
	rq_promotion = new RemoteRequest("/common/lastvisit.html?type=store&id="+storeId, visitCookieCallback);
}
function  visitCookieCallback() {

}
//xml http request , show the extentsearch info , edit by phantom
var rq_extentsearch ; 
function showExtentSearch(storeId,city,categoryId,posx,posy) {	
	var url = "/store/include/ExtentSearch.html?storeId="+storeId+"&city="+city+"&categoryId="+categoryId+"&posx="+posx+"&posy="+posy;
	rq_extentsearch = new RemoteRequest(url, setExtentSearchContent);
}
function showFangExtentSearch(city,mapCoordinate,DistrictName) {
	if(mapCoordinate == null || mapCoordinate.length < 5){
		return;
	}else{
		var mapPos = mapCoordinate.split(',');
		if(mapPos.length<3){
			return;
		}else{
			if(mapPos[0]!="" && mapPos[0]!="0"){
				showDistrictExtentSearch("",city,"",mapPos[0],mapPos[1],DistrictName);
			}else{
				return;
			}
		}
	}
}
//call back
function setExtentSearchContent() {
	try {
		if(rq_extentsearch.page_currentxmlhttpobject.readyState == 4){
			var response_text = rq_extentsearch.page_currentxmlhttpobject.responseText ;
			if (response_text!=null && response_text.length>1)
				document.getElementById("store_extentsearch_list").innerHTML = rq_extentsearch.page_currentxmlhttpobject.responseText;
			rq_extentsearch = null ; 
		}
	}catch(e) {}
}

//xml http request , show the fangextentsearch info , edit by phantom
var rq_fangextentsearch ; 
function showDistrictExtentSearch(storeId,city,categoryId,posx,posy,DistrictName) {	
	var url = "/store/include/FangExtentSearch.html?storeId="+storeId+"&city="+city+"&categoryId="+categoryId+"&posx="+posx+"&posy="+posy+"&DistrictName="+DistrictName;
	rq_fangextentsearch = new RemoteRequest(url, setFangExtentSearchContent);
}
//call back
function setFangExtentSearchContent() {
	try {
		if(rq_fangextentsearch.page_currentxmlhttpobject.readyState == 4){
			document.getElementById("fang_extentsearch_list").innerHTML = rq_fangextentsearch.page_currentxmlhttpobject.responseText;
		}
	}catch(e) {}
}

//xml http request , show the visitedstore list , edit by phantom
var rq_visitedstore ; 
function showVisitedStore(pageNo,username,city,totalcount) {	
	var url = "/profile/visitedstorelist.html?username="+username+"&city="+city+"&totalcount="+totalcount+"&pageNo="+pageNo;
	rq_visitedstore = new RemoteRequest(url, setVisitedStoreContent);
}
//call back
function setVisitedStoreContent() {
	try {
		if(rq_visitedstore.page_currentxmlhttpobject.readyState == 4){
			document.getElementById("visitedstore_list").innerHTML = rq_visitedstore.page_currentxmlhttpobject.responseText;
			document.getElementById("centerimg").innerHTML="";
		}
	}catch(e) {}
}

//xml http request , show the wantedstore list , edit by phantom 061113
var rq_wantedstore ; 
function showWantedStore(pageNo,username,city,totalcount) {	
	var url = "/profile/wantedstorelist.html?username="+username+"&city="+city+"&totalcount="+totalcount+"&pageNo="+pageNo;
	rq_wantedstore = new RemoteRequest(url, setWantedStoreContent);
}
//call back
function setWantedStoreContent() {
	try {
		if(rq_wantedstore.page_currentxmlhttpobject.readyState == 4){
			document.getElementById("wantedstore_list").innerHTML = rq_wantedstore.page_currentxmlhttpobject.responseText;
			document.getElementById("centerimg").innerHTML="";
		}
	}catch(e) {}
}

//xml http request , show the operatepos list , edit by phantom 070201
var rq_operatepos ; 
function showOperatePos(pageNo,userid,city,totalcount) {	
	var url = "/profile/operateposlist.html?userId="+userid+"&city="+city+"&totalcount="+totalcount+"&pageNo="+pageNo;
	rq_operatepos = new RemoteRequest(url, setOperatePosContent);
}
//call back
function setOperatePosContent() {
	try {
		if(rq_operatepos.page_currentxmlhttpobject.readyState == 4){
			document.getElementById("operatepos_list").innerHTML = rq_operatepos.page_currentxmlhttpobject.responseText;
			document.getElementById("centerimg").innerHTML="";
		}
	}catch(e) {}
}

//xml http request , show map in the profile , edit by phantom
var rq_profileshowmap ; 
function showProfileMap(storeId) {	
	var url = "/profile/ShowMapAction.html?storeId="+storeId;
	rq_profileshowmap = new RemoteRequest(url, setProfileMapContent);
}
//call back
function setProfileMapContent() {
	try {
		if(rq_profileshowmap.page_currentxmlhttpobject.readyState == 4){
			document.getElementById("show_map").innerHTML = rq_profileshowmap.page_currentxmlhttpobject.responseText;
			//document.getElementById("city_name").innerHTML = "<ww:property value='store.city' />" ;
		}

	}catch(e) {	}
}

//xml http request , show the promotion info
var rq_prom ; 
function showPromotion(storeId) {	
	var url = "/store/include/storedetailadlist.html?storeid="+storeId;
	rq_prom = null;
	rq_prom = new RemoteRequest(url, setPromotionContent);
}

function showAllPromotion(storeId){
    var url = "/store/include/storedetailadlist.html?allinfo=1&storeid="+storeId;
    rq_prom = null;
	rq_prom = new RemoteRequest(url, setPromotionContent);
}
//call back
function setPromotionContent() {
	try {
		if(rq_prom.page_currentxmlhttpobject.readyState == 4){
			document.getElementById("promotion").innerHTML = rq_prom.page_currentxmlhttpobject.responseText;
			rq_prom = null;
		}
	}catch(e) {}
}
//xml http request ,show the sub store list
var rq_substore ; 
function showSubStoreList(city,storeId) {
	rq_substore = new RemoteRequest("/store/include/substorelist.html?city="+city+"&storeId="+storeId, setSubStoreListContent);
}

function showAllSubStoreList(city,storeId){
   rq_substore = new RemoteRequest("/store/include/substorelist.html?allSub=1&city="+city+"&storeId="+storeId, setSubStoreListContent);
}
function setSubStoreListContent(data) {
	try {
  		if(rq_substore.page_currentxmlhttpobject.readyState == 4){
   			document.getElementById("substorelist").innerHTML =rq_substore.page_currentxmlhttpobject.responseText;
		}
	}catch(e) {}
}
function showAllFoodList(storeId,city){
   rq_substore = null;
   rq_substore = new RemoteRequest("/store/include/allfoodlist.html?storeId="+storeId+"&city="+city, setFoodListContent);
}
function setFoodListContent(data){
   try {
  		if(rq_substore.page_currentxmlhttpobject.readyState == 4){
   			document.getElementById("allfootlist").innerHTML =rq_substore.page_currentxmlhttpobject.responseText;
   			rq_substore= null;
		}
	}catch(e) {}

}
//xml http request ,show first appraisement user 
var rq_firstappriasement ; 
function showFirstAppraisementUser(storeId) {
	rq_firstappriasement = new RemoteRequest("/store/include/firstappraisementuser.html?storeId="+storeId, setFirstAppraisementUser);
} 
function setFirstAppraisementUser() {
	try {
  		if(rq_firstappriasement.page_currentxmlhttpobject.readyState == 4){
   			document.getElementById("firstappraisementuser").innerHTML =rq_firstappriasement.page_currentxmlhttpobject.responseText;
		}
	}catch(e) {}
}

//show or hidden appraisement contend
function  showOrHiddenAppraisementContend() {
	if (document.getElementById("appraisementcontend").style.display == "") {
		document.getElementById("appraisementcontend").style.display = "none" ; 
		document.getElementById("maxmin").src = "/images/store/pic_dp_menu_max.gif"; 
	}
	else {	
		document.getElementById("appraisementcontend").style.display = "" ; 
		document.getElementById("maxmin").src = "/images/store/pic_dp_menu_min.gif"; 
	}
}
