var CurrCat="";
var CurrSec="";
var query="";
var refferer="";

var sURL = document.location.href;

if(typeof HTMLElement != 'undefined' && HTMLElement.prototype.__defineGetter__ != 'undefined')
    {
        HTMLElement.prototype.__defineGetter__("innerText", function () {
           var r = this.ownerDocument.createRange();
           r.selectNodeContents(this);
           return r.toString();
        }); 
    }


if (sURL.indexOf("&Details=") > 0 | sURL.indexOf("lu_details=1") > 0)
{
document.title=document.getElementById("DetailTitle").innerText + " - Shop - Walker Art Center";
}
else if(getCatalog()!="Jump to Category..." && getCatalog()!="")
{
document.title=getCatalog() + " - Shop - Walker Art Center";
}

BreadCrumb();

if(document.title.indexOf("&amp;")>0)
{
str=document.title;
str=str.replace("&amp;","&");
document.title=str;
}

function BreadCrumb()
     {
           CurrSec = getURLParam('sectionid');             
           CurrCat = getURLParam('catalogid');
   CurrSection=getURLParam('section');
   query=getURLParam('query');
   
 if(document.getElementById("Crumb")!=null)
 { 
    if(CurrSection=="contactus")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Contact Us</span>";
document.title="Contact Us - Shop - Walker Art Center";

             }
             else if(CurrSection=="searchtips")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Search Tips</span>";
document.title="Search Tips - Shop - Walker Art Center";

             }
             else if(CurrSection=="shippinginfo")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Shipping Info</span>";
document.title="Shipping Info - Shop - Walker Art Center";

             }
             else if(CurrSection=="faq")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>FAQ</span>";
document.title="FAQ - Shop - Walker Art Center";

             }
             else if(CurrSection=="sitemap")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Site Map</span>";
document.title="Site Map - Shop - Walker Art Center";

             }
             else if(CurrSection=="membership")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Membership</span>";
document.title="Membership - Shop - Walker Art Center";

             }
             else if(CurrSection=="inthewindow")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>In The Window</span>";
document.title="In The Window - Shop - Walker Art Center";

             }
             else if(CurrSection=="abouttheshop")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>About The Shop</span>";
document.title="About The Shop - Shop - Walker Art Center";

             }
             else if(CurrSection=="location")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Location, Hours, Directions</span>";
document.title="Location, Hours, Directions - Shop - Walker Art Center";

             }
             else if(CurrSection=="privacy")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Privacy Policy</span>";
