/* RefererCheck ---------------------------------------------*/
$(document).ready(function (){
    var locationValue = location.search.substr(5,30);
    if(locationValue == "eol"){
        var foo = "Eol";
        var hoge = "eol";
    }else if(locationValue == "newproduct"){
        var foo = "Newproduct";
        var hoge = "new_product";
    }else if(locationValue == "shelf"){
        var foo = "Shelf";
        var hoge = "shelf";
    }else if(locationValue == "livingtable"){
        var foo = "Livingtable";
        var hoge = "living_table";
    }else if(locationValue == "bed"){
        var foo = "Bed";
        var hoge = "bed";
    }else if(locationValue == "color"){
        var foo = "Color";
        var hoge = "color";
    }else if(locationValue == "personalsofa"){
        var foo = "Personalsofa";
        var hoge = "personal_sofa";
    }else if(locationValue == "designer"){
        var foo = "Designer";
        var hoge = "designer";
    }else if(locationValue == "chair"){
        var foo = "Chair";
        var hoge = "chair";
    }else if(locationValue == "diningtable"){
        var foo = "Diningtable";
        var hoge = "dining_table";
    }else if(locationValue == "sofa"){
        var foo = "Sofa";
        var hoge = "sofa";
    }else if(locationValue == "office"){
        var foo = "Office";
        var hoge = "office";
    }else if(locationValue == "interiorelement"){
        var foo = "Interiorelement";
        var hoge = "interior_element";
    }else if(locationValue == "arflexprima"){
        var foo = "Arflexprima";
        var hoge = "arflex_prima";
    }else if(locationValue == "holidays"){
        var foo = "Holidays";
        var hoge = "holidays";
    }else if(locationValue == "aun"){
        var foo = "Aun";
        var hoge = "aun";
    }else{
    }
//    $("li.navi"+foo).empty().append("<span>CurrentCategory</span>");
    $("li.navi"+foo+" a").addClass("currentCategory");
    $("span#"+hoge).attr({ style: "display:inline"});
    $("li."+hoge+"CatLabel").attr({ style: "display:block"});
    $("li.itemImageLink01").empty().append("<span>1</span>");
    $("div.navi"+foo+"Area").attr({ style: "display:block"});
    $("div.navi"+foo+"Area").attr({ style: "display:block"});
    $("li.link1 a").click(function() {
        $("p.photoDes1").attr({ style: "display:block"});
        $("p.photoDes2").attr({ style: "display:none"});
    });
    $("li.link2 a").click(function() {
        $("p.photoDes1").attr({ style: "display:none"});
        $("p.photoDes2").attr({ style: "display:block"});
    });
});
function applySelectedTo(link) {
  var ul = document.getElementById("imageNavi");
  var allLinks = ul.getElementsByTagName("a");
  for (var i=0; i<allLinks.length; i++) { 
    allLinks[i].className = ""; 
  }
  link.className = "selected";
}
