function clearall(){
	if (confirm("您确定清空购物车中的全部商品吗？")){
		location.href="?action=clear_all";
  }
}
function clearKeep(){
	if (confirm("您确定清空收藏箱中的全部商品吗？")){
		location.href="?action=clearKeep";
  }
}
function clearzero(){
	if (confirm("您确定将访问量清零吗？")){
		location.href="?action=zero";
  }
}
function brand(brand){
	document.form.brand_name.value=brand.value.substr(0,brand.value.indexOf("-"));
	document.form.brand_code.value=brand.value.substr(brand.value.indexOf("-")+1,100);
}
function goodsType(goodsType){
	document.form.goods_type.value=goodsType.value.substr(0,goodsType.value.indexOf("-"));
	document.form.goods_type_code.value=goodsType.value.substr(goodsType.value.indexOf("-")+1,100);
}
function firm(el){
	goods_name = el.value.substr(0, el.value.indexOf("!--"))
	goods_code = el.value.substr(el.value.indexOf("!--") + 3,100)
	ef = '真的要删除【商品名称】是【' + goods_name + '】的记录吗？' +
	     '\n如果点确定的话，则该商品相关的资料也将会删除！'
	if(confirm(ef))
	  {location.href = "goods_delete.asp?goods_code=" + goods_code;}
	else{}
}
function jump(lik){
  location.href = lik;
}
function order(es){
	order = es.value.substring(0, es.value.indexOf("!--"))
	kind = es.value.substring(es.value.indexOf("!--") + 3,es.value.indexOf("*--"))
	qw = es.value.substring(es.value.indexOf("*--") + 3,es.value.indexOf("#--"))
	goods_type = es.value.substring(es.value.indexOf("#--") + 3,es.value.indexOf("^--"))
	brand_name = es.value.substring(es.value.indexOf("^--") + 3,es.value.indexOf("+--"))
	address = es.value.substring(es.value.indexOf("+--") + 3,100)
	if(kind == "asc"){
  	kind = "desc"
    val = order + ' ' + kind
    img = '<img src="../images/sort_desc.jpg">'}
  else{
  	kind = "asc"
  	val = order + ' ' + kind
  	img = '<img src="../images/sort_asc.jpg">'}
  if(address=="order.asp"){
    location.href = "order.asp?order=" + val + "&qw=" + escape(qw) + "&kind=" + kind + "&img=" + img + "&goods_type=" + goods_type + "&brand_name=" + brand_name}
  else if(address=="goods_find.asp"){
    location.href = "goods_find.asp?order=" + val + "&qw=" + escape(qw) + "&kind=" + kind + "&img=" + img + "&goods_type=" + goods_type + "&brand_name=" + brand_name}
  else if(address=="member.asp"){
    location.href = "member.asp?order=" + val + "&qw=" + escape(qw) + "&kind=" + kind + "&img=" + img + "&goods_type=" + goods_type + "&brand_name=" + brand_name}
  else{}
}

function shownotice(sn){
	display = getid(sn).style.display
	if(display=="block")
	  getid(sn).style.display = "none"
	else
		getid(sn).style.display = "block"
}
function show(th){
	checkid = th.value.substring(0, th.value.indexOf("!--"))
	showid = th.value.substring(th.value.indexOf("!--") + 3,100)
  if(getid(checkid).checked){
  	 getid(showid).style.display = "block";
  }
  else{
    getid(showid).style.display = "none";
  }
}
function getid(id)
{
	return document.getElementById(id);
}
//联系我们
function contactwe(){
	eventwin = open ('','','width=300,height=150');
	with (eventwin.document) {
	writeln("如有站内技术问题，请QQ联系我们！<br>&nbsp;&nbsp;&nbsp;QQ:271732906");
  }
}
function getPosition(o)
{
    var temp={};
    temp.left=temp.right=temp.top=temp.bottom=0;
    var oWidth=o.offsetWith,oHeight=o.offsetheight;
    while(o!=document.body)
    {
        temp.left+=o.offsetLeft;
        temp.top+=o.offsetTop;
        var border=parseInt(o.offsetParent.currentStyle.borderWidth);
        if(border)
        {
            temp.left+=border;
            temp.top+=border;
        }
        o=o.offsetParent;
    }
    temp.right=temp.left+oWidth;
    temp.bottom=temp.top+temp.oHeight;
    return temp;
}

function change()
{
var   oObj = event.srcElement;
if(oObj.tagName.toLowerCase() == "td")
{
var   oTr = oObj.parentNode;
for(var   i=1;   i<document.all.tbl.rows.length;   i++)
{
document.all.tbl.rows[i].style.backgroundColor = "";
document.all.tbl.rows[i].tag = false;
}
oTr.style.backgroundColor = "#CCCCFF";   oTr.tag = true;
}
}
function   out()
{
var   oObj = event.srcElement;
if(oObj.tagName.toLowerCase() == "td")
{
var   oTr = oObj.parentNode;
if(!oTr.tag)   oTr.style.backgroundColor = "";
}
}
function   over()
{
var   oObj = event.srcElement;
if(oObj.tagName.toLowerCase() == "td")
{
var   oTr = oObj.parentNode;
if(!oTr.tag)   oTr.style.backgroundColor = "#F1F1F1";
}
}
function tdshow(obj,arr)
{
	var cArr = arr||["#fff","#FAFAFA","#EBEBEB"];
	var trArr=document.getElementById(obj).getElementsByTagName("tr");
	for(var i=0,j=trArr.length;i<j;i++)
	{
		var o=trArr[i];
		o.style.backgroundColor=cArr[i%2];
		o.onmouseover=function(){this.style.backgroundColor=cArr[2];}
		o.onmouseout=function(){this.style.backgroundColor=cArr[this.sectionRowIndex%2];}
	}
}
function findObj(theObj, theDoc)
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;

  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all)
  {
  	foundObj = theDoc.all[theObj];
  }
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
  { foundObj = theDoc.forms[i][theObj];
   }
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
  {
    foundObj = findObj(theObj,theDoc.layers[i].document);
   }
  if(!foundObj && document.getElementById)
  {
  	foundObj = document.getElementById(theObj);
  }
  return foundObj;
}
