﻿var TEMP = 0;
var CART = 1;

function doHome() {
	locate("../site/index.jsp");
}

function doLogin() {
	loginForm.submit();
}

function doRegister() {
	locate("../member/register.jsp");
}

function doRetrieve() {
	locate("../site/retrieve.jsp");
}

function doLogout() {
	locate("../common/logout.jsp");
}

function doGoLogin() {
	locate("../member/login.jsp");
}

function doGoMemberIndex() {
	locate("../member/index.jsp");
}

function doGoMemberLogin() {
	locate("../member/login.jsp");
}

function doGoMemberPassword() {
	locate("../member/member_password.jsp");
}

function doSearch() {
	locate("../product/index.jsp?" + param("cid") + param("key") + param("special") + param("gift"));
}

function doSearchAd() {
	locate("../product/index.jsp?" + param("cid") + param("kw", "key") + param("special") + param("gift") + param("title") + param("author") + param("vendor") + param("uid") + param("pattern"));
}

function doAddFriend(id) {
	noFunc();
}

function doAddFavorite(id) {
	openwin("../member/favorite_.jsp?id=" + id);
}

function doDeleteFavorite(id) {
	locate("../member/favorite_.jsp?8&id=" + id);
}

function doCart() {
	locate("../product/cart.jsp");
}

