// JavaScript Document
function bookmark(){ 
          if ( document.all ) window.external.AddFavorite(location.href,document.title);
}
function sethomepage(obj){
          obj.style.behavior= 'url(#default#homepage)';
          obj.setHomePage (location.href);
}

function s_h_shop(index)
{
	      var obj,objx;
		  if(document.all)
		     obj = document.all["class_"+index];
		  else
		     obj = document.getElementById("class_"+index);
	      obj.style.visibility = "hidden";
		  
}
function cls_sh(index)
{
	      var obj;
	      if(document.all)
		     obj = document.all["child_"+index];
		  else
		     obj = document.getElementById("child_"+index);
	      obj.style.visibility = "hidden";
}
function checksearch(obj)
{
	     if(obj.key.value == "")
		 {
			 alert("请输入搜索关键字！");
			 obj.keyword.focus();
			 return false;
		 }
		 return true;
}
function getobject(id)
{
	      var obj;
	      if(document.all)
			  obj = document.all[id];
		  else
			  obj = document.getElementById(id);
		  return obj;
}
function ShowHideShop(id) {
          var x,y,offsetParent,sobj,obj,objx;
		  for(var i=30;i<300;i++)
		  {
			  if(id == i) continue;
			  objx = getobject("class_" + i);
			  if(objx != null)
			  {
				 if(objx.tagName.toUpperCase()!="A")
			        objx.style.visibility = "hidden";
			  }
		  }
		  obj = getobject("root_" + id);
		  sobj = getobject("class_" + id);
		  offsetParent = obj;
		  if(offsetParent)
		  {
		     x=0;
	         y=0;
	         while(offsetParent!=null && offsetParent.tagName.toUpperCase()!="BODY") {
		            x += offsetParent.offsetLeft;
		            y += offsetParent.offsetTop;
		            offsetParent=offsetParent.offsetParent;
	         }
		  }
		  if(sobj)
		  {
			 sobj.style.top = (y + 5) + "px";
		     sobj.style.left = (x + 115) + "px";
		     sobj.style.visibility = "visible";
		  }
		  
}
function ShowHideShopA(id,oid) {
          var x,y,offsetParent,sobj,obj,objx;
		  for(var i=1;i<1000;i++)
		  {
			  objx = getobject("child_"+i);
			  if(objx != null)
			     objx.style.visibility = "hidden";
		  }
		  obj = getobject("class_" + id);
		  sobj = getobject("child_" + id);
		  if(!obj) return;
		  offsetParent = obj;
		  if(offsetParent)
		  {
		     x=0;
	         y=0;
	         while(offsetParent!=null && offsetParent.tagName.toUpperCase()!="BODY") {
		            x += offsetParent.offsetLeft;
		            y += offsetParent.offsetTop;
		            offsetParent=offsetParent.offsetParent;
	         }
		  }
		  if(sobj)
		  {
			 sobj.style.top = (y - 6) + "px";
		     sobj.style.left = (x + 134) + "px";
		     sobj.style.visibility = "visible";
		  }
}

function chksendmsg(obj){
	      if(obj.content.value.length<1){
			  alert("请最少输入1个以上字符！");
			  obj.content.focus();
			  return false;
		  }
		  if(obj.username.value==""){
			  alert("请输入你的真实姓名！");
			  obj.username.focus();
			  return false;
		  }
		  if(obj.address.value==""){
			  alert("请输入你的联系地址！");
			  obj.address.focus();
			  return false;
		  }
		  if(obj.tel.value==""){
			  alert("请输入你的联系电话！");
			  obj.tel.focus();
			  return false;
		  }
		  return true;
}
