﻿var txtAddress="全市";
var txtKeyword="例：酒店";
var txtComment="点击这里发表评论……";
function clearAddr(A,comAddr)
{
	if(A.value==eval(comAddr))
	{
		A.value="";
		A.style.color="#000"
	}
}

function resetAddr(A,comAddr)
{
	if(!A.value)
	{
		A.value=eval(comAddr);
		A.style.color="#999"
	}
}


function getAddr(addr,B){
	var A=$(addr).value;
	A=A.strip();
	comAddr=eval(B);
	if(A==comAddr){
		return""
	}
	return A
}
function setAddr(E,F){
    if (!$(E))
        return;
    var C=$(E).value;
    var comAddr=eval(F);
	var B=$(E);
	var A=$("addr_b");
	if(C==""||C==comAddr){
		if(B){
			B.value=comAddr;B.style.color="#999"
		}
		if(A){
			A.value=comAddr;A.style.color="#999"
		}
	}
	else{
		if(B){
			B.value=C;B.style.color="#000"
		}
		if(A){
			A.value=C;A.style.color="#000"
		}
	}
}
function defaultOnload()
{
    setAddr("txtAddress","txtAddress");
    setAddr("txtKeyword","txtKeyword");
    setAddr("txtAddress1","txtAddress");
    setAddr("txtKeyword1","txtKeyword");
    setAddr("txtComment","txtComment");
        //$("BrandName").focus();
}

function setout(D,B){
      
	if($("txtAddress"))
	    $("txtAddress").value=getAddr("txtAddress","txtAddress");
	if($("txtKeyword"))
	    $("txtKeyword").value=getAddr("txtKeyword","txtKeyword");
	if($("txtAddress1"))
	    $("txtAddress1").value=getAddr("txtAddress1","txtAddress");
	if($("txtKeyword1"))
	    $("txtKeyword1").value=getAddr("txtKeyword1","txtKeyword");
    if($("txtComment"))    
	    $("txtComment").value=getAddr("txtComment","txtComment");
	//alert('6wywy');
	//window.open("GoodsAskResult.aspx?BrandName="+G+"&GoodsName="+F+"&TypeNum="+E,"_self");
	//gotoTextView(F,G,E,A)
}


function addToLabel(D,F){
	var C=$(D);
	var A=C.value.replace(/,+?/ig,",");
	var E=A.split(",");
	if(E[0]==""){
		E.shift()
	}if(E[E.length-1]==""){
		E.pop()
	}
	for(var B=0;B<E.length;B++){
		if(E[B]==F.innerHTML){
			C.value=E.join(",");
			return 
		}
	}
	if(E.length>=10){
		C.value=E.join(",");
		return 
	}
	E.push(F.innerHTML);
	C.value=E.join(",")
}


