<!--
function $(b){return document.getElementById(b);}
function showhide(sid,mid)
{
var pid=document.getElementById(sid);
var mdid=document.getElementById(mid);
if(pid.style.display=='')
  {
    pid.style.display='none';
    mdid.innerHTML='<img src=/images/j.gif>';
   }else{
    pid.style.display='';
    mdid.innerHTML='<img src=/images/-.gif>';
   }
}

function Img_Load(ImgD,ImgW,ImgH)
{
 if (ImgD.height>ImgH)
 {
  ImgD.width=ImgH/ImgD.height*ImgD.width;ImgD.height=ImgH;
 }
 if (ImgD.width>ImgW)
 {
  ImgD.height=ImgW/ImgD.width*ImgD.height;ImgD.width=ImgW;
 }
}

function chkInp(){
var regCh = null;
var regAll = null;
switch(event.srcElement.jinzhi){
case "bin": regCh = /[0-1]/; regAll = /^[0-1]*$/; break;
case "oct": regCh = /[0-7]/; regAll = /^[0-7]*$/; break;
case "hex": regCh = /[0-9a-fA-F]/; regAll = /^[0-9a-fA-F]*$/; break;
default: regCh = /[0-9]/; regAll = /^[0-9]*$/; break;
}
switch(event.type){
case "keypress": event.returnValue = regCh.test(String.fromCharCode(event.keyCode)); break;
case "paste" : event.returnValue = regAll.test(window.clipboardData.getData("text")); break;
case "drop" : event.returnValue = regAll.test(event.dataTransfer.getData("text")); break;
case "blur" : if(regAll.test(event.srcElement.vlaue)) alert("number"); return;
default: break;
}
}

function go_cart(pro_id) //不要改动,否则购车不能用
{
var quantity
var pro_size
$("quantity")?quantity=$("quantity").value:quantity=$('quantity'+pro_id).value;
$("pro_size")?pro_size=$("pro_size").value:pro_size=$('pro_size'+pro_id).value;
quantity=quantity.replace(/\D/g,'');
if(quantity=='')
{
alert('Please input quantity!');
document.getElementById('quantity').focus();
return false;
}
else if(quantity==0){
document.getElementById('quantity').value=1;
quantity=1;
var order=window.open('/order/?fs=add&pro_id='+pro_id+'&quantity='+quantity+'&pro_size='+pro_size,'order','toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,width=800,height=600,top=50,left=100');
}
else
{
var order=window.open('/order/?fs=add&pro_id='+pro_id+'&quantity='+quantity+'&pro_size='+pro_size,'order','toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,width=800,height=600,top=50,left=100');
}
order.focus();
$("size_quant")?$("size_quant").style.display='none':null;
$("over_c")?$("over_c").style.display='none':null;
}

function show_searchtt()
{
$("search_tt").style.display="block";
}

function show_searchtt_1()
{
$("search_tt").style.display="block";
//$("search_tt").style.height=60+"px";
$("search_tt").innerHTML="<div>Best-first search:</div><div onmouseover=\"this.style.background='#666'\" onmouseout=\"this.style.background=''\" onclick=\"document.getElementById('keyword').value=this.innerHTML\">id:1234</div><div onmouseover=\"this.style.background='#666'\" onmouseout=\"this.style.background=''\" onclick=\"document.getElementById('keyword').value=this.innerHTML\">name:abercombie fitch</div>";
}

function hide_searchtt()
{
$("search_tt").style.display="none";
}
function mouseout()
{
setTimeout("hide_searchtt()",5000);
}

//以下是ajax程序,不要改动
var xmlHttp=false;
function CreateXMLHttpRequest()
{
	if (window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	else
	{
		xmlHttp = new XMLHttpRequest();
	}
}

function get_search()
{
var keyword=$('keyword').value;
$('search_tt').style.display="block";
var url="/search/?s=ts&keyword="+escape(keyword);
CreateXMLHttpRequest();
if (trim(keyword)!="")
{
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function()
{
   if(xmlHttp.readyState==4&&xmlHttp.status==200)
  {
  var data=xmlHttp.responseText;
$('search_tt').innerHTML =data;
//$('search_tt').style.height=100+"px";
$('search_tt').style.overflow="hidden";
  }
}
xmlHttp.send(null);

}
}


function go_search(key)
{
$('keyword').value=key;
window.location.href="/search/?s=k&keyword="+key;
}

function trim(str){  //删除左右两端的空格
       return str.replace(/(^\s*)|(\s*$)/g, "");
   }

function tf(pro_name)
{
$('keyword').value=pro_name;
}

function show_d(d,n)
{
if (n=='0')
	{
	$('d'+d).style.display='block';
	//$('c'+d).style.display='none';
	//$('pro_size'+d).disabled=false;
	//$('quantity'+d).disabled=false;
	}
	else
	{
	$('d'+d).style.display='none';
	//$('c'+d).style.display='block';
	//$('pro_size'+d).disabled=true;
	//$('quantity'+d).disabled=false;
	}
}

function show_p(pro_id,f)
{
if (f=='on')
{
$("size_quant").style.display='block';
$("over_c").style.display='block';
$("over_c").style.height=document.body.scrollHeight;
$("size_quant").style.top=document.body.scrollTop+200+'px';
$("size_quant").style.left=document.body.scrollWidth/2-200+'px';
show_p_s(pro_id);
//alert(document.body.clientHeight);
}else
{
$("size_quant").style.display='none';
$("over_c").style.display='none';

}
}


function show_p_s(pro_id)
{
var xmlHttp2=false;
var url="/order/get_size_qty.asp?pro_id="+pro_id;
if (window.ActiveXObject)
	{
		xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	else
	{
		xmlHttp2 = new XMLHttpRequest();
	}
xmlHttp2.open("GET",url,true);
xmlHttp2.onreadystatechange=function()
	{
	if(xmlHttp2.readyState<4){$("p-s").innerHTML="<img src='/images/indicator_medium.gif'>loading...";}
	if(xmlHttp2.readyState==4&&xmlHttp2.status==200)
		{
		var data=xmlHttp2.responseText;
		$("p-s").innerHTML=data;
		}
	}
xmlHttp2.send(null);
}

function show_most_view()
{
var xmlHttp3=false;
var url="/inc/get_most_view.asp";
if (window.ActiveXObject)
	{
		xmlHttp3 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	else
	{
		xmlHttp3 = new XMLHttpRequest();
	}
xmlHttp3.open("GET",url,true);
xmlHttp3.onreadystatechange=function()
	{
	if(xmlHttp3.readyState<4){$("p-s").innerHTML="<img src='/images/indicator_medium.gif'>loading...";}
	if(xmlHttp3.readyState==4&&xmlHttp3.status==200)
		{
		var data=xmlHttp3.responseText;
		$("most_view").innerHTML=data;
		}
	}
xmlHttp3.send(null);
}




-->



