function validateForm(n,t){var i=0,r=$("#fNameLabel"),u=$("#lNameLabel"),f=$("#addy1Label"),e=$("#cityLabel"),o=$("#stateLabel"),s=$("#zipLabel"),h=$("#countryLabel"),c=$("#phoneLabel"),l=$("#emailLabel"),a=$("#fName"),v=$("#lName"),y=$("#addy1"),p=$("#city"),w=$("#state"),b=$("#zip"),k=$("#country"),d=$("#phone"),g=$("#email");a.val()?(r.text(""),i=0):(r.text("* First name is required"),i=1);v.val()?(u.text(""),i=0):(u.text("* Last name is required"),i=1);y.val()?(f.text(""),i=0):(f.text("* Address line 1 is required"),i=1);p.val()?(e.text(""),i=0):(e.text("* City is required"),i=1);w.val()?(o.text(""),i=0):(o.text("* State/Province/Region is required"),i=1);b.val()?(s.text(""),i=0):(s.text("* Zip Code/Postal Code is required"),i=1);k.val()?(h.text(""),i=0):(h.text("* Country is required"),i=1);d.val()?(c.text(""),i=0):(c.text("* Phone number is required"),i=1);g.val()?(l.text(""),i=0):(l.text("* Email number is required"),i=1);i==0&&t.submit()}function setEqualHeight(n,t){var i=0,r;n.each(function(){currentHeight=$(this).height();currentHeight>i&&(i=currentHeight)});n.height(i);r=i;$(t).css({"min-height":r+"px"})}var fireFoxCurVer="3.5",ieCurVer="9",operaCurVer="11",safariCurVer="5",chromeCurVer="15",BrowserDetect;$(document).ready(function(){function r(){var s=$(window).width(),t=$(window).height(),h=$("#fileName").val(),c=$("#largePath").val(),l=$("#totImages").val(),e=l-1,n=null,u=null,f=null,i=$("#hostName").val(),o;if($("#appDetails").show(),$("body").css({position:"fixed"}),$("#appDetails").width(s),$("#appDetails").height(t),$("#app").attr("src",c+h),t<=1075){var r=t-180<=400?400:t-180,a=r/900,v=Math.round(1200*a);$("#app").attr("height",r);$("#app").attr("width",v)}else r=t-175;$("#appDetails div div").width($("#appDetails div #app").attr("width"));$("#appDetails div").css({width:$("#appDetails div #app").attr("width")}).css({margin:"0 auto"});$("#arrows img")&&(o=r/2+25,$("#arrows img").css({top:o+"px"}),$("#arrows img").mouseover(function(){$(this).css({opacity:"1"}).css({filter:"alpha(opacity = 100)"})}),$("#arrows img").mouseout(function(){$(this).css({opacity:"0.5"}).css({filter:"alpha(opacity = 50)"})}),$("img#prev").unbind("click"),$("img#prev").click(function(){var t;n=$("#curImgIndex").val();u=n-1<0?0:n-1;t="#appDetailId"+u;$("#curImgIndex").val(u);$("#app").attr("src",i+"/Configurator/2/products/applications/large/"+$(t).children("img").attr("data-file"));$("#galTitle").html($(t).children("img").attr("gal-title"));var f=$(t).children("img").attr("gal-other"),e=$(t).children("img").attr("gal-location"),o=$(t).children("img").attr("gal-credits"),s=$(t).children("img").attr("gal-downloadable"),r="";f||e||o||s=="True"?(e&&(r+=e+"<br />"),f&&(r+=f+"<br />"),o&&(r+=o+"<br />"),s=="True"&&(r+="<a href='"+i+"/Configurator/2/products/applications/hires/"+$(t).children("img").attr("data-file")+"' target='_blank'>Download Hi-Res Image<\/a><br />"),$("#galText").html(r)):$("#galText").html("")}),$("img#next").unbind("click"),$("img#next").click(function(){var t;n=$("#curImgIndex").val();f=n*1+1>e?e:n*1+1;t="#appDetailId"+f;$("#curImgIndex").val(f);$("#app").attr("src",i+"/Configurator/2/products/applications/large/"+$(t).children("img").attr("data-file"));$("#galTitle").html($(t).children("img").attr("gal-title"));var u=$(t).children("img").attr("gal-other"),o=$(t).children("img").attr("gal-location"),s=$(t).children("img").attr("gal-credits"),h=$(t).children("img").attr("gal-downloadable"),r="";u||o||s||h=="True"?(o&&(r+=o+"<br />"),u&&(r+=u+"<br />"),s&&(r+=s+"<br />"),h=="True"&&(r+="<a href='"+i+"/Configurator/2/products/applications/hires/"+$(t).children("img").attr("data-file")+"' target='_blank'>Download Hi-Res Image<\/a><br />"),$("#galText").html(r)):$("#galText").html("")}))}var i=$.pgwBrowser(),u,n,t;$("a.iframe").fancybox({onComplete:function(){$("#fancybox-frame").attr("allowfullscreen","allowfullscreen")}});i.browser.name=="Chrome"&&i.os.group=="Mac OS"&&$(".prod_content h3").addClass("heavy");$("#links li.spec-sheets").hover(function(){$(".dropDownMenu-specsheet").fadeIn();$(".dropDownMenu-specsheet").mouseleave(function(){$(this).fadeOut()})});$("#links li.get-quote").hover(function(){$(".dropDownMenu-getQuote").fadeIn();$(".dropDownMenu-getQuote").mouseleave(function(){$(this).fadeOut()})});$("#links li.resources").hover(function(){$(".dropDownMenu-resources").fadeIn();$(".dropDownMenu-resources").mouseleave(function(){$(this).fadeOut()})});$("#links li.new-products").hover(function(){$(".dropDownMenu-new-products").fadeIn();$(".dropDownMenu-new-products").mouseleave(function(){$(this).fadeOut()})});$("#appslayout ul li img").mouseover(function(){$(this).css({opacity:"0.8"}).css({filter:"alpha(opacity = 80)"})});$("#appslayout ul li img").mouseout(function(){$(this).css({opacity:"1"}).css({filter:"alpha(opacity = 100)"})});$(".appDetailLink").click(function(){var f=$("#hostName").val(),n;$("#app").attr("src",f+"/ELEMENT/applications/large/loading.gif");var s=$(window).scrollTop(),h=$(this).children("img").attr("data-file"),e=$(this).children("img").attr("gal-title"),t=$(this).children("img").attr("gal-other"),i=$(this).children("img").attr("gal-location"),u=$(this).children("img").attr("gal-credits"),o=$(this).children("img").attr("gal-downloadable"),c=$(this).children("img").attr("gal-num"),f=$("#hostName").val();$("#curImgIndex").val($(this).children("img").attr("gal-index"));$("#winScroll").val(s);$("#fileName").val(h);r();n="";e&&$("#galTitle").html(e);(t||i||u||o=="True")&&(i&&(n+=i+"<br />"),t&&(n+=t+"<br />"),u&&(n+=u+"<br />"),o=="True"&&(n+="<a href='"+f+"/Configurator/2/products/applications/hires/"+$(this).children("img").attr("data-file")+"' target='_blank'>Download Hi-Res Image<\/a><br />"),$("#galText").html(n))});$(".newImage").hover(function(){$(this).parent("a").children("img").css("background-color","rgb(64, 64, 64)")},function(){$(this).parent().children().css("background-color","rgb(0, 0, 0)")});$("#close").click(function(){$("body").css({position:"relative"});var n=$("#winScroll").val();$("#appDetails").hide();$("#fileName").val("");$("#curImgIndex").val("")});$(".nav").click(function(){var n=$(this).attr("to");$("html, body").animate({scrollTop:$(n).offset().top-175},0)});$(".nav-sub-menu .dropdown-toggle").on("click",function(n){n.preventDefault();n.stopPropagation();$(this).toggleClass("active");$(this).next().toggleClass("hidden")});$(window).resize(function(){$("#appDetails").is(":visible")&&r("true")});$("a.catalog").click(function(){this.w=$(window).width();this.h=$(window).height();var n=$(this).attr("title"),t=window.open("//catalogs.generation-brands.com/ELEMENT-Lighting/"+n,"_blank","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0,height="+this.h+",width="+this.w);t.moveTo(0,0)});$("#queryGo").click(function(){var n=$("#query").val();window.location="/Products/Search/?query="+n});$("#query").on("keyup",function(n){if(n.which==13){var t=$("#query").val();window.location="/Products/Search/?query="+t}});$("#query").autocomplete({source:function(n,t){$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:"/Services/Services.asmx/GetSkus",dataType:"json",data:"{'value':'"+n.term+"'}",success:function(n){t($.map(n.d,function(n){return{label:n.Name,value:n.Name}}))}})},minLength:3,select:function(n,t){window.location="/Products/Sku/"+t.item.value},open:function(){},close:function(){},error:function(n,t){alert(t)}});$("div#myNews label").click(function(){var n=$(this).text(),t;n=n.replace("+ ","").replace("- ","");t=$("div#myNews div#"+n);t.is(":visible")?(t.fadeOut("fast"),$(this).text("+ "+n)):(t.fadeIn("fast"),$(this).text("- "+n))});u=$("#secondary #bottom");$(window).scroll(function(){var n=$(window).scrollTop()==0||$(window).scrollTop()<=120?0:$(window).scrollTop(),t=$("#content").height(),i=$(window).height()+$(window).scrollTop();u.stop().animate({marginTop:n+"px"},"normal");$(window).scrollTop()>120?($("#arrow").show(),$("#pageTitle").show()):($("#arrow").hide(),$("#pageTitle").hide())});n=!1;switch(BrowserDetect.browser){case"Explorer":BrowserDetect.version<ieCurVer&&(n=!0,t=ieCurVer);break;case"Chrome":BrowserDetect.version<chromeCurVer&&(n=!0,t=chromeCurVer);break;case"Opera":BrowserDetect.version<operaCurVer&&(n=!0,t=operaCurVer);break;case"Safari":BrowserDetect.version<safariCurVer&&(n=!0,t=safariCurVer);break;case"Firefox":BrowserDetect.version<fireFoxCurVer&&(n=!0,t=fireFoxCurVer)}n&&$("#links ul").append("<li><a href='/Home/BrowserUpgrade/?name="+BrowserDetect.browser+"&curVer="+BrowserDetect.version+"&recentVer="+t+"&os="+BrowserDetect.OS+"' class='red'>upgrade your browser<\/a><\/li>")});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(n){for(var i,r,t=0;t<n.length;t++)if(i=n[t].string,r=n[t].prop,this.versionSearchString=n[t].versionSearch||n[t].identity,i){if(i.indexOf(n[t].subString)!=-1)return n[t].identity}else if(r)return n[t].identity},searchVersion:function(n){var t=n.indexOf(this.versionSearchString);if(t!=-1)return parseFloat(n.substring(t+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();$(document).ready(function(){$(window).load(function(){$("#prodDesc #prodImg .flexslider").flexslider({pauseOnHover:!0,start:function(){$(".flexslider").removeClass("loading")},controlNav:!1,after:function(n){n.playing||n.play()}})});setEqualHeight($("#3in > div"),"#3in");$("#ledonly").click(function(){var r=$(this).is(":checked"),u,t,n,i;r==!0?$(".cmh").addClass("hide"):($(".cmh").removeClass("hide"),$(".product span").css({float:"none"}),u=$("#3trims").is(":visible")?-95:150,t=$("#3trims").height()/4+534,$(".product span").css({float:"left"}),n="#3in > div",i="#3in",$(n).height(t),setEqualHeight($(n),i))});var n=$("#prodDesc #bottom");$(window).scroll(function(){var t=$(window).scrollTop()==0||$(window).scrollTop()<=120?10:$(window).scrollTop();n.stop().animate({marginTop:t+"px"},"normal");$(window).scrollTop()>120?$("#arrow").show():$("#arrow").hide()});$(".jumpNav").on("click",function(){var n=$(this).data("target");$("html,body").animate({scrollTop:$(n).offset().top-150},"slow")});$(".back-to-top-arrow").on("click",function(){$("html, body").animate({scrollTop:0},"normal")});$("#instlink").bind("click.dropdown",function(){$("#instfiles").is(":visible")?($("#instfiles").unbind("mouseout.dropdown"),$("#instfiles").fadeOut()):($(".downloads").is(":visible"),$(".downloads").fadeOut(),$("#instfiles").fadeIn("normal"),$("#instfiles").mouseleave(function(){$("#instfiles").fadeOut()}))});$("#ieslink").bind("click.dropdown",function(){$("#iesfiles").is(":visible")?($("#iesfiles").unbind("mouseout.dropdown"),$("#iesfiles").fadeOut()):($(".downloads").is(":visible"),$(".downloads").fadeOut(),$("#iesfiles").fadeIn("normal"),$("#iesfiles").mouseleave(function(){$("#iesfiles").fadeOut()}))});$("#speclink").bind("click.dropdown",function(){$("#specfiles").is(":visible")?($("#specfiles").unbind("mouseout.dropdown"),$("#specfiles").fadeOut()):($(".downloads").is(":visible"),$(".downloads").fadeOut(),$("#specfiles").fadeIn("normal"),$("#specfiles").mouseleave(function(){$("#specfiles").fadeOut()}))});$("#revitlink").bind("click.dropdown",function(){$("#revitfiles").is(":visible")?($("#revitfiles").unbind("mouseout.dropdown"),$("#revitfiles").fadeOut()):($(".downloads").is(":visible"),$(".downloads").fadeOut(),$("#revitfiles").fadeIn("normal"),$("#revitfiles").mouseleave(function(){$("#revitfiles").fadeOut()}))});$("#videolink").bind("click.dropdown",function(){$("#videofiles").is(":visible")?($("#videofiles").unbind("mouseout.dropdown"),$("#videofiles").fadeOut()):($(".downloads").is(":visible"),$(".downloads").fadeOut(),$("#videofiles").fadeIn("normal"),$("#videofiles").mouseleave(function(){$("#videofiles").fadeOut()}))});$(".imageFolderBox a").click(function(){var n=$(this).attr("class");$("div.lazy").each(function(){n=="all"?$(this).removeClass("hide"):($(this).removeClass("hide"),$(this).hasClass(n)||$(this).addClass("hide"))});$("span.imageFolderBox").removeClass("on");$(this).parent("span.imageFolderBox").addClass("on")})});$(document).ready(function(){})