function doAddCart(id) {
	obj("info1").style.display = "none";
	obj("info2").style.display = "";
	send("../store/cart_.jsp?id=" + id + "&st=" + CART + "&qty=" + encode(value("qty" + id, "+"))+"&storeId="+ encode(value("storeId", "+")) +"&groupId="+ encode(value("groupId", "+")) + "&tagName="+ encode(value("productType", "+")) + "&require="+ encode(value("require", "+")) + "&shippingId="+ value("shippingId") + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+"))+"&noCnt=1&addOne=addOne","");
	var a = encode(value("storeId", "+"));
	var b = value("shippingId");
	setTimeout(function(){doCartAj(a,b)},500);
	//doCartAj(encode(value("storeId", "+")), value("shippingId"));
	//location.href=("../store/cart_.jsp?id=" + id + "&st=" + CART + "&qty=" + encode(value("qty" + id, "+"))+"&storeId="+ encode(value("storeId", "+")) +"&groupId="+ encode(value("groupId", "+")) + "&tagName="+ encode(value("productType", "+")) + "&require="+ encode(value("require", "+")) + "&shippingId="+ value("shippingId") + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+"))+"&noCnt=1&addOne=addOne" );
}

function doBuyAtOnce(id) {
	openwin("../product/cart_.jsp?id=" + id + "&st=" + CART + params("qty") + "&auto=" + true);
}

function doBuyTogether(ids) {
	var qtys = ""; for (var i = 0; i < ids.split(",").length; i++) qtys += "&qty=" + encode(value("qtys", "+"));
	openwin("../product/cart_.jsp?id=" + ids + "&st=" + CART + qtys);
}


function doMoveCart(id) {
	locate("../product/cart_.jsp?id=" + id + "&st=" + CART);
}

function doMoveTemp(id) {
	locate("../product/cart_.jsp?id=" + id + "&st=" + TEMP);
}

function doDeleteItem(id, groupId) {
	obj("info1").style.display = "none";
	obj("info2").style.display = "";
	send("../store/cart_.jsp?id=" + id + "&qty=" + 0 +"&storeId="+ encode(value("storeId", "+"))+ "&tagName="+ encode(value("productType", "+")) + "&groupId=" + groupId + "&require="+ encode(value("require", "+")) + "&shippingId="+ encode(value("shippingId", "+")) + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+")),"");
	doCartAj(encode(value("storeId", "+")), encode(value("shippingId", "+")));
	//locate("../store/cart_.jsp?id=" + id + "&qty=" + 0 +"&storeId="+ encode(value("storeId", "+"))+ "&tagName="+ encode(value("productType", "+")) + "&groupId=" + groupId + "&require="+ encode(value("require", "+")) + "&shippingId="+ encode(value("shippingId", "+")) + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+")));
}

function doClearItem() {
	obj("info1").style.display = "none";
	obj("info2").style.display = "";
	send("../store/cart_.jsp?clear=" + true+"&qty=" + 0 +"&storeId="+ encode(value("storeId", "+"))+ "&tagName="+ encode(value("productType", "+")) + "&shippingId="+ encode(value("shippingId", "+")) + "&distance="+ value("distance"),"");
	doCartAj(encode(value("storeId", "+")), encode(value("shippingId", "+")));
	//locate("../store/cart_.jsp?clear=" + true+"&qty=" + 0 +"&storeId="+ encode(value("storeId", "+"))+ "&tagName="+ encode(value("productType", "+")) + "&shippingId="+ encode(value("shippingId", "+")) + "&distance="+ value("distance"));
}

function doSaveCart() {
	locate("../product/cart_.jsp?" + params("id") + params("qty"));
}

function doAmendCart(id, groupId) {
	obj("info1").style.display = "none";
	obj("info2").style.display = "";
	send("../store/cart_.jsp?id=" + id + "&st=" + CART + "&qty=" + encode(value("qtyAmend" + id+"_"+groupId, "+"))+"&storeId="+ encode(value("storeId", "+")) +"&groupId="+ groupId + "&tagName="+ encode(value("productType", "+")) + "&require="+ encode(value("require", "+")) + "&shippingId="+ encode(value("shippingId", "+")) + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+"))+"&noCnt=1&addOne=noAddOne","");
	doCartAj(encode(value("storeId", "+")), encode(value("shippingId", "+")));
	//locate("../store/cart_.jsp?id=" + id + "&st=" + CART + "&qty=" + encode(value("qtyAmend" + id+"_"+groupId, "+"))+"&storeId="+ encode(value("storeId", "+")) +"&groupId="+ groupId + "&tagName="+ encode(value("productType", "+")) + "&require="+ encode(value("require", "+")) + "&shippingId="+ encode(value("shippingId", "+")) + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+"))+"&noCnt=1&addOne=noAddOne" );
}

function doContinue() {
	locate("../site/index.jsp");
}

function doCheckout() {
	locate("../order/index.jsp?storeId="+ encode(value("storeId", "+")) + "&require="+ encode(value("require", "+")) + "&shippingId="+ encode(value("shippingId", "+"))+ "&distance="+ encode(value("distance", "+"))+ "&eatcount="+ encode(value("eatcount", "+"))+ "&small_charge="+ encode(value("small_charge", "+")));
}

function doAutoForm() {
	locate("../order/autoform.jsp");
}

function doSelectShipping(id) {
	submit("../order/order_.jsp?url=shipping", null, id);
}

function doModifyShipping() {
	openwin("../member/shipping.jsp");
}

function doShipping() {
	var tmp = document.getElementById("order").send;
		var bChecked = false;
		vl = "";
		for (var j = 0; j < tmp.length; j++) {
			if (tmp[j].checked) {
				bChecked = true;
				vl = tmp[j].value;
			}
		}
	if(isEmpty(value("hourSelecte"))) {alert("对不起，超过营业时间范围。");return;}
	if(vl == 1) submit("../order/order_.jsp?url=shipping&shippingTime=" + "sendNow", "", "order");
	if(vl == 2)
	submit("../order/order_.jsp?url=shipping&shippingTime=" + encode(value("hourSelecte", "+"))+":"+encode(value("minSelecte", "+")), "", "order");
}

function doWrapper() {
	submit("../order/order_.jsp?url=wrapper", "", "order");
}

function doPayment() {
	submit("../order/order_.jsp?url=payment", "", "order");
}


function doConfirm() {
	submit("../order/order_.jsp?url=confirm", "", "order");
}

function doSubmit(bStoreDistance,bShipping,bTime) {
	submit("../order/submit_.jsp?bStoreDistance=" + bStoreDistance + "&bShipping=" +bShipping + "&bTime=" +bTime);
}

function doIPS(id) {
	openwin("../order/ips_.jsp?id=" + id, null, "scrollbars=yes,resizable=yes,status=yes,toolbar=no");
}

function doIPSMember(id) {
	openwin("../member/ips_.jsp?id=" + id, null, "scrollbars=yes,resizable=yes,status=yes,toolbar=no");
}

function doAccount() {
	locate("../member/index.jsp");
}

function doSavePassword() {
	submit("../member/password_.jsp");
}

function doSaveProfile() {
	submit("../member/profile_.jsp");
}

function doNewShipping() {
	locate("../member/shipping.jsp?5#1");
}

function doEditShipping(id) {
	locate("../member/shipping.jsp?6&id=" + id+"#1");
}

function doSaveShipping(id) {
	submit("../member/shipping_.jsp?7&id=" + id, "", "shipping");
}

function doDeleteShipping(id) {
	locate("../member/shipping_.jsp?8&id=" + id);
}

function doSubmitMember(action) {
	submit("../member/submit_.jsp?" + action);
}

function doCancelOrder(action, id) {
	locate("../member/order_.jsp?" + action + "&id=" + id);
}

function doCancelMember(id) {
	locate("../member/member_.jsp?&id=" + id);
}


function doCheckQty(src, id) {
	if (src.checked) enable("qty" + id);
	else disable("qty" + id);
}

function noFunc() {
	alert(ilan==0?"该版本无次功能!":"No this feature for this edition!");
}

function doSwitchLan() {
	obj("switchLan").click();
}


function doOrder() {
	if (!doCheck()) {
		return;
	}
	submit("../order/chinapay_.jsp");
}

/*function doSubmit(paywayId) {
	if (!doCheck()) {
		return;
	}
	obj("payway_id").value = paywayId;
	submit("../order/order_submit.jsp", "_self", obj("confirmForm"));
}*/


function doSelectGiftShipping(id) {
	submit("../order/gift_shipping.jsp?shippingId=" + id);
}


function doGiftShipping() {
	submit("../order/gift_shipping.jsp");
}

function doGiftConfirm() {
	submit("../order/gift_confirm.jsp", "_self", obj("shippingForm"));
}

function doGiftSubmit() {
	submit("../order/gift_submit.jsp");
}


function doSearchStoreList(type) {
	var tmp = document.getElementById("matchingRoadForm").matchingRoadId;
	var mapx = document.getElementById("mapx").value;
	var mapy = document.getElementById("mapy").value;
	var strSearchName = document.getElementById("strSearchName").value;
	var bChecked = false;
	vl = "";
	for (var j = 0; j < tmp.length; j++) {
		if (tmp[j].checked) {
			bChecked = true;
			vl = tmp[j].value;
		}
	}
	if(type == 0)
	locate("../store/store_list.jsp?shippingId="+ vl + "&distance=" + encode(value("distance", "+")) + "&storeTypeId=" + encode(value("storeTypeId", "+")) + "&setDefault=1" + "&strSearchName=" + strSearchName + "&mapx=" + mapx + "&mapy=" + mapy + "&search_type=0");
	if(type == 1)
	locate("../store/product_list.jsp?shippingId="+ vl + "&distance=" + encode(value("distance", "+")) + "&storeTypeId=" + encode(value("storeTypeId", "+")) + "&setDefault=1" + "&strSearchName=" + strSearchName + "&mapx=" + mapx + "&mapy=" + mapy + "&search_type=1");

}

function doHasten(orderId) {
	if (!confirm("是否确认催送订单？")) {
		return;
	}
	obj("order_id_hasten").value = orderId;
	orderForm.submit();
}

function doCancel(orderId) {
	if (!confirm("是否确认取消订单？")) {
		return;
	}
	obj("order_id_cancel").value = orderId;
	orderForm.submit();
}

function doSetDefault(id,id_) {
	locate("../member/shipping_.jsp?9&id=" + id + "&user_id=" + id_);
}

function doGoBack(shopId, shippingId, distance, mapx, mapy, strSearchName){
	locate("../store/store_product.jsp?shopId=" + shopId + "&shippingId=" + shippingId + "&distance=" + distance + "&mapx=" + mapx + "&mapy=" + mapy + "&strSearchName=" + strSearchName);
}

function doDeleteSms() {
	smsForm.submit();
}

//Anonymous edition
function doSuggestion(strSearchName){
	//obj("suggest").style.display = "none";
	if(strSearchName.length<=1) {
	obj("suggest").style.display = "none";
	return;
	}
	send("../site/search_words.jsp?strSearchName=" + encode(strSearchName), "resSuggestion");
}

function resSuggestion(res) {//alert(res);
	if(res==-1) {obj("suggest").style.display = "none"; return;}
	html("suggest", res);
	obj("suggest").style.display = "block";
}

function ls(i){
	document.getElementById("tbSearch").value = document.getElementById("s"+i).innerHTML;
	obj("suggest").style.display = "none";
}

function ls2(i){
	document.getElementById("tbSearch2").value = document.getElementById("s"+i).innerHTML;
	obj("suggest").style.display = "none";
}

function ls3(i){
	document.getElementById("tbSearch3").value = document.getElementById("s"+i).innerHTML;
	obj("suggest").style.display = "none";
}


function hideSuggestion(){
	obj("suggest").style.display = "none";
}

function dowbsearch(){
	if(document.getElementById("tbSearch").value == "" || document.getElementById("tbSearch").value == "如：大厦、大楼、小区、交叉路口等")
	{
		alert('想搜索什么呢？');
		return;
	}
	document.getElementById("searchword").action = "../member/area_choose_a.jsp";
	document.getElementById("searchword").submit();
}

function dowbsearch2(){
	if(document.getElementById("tbSearch2").value == "" || document.getElementById("tbSearch2").value == "如：大厦、大楼、小区、交叉路口等")
	{
		alert('想搜索什么呢？');
		return;
	}
	document.getElementById("searchword").action = "../member/area_choose_a.jsp";
	document.getElementById("searchword").submit();
}

function dowbsearch3(){
	if(document.getElementById("tbSearch3").value == "" || document.getElementById("tbSearch3").value == "如：大厦、大楼、小区、交叉路口等")
	{
		alert('想搜索什么呢？');
		return;
	}
	//document.getElementById("searchword").action = "../member/area_choose_a.jsp";
	//document.getElementById("searchword").submit();
	var kw = document.getElementById("tbSearch3").value;
	submit("../member/shipping_step3.jsp?5&kw="+ encode(kw));
}

function doSearchWord(kw, mapx, mapy){
	locate("../member/area_choose_a.jsp?kw="+ encode(kw) + "&mapx=" + mapx +"&mapy=" + mapy);
}

function doASearchStoreList(kw, mapx, mapy, type, storeTypeId) {//alert(kw);
	locate("../member/area_choose_a.jsp?kw="+ encode(kw) + "&mapx=" + mapx +"&mapy=" + mapy+"&search_type=" + type +"&storeTypeId=" + storeTypeId);
}

function doACheckout() {
	locate("../order/index.jsp?storeId="+ encode(value("storeId", "+")) + "&require="+ encode(value("require", "+"))+ "&distance="+ encode(value("distance", "+"))+ "&eatcount="+ encode(value("eatcount", "+"))+ "&mapx="+ encode(value("mapx", "+"))+ "&mapy="+ encode(value("mapy", "+"))+ "&small_charge="+ encode(value("small_charge", "+"))+ "&strSearchName="+ encode(value("strSearchName", "+")));
}

function doAShipping() {
	if(isEmpty(document.getElementById("shipping_address").value)) {alert("送货地址不能为空");return;}
	if(isEmpty(document.getElementById("full_name").value)) {alert("联系人不能为空");return;}
	if(isEmpty(document.getElementById("shipping_phone").value)&&isEmpty(document.getElementById("shipping_mobile").value)&&isEmpty(document.getElementById("shipping_qq").value)&&isEmpty(document.getElementById("shipping_msn").value)) {alert("联系方式不能为空");return;}
	var tmp = document.getElementById("order").send;
	var bChecked = false;
	vl = "";
	for (var j = 0; j < tmp.length; j++) {
		if (tmp[j].checked) {
			bChecked = true;
			vl = tmp[j].value;
		}
	}
	if(value("hourSelecte")==0) {alert("对不起，超过营业时间范围。");return;}
	var bSaved = 0;
	if(!isEmpty(document.getElementById("save_shipping"))&&document.getElementById("save_shipping").checked){
		bSaved = 1;
	}
	if(vl == 1) submit("../order/order_.jsp?url=confirm_a&shippingTime=" + "sendNow"+ "&mapx="+ encode(value("mapx", "+"))+ "&mapy="+ encode(value("mapy", "+"))+"&bsaved="+bSaved, "", "order");
	if(vl == 2)
	submit("../order/order_.jsp?url=confirm_a&shippingTime=" + encode(value("hourSelecte", "+"))+":"+encode(value("minSelecte", "+"))+ "&mapx="+ encode(value("mapx", "+"))+ "&mapy="+ encode(value("mapy", "+"))+"&bsaved="+bSaved, "", "order");
}

/*function doAShippingSave() {
	if(isEmpty(document.getElementById("shipping_address").value)) {alert("联系地址不能为空");return;}
	if(isEmpty(document.getElementById("full_name").value)) {alert("联系人不能为空");return;}
	if(isEmpty(document.getElementById("shipping_phone").value)) {alert("联系电话不能为空");return;}
	if(value("hourSelecte")==0) {alert("对不起，超过营业时间范围。");return;}
	if(document.getElementById("save_shipping").checked){
		doSaveAShipping();
	}
	var tmp = document.getElementById("order").send;
	var bChecked = false;
	vl = "";
	for (var j = 0; j < tmp.length; j++) {
		if (tmp[j].checked) {
			bChecked = true;
			vl = tmp[j].value;
		}
	}
	if(vl == 1) submit("../order/order_.jsp?url=confirm_a&shippingTime=" + "sendNow"+ "&mapx="+ encode(value("mapx", "+"))+ "&mapy="+ encode(value("mapy", "+")), "", "order");
	if(vl == 2)
	submit("../order/order_.jsp?url=confirm_a&shippingTime=" + encode(value("hourSelecte", "+"))+":"+encode(value("minSelecte", "+"))+ "&mapx="+ encode(value("mapx", "+"))+ "&mapy="+ encode(value("mapy", "+")), "", "order");
}

function doSaveAShipping() {
	submit("../order/shipping_a_.jsp", "", "order");
}*/

function doASubmit(bStoreDistance,bShipping,bTime,mapx,mapy,bsaved) {
	submit("../order/submit_a_.jsp?bStoreDistance=" + bStoreDistance + "&bShipping=" +bShipping + "&bTime=" +bTime + "&mapx=" +mapx + "&mapy=" +mapy+"&bsaved=" +bsaved);
}

function doASaveSubmit(bStoreDistance,bShipping,bTime,full_name,shipping_phone,shipping_address,near,mapx,mapy,bsaved) {
	locate("../order/shipping_a_.jsp?bStoreDistance=" + bStoreDistance + "&bShipping=" +bShipping + "&bTime=" +bTime + "&full_name=" +full_name + "&shipping_phone=" +shipping_phone + "&shipping_address=" +shipping_address +"&shipping_near=" + near + "&mapx=" +mapx + "&mapy=" +mapy+"&bsaved=" +bsaved);
}

function doShopSearch(){
	if(document.getElementById("kw").value == "如：美食：香辣鸡腿堡 或 店铺：肯德基")
	document.getElementById("kw").value = "";
	/*if(document.getElementById("kw").value == ""){
	alert("请输入您想搜索的内容！");
	return;
	}*/
	if(document.getElementById("search_type2").selected){
	document.getElementById("searchshop").action = "../store/store_list.jsp";
	document.getElementById("searchshop").submit();
	}
	else {
	document.getElementById("searchshop").action = "../store/product_list.jsp";
	document.getElementById("searchshop").submit();	
	}
}

function show(cont,id){
	obj("lynote"+id).style.display=cont;
	obj("lynote"+id).style.left=event.clientX+document.documentElement.scrollLeft;   
	obj("lynote"+id).style.top=event.clientY+document.documentElement.scrollTop;   
}

var _requestCart, _responseCart, _functionCart;
function sendCart(u, f, params) { if (window.XMLHttpRequest) _requestCart = new XMLHttpRequest(); else if (window.ActiveXObject) _requestCart = new ActiveXObject("Microsoft.XMLHTTP"); if (_requestCart) { _functionCart = f == null ? "doResponse" : f; _requestCart.onreadystatechange = processCart; _requestCart.open("post", u, true); _requestCart.setRequestHeader("content-type","application/x-www-form-urlencoded"); _requestCart.send(params); } }
function processCart() { var rs = _requestCart.readyState; if (rs == 4) { _responseCart = _requestCart.responseText; eval(_functionCart + "(_responseCart)"); } }

var _requestProduct, _responseProduct, _functionProduct;
function sendProduct(u, f, params) {;if (window.XMLHttpRequest) _requestProduct = new XMLHttpRequest(); else if (window.ActiveXObject) _requestProduct = new ActiveXObject("Microsoft.XMLHTTP"); if (_requestProduct) { _functionProduct = f == null ? "doResponse" : f; _requestProduct.onreadystatechange = processProduct; _requestProduct.open("post", u, true); _requestProduct.setRequestHeader("content-type","application/x-www-form-urlencoded"); _requestProduct.send(params); } }
function processProduct() { var rs = _requestProduct.readyState; if (rs == 4) { _responseProduct = _requestProduct.responseText; eval(_functionProduct + "(_responseProduct)"); } }

function doCartAj(id, shippingId){
	sendCart("../store/cart_ajax.jsp?storeId=" + id+"&shippingId="+shippingId, "resCartAj");
}

function resCartAj(res) {
	html("cartaj", res);
	obj("info1").style.display = "";
	obj("info2").style.display = "none";
}

function doProductAj(id, shippingId, productType, pg, levelId, type){
	sendProduct("../store/product_ajax.jsp?storeId=" + id+"&shippingId="+shippingId+"&page_no="+pg+"&tagName="+encode(productType)+"&product_level_id="+levelId+"&is_recommend="+type, "resProductAj");
}

function resProductAj(res) {
	html("productaj", res);
}

function switchHrefColor(i, j){
	var k = 0;
	for(k; k<=j; k++){
		if(i == k)
		document.getElementById("tag"+k).className = "chen";
		else
		document.getElementById("tag"+k).className = "lb";
	}
}

function checkACartInfo(){
	var a = document.getElementById("cart_info1").innerHTML;
	if(a == 0){
		alert('对不起，您还没有选购商品！');
		return;
	}
	
	var b = document.getElementById("cart_info2").innerHTML;
	if(b == "false"){
		alert('对不起，未达到起送金额！');
		return;
	}
	
	doACheckout();
}

function checkCartInfo(){
	var a = document.getElementById("cart_info1").innerHTML;
	if(a == 0){
		alert('对不起，您还没有选购商品！');
		return;
	}
	
	var b = document.getElementById("cart_info2").innerHTML;
	if(b == "false"){
		alert('对不起，未达到起送金额！');
		return;
	}
	doCheckout();
}

function doListAddCart(id, storeId) {
	send("../store/cart_.jsp?id=" + id + "&st=" + CART + "&qty=1"+"&storeId="+ encode(storeId) +"&groupId="+ encode(value("groupId", "+")) + "&tagName="+ encode(value("productType", "+")) + "&require="+ encode(value("require", "+")) + "&shippingId="+ value("shippingId") + "&distance="+ value("distance")+ "&eatcount="+ encode(value("eatcount", "+"))+"&noCnt=1&addOne=addOne","");
	doCartAj(encode(storeId), value("shippingId"));
}

function getOrderInfo(id){
	send("../order/order_state_a.jsp?id=" + id, "resOrderInfo");
}

function resOrderInfo(res) {
	html("orderinfo", res);
}

function doHastenA(id) {
	if (!confirm("是否确认催送订单？")) {
		return;
	}
	send("../order/order_state_a.jsp?id=" + id + "&order_id_hasten=" + id, "resOrderInfo");
}

function doCancelA(id) {
	if (!confirm("是否确认取消订单？")) {
		return;
	}
	send("../order/order_state_a.jsp?id=" + id + "&order_id_cancel=" + id, "resOrderInfo");
}

function doAddOneCart(id) {
	var a = document.getElementById("qty" + id).value
	var b = a*1 + 1;
	if(b > 999) return;
	document.getElementById("qty" + id).value = b;
}

function doDecOneCart(id) {
	var a = document.getElementById("qty" + id).value
	var b = a*1 - 1;
	if(b <= 0) return;
	document.getElementById("qty" + id).value = b;
}

var globalObjStyle;
//鼠标移上改变样式
function mouseOver(obj, className) {
	if (obj == null) obj = event.srcElement;
	globalObjStyle = obj.className;
	if (className == null) className = "over";
	obj.className = className;
}

//鼠标移出改变颜色
function mouseOut(obj, className) {
	if (obj == null) obj = event.srcElement;
	if (className == null) className = globalObjStyle;
	obj.className = className;
}

//new shipping step
function doLocation(kw){
	submit("../member/shipping_step3.jsp?5&kw="+ encode(kw));
}

function doLocation2(){
	if(document.getElementById("tbSearch").value == "" || document.getElementById("tbSearch").value == "如：大厦、大楼、小区、交叉路口等")
	{
		alert('请先输入你的位置！');
		return;
	}
	var kw = document.getElementById("tbSearch").value;
	submit("../member/shipping_step3.jsp?5&kw="+ encode(kw));
}

function doNewShipping2() {
	locate("../member/shipping_step1.jsp");
}

function doSaveShipping2(id) {
	submit("../member/shipping_step_.jsp?7&id=" + id, "", "shipping");
}

function doEditShipping2(id) {
	locate("../member/shipping_step4.jsp?6&id=" + id);
}

function postShippingInfo(id) {//alert(id);
	submit("../member/shipping_step1.jsp?id=" + id, "", "shipping");
}

function postShippingInfo2(id) {//alert(id)
	submit("../member/shipping_step2.jsp?areaId=" + id, "", "shipping1");
}

function postShippingInfo3(id, sortCode) {
	submit("../member/shipping_step2.jsp?areaId=" + id + "&sortCode=" + sortCode, "", "shipping");
}

function doFilterWord(id, sortCode) {
	if(document.getElementById("roadName").value == "")
	{
		alert('请先输入过滤条件！');
		return;
	}
	var roadName = document.getElementById("roadName").value;
	submit("../site/area.jsp?areaId=" + id + "&sortCode=" + sortCode + "&roadName=" + roadName, "", "rn1");
}