$(function(){setInterval(function(){$(window).width()<1186?$("#extra1").hide():$("#extra1").show()},1);var d=$("#sidebar > dl.menu");var b=d.children("dd").hide();var f=b.prev("dt");f.addClass("closed").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).click(function(){$(this).toggleClass("closed").nextUntil("dt").toggle();return false});var a=$("#pros > h1").attr("title")||"notitle";d.children().has("a[title='"+a+"'], a[title^='"+a+"']").addClass("current").filter("dd").prevAll("dt:first").removeClass("closed").nextUntil("dt").show();$("#sidebar > h2").css("cursor","pointer").click(function(){$(this).next("dl, ul").slideToggle("fast");return false}).filter(".closed").next(":not(:has('.current'))").slideToggle("fast");if($("#pager > em").text()=="1 / 1"){$("#pager").addClass("hide")}if($("#pros > div.pager > span.list").text()==""){$("#pros > div.pager").hide()}$("body#type_list #pros > div.list:first").addClass("first");$("#sform input:text").focus(function(){if(this.value=="Keywords, Number or Model, For example: IP-4-A"||this.value=="Palabras claves, número o modelo, por ejemplo: IP-4-A"){this.value=""}}).blur(function(){if(this.value==""){this.value=this.defaultValue}});var h=$("#picview > a");var g=$("#color > li > a");g.click(function(){var i=this.href;h.attr("href",i).children("img").stop(true,true).fadeOut(800,function(){var j=$(this);if(this.src==i){j.fadeIn(800)}else{j.attr("src",i).load(function(){j.fadeIn(800)})}});$(this).parent().addClass("current").siblings().removeClass("current");return false});$("#footer img").removeAttr("alt");$("#links a.external_links").attr("target","_blank");if($.browser.msie&&$.browser.version<7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var c=$("#extra1 a.msn");c.css("position","absolute");$(window).scroll(function(){c.animate({top:$(document).scrollTop()+30+"px"},1)})}if($.browser.safari){$("body").css("margin","0");$("ul").css("padding","0")}if($("body.jqbox.jqpager").length){$.getScript("/js/jqlazyload.js",function(){$("#pros > div.hide > a > img").lazyload({placeholder:"/img/loading.gif",effect:"fadeIn"})})}if($("body.jqbox").length){$.getScript("/js/jqbox.js",function(){$('#pros > div > h3 > a[href$=".jpg"]').lightBox();$("#main .jqbox").each(function(){$(this).find('a[href$=".jpg"]').lightBox()})})}if($("body.jqpager").length){$.getScript("/js/jqpager.js",function(){$("#pros > div").quickpaginate({perpage:20,pager:$("#jqpager")});$("#pros > div.poster").quickpaginate({perpage:1,pager:$("#jqpager")})})}});$.getScript("/js/scroll2top.min.js");$(window).load(function(){var r=$("#gallery");r.children("dt").css({opacity:0}).siblings("dd").css({opacity:0.7,bottom:"-100px"});r.children("dt.show").css({opacity:1}).next("dd").css({bottom:0});setTimeout(function(){gallery(r)},1400);r.hover(function(){$(this).css("opacity",0.9)},function(){$(this).css("opacity",1)});var l=$("#banner > ul.num > li");var s=l.length;var e=1;var f;l.mouseover(function(){e=l.index(this);showImg(e)}).eq(0).mouseover();$("#banner").hover(function(){clearInterval(f)},function(){f=setInterval(function(){if(++e==s){e=0}showImg(e)},5000)}).trigger("mouseleave");if($("body.view").length){var g=$("#picview > a:first");var j=g.next().add(g.parent().next());var h=new Image();h.src=g.children("img")[0].src;var q=h.width>587?587:h.width;g.toggle(function(){$(this).animate({width:q+"px",height:q+"px"},300);j.hide()},function(){$(this).animate({width:"307px",height:"307px"},300,function(){j.show()})})}var c=1;var m=5;var o;var d=$("#hot_products > div.tips > span");var a=$("#hot_products > div.prolist > ul");var k=$("#hot_products > div.btn > span");var n=a.children("li").length;var p=Math.ceil(n/m);var b=a.parent().width();$("#hot_products").hover(function(){clearInterval(o)},function(){o=setInterval(function(){scroll_next()},5000)}).trigger("mouseleave");k.filter(".next").click(scroll_next=function(){if(!a.is(":animated")){if(c==p){a.animate({left:0},1000);c=1}else{a.animate({left:"-="+b},1000);c++}d.eq(c-1).addClass("current").siblings().removeClass("current")}});k.filter(".prev").click(function(){if(!a.is(":animated")){if(c==1){a.animate({left:"-="+b*(p-1)},1000);c=p}else{a.animate({left:"+="+b},1000);c--}d.eq(c-1).addClass("current").siblings().removeClass("current")}});if($("#vip_form").length){$.getScript("/js/jq.validate.js",function(){jQuery.validator.addMethod("tel",function(u,t){u=u.replace(/\s+/g,"");var i=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;return this.optional(t)||u.match(/^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/)||i.test(u)},"Please specify a valid tel number");jQuery.validator.addMethod("phone",function(w,v){w=w.replace(/\s+/g,"");var u=/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/;var t=/^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/;var i=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;return this.optional(v)||w.match(t)||w.match(u)||i.test(w)},"Please specify a valid phone number");$("#vip_form").validate({rules:{country:"required",company:"required",name:{required:true,minlength:2},email:{required:true,email:true},tel:{required:true,phone:true},fax:{required:true,tel:true}},messages:{country:"Please enter your country",company:"Please enter your company name",name:{required:"Please enter your name",minlength:"Your name must consist of at least 2 characters"},email:"Please enter a valid email address",tel:{required:"Please enter your tel number",minlength:"Please specify a valid phone number"},fax:{required:"Please enter your fax number",minlength:"Please specify a valid fax number"}}})})}});function gallery(c){var b=c.children("dt.show");var a=b.next("dd").next("dt").length?b.next("dd").next("dt"):c.children("dt:first");a.css({opacity:0}).addClass("show").fadeTo(1000,1);b.fadeTo(1000,0).removeClass("show");b.next("dd").removeClass("show").css({bottom:"-100px"});a.next("dd").addClass("show").animate({bottom:0},400);setTimeout(function(){gallery(c)},4000)}function showImg(b){var a=$("#banner").height();$("#banner > ul.slider").stop(true,false).animate({top:-a*b},600);$("#banner > ul.num > li").removeClass("on").eq(b).addClass("on")};

