﻿
//跳转到指定的Url
function RedirectUrl(url)
{
    location.href=url;
}

//关闭当前浏览器窗口
function CloseWindow() 
{ 
    top.opener = null; 
    top.open('', '_self'); 
    window.close(); 
}

//隐藏显示层
function ShowHideLayer(tabobj,operator)
{
    subname= tabobj.id+"floatdiv";
    if(operator=="min")
    { 
        tabobj.style.cursor="hand";
        //subname= tabobj.id+"floatdiv";
        eval(subname).style.display="block";
        //HideOtherDiv(eval(subname));
    }
    else if(operator=="max")
    {        
        //subname= tabobj.id+"floatdiv";
        eval(subname).style.display="none";
    }    
    if(operator=="auto")
    {
        if(eval(subname).style.display=="none")
        {
            eval(subname).style.display="block";
        }
        else
        {
            eval(subname).style.display="none";
        }
    }
}
function ShowHideLayer3(tabobj,operator)
{
    if(operator=="min")
    { 
        tabobj.style.cursor="hand";
        subname= tabobj.id+"floatdiv";
        eval(subname).style.display="block";
        //HideOtherDiv(eval(subname));
    }
    else if(operator=="max")
    {        
        subname= tabobj.id+"floatdiv";
        eval(subname).style.display="none";
    }    
    if(operator=="auto")
    {
        if(eval(subname).style.display=="none")
        {
            eval(subname).style.display="block";
        }
        else
        {
            eval(subname).style.display="none";
        }
    }
}

//切换图片
function ChangeCategoryImage(objimg)
{
    var img=document.getElementById(objimg)
    if(img!=null)
    {
        if(img.nameProp=="Icon18.gif")
        {
            img.src="../image/Icon17.gif";
        }
        else
        {
            img.src="../image/Icon18.gif";
        }
    }
}

function ShowHideLayer2(tabobj,operator)
{
    if(operator=="min")
    { 
        tabobj.style.cursor="hand";
        subname= tabobj.id+"floatdiv";
        eval(subname).style.display="block";
        HideOtherDiv(eval(subname));
    }
    else if(operator=="max")
    {        
        subname= tabobj.id+"floatdiv";
        eval(subname).style.display="none";
    }    
}
//隐藏其他层
function HideOtherDiv(obj)
{
    //var obj=document.getElementById(objstr);
    var objspecialareafloatdiv=document.getElementById('imgExpSpecialAreafloatdiv');     
    var objpricefloatdiv=document.getElementById('imgExpPricefloatdiv');
    var objshiyongfloatdiv=document.getElementById('imgExpUsefloatdiv');
    var objlookfacefloatdiv=document.getElementById('imgExpLookFacefloatdiv');
    var objcolorfloatdiv=document.getElementById('imgExpColorfloatdiv');
    var objgongnengfloatdiv=document.getElementById('imgExpGonenengfloatdiv');

    if(obj==objspecialareafloatdiv && objspecialareafloatdiv!=null)    
        objspecialareafloatdiv.style.display="block";    
    else    
        objspecialareafloatdiv.style.display="none";    
        
    if(obj==objpricefloatdiv && objpricefloatdiv!=null)
        objpricefloatdiv.style.display="block";
    else
        objpricefloatdiv.style.display="none";
        
    if(obj==objshiyongfloatdiv && objshiyongfloatdiv!=null)
        objshiyongfloatdiv.style.display="block";
    else
        objshiyongfloatdiv.style.display="none";
    
    if(obj==objlookfacefloatdiv && objlookfacefloatdiv!=null)
        objlookfacefloatdiv.style.dispaly="block";
    else
        objlookfacefloatdiv.style.display="none";
    
    if(obj==objcolorfloatdiv && objcolorfloatdiv!=null)
        objcolorfloatdiv.style.display="block";
     else
        objcolorfloatdiv.style.display="none";
    
    if(obj==objgongnengfloatdiv && objgongnengfloatdiv!=null)
        objgongnengfloatdiv.style.display="block";
    else
        objgongnengfloatdiv.style.display="none";
    
}

//显示购物车
function showCart(SysNo,ProdCount,Color) { 
window.open("../Shopping/ShoppingCart.aspx?id="+SysNo+"&count="+ProdCount+"&color="+Color+"&Action=Add","CartWindow");
//window.open('basket.aspx?time='+t+'&item='+Item+'&ordernum='+document.item.OrderNum.value,'basketlist','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=200,titlebar=0');
}