document.title="Privacy Policy - Shop - Walker Art Center";

             }
             else if(CurrSection=="artists")
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Artists</span>";
document.title="Artists - Shop - Walker Art Center";

             }  
 else if (sURL.indexOf("frmLUSTD")>0 | (query!="" && (sURL.indexOf("&query=") > 0 && sURL.indexOf("&CatalogID=") < 0)) )
 {
document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>Search Result</span>";
document.title="Search Result - Shop - Walker Art Center";
if(document.getElementById("current-catalog")!=null)
{
document.getElementById("current-catalog").style.display="none";
}

var browser=navigator.appName; 
                if(browser=="Netscape")
                {
if(document.getElementById("products-pager-top")!=null && document.getElementById("products-table")!=null)
{
document.getElementById("products-table").style.marginLeft="-750px";
document.getElementById("products-pager-top").style.position="relative";
}
}
 } 
             else if(CurrSection=="product" && getCatalog()=="Jump to Category..." && document.getElementById("searchstd-query").value=="" && sURL.indexOf("&CatalogID=") < 0)
             {
                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>What's New</span>";
document.title="What's New - Shop - Walker Art Center";

             }
    else if(document.getElementById("section-cart")!=null)
{
    var HeaderText=document.getElementById("section-cart").getElementsByTagName('div')[0].innerHTML;
    document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>" + HeaderText + "</span>";    
document.title=HeaderText + " - Shop - Walker Art Center";
}
else if(document.getElementById("section-orders")!=null)
{
    var HeaderText=document.getElementById("section-orders").getElementsByTagName('div')[0].innerHTML;
    document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>" + HeaderText + "</span>";    
document.title=HeaderText + " - Shop - Walker Art Center";

} 
else if(document.getElementById("section-account")!=null)
{
    var HeaderText=document.getElementById("section-account").getElementsByTagName('div')[0].innerHTML;
    document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent>" + HeaderText + "</span>";    
document.title=HeaderText + " - Shop - Walker Art Center";

}         
           else if(CurrCat=="" && CurrSec!=null)
           {            
                CurrSec = getURLParam('sectionid');             
                CurrCat = ""; 
                catText="";
subcatText="";
   
                if(document.getElementById("container-catalogs-list")!=null)
                {
                    var html= document.getElementById("container-catalogs-list").innerHTML;    
                    var browser=navigator.appName; 
                    if(browser=="Netscape")
                    {
                    var pos = html.indexOf("selected=");    
                    pos = pos+31; 
                    } 
                    else
                    {
                    var pos = html.indexOf("selected CatalogID=");
                    //alert(pos);     
                    pos = pos+20;
                    }  
                    CurrCat=html.substr(pos,3);                   
                }

if(document.getElementById("catalogs-list")!=null)
   {
                lgth = document.getElementById("catalogs-list").options.length - 1;
for(i=0;i<lgth;i++)
{
if(document.getElementById("catalogs-list").options[i].value=="-"+CurrCat)
{
document.getElementById("catalogs-list").options[i].selected=true;
catText=getCatalog();
continue;
}

if(document.getElementById("catalogs-list").options[i].value==CurrSec)
{
document.getElementById("catalogs-list").options[i].selected=true;
subcatText=getCatalog().substring(4);
continue;
}
}

document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <a href='javascript:Catalogs_ViewCatalog("+CurrCat+",\"Product\");'>" + catText + "</a>";
if(subcatText!="")
{
document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent><a href='javascript:Catalogs_ViewSection("+CurrSec+", "+CurrCat+",\"Product\");'>" + subcatText + "</a></span>";
}

   }
           }
           else if(CurrCat!=null && CurrSec=="")
           {
                Catalog=getCatalog();  

                document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent><a href='javascript:Catalogs_ViewCatalog("+CurrCat+",\"Product\");'>" + Catalog + "</a></span>";

           }
           else if(CurrCat!="" && CurrSec!=null)
           {
catText="";
subcatText="";
lgth = document.getElementById("catalogs-list").options.length - 1;
for(i=0;i<lgth;i++)
{
if(document.getElementById("catalogs-list").options[i].value=="-"+CurrCat)
{
document.getElementById("catalogs-list").options[i].selected=true;
catText=getCatalog();
continue;
}

if(document.getElementById("catalogs-list").options[i].value==CurrSec)
{
document.getElementById("catalogs-list").options[i].selected=true;
subcatText=getCatalog().substring(4);
continue;
}
}

//document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <a href='javascript:Catalogs_ViewCatalog("+CurrCat+",\"Product\");'>" + catText + "</a>"+ " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent><a href='javascript:Catalogs_ViewSection("+CurrSec+", "+CurrCat+",\"Product\");'>" + subcatText + "</a></span>";                
document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <a href='javascript:Catalogs_ViewCatalog("+CurrCat+",\"Product\");'>" + catText + "</a>";
if(subcatText!="")
{
document.getElementById("Crumb").innerHTML=document.getElementById("Crumb").innerHTML + " <span class=crumbQuo>&rsaquo;</span> <span class=crumbCurrent><a href='javascript:Catalogs_ViewSection("+CurrSec+", "+CurrCat+",\"Product\");'>" + subcatText + "</a></span>";
}

           }   
 }
     }

function getCatalog()
{
    var text="";
if(document.getElementById("catalogs-list")!=null)
{
var bulk = document.getElementById("catalogs-list").options;
    text = bulk[bulk.selectedIndex].text;    
}
else
{
    text=null;
}
    return text;
}



function getURLParam(strParamName)
    {
      var strReturn = "";
      var strHref =window.location.href;
      if ( strHref.indexOf("&") > -1 )
      {
        var strQueryString = strHref.substr(strHref.indexOf("&")).toLowerCase();
        var aQueryString = strQueryString.split("&");
        for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
        {
          if (aQueryString[iParam].indexOf(strParamName + "=") > -1 )
          {
            var aParam = aQueryString[iParam].split("=");
            strReturn = aParam[1];
            break;
          }
        }
      }
      return strReturn;
    }