var product_pages={abo:"about",env:"environment",gal:"gallery",vie:"swatches",sto:"stockists",pro:"enquiry",spe:"specials"};var opensection;var opensectionid;var newsarticles={};var openarticleid;var cachedcontent={};jQuery.preloadImages=function(){for(var a=0;a<arguments[0].length;a++){jQuery("<img>").attr("src",arguments[0][a])}};function validEmail(a){var b=/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i;return b.test(a)}function isIE6(){var a=$.browser.msie;var b=$.browser.version.substr(0,1);return((a)&&(b<7))}function isIE7(){var a=$.browser.msie;var b=$.browser.version.substr(0,1);return((a)&&(b<8))}function toStep1(){$("#tit-step1").toggleClass("closed");if(isIE6()){$(".list").toggle();$(".form").toggle()}else{$(".list").slideToggle({duration:500,easing:"easeInOutCubic"});$(".form").slideToggle({duration:500,easing:"easeInOutCubic"})}}function toStep2(){var a=[];$(".list input:checked").each(function(){a.push($(this).val())});$("#swatchlist").val(a.join(", "));$("#swatch_sum p").html(a.join(", ")+'<br /><a href="javascript:toStep1();" tabindex="3">Edit this list</a>');if(a.length==0){jAlert("Please select a swatch first...","No Swatch Selected...")}else{$("#tit-step1").toggleClass("closed");if(isIE6()){$(".list").toggle();$(".form").toggle()}else{$(".list").slideToggle({duration:500,easing:"easeInOutCubic"});$(".form").slideToggle({duration:500,easing:"easeInOutCubic"})}}}function toggleStep1Step2(){if(list.length==0){jAlert("Please select a swatch first...","No Swatch Selected...")}else{$("#tit-step1").toggleClass("closed");if(isIE6()){$(".list").toggle();$(".form").toggle()}else{$(".list").slideToggle({duration:500,easing:"easeInOutCubic"});$(".form").slideToggle({duration:500,easing:"easeInOutCubic"})}adjustProductHeight()}}function orderSwatches(){var a=[];if(!validEmail($("#f-email").val())){a.push("Please enter a valid <em>Email Address</em>")}if($("#f-for option:selected").val()==""){a.push("Please select <em>Who</em> this is for")}if($("#f-address").val()==""){a.push("Please enter a <em>Physical Address</em>")}if(a.length>0){jAlert(a,"Order Form Incomplete...");return}var b=$("#f-copy:checked").val();if(b==null){b="no"}$.post("/form/order-swatches",{division:$("#f-division").val(),productid:$("#f-productid").val(),countrycode:$("#f-countrycode").val(),list:$("#swatchlist").val(),email:$("#f-email").val(),whofor:$("#f-for option:selected").val(),address:$("#f-address").val(),comments:$("#f-comments").val(),emailcopy:b});$("#tit-step2").addClass("closed");if(isIE6()){$("#tit-step1").hide();$(".form").hide();$(".thanks").show()}else{$("#tit-step1").slideUp({duration:500,easing:"easeInOutCubic"});$(".form").slideUp({duration:500,easing:"easeInOutCubic"});$(".thanks").slideDown({duration:500,easing:"easeInOutCubic"})}}function resetSwatches(){$(".list input:checked").each(function(){$(this).attr("checked","")});$("#tit-step1").removeClass("closed");if(isIE6()){$("#tit-step1").show();$(".list").show();$(".thanks").hide()}else{$("#tit-step1").slideDown({duration:500,easing:"easeInOutCubic"});$(".list").slideDown({duration:500,easing:"easeInOutCubic"});$(".thanks").slideUp({duration:500,easing:"easeInOutCubic"})}}function sendGeneralEnquiry(){var b=[];var e="";if($("#f-name").val()==""){b.push("Please enter your <em>Name</em>")}if($("#f-company").val()==""){b.push("Please enter the name of your <em>Company</em>")}var d=$("#f-gmethod option:selected").val();if(d==""){b.push("Please select a <em>Method</em> for Autex to contact you")}else{if(d=="email"){e=$("#f-email").val();if(!validEmail(e)){b.push("Please enter a valid <em>Email Address</em>")}}else{if(d=="phone"){e=$("#f-phone").val();if(e==""){b.push("Please enter a <em>Phone Number</em>")}}else{if(d=="fax"){e=$("#f-fax").val();if(e==""){b.push("Please enter a <em>Fax Number</em>")}}}}}var a=[];$("#field-business input:checked").each(function(){a.push($(this).val())});if(($("#f-otherbusiness").val()=="")||($("#f-otherbusiness").val()==$("#f-otherbusiness").attr("title"))){if(a.length==0){b.push("Please define your <em>Type of Business</em>")}}else{a.push($("#f-otherbusiness").val())}if($("#f-subject").val()==""){b.push("Please enter the <em>Subject</em> of this Enquiry")}if($("#f-comments").val()==""){b.push("Please enter some <em>Comments</em> to go with this Enquiry")}if($("#f-region").val()==""){b.push("Please enter the <em>Region</em> of this Enquiry")}if(b.length>0){jAlert(b,"Enquiry Form Incomplete...");return}var c=$("#f-copy:checked").val();if(c==null){c="no"}$.post("/form/general-enquiry",{division:$("#f-division").val(),countrycode:$("#f-countrycode").val(),name:$("#f-name").val(),company:$("#f-company").val(),method:d,methodvalue:e,business:a.join(", "),subject:$("#f-subject").val(),comments:$("#f-comments").val(),region:$("#f-region").val(),productenquiry:$("#f-productenquiry").val(),emailcopy:c});if(isIE6()){$(".form-thanks").show();$(".form-fill").hide()}else{$(".form-thanks").slideDown({duration:500,easing:"easeInOutCubic"});$(".form-fill").slideUp({duration:500,easing:"easeInOutCubic"})}}function sendExportEnquiry(){var d=[];if($("#f-name").val()==""){d.push("Please enter your <em>Name</em>")}if($("#f-company").val()==""){d.push("Please enter the name of your <em>Company</em>")}var f=$("#f-method option:selected").val();if(f==""){d.push("Please select a preferred <em>Contact Method</em>")}else{if(f=="email"){if(!validEmail($("#f-email").val())){d.push("Please enter a valid <em>Email Address</em>")}}else{if(f=="phone"){if($("#f-phone").val()==""){d.push("Please enter a <em>Phone Number</em>")}}else{if(f=="fax"){if($("#f-fax").val()==""){d.push("Please enter a <em>Fax Number</em>")}}else{if($("#f-method-other").val()==""){d.push("Please enter an <em>Alternate Contact Method</em>")}}}}}if($("#f-address").val()==""){d.push("Please enter a <em>Physical Address</em>")}if($("#f-country").val()==""){d.push("Please enter your <em>Country</em>")}var b=[];$("#field-business input:checked").each(function(){b.push($(this).val())});if(($("#f-otherbusiness").val()=="")||($("#f-otherbusiness").val()==$("#f-otherbusiness").attr("title"))){if(b.length==0){d.push("Please define your <em>Type of Business</em>")}}else{b.push($("#f-otherbusiness").val())}var c=[];$("#field-products input:checked").each(function(){c.push($(this).val())});if(($("#f-otherproducts").val()=="")||($("#f-otherproducts").val()==$("#f-otherproducts").attr("title"))){if(c.length==0){d.push("Please define the <em>Products you are interested in</em>")}}else{c.push($("#f-otherproducts").val())}if($("#f-requirements").val()==""){d.push("Please enter your <em>Requirements</em>")}if($("#f-region").val()==""){d.push("Please enter the <em>Region</em> of this Enquiry")}if(d.length>0){jAlert(d,"Export Form Incomplete...");return}var e=$("#f-copy:checked").val();if(e==null){e="no"}var a=$("#f-method-other").val();if(a==$("#f-method-other").attr("title")){a=""}$.post("/form/export-enquiry",{countrycode:$("#f-countrycode").val(),name:$("#f-name").val(),company:$("#f-company").val(),method:f,email:$("#f-email").val(),phone:$("#f-phone").val(),fax:$("#f-fax").val(),other:a,website:$("#f-website").val(),address:$("#f-address").val(),country:$("#f-country").val(),business:b.join(", "),divisions:c.join(", "),requirements:$("#f-requirements").val(),productref:$("#ref-product").val(),region:$("#f-region").val(),emailcopy:e});if(isIE6()){$(".form-thanks").show();$(".form-fill").hide()}else{$(".form-thanks").slideDown({duration:500,easing:"easeInOutCubic"});$(".form-fill").slideUp({duration:500,easing:"easeInOutCubic"})}}function sendInfoRequest(){var a=[];if($("#f-name").val()==""){a.push("Please enter your <em>Name</em>")}if($("#f-address").val()==""){a.push("Please enter a <em>Physical Address</em>")}if(!validEmail($("#f-email").val())){a.push("Please enter a valid <em>Email Address</em>")}if(($("#f-type1").val()=="")||($("#f-type2").val()=="")){a.push("Error - incomplete information")}if(a.length>0){jAlert(a,"Export Form Incomplete...");return}var b=$("#f-copy:checked").val();if(b==null){b="no"}$.post("/form/request-info",{division:$("#f-division").val(),countrycode:$("#f-countrycode").val(),name:$("#f-name").val(),address:$("#f-address").val(),phone:$("#f-phone").val(),email:$("#f-email").val(),type1:$("#f-type1").val(),type2:$("#f-type2").val(),emailcopy:b});if(true){$(".form-thanks").show();$(".form-fill").hide()}else{$(".form-thanks").slideDown({duration:500,easing:"easeInOutCubic"});$(".form-fill").slideUp({duration:500,easing:"easeInOutCubic"})}}function closeNewsArticle(a){$("#"+a).removeClass("open");$("#"+a+" p:first").html(newsarticles[a].substr(0,130)+"...");$("#"+a+" p:not(:first)").hide();$("#"+a+" h4").hide();$("#"+a+" .gimages").hide();$("#"+a+" .links").hide();if(openarticleid==a){openarticleid=undefined}$("#"+a+" .morelink").html("Read More");$("#"+a+" .morelink").unbind();$("#"+a+" .morelink").click(function(){openNewsArticle(a);return false})}function openNewsArticle(a){if((openarticleid!=undefined)&&(openarticleid!=a)){closeNewsArticle(openarticleid)}$("#"+a).addClass("open");$("#"+a+" p:first").html(newsarticles[a]);$("#"+a+" p").show();$("#"+a+" h4").show();$("#"+a+" .gimages").show();$("#"+a+" .links").show();openarticleid=a;$("#"+a+" .morelink").html("Close");$("#"+a+" .morelink").unbind();$("#"+a+" .morelink").click(function(){closeNewsArticle(a);return false})}function setOpenSectionEvents(a){$(a).each(function(){$(this).click(function(){var b=$(this).parent().parent().prev().prev().html()+" : "+$(this).html();if(opensectionid!=""){$(opensection).parent().toggleClass("open");$(opensection).next().slideToggle({duration:500,easing:"easeInOutCubic"})}if(opensectionid!=b){$(this).parent().toggleClass("open");$(this).next().slideToggle({duration:500,easing:"easeInOutCubic"});opensectionid=b;opensection=$(this)}else{opensectionid=opensection=""}return false})})}function getProductPageContent(c,b,a){$.get("/retrieve-page/"+c+"/"+b+"/"+a,function(k){cachedcontent[a]=k;var d=[];var g=[/url\(.*?\.jpg|gif|png/gi,/rc=\".*?\.jpg|gif|png/gi];for(var f=0;f<g.length;f++){var h=k.match(g[f]);if(h!=null){for(var e=0;e<h.length;e++){d.push(h[e].substr(4))}}}$.preloadImages(d)})}function viewNewsArchive(){$(".articles .butwrap").hide();$(".articles .archive").slideDown()}function setupFormFieldEvents(){$(".textfield input").each(function(){$(this).focus(function(){$(this).css({backgroundPosition:"left bottom"})});$(this).blur(function(){$(this).css({backgroundPosition:"left top"})})});$("input.defvalue").each(function(){$(this).addClass("def");$(this).focus(function(){$(this).css({backgroundPosition:"left bottom"});if($(this).val()==$(this).attr("title")){$(this).removeClass("def");$(this).val("")}});$(this).blur(function(){$(this).css({backgroundPosition:"left top"});if($(this).val()==""){$(this).addClass("def");$(this).val($(this).attr("title"))}})});$(".textarea textarea").each(function(){$(this).focus(function(){$(this).parent().css({backgroundPosition:"left bottom"})});$(this).blur(function(){$(this).parent().css({backgroundPosition:"left top"})})});$(".select select").each(function(){$(this).mouseover(function(){$(this).parent().css({backgroundPosition:"left bottom"})});$(this).focus(function(){$(this).parent().css({backgroundPosition:"left bottom"})});$(this).mouseout(function(){$(this).parent().css({backgroundPosition:"left top"})});$(this).blur(function(){$(this).parent().css({backgroundPosition:"left top"})});$(this).change(function(){var a=$(this).children("option:selected");var b=$(a).val();$(this).prev().html($(a).html())})});$("#f-gmethod").change(function(){var a=["email","phone","fax"];var c=$(this).children("option:selected").val();for(var b=0;b<a.length;b++){if(a[b]==c){$("#method-"+c).slideDown({duration:300,easing:"easeOutCubic"})}else{$("#method-"+a[b]).hide()}}if(c=="email"){$("#field-copy").show()}else{$("#field-copy").hide()}})}$(document).ready(function(){setupFormFieldEvents();$("#menu").each(function(){var a=[];$("#menu li").find("a").each(function(){a.push($(this).html().substr(0,3).toLowerCase())});var c=$("#container").attr("class").substr(9);var d=$("#colr h1 a").attr("href").substr(1,2);for(var b=0;b<a.length;b++){getProductPageContent(d,c,a[b])}$.preloadImages(["/img/form/bg-menu.jpg","/img/but/autex-gallery.png","/img/but/backto-step1.png","/img/but/next-step.png","/img/icon/item-toggle.png","/img/icon/matrix-open.png"])});$("#menu li").find("a").click(function(){$("#menu .sel").removeClass("sel");$(this).parent().addClass("sel");var d=$(this).html().substr(0,3).toLowerCase();var b=cachedcontent[d];$("#page-content").html(b);if(!$.browser.msie){$("#page-content").hide();$("#page-content").fadeIn(300)}setupFormFieldEvents();$(".swatches .form").hide();$(".swatches .thanks").hide();tb_init("a.thickbox");setOpenSectionEvents(".country .opt");try{if(pageTracker){var a=window.location+"";var e=a.substr(a.search(/autexindustries/)+20).split("/");pageTracker._trackPageview("/"+e[0]+"/"+e[1]+"/"+e[2]+"/"+product_pages[d])}}catch(c){}return false});$(".news li.article").each(function(){var a=$(this).attr("id");newsarticles[a]=$(this).find("p:first").html();$(this).find("p:first").html(newsarticles[a].substr(0,130)+"...");$(this).find("p").hide();$(this).find("h4").hide();$(this).find(".images").hide();$(this).find(".links").hide();$(this).find("p:first").show();$(this).find(".morelink").click(function(){openNewsArticle(a);return false});if($(this).hasClass("selected")){openNewsArticle(a)}});$("#f-method").change(function(){var a=["email","phone","fax","other"];var c=$(this).children("option:selected").val();if(c=="email"){$("#field-copy").show()}else{$("#field-copy").hide()}for(var b=0;b<4;b++){if(a[b]==c){if(b<3){$("#field-"+a[b]).prev().find("em").html("(required)")}else{$("#field-method-other").prev().addClass("nomargin");$("#field-method-other").slideDown({duration:300,easing:"easeOutCubic"})}}else{if(b<3){$("#field-"+a[b]).prev().find("em").html("")}else{$("#field-method-other").prev().removeClass("nomargin");$("#field-method-other").hide()}}}});$("#gobut").click(function(){var a=$("#f-division").children("option:selected").val();if(a==""){$(".division").each(function(){$(this).show()})}else{$(".division").each(function(){$(this).hide()});$("."+a).each(function(){$(this).show()})}return false});if($.browser.opera){if($("#filterby").html()!=undefined){$("#division-select").css("background","none")}}setOpenSectionEvents(".country .opt");setOpenSectionEvents(".matrix .division .opt");$("a.video").click(function(){var f=$(this).attr("rel");var c=$('<div id="TB_overlay" class="TB_overlayBG">').appendTo("body");var e=$('<div id="TB_window">').appendTo("body").show().css({marginLeft:"-427px",marginTop:"-255px",width:"854px"});var a=$('<div id="TB_Header"><a href="#" id="TB_ImageOff" title="Close">Close Window</a></div>').appendTo(e);var d=$('<iframe width="853" height="510" src="http://www.youtube.com/embed/'+f+'?rel=0&autoplay=1&modestbranding=1" frameborder="0" allowfullscreen></iframe>').appendTo(e);var b=function(){$("iframe").remove();$("#TB_window").remove();$("#TB_overlay").remove()};c.click(b);$("a",a).click(function(){b();return false});return false})});
