
﻿
var val=getQueryString("overwritefull");if(val=="y")document.cookie="overwrite_mobile=true";if((DetectIphoneOrIpod()||DetectIpad())&&getCookie("overwrite_mobile")!="true"&&(window.location.hostname=="www.lbllighting.com"||window.location.hostname=="lbllighting.com"||window.location.hostname=="lbl2012"))window.location="http://m.lbllighting.com/";var fireFoxCurVer="3.5";var ieCurVer="9";var operaCurVer="11";var safariCurVer="5";var chromeCurVer="15";var myWindowWidth=$(window).width();$(document).ready(function(){if(myWindowWidth<=1024){$("#container").css({"margin":"33px 0 0 0"});}});$(document).ready(function(){showMyLocation();$("#header h1").click(function(){window.location.href="/";});activeItem=$("#accordion li:first");$("#accordion li").hover(function(){var title=$(this).attr("title");$('#accordion li').each(function(){if(title==$(this).attr("title")){$(activeItem).animate({width:"678px"},{duration:600,queue:false});}
$(this).animate({width:"27px"},{duration:600,queue:false});$(this).removeClass('banner').addClass('small');});$(activeItem).animate({width:"27px"},{duration:600,queue:false});$(this).animate({width:"678px"},{duration:600,queue:false});activeItem=this;});$("#accordion li").click(function(){var url=($(this).attr("title")=="systems")?"/Products/Systems/":"/Products/Fixtures/"+$(this).attr("id");window.location=url;});$("a.catalog").click(function(){this.w=$(window).width();this.h=$(window).height();var win=window.open("/Home/CatalogView/","_blank","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0,height="+this.h+",width="+this.w);win.moveTo(0,0);});$(function(){$("#myLeftMenu ul").hide();$("#myLeftMenu li").bind("mouseover.dropdown",function(){if($(this).find('ul.childMenu').is(":visible")){$(this).find('ul.childMenu').unbind("mouseout.dropdown");}
else{$(this).find('ul.childMenu').slideDown(200);$(this).find('ul.childMenu').mouseleave(function(){$(this).slideUp(200);});}});$("#myLeftMenu li.menuActive").each(function(){var $ul=$(this).find("ul");$ul.show();$ul.removeClass("childMenu");});$("#myLeftMenu ul li").each(function(){if($(this).hasClass("menuActive")){$(this).parent().show();$(this).parent().removeClass("childMenu");}});});$('div#menu ul li a').mouseover(function(){$('div#submenu ul').each(function(){$(this).fadeOut("fast");});var $menuItemMain=$(this);var className=$menuItemMain.attr('class');var $subMenuItem=$('ul.sub_products.'+className);$subMenuItem.fadeIn("normal");if($('div#carrot img:hidden')){$('div#carrot img').fadeIn("slow");}
var carrotBaseline=162;var widthOfMenu=$('div#menu').width();var widthOfMenuItem=$menuItemMain.width();var firstTitle=$('div#menu ul li a:nth-child(1)').attr("class");var totToMove=0;var subMenuMove=0;$('div#menu ul li a').each(function(){var eachTitle=$(this).attr("class");var eachWidth=parseInt($(this).width());if(firstTitle==className){totToMove+=(eachWidth/2)-5;return false;}
else{if(className!=eachTitle){totToMove+=eachWidth+12;subMenuMove+=eachWidth+14;}
else{totToMove+=((eachWidth+6)/2)-5;return false;}}});var whereToMoveCarrot=parseInt(carrotBaseline)+totToMove;$('div#carrot img').animate({left:whereToMoveCarrot+"px"},{duration:300,queue:false});var whereToMoveSubMenu=subMenuMove;$subMenuItem.css({"overflow":"hidden"}).css({"left":whereToMoveSubMenu+"px"});$("#main").mouseover(function(){$('div#carrot img').hide();$subMenuItem.hide();});});var $howToBuy=$("a.showroom");$howToBuy.click(function(){var ipValue=$("#ip").val();var ip=(ipValue=="127.0.0.1"||ipValue.indexOf("10.64.")==0)?"24.104.129.78":$("#ip").val();var urlForCountryCheck="http://www.geoplugin.net/json.gp?jsoncallback=?&ip="+ip;var isCookie=getCookie("myZipCode");var userCountry;$.getJSON(urlForCountryCheck,function(data){if(data["geoplugin_countryCode"]=="US"){if(!isCookie||isCookie=="undefined"){$("#showroomPopUpContainer").css({"visibility":"visible"}).css({"display":"block"});}
else{var myZip=getCookie("myZipCode");window.location="/How-To-Buy/Showrooms/"+myZip+"?radius=5";}}
else window.location="/How-To-Buy/Showrooms/";});});var $goZipBtn=$("input#goShowZip");var $zipInputField=$("input#showroomZip");$goZipBtn.click(function(){var inputValue=$zipInputField.val();if(!inputValue||inputValue.length!=5){alert("something bad happened");}
else{$(this).attr("disabled","disabled");setCookie("myZipCode",inputValue,365);window.location="/How-To-Buy/Showrooms/"+inputValue+"?radius="+5;}});$("#showroomZip").keydown(function(event){if(event.keyCode==46||event.keyCode==8||event.keyCode==37||event.keyCode==39){}
else{if((event.keyCode<48||event.keyCode>57)&&(event.keyCode<96||event.keyCode>105)){event.preventDefault();}}});var doShow=false;var myRecentVer;switch(BrowserDetect.browser){case"Explorer":if(BrowserDetect.version<ieCurVer){doShow=true;myRecentVer=ieCurVer;}
break;case"Chrome":if(BrowserDetect.version<chromeCurVer){doShow=true;myRecentVer=chromeCurVer;}
break;case"Opera":if(BrowserDetect.version<operaCurVer){doShow=true;myRecentVer=operaCurVer;}
break;case"Safari":if(BrowserDetect.version<safariCurVer){doShow=true;myRecentVer=safariCurVer;}
break;case"Firefox":if(BrowserDetect.version<fireFoxCurVer){doShow=true;myRecentVer=fireFoxCurVer;}
break;}
if(doShow)$('#footer div.right').append("&nbsp;|&nbsp; <label><a href='/Home/BrowserUpgrade/?name="+BrowserDetect.browser+"&curVer="+BrowserDetect.version+"&recentVer="+myRecentVer+"&os="+BrowserDetect.OS+"' class='red'>upgrade your browser</a></label>");$("#feedback").keyup(function(){if($(this).val()!='')
$("#feedbackSubmit").removeAttr("disabled",null)
else
$("#feedbackSubmit").attr("disabled","disabled");});$("#feedbackSubmit").click(function(){$("#feedbackSubmit").attr("disabled","disabled");this.form.submit();});$("#email, #phone, #city, #state, #zip, #addy1").keyup(function(){if($("#email").val()!=''&&$("#phone").val()!=''&&$("#city").val()!=''&&$("#state").val()!=''&&$("#zip").val()!=''&&$("#addy1").val()!='')
$("#catalogSubmit").removeAttr("disabled",null);else
$("#catalogSubmit").attr("disabled","disabled");});$("#catalogSubmit").click(function(){$("#catalogSubmit").attr("disabled","disabled");this.form.submit();});if($("#rightContent").length>0){var menuHeight=$("#innerLeftMenu").height();var contentHeight=$("#rightContent").height();var myHeight=(menuHeight>contentHeight)?menuHeight:contentHeight;$("#innerBody").height(myHeight);}
$("#searchText").focus(function(){if($(this).val()=="Product Search")$(this).val("");});$("#searchText").blur(function(){if($(this).val()=="")
$(this).val("Product Search");});$("#searchText").keypress(function(event){if(event.which==13&&$(this).val()!=""){var text=$(this).val();var params="{'text':'"+text+"'}";$.ajax({type:"POST",url:"/Services/Search.asmx/SearchProducts",data:params,contentType:"application/json; charset=utf-8",dataType:"json",success:function(arg){searchSuccess(arg,text);},error:function(){alert("An Error Occured.");}});}});function searchSuccess(arg,text){var fixtures=arg.d;$("#main").fadeOut("normal",function(){var string="<div id='innerBody'>\n";string+=" <h1>search results</h1><br />\n";if(fixtures){$.each(fixtures,function(index,fixture){var fname=(!fixture.DefaultColor)?fixture.Id+".jpg":fixture.Id+"_"+fixture.DefaultColor.toLowerCase().replace(/ /g,"_").replace(/\//g,"_")+".jpg";var sname=fixture.SpecSheet.replace(/ /g,"-");string+="<div class='search'>\n";string+="     <a href='/Products/Fixtures/"+sname+"/"+fixture.Name.replace(/ /g,"-").replace(/"/g,"").replace(/\//g,"-").replace(/\(/g,"").replace(/\)/g,"")+"'><img src='http://images.lbllighting.com/Configurator/8/products/thumbs/"+fname+"' align='left' style='padding-right:10px;'/></a>\n";string+=fixture.Name+"\n";string+="     <h3>"+fixture.Description+"</h3><br />\n";string+="     <a href='/Products/Fixtures/"+sname+"/"+fixture.Name.replace(/ /g,"-").replace(/"/g,"").replace(/\//g,"-").replace(/\(/g,"").replace(/\)/g,"")+"'>Go to the "+fixture.Name+" product page</a>.\n";string+="     <br clear='all' />";string+="</div>\n";});}
else{string+="Sorry, but your search yielded no results. Please try another search.";}
string+="</div>\n";$("#main").html(string).fadeIn("fast");});}
var wishListLength=($("div").is('.finalWishList'))?$('.finalWishList').length:0;$(".wishListToggle").click(function(){var isChecked=$(this).is(":checked");var id=$(this).attr("title");var name=$(this).attr("name");var page=$(this).attr("this-page");if(isChecked){var content=$("#htmlForWishList").html();var params="{'id':'"+id+"', 'name':'"+name+"', 'page':'"+page+"', 'html':'"+escape(content)+"'}";$.ajax({type:"POST",url:"/Services/WishList.asmx/AddToWishList",data:params,contentType:"application/json; charset=utf-8",dataType:"json"});var curCookie=getCookie("JSWishList");if(!curCookie)curCookie=id;else curCookie+=","+id;setCookie("JSWishList",curCookie,365);$("#addToWishList label").fadeIn("fast");$("#addToWishList label").fadeOut(2500);}
else{var params="{'id':'"+id+"'}";$.ajax({type:"POST",url:"/Services/WishList.asmx/RemoveFromWishList",data:params,contentType:"application/json; charset=utf-8",dataType:"json"});var curCookie=getCookie("JSWishList");if(curCookie){var allItems=curCookie.split(",");var newCookie="";for(i=0;i<allItems.length;i++){if(id!=allItems[i]){newCookie+=allItems[i]+",";}}
newCookie=newCookie.slice(0,-1)
setCookie("JSWishList",newCookie,365);if($("div").is('.finalWishList')){wishListLength-=1;wishListCount(wishListLength);}
function wishListCount(wishListLength){if(wishListLength==0)setTimeout("window.location.reload()",1000);}}}});$("#wishListHelp, #wishListInfo div.right").click(function(){if($("#wishListInfo").is(":visible"))
$("#wishListInfo").fadeOut("normal");else
$("#wishListInfo").fadeIn("normal");});});function returnToSearchResults(){if($("#searchText").val()!=""&&$("#searchText").val()!="Product Search"){var text=$(this).val();var params="{'text':'"+searchVal+"'}";$.ajax({type:"POST",url:"/Services/Search.asmx/SearchProducts",data:params,contentType:"application/json; charset=utf-8",dataType:"json",success:function(arg){searchSuccess(arg);},error:function(){alert("An Error Occured.");}});}}
function setCookie(name,value,expDays){if(expDays){var date=new Date();date.setTime(date.getTime()+(expDays*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function setCookie2(name,value,expires,path,domain,secure){var date=new Date();date.setTime(date.getTime()+(expires*24*60*60*1000));var curCookie=name+"="+value+
((expires)?"; expires="+date.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");document.cookie=curCookie;}
function getCookie(name){var i,x,y,ARRcookies=document.cookie.split(";");for(i=0;i<ARRcookies.length;i++){x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);x=x.replace(/^\s+|\s+$/g,"");if(x==name)return unescape(y);}}
function deleteCookie(name){if(getCookie(name)){setCookie(name,"",-1);}}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function setMyShowroom(h){deleteCookie("myLocation");setCookie("myLocation",h,"365");showMyLocation();}
function deleteMyShowroom(){deleteCookie("myLocation");showMyLocation();}
function deleteMyZip(){deleteCookie("myZipCode");showMyLocation();}
function showMyLocation(){if($("#myLoc").length==1)$("#myLoc").remove();if(!getCookie("myLocation")&&getCookie("myZipCode"))
$("#innerLeftMenu").append("<div id=\"myLoc\">Your location: "+getCookie("myZipCode")+" <a href='javascript:void(0);' onclick='deleteMyZip()' style='color:#f00;text-decoration:underline;'><big>x</big></a></div><br />");if(getCookie("myLocation")){var leftMenuHeight=$("#innerLeftMenu").height();var leftMenuWidth=$("#innerLeftMenu").width();var itemWidth=leftMenuWidth-20;var itemTop=leftMenuHeight+parseInt(30);var str="<div id=\"myLoc\">";if(getCookie("myZipCode"))
str+="<div>Your location: "+getCookie("myZipCode")+" <a href='javascript:void(0);' onclick='deleteMyZip()' style='color:#f00;text-decoration:underline;'>x</a></div><br />";str+="<div style='border-bottom:1px solid white;padding-bottom:10px;'>Your home showroom:</div><br />";str+=getCookie("myLocation").replace(/h2/gi,"h3");str+="<br /><a href='javascript:void(0);' onclick='deleteMyShowroom();' style='color:#f00;text-decoration:underline;'>remove this location</a>";str+="</div>";$("#innerLeftMenu").append(str);}}
function getQueryString(key,default_){if(default_==null)default_="";key=key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regex=new RegExp("[\\?&]"+key+"=([^&#]*)");var qs=regex.exec(window.location.href);if(qs==null)return default_;else return qs[1];}﻿$(document).ready(function(){var isZipCookie=getCookie("myZipCode");var isMyLocCookie=unescape(getCookie("myLocation"));var curZip=(isZipCookie)?isZipCookie:"60601";$("#zipCode").val(curZip);if($("#showroomResults, #repResults").length>0){$('html').animate({scrollTop:"600px"},1000);}
var $goZipRadiusBtn=$("#goZipRadiusBtn");$goZipRadiusBtn.click(function(){var zipToSearch=$("#zipCode").val();var radiusToSearch=$("#zipRadius").val();window.location="/How-To-Buy/Showrooms/"+zipToSearch+"?radius="+radiusToSearch});$("#northAmericanLink").click(function(){var $thisTxt=$("#northAmericanLink a").text();if($thisTxt=="Show Canadian Map"){$("#northAmericanLink a").text("Show United States Map");$("#usaMap").attr("usemap","#canada")
$("#usaMap").attr("src","/Content/Images/canada.jpg");}
else{$("#northAmericanLink a").text("Show Canadian Map");$("#usaMap").attr("usemap","#USA")
$("#usaMap").attr("src","/Content/Images/usa.png");}});var url=window.location.pathname;if(url.match(/\/ON|\/AB|\/BC|\/MB|\/NB|\/NL|\/NT|\/NS|\/NU|\/ON|\/PE|\/QC|\/SK|\/YK/)){var $thisTxt=$("#northAmericanLink a").text();if($thisTxt=="Show Canadian Map"){$("#northAmericanLink a").text("Show United States Map");$("#usaMap").attr("usemap","#canada")
$("#usaMap").attr("src","/Content/Images/canada.jpg");}};});﻿$(document).ready(function(){$("div#myNews div label").each(function(){var curYear=(new Date).getFullYear();var labelYear=$(this).text();labelYear=labelYear.replace("+ ","").replace("- ","");if(labelYear==curYear){$("div#myNews div div#"+labelYear).show();$(this).text("- "+labelYear);}});$("div#myNews div label").click(function(){var labelYear=$(this).text();labelYear=labelYear.replace("+ ","").replace("- ","");var $itsDiv=$("div#myNews div div#"+labelYear);if($itsDiv.is(":visible")){$itsDiv.fadeOut("fast");$(this).text("+ "+labelYear);}
else{$itsDiv.fadeIn("fast");$(this).text("- "+labelYear);}});$("div#myNews div div a.headline").click(function(){var headlineId=$(this).attr("id");var $description=$("span#desc"+headlineId.replace("headline",""));if($description.is(":visible")){$description.fadeOut("fast");}
else{$description.fadeIn("fast");$description.css({"display":"block"});}});});﻿$(document).ready(function(){$("p#theColors a").mouseover(function(){var newColor=$(this).text();newColor=$(this).attr("id")+"_"+newColor.toLowerCase().replace(/ /g,"_").replace(/\//g,"_")+".jpg";var myClass=$(this).attr("class");var $bigImg=$("#prodImg-"+myClass);var oldImgName=$bigImg.attr("alt");var oldImgSrc=$bigImg.attr("src");var newImgSrc=oldImgSrc.replace(oldImgName,newColor).replace("/products/alternate/"+$(this).attr("id")+"/full/","/products/full/");$bigImg.attr("src",newImgSrc.replace("lineart","full"));$bigImg.attr("alt",newColor);$("#zoom").show();largeImg=newImgSrc.replace("full","hires");$("#prodDefaultColorLabel h3.txt-"+myClass).text($(this).text().toLowerCase());});$("p#theLineArt a").click(function(){var $lineDiv=$("#lineArtDiv");if($lineDiv.is(":visible")){$("#lineArtDiv").slideUp("fast");}
else{$("#lineArtDiv").slideDown("fast");}});$("p#additionalThumbs a").mouseover(function(){var $bigImg=$(".prodImg");var newColor=$(this).children("img").attr("title");var fileName=$(this).attr("file-name");var fixId=$(this).attr("fix-id");var oldImgName=$bigImg.attr("alt");var oldImgSrc=$bigImg.attr("src");var newImgSrc=oldImgSrc.replace(oldImgName,fileName);newImgSrc=newImgSrc.replace("/products/full/","/products/alternate/"+fixId+"/full/");$bigImg.attr("src",newImgSrc);$bigImg.attr("alt",fileName);$("#prodDefaultColorLabel h3").text(newColor);});$(function(){var $instMain=$("#instructionContainer"),$inst=$("#fixDetailInstruction"),$instMenu=$instMain.find(".instructions");$inst.bind("mouseover.dropdown",function(){if($instMenu.is(":visible")){$instMain.unbind("mouseout.dropdown");$instMenu.fadeOut("fast");}
else{$instMenu.fadeIn("fast");$instMain.mouseleave(function(){$instMenu.fadeOut("fast");});}});});if($("#productScroller").length){var $prodScoller=$("#productScroller");var $wrapper=$("#wrapper");var imgWidth=$("#scroller li").css("width").replace("px","");var visibleAreaWidth=$prodScoller.css("width").replace("px","");visibleAreaWidth=parseInt(visibleAreaWidth)+10;var totWidth=($prodScoller.attr("count")*imgWidth);var startLeft=($wrapper.position().left==0)?getCookie("scrollerPos"):$wrapper.position().left;var maxLeft=(totWidth*-1)+parseInt(visibleAreaWidth);var curPage=$("#curPage").val();var cookiedPage=getCookie("curCookiePage");if(cookiedPage&&cookiedPage!=curPage){deleteCookie("scrollerPos");}
setCookie("curCookiePage",curPage,365);$("#scroller ul").css({"width":totWidth+"px"});$("div.arrow-left, div.arrow-right").click(function(){if($(":animated").length)return false;else{startLeft=$wrapper.position().left;if($(this).hasClass("arrow-left")){if(startLeft<0){$wrapper.animate({left:parseInt(startLeft)+parseInt(visibleAreaWidth)+"px"},1000);startLeft=parseInt(startLeft)+parseInt(visibleAreaWidth);}}
if($(this).hasClass("arrow-right")){if(startLeft<=0&&startLeft>maxLeft){$wrapper.animate({left:startLeft-visibleAreaWidth+"px"},1000);startLeft=startLeft-visibleAreaWidth;}}}});$("ul#theList li a").click(function(){setCookie("scrollerPos",startLeft,365);});if(getCookie("scrollerPos")){$wrapper.animate({left:getCookie("scrollerPos")+"px"},1);}}});function emailToFriend(t){var url="http://www.lbllighting.com"+t.title;window.open("/Products/Email/?name="+url,"email",config='height=215,width=500, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no');}
function emailWishList(t){window.open("/WishList/Email/","email",config='height=160,width=435, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no');}﻿$(document).ready(function(){var curIndexItem=$("#gallerySlideShow ul").attr("cur-li");var totalItems=$("#gallerySlideShow ul").attr("tot-li");var totalIndexItems=totalItems-1;var $curGalImg;$("#galleryThumbs a img").click(function(){var $_this=$(this);var i=0;$("#gallerySlideShow ul li img.galImg").each(function(){if($_this.attr("alt")==$(this).attr("alt")){$(this).parent().show("normal");$curGalImg=$(this).parent();curIndexItem=i;}
else{$(this).parent().hide();}
i++;});showHideLeftArrow(curIndexItem);showHideRightArrow(curIndexItem,totalIndexItems);$("#gallerySlideShow").show("normal");});$("#galleryLeftArrow").click(function(){var prevIndexImage=curIndexItem-1;if(prevIndexImage>=0){$curGalImg.hide();$curGalImg.prev().fadeIn("slow")
$curGalImg=$curGalImg.prev();curIndexItem-=1;showHideLeftArrow(curIndexItem);showHideRightArrow(curIndexItem,totalIndexItems);}});$("#galleryRightArrow").click(function(){var nextIndexImage=parseInt(curIndexItem)+parseInt(1);if(nextIndexImage<=totalIndexItems){$curGalImg.hide();$curGalImg.next().fadeIn("slow")
$curGalImg=$curGalImg.next();curIndexItem+=1;showHideLeftArrow(curIndexItem);showHideRightArrow(curIndexItem,totalIndexItems);}});$("#gallerySlideShowClose").click(function(){$("#gallerySlideShow").hide("normal");});});function showHideLeftArrow(curIndexItem){if(curIndexItem==0){$("#galleryLeftArrow img").attr("src","/Content/Images/Gallery/off_left_arrow.gif");$("#galleryLeftArrow").removeClass("cursor-pointer");}
else{$("#galleryLeftArrow img").attr("src","/Content/Images/Gallery/full_left_arrow.gif");$("#galleryLeftArrow").addClass("cursor-pointer");}}
function showHideRightArrow(curIndexItem,totalIndexItems){if(curIndexItem==totalIndexItems){$("#galleryRightArrow img").attr("src","/Content/Images/Gallery/off_right_arrow.gif");$("#galleryRightArrow").removeClass("cursor-pointer");}
else{$("#galleryRightArrow img").attr("src","/Content/Images/Gallery/full_right_arrow.gif");$("#galleryRightArrow").addClass("cursor-pointer");}}﻿$(document).ready(function(){$("#hiResContainer a, #specSheetContainer a, #instructionsContainer a").click(function(){var $parentDiv=$(this).parent();var parentId=$parentDiv.attr("id");var systemId=$(this).attr("system-id");var subSystem2Id=$(this).attr("sub-system2-id");var whichParent=$(this).parent().parent().attr("id");var params="{ 'sysId' : '"+systemId+"', 'subSys2Id' : '"+subSystem2Id+"' }";if($("div."+parentId).length<=0){$parentDiv.append("<div class='"+parentId+"' style='padding:10px;font-size:10pt;'></div>");$("."+parentId).append("<div class='loading_"+parentId+"' style='padding:75px;'><img src='/Content/Images/loader.gif' alt='Loading' title='Loading' /></div>");if(whichParent=="hiResContainer"){$.ajax({type:"POST",url:"/Services/Downloads.asmx/GetHiRes",data:params,contentType:"application/json; charset=utf-8",dataType:"json",success:function(arg){LoadList(arg,parentId,whichParent);},error:function(arg){FailLoadList(parentId);}});}
else if(whichParent=="specSheetContainer"){$.ajax({type:"POST",url:"/Services/Downloads.asmx/GetSpecSheets",data:params,contentType:"application/json; charset=utf-8",dataType:"json",success:function(arg){LoadList(arg,parentId,whichParent);},error:function(arg){FailLoadList(parentId);}});}
else if(whichParent=="instructionsContainer"){$.ajax({type:"POST",url:"/Services/Downloads.asmx/GetInstructionSheets",data:params,contentType:"application/json; charset=utf-8",dataType:"json",success:function(arg){LoadList(arg,parentId,whichParent);},error:function(arg){FailLoadList(parentId);}});}}
else{if($("div."+parentId).is(":visible"))
$("div."+parentId).fadeOut("fast");else
$("div."+parentId).fadeIn("fast");}});});function LoadList(arg,parentId,whichParent){var html="<table width='100%'>";html+="   <tr>";var fixtures=arg.d;var numPerCols=0;var $parentDiv=$("."+parentId);$("div .loading_"+parentId).remove();if(fixtures&&fixtures.length>0){if(whichParent=="hiResContainer"||whichParent=="instructionsContainer"){numPerCols=(parentId=="hardware"||parentId=="outdoor")?Math.round(fixtures.length/2):Math.round(fixtures.length/4);html+=(parentId=="hardware"||parentId=="outdoor")?"<td align='left' valign='top' width='50%'>":"<td align='left' valign='top' width='25%'>\n";}
else if(whichParent=="specSheetContainer"){numPerCols=(parentId=="hardware"||parentId=="outdoor")?Math.round(fixtures.length/2):Math.round(fixtures.length/3);html+=(parentId=="hardware"||parentId=="outdoor")?"<td align='left' valign='top' width='50%'>":"<td align='left' valign='top' width='33%'>\n";}
$.each(fixtures,function(index,fixture){var i=index+1;var name=StripName(fixture.Name);if(whichParent=="hiResContainer"){html+="<a href='http://images.techlighting.com/Configurator/8/products/hires/"+fixture.Id+".zip' target='_blank' style='color:#666;'>"+name+"</a><br />";}
else if(whichParent=="specSheetContainer"){var spec=(!fixture.SpecSheet||fixture.SpecSheet=="")?"<a href='#' onclick=\"GenDownloadableSpec('"+fixture.Id+"', '"+fixture.Name+"');\" style='color:#666;'>":"<a href='/Products/OpenPdf/"+fixture.SpecSheet+"' style='color:#666;'>";html+="<input type='checkbox' title='"+RenameSpec(fixture.Name)+"' lang='"+fixture.SpecSheet+"' name='specs' alt='"+fixture.Name+"' value='"+fixture.Id+"' onclick=\"AddSpec(this, this.form, '"+RenameSpec(fixture.SpecSheet)+"', "+fixture.Id+")\"> "+spec+name+"</a><br />";}
else if(whichParent=="instructionsContainer"){html+="<a href='/Downloads/Instructions/"+fixture.Id+"' style='color:#666;'>"+name+"</a><br />";}
if(i%numPerCols==0){html+="</td><td align='left' valign='top'>";}});html+="</td>\n";html+="   </tr>";html+="</table>";$parentDiv.html(html);}
else FailLoadList(parentId);}
function FailLoadList(parentId){$("div .loading_"+parentId).remove();$("."+parentId).html("Sorry, but no products were found for this category.<br /><br />");}
function StripName(name){return name.replace("Suspension","").replace("Wall","").replace("Ceiling","").replace("Bath","").replace("Outdoor","").replace(/Head/gi,"").replace("Pendant","").replace(/With /gi,"w/").replace("Line-Voltage","").replace(/transformer/gi,"Xfmr").replace(/electronic/gi,"Elec").replace(/magnetic/gi,"Mag").replace(/monorail/gi,"MO").replace(/remote/gi,"Rmt").replace(/surface/gi,"Surf").replace(/illuminated/gi,"Illum");}
function RenameSpec(name){if(name)
return name.toLowerCase().replace(/ /g,"_").replace(/"/g,"").replace(/'/g,"").replace(/é/g,"e").replace(/\//g,"-");}
function AddSpec(t,f,name,id,filename){var displayList="";var listVal="";var listIds="";var $downloadList=$("#downloadSpecList");var $downloadListIDs=$("#downloadSpecListIDs");var totChecked=CntBoxes(t,f);var cnt=0;for(var i=0;i<f.elements.length;i++){if(f.elements[i].type=='checkbox'){if(f.elements[i].checked==true){displayList+="<div style='padding:1px;width:125px;font-size:8pt;'>"+f.elements[i].alt+"</div>";listVal+=(!f.elements[i].lang)?f.elements[i].title+",":f.elements[i].lang+",";listIds+=f.elements[i].value+",";cnt++;}}}
if(totChecked>0){displayList+="<br /><div style='padding-bottom:4px;'><a href='#' onclick='SubmitForm(this, this.form)' style='font-size:8pt;color:#ff6a27'>Download Specsheets</a></div>";displayList+="<div><a href='#' onclick='ClearSelected(this)' style='font-size:8pt;color:#ff6a27'>Clear All Selected</a></div>";}
$downloadList.attr("value",listVal);$downloadListIDs.attr("value",listIds);$("#specSheetList").html(displayList);}
function CntBoxes(t,f){var cnt=0;for(var i=0;i<f.elements.length;i++){if(f.elements[i].type=='checkbox')if(f.elements[i].checked==true)cnt++;}
if(cnt>10){alert("You have exceeded the maximum number of specsheets you can download at one time.");t.checked=false;}
return cnt;}
function ClearSelected(t){$('input:checkbox').removeAttr('checked');$("#downloadSpecList").attr("value","");$("#downloadSpecListIDs").attr("value","");$("#specSheetList").html("");}
function SubmitForm(t){var f=$("#myForm");f.submit();ClearSelected(t);}
function GenDownloadableSpec(id,filename){var params="{ 'name' : '"+filename+"', 'fixId' : '"+id+"' }";$.ajax({type:"POST",url:"/Services/Downloads.asmx/GenerateSpecSheet",data:params,contentType:"application/json; charset=utf-8",dataType:"json",success:function(arg){if(arg&&(arg.d!=null||arg.d!=""))window.open(arg.d,"_blank");},error:function(){alert("failed");}});}
