function mouseleaveFunction(a){a.removeClass("active")}function mouseoverFunction(a){if(a.children("input").prop("checked")){a.addClass("active");var b=a.position();var c=a.find("div.dropdownContentBox");c.css("left",b.left+"px").css("top",b.top+25+"px");c.scrollTop(0)}}function showPreview(a){if(parseInt(a.w)>0){var b=100/a.w;var c=100/a.h;jQuery("#preview").css({width:Math.round(b*500)+"px",height:Math.round(c*370)+"px",marginLeft:"-"+Math.round(b*a.x)+"px",marginTop:"-"+Math.round(c*a.y)+"px"})}}function openLightBox(a){if($("#usercomments").length!=0){$("div").remove(".lightboxiframe-holder")}$("body").append('<div class="lightboxiframe-holder" style="display:none;"><div id="usercomments"><iframe width="490" height="452" frameborder="0" src="'+a+'" scrolling="no"></iframe></div><a id="lightbox_link" href="#usercomments">LightBox</a></div>');$("#lightbox_link").fancybox().trigger("click")}function signinTextCheck(){$(this).parentsUntil("div#tmSignUp").find("input:not([type='image'])").each(function(){if(!$(this).val()==""){$(this).parent().addClass("withoutText")}else{$(this).parent().removeClass("withoutText")}})}function clearPassword(){if($("#tmSignUp input[type='password']").val()!=""){$("#tmSignUp input[type='password']").attr("class","txt-input")}clearInterval(loginValidate)}function openWindow(a,b,c){window.open(a,b,c)}function CurrencyFormatted(a){a=a.toString().replace(/\$|\,/g,"");if(isNaN(a))a="0";sign=a==(a=Math.abs(a));a=Math.floor(a*100+.50000000001);cents=a%100;a=Math.floor(a/100).toString();if(cents<10)cents="0"+cents;for(var b=0;b<Math.floor((a.length-(1+b))/3);b++)a=a.substring(0,a.length-(4*b+3))+","+a.substring(a.length-(4*b+3));return(sign?"":"-")+a+"."+cents}var loginValidate;$(function(){$("#tmSignUp input[type='text']").click(function(){loginValidate=setInterval(clearPassword,10)});$("#tmSignUp div input:not([type='image'])").each(function(){if(!$(this).val()==""){$(this).parent().addClass("withoutText")}else{$(this).parent().removeClass("withoutText")}$(this).focus(function(){if($(this).val()==""){$(this).parent().addClass("withoutText")}});$(this).focusout(signinTextCheck)})});$(document).ready(function(){try{var b=0;var e=400;var f=$(".product-filter-category ul ul");for(d=0;d<f.length;d++){b+=f.eq(d).height();if(b>e){b-=f.eq(d).height();for(c=0;c<f.eq(d).children("li").eq(c).length;c++){b+=f.eq(d).children("li").eq(c).height();varHeight=b;if(b>=e-varHeight){b-=f.eq(d).children("li").eq(c).height();varHeight=b;for(a=0;a<f.eq(d).children("li").eq(c).children("ul").children("li").length;a++){b+=f.eq(d).children("li").eq(c).children("ul").children("li").eq(a).height();if(b>=e-varHeight){$(".product-filter-category ul").eq(0).attr("style","height:"+(b+15)+"px;overflow:hidden;");$('<div style="padding:0px 10px 15px 10px; background:#E9E9E9; text-align:center"><a style="display:block; cursor:pointer" class="more-cats"><img src="pics/search/btn-more-categories.gif" /></a></div>').insertAfter($(".product-filter-category ul").eq(0));break}}break}}$(".more-cats").click(function(){$(".product-filter-category ul").eq(0).attr("style","height: auto;");$(this).parent().hide()});break}}b=0;e=200;f=$(".brandsHide");for(i=0;i<f.children("li").length;i++){b+=f.children("li").eq(i).height();if(b>e){$(".brandsHide").attr("style","height:"+b+"px;overflow:hidden;");$('<div style="padding:0px 10px 15px 10px; background:#E9E9E9; text-align:center"><a style="display:block; cursor:pointer" class="more-brands"><img src="pics/search/btn-more-brands.gif" /></a></div>').insertAfter(f);$(".more-brands").click(function(){$(".brandsHide").attr("style","height: auto;");$(this).parent().hide()});break}}}catch(g){}try{$(".merchant-tooltip").css("display","none");$(".merchant-tooltip").offset({top:-9999,left:-9999});$(".shop-info a").mouseover(function(a){if($(this).hasClass("off")){$(".tooltip-text").html("Not available for this eShop")}else{$(".tooltip-text").html($(this).html())}var b=$(".merchant-tooltip").width()/2;$(".merchant-tooltip").css("display","block");$(".merchant-tooltip").offset({top:a.pageY-45,left:a.pageX-b})});$(".shop-info a").mouseout(function(a){$(".merchant-tooltip").css("display","none");$(".merchant-tooltip").offset({top:-9999,left:-9999})})}catch(g){}try{$(".txtMerchantNotes").focus(function(){if($(this).val()=="Kindly leave any additional comment you would like to store with the order"){$(this).val("")}});$(".txtMerchantNotes").blur(function(){if($(this).val()==""){$(this).val("Kindly leave any additional comment you would like to store with the order")}})}catch(g){}try{$(".txtComment").focus(function(){if($(this).val()=="Kindly leave any additional comment you would like to send to the seller"){$(this).val("")}});$(".txtComment").blur(function(){if($(this).val()==""){$(this).val("Kindly leave any additional comment you would like to send to the seller")}})}catch(g){}try{$.Jcrop("#cropbox",{setSelect:[75,0,225,150],onChange:showPreview,onSelect:showPreview,aspectRatio:1})}catch(g){}try{$(".brand-radio").eq(0).click(function(){$('tr[class^="new-brand"]').addClass("disabled-brand");$('tr[class^="old-brand"]').removeClass("disabled-brand");$(".brands-tb").prop("disabled",true);$(".brands-tb").val("");$(".brands-dd").prop("disabled",false)});$(".brand-radio").eq(1).click(function(){$('tr[class^="old-brand"]').addClass("disabled-brand");$('tr[class^="new-brand"]').removeClass("disabled-brand");$(".brands-dd").prop("disabled",true);$(".brands-dd").val("");$(".brands-tb").prop("disabled",false)})}catch(g){}try{tmpURLString=window.location.pathname;slashFlag=false;if(tmpURLString.substring(tmpURLString.length-1,tmpURLString.length)=="/"){slashFlag=true;tmpURLString=tmpURLString.substring(0,tmpURLString.length-1)}tmpURL=tmpURLString.split("/");$(".help-icon").each(function(a){if($(".help-page").val()!=null){$(this).html("<a href='javascript:void(0);' onclick=openWindow('"+$(".help-page").val()+"#"+(a+1)+"','trolleymaniahelp','scrollbars=yes,width=400,height=500');><img src='pics/form/form-icon-help.gif' alt='Help' width='28' height='28' /></a>")}else{strURL=tmpURL[tmpURL.length-1];if(slashFlag){$(this).html("<a href='javascript:void(0);' onclick=openWindow('../help-"+strURL+"#"+(a+1)+"','trolleymaniahelp','scrollbars=yes,width=400,height=500');><img src='pics/form/form-icon-help.gif' alt='Help' width='28' height='28' /></a>")}else{$(this).html("<a href='javascript:void(0);' onclick=openWindow('help-"+strURL+"#"+(a+1)+"','trolleymaniahelp','scrollbars=yes,width=400,height=500');><img src='pics/form/form-icon-help.gif' alt='Help' width='28' height='28' /></a>")}}})}catch(g){}try{$(".DateTo").datepicker({showOn:"button",buttonImage:"pics/form/btn-calendar.gif",buttonImageOnly:true});$(".DateTo").datepicker($.datepicker.regional["en"]);$(".DateFrom").datepicker({showOn:"button",buttonImage:"pics/form/btn-calendar.gif",buttonImageOnly:true});$(".DateFrom").datepicker($.datepicker.regional["en"])}catch(g){}try{$("#filebank").fancybox({padding:10,width:790,height:350,autoScale:false,transitionIn:"none",transitionOut:"none",type:"iframe"})}catch(g){}try{function h(a,b,c,d){for(i=0;i<a.length;i++){if(a[i]=="true"){b.children("input").eq(i+1).prop("disabled",false);b.children("label").eq(i+1).addClass("cyan-text")}else{b.children("input").eq(i+1).prop("disabled",true);b.children("label").eq(i+1).removeClass("cyan-text")}}}for(c=0;c<$(".delivery-method").length;c++){if($(".delivery-method").eq(c).children("input").prop("checked")){var j=$(".delivery-method").eq(c).parent().children(".days-holder").val().split("|");var k=$(".delivery-day-holder").eq(c).children("span");h(j,k,false);var l=$(".delivery-method").eq(c).children("input").val().split("|");$(".shipping-method").html("<span class='cyan-text'>Shipping Method :</span> "+l[0]+" ( "+l[1]+" )");$(".shipping-method-price").html("€"+CurrencyFormatted(l[2]));var m=Number($(".price-exc-vat").val());var n=Number($(".total-vat").val());var o=Number(l[2]);var p=Number(l[3]);$(".total-vat-text").html("€"+CurrencyFormatted(n+p));var q=CurrencyFormatted(o+m+n+p);$(".total-price").html("€"+q)}else{$(".delivery-method").eq(c).parentsUntil(".list-ul").parent().next().children(".day-selector").slideUp()}}$(".delivery-method").click(function(){$(".day-selector").slideUp();$(this).parentsUntil(".list-ul").parent().next().children("ul").slideDown();var a=$(this).children("input").val().split("|");$(".shipping-method").html("<span class='cyan-text'>Shipping Method :</span> "+a[0]+" ( "+a[1]+" )");$(".shipping-method-price").html("€"+CurrencyFormatted(a[2]));var b=Number($(".price-exc-vat").val());var c=Number($(".total-vat").val());var d=Number(a[2]);var e=Number(a[3]);$(".total-vat-text").html("€"+CurrencyFormatted(c+e));var f=CurrencyFormatted(d+b+c+e);$(".total-price").html("€"+f);var g=new Array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");var i=$(this).parent().children(".days-holder").val().split("|");var j=$(this).parentsUntil(".list-ul").parent().next().children("ul").children(".delivery-day-holder").children("span");j.children("input").eq(0).prop("checked",false);h(i,j,false)})}catch(g){}try{$(".all-checkboxes input").click(function(){var a=$(this).parentsUntil(".delivery-day-holder").parent().children("span");for(i=1;i<=8;i++){if($(this).prop("checked")){if(a.eq(i).children("input:checkbox").prop("disabled")==false){a.eq(i).children("input:checkbox").prop("checked",true)}}else{a.eq(i).children("input:checkbox").prop("checked",false)}}})}catch(g){}$("table").attr("rules","");try{$(".commentbox").focus(function(){if($(this).val()=="Please leave your feedback"){$(this).val("")}});$(".commentbox").blur(function(){if($(this).val()==""){$(this).val("Please leave your feedback")}});$(".star").click(function(){$(this).parentsUntil(".star-holder").parent().parent().children(".rating-holder").val($(this).html());objHolder=$(this).parentsUntil(".star-holder").parent().children("li");for(i=5;i>=0;i--){if($(this).parentsUntil(".star-holder").parent().parent().children(".rating-holder").val()!=objHolder.eq(i).children("a").html()){if(objHolder.eq(i).children("a").hasClass("on")){objHolder.eq(i).children("a").removeClass("on")}}else{break}}});$(".star").mouseover(function(){for(i=0;i<5;i++){if($(this).parentsUntil(".star-holder").parent().children("li").eq(i).children("a").html()!=$(this).html()){$(this).parentsUntil(".star-holder").parent().children("li").eq(i).children("a").addClass("on")}else{$(this).addClass("on");break}}});$(".star").mouseout(function(){objHolder=$(this).parentsUntil(".star-holder").parent().children("li");for(i=5;i>=0;i--){if($(this).parentsUntil(".star-holder").parent().parent().children(".rating-holder").val()!=objHolder.eq(i).children("a").html()){if(objHolder.eq(i).children("a").hasClass("on")){objHolder.eq(i).children("a").removeClass("on")}}else{break}}})}catch(g){}try{$("input[type='file']","#form").filestyle({image:"pics/form/btn-browse.gif",imagewidth:62,imageheight:28,width:180,title:"Browse..."})}catch(g){}try{$("input[type='file']",".alias").filestyle({image:"pics/form/btn-browse.gif",imagewidth:62,imageheight:28,width:180,title:"Browse..."})}catch(g){}try{if($(".giftswitch").children("input[@type=checkbox]").prop("checked")==false){$(".gift-price").slideUp()}$(".giftswitch").click(function(){if($(".giftswitch").children("input[@type=checkbox]").prop("checked")){$(".gift-price").slideUp()}else{$(".gift-price").slideDown()}});if($(".owndeliveryswitch").children("input[@type=checkbox]").prop("checked")==false){$(".own-delivery").slideUp()}$(".owndeliveryswitch").click(function(){if($(".owndeliveryswitch").children("input[@type=checkbox]").prop("checked")){$(".own-delivery").slideUp()}else{$(".own-delivery").slideDown()}});if($(".customer-pickup-switch").children("input[@type=checkbox]").prop("checked")==false){$(".customer-pickup").slideUp()}$(".customer-pickup-switch").click(function(){if($(".customer-pickup-switch").children("input[@type=checkbox]").prop("checked")){$(".customer-pickup").slideUp()}else{$(".customer-pickup").slideDown()}});if($(".international-switch").children("input[@type=checkbox]").prop("checked")==false){$(".international-postage").slideUp()}$(".international-switch").click(function(){if($(".international-switch").children("input[@type=checkbox]").prop("checked")){$(".international-postage").slideUp()}else{$(".international-postage").slideDown()}})}catch(g){}try{$(".switch").click(function(){var a=$(this).parent().children(".info-text");if($(this).children("input[@type=checkbox]").prop("checked")){$(this).removeClass("switch");$(this).addClass("switch off");$(this).children("input[@type=checkbox]").prop("checked",false);a.children("span").remove();a.append("<span class='red-text'>deactivated</span>")}else{$(this).removeClass("switch off");$(this).addClass("switch");$(this).children("input[@type=checkbox]").prop("checked",true);a.children("span").remove();a.append("<span class='green-text'>active</span>")}})}catch(g){}try{$(".radio-switch").click(function(){$('[class^="'+$(this).attr("class")+'"]').children("input").prop("checked",false);$(this).children("input").prop("checked",true)})}catch(g){}try{$(".compare-box .button").click(function(){if($(this).parent().height()==160){tmpHeight=$(this).parent().children(".more-details").height()+$(this).parent().height()+15;$(this).parent().animate({height:tmpHeight},500)}else{$(this).parent().animate({height:"160"},500)}});$(".close-button").click(function(){$(this).parent().fadeOut()})}catch(g){}try{$(".edit-address").click(function(){if($(this).parent().height()<=40){$(this).parent().animate({height:"250px"},500)}else{$(this).parent().animate({height:"40px"},500)}})}catch(g){}try{$(".rating-module").easySlider({ratingsteps:true,continuous:true});$(".rating-icons").click(function(){$(this).parent().children(".rating-icons").attr("src","pics/landingpages/rating-off.gif");for(i=0;i<5;i++){$(this).parent().children(".rating-icons").eq(i).attr("src","pics/landingpages/rating-on.gif");if($(this).parent().children(".rating-icons").eq(i).attr("alt")==$(this).attr("alt")){$(this).parent().parent().children(".rating-holder").val($(this).attr("alt"));break}}});$(".rating-icons").mouseover(function(){for(i=0;i<5;i++){if($(this).parent().children(".rating-icons").eq(i).attr("src")!="pics/landingpages/rating-on.gif"){$(this).parent().children(".rating-icons").eq(i).attr("src","pics/landingpages/rating-hover.gif")}if($(this).parent().children(".rating-icons").eq(i).attr("alt")==$(this).attr("alt")){break}}});$(".rating-icons").mouseout(function(){for(i=0;i<5;i++){if($(this).parent().children(".rating-icons").eq(i).attr("src")=="pics/landingpages/rating-hover.gif"){$(this).parent().children(".rating-icons").eq(i).attr("src","pics/landingpages/rating-off.gif")}}});$(".comment").focus(function(){if($(this).val()=="Please leave your feedback"){$(this).val("")}});$(".comment").blur(function(){if($(this).val()==""){$(this).val("Please leave your feedback")}})}catch(g){}try{$(".image-view .thumb-image").mouseover(function(){var a=$(this);var b=$(".image-view-hide");var c=0;if(b.attr("offsetLeft")+a.attr("offsetLeft")>700){c=b.attr("offsetLeft")+a.attr("offsetLeft")-255}else{c=a.attr("offsetLeft")+a.width()+b.attr("offsetLeft")+5}var d=a.attr("offsetTop")+b.attr("offsetTop")-($("#detail-viewer").height()/2-50);$("#detail-viewer img").attr("src",a.children(".large-image-data").val());$("#detail-viewer .shop-name").html(a.children(".shop-name-data").val());$("#detail-viewer .product-name").text(a.children(".product-name-data").val());$("#detail-viewer .price-tag").html(a.children(".price-tag-data").val());$("#detail-viewer .price-tag-old").html(a.children(".old-price-data").val());$("#detail-viewer").css("display","inline");$("#detail-viewer").offset({top:d,left:c})});$(".image-view .thumb-image").mouseout(function(){$("#detail-viewer").css("display","none");$("#detail-viewer").hide();$("#detail-viewer").offset({top:-9999,left:-9999})})}catch(g){}try{$(".length").focus(function(){$(".box-img").attr("src","pics/form/icon-box-l.jpg")});$(".width").focus(function(){$(".box-img").attr("src","pics/form/icon-box-w.jpg")});$(".height").focus(function(){$(".box-img").attr("src","pics/form/icon-box-h.jpg")});$(".length, .width, .height").blur(function(){$(".box-img").attr("src","pics/form/icon-box-off.jpg")});$(".wieght").keyup(function(){if(!isNaN($(this).val())){$(".kilos").text($(this).val()/1e3+"Kg")}else{$(".kilos").text("Please insert a number")}});$(".cat-item a").mouseover(function(a){$(".tool-tip").css("display","inline");$(".tool-tip").offset({top:a.pageY-10,left:a.pageX+10})});$(".cat-item a").mouseout(function(a){$(".tool-tip").css("display","none");$(".tool-tip").offset({top:-9999,left:-9999})});function r(){vatText="";tmpPrice=Number($(".price").val());tmpVat=(Number($(".vat-amount").val())+100)/100;tmpDiscount=Number($(".discount").val());if($(".price").val()!=""){$(".vat-text").html("Inc VAT: €"+CurrencyFormatted(tmpPrice*tmpVat))}discountText="";if(tmpPrice!=""&&tmpDiscount!=""){discPrice=tmpPrice*(tmpDiscount/100);discPrice=(tmpPrice-discPrice)*tmpVat;discountText="Discounted Price: €"+CurrencyFormatted(discPrice)}$(".discount-text").html(discountText)}$(".price").keyup(function(){r()});$(".discount").keyup(function(){r()});r()}catch(g){}try{$("#promoContainer").easySlider({auto:true,continuous:true,numeric:true});$(function(){$("#accordion").accordion()})}catch(g){}try{$(".password_adv").passStrength({shortPass:"top_shortPass",badPass:"top_badPass",goodPass:"top_goodPass",strongPass:"top_strongPass",baseStyle:"top_testresult",userid:"#username",messageloc:1})}catch(g){}try{$(".license").change(function(){var a=$(this).val().split("|");var b=$(this).val().split("|");$(".txtAuthority").val(a[0]);$(".txtAuthorityURL").val(b[1]);$(".txtAuthority").prop("disabled",true);$(".txtAuthorityURL").prop("disabled",true);if($(this).val()=="other"){$(".txtAuthority").val("");$(".txtAuthorityURL").val("");$(".txtAuthority").prop("disabled",false);$(".txtAuthorityURL").prop("disabled",false)}})}catch(g){}try{$("#templates .color-selection li a").mouseover(function(){var a=$(this).parent().parent().parent();var b=$("#templates");var c=0;if(b.attr("offsetLeft")+a.attr("offsetLeft")>500){c=b.attr("offsetLeft")+a.attr("offsetLeft")-305}else{c=a.attr("offsetLeft")+a.width()+b.attr("offsetLeft")+5}var d=a.attr("offsetTop")+b.attr("offsetTop");cProperties=$(this).attr("rel").split("|");$(".template-preview").css("display","inline");$(".template-preview img").attr("src",cProperties[0]);$(".template-preview").css("background-color","#"+cProperties[1]);$(".template-preview").offset({top:d,left:c})});$("#templates .color-selection li a").mouseout(function(){$(".template-preview").css("display","none");$(".template-preview").hide();$(".template-preview").offset({top:-9999,left:-9999})})}catch(g){}try{$(".color-selection li a").click(function(){$(this).parent().parent().children().children().removeClass("selected-colour");$(this).addClass("selected-colour");cProperties=$(this).attr("rel").split("|");$(".selected-color").html(cProperties[0]);$(".selected-color-input").val(cProperties[1])});$(function(){$(".review-accordion").accordion({collapsible:true,active:false,autoHeight:false,navigation:true})})}catch(g){}try{$(".cart-merge a").mouseover(function(a){$("#thumbnail img").attr("src",$(this).attr("rel"));$("#thumbnail").css("display","inline");$("#thumbnail").offset({top:a.pageY-40,left:a.pageX+25})});$(".cart-merge a").mouseout(function(a){$("#thumbnail").css("display","none");$("#thumbnail").offset({top:-9999,left:-9999})})}catch(g){}try{$(".product-name a").mouseover(function(a){$("#thumbnail img").attr("src",$(this).attr("rel"));$("#thumbnail").css("display","inline");$("#thumbnail").offset({top:a.pageY-40,left:a.pageX+25})});$(".product-name a").mouseout(function(a){$("#thumbnail").css("display","none");$("#thumbnail").offset({top:-9999,left:-9999})})}catch(g){}try{$(".info-bar img").click(function(a){$(this).parent().fadeOut("slow")})}catch(g){}});$(function(){$(".giftRadio input").click(function(){if($(this).val()==1){if(!$(this).is(":selected")){$(this).parentsUntil("div").parentsUntil("table").find(".giftWrapText").slideDown()}}else{if(!$(this).is(":selected")){$(this).parentsUntil("div").parentsUntil("table").find(".giftWrapText").slideUp()}}})});$(document).ready(function(){$("div.tmJSDropdown1 div.dropdown input").click(function(){var a=$(this).parent();if($(this).prop("checked")){a.children("div.dropdownarrow").show();mouseoverFunction($(this).parent())}else{a.removeClass("active");a.children("div.dropdownarrow").hide()}});$("div.tmJSDropdown1 span.selectAll").click(function(){$(this).parentsUntil("div.dropdownContentBox").find("input").prop("checked",true)});$("div.tmJSDropdown1 span.selectNone").click(function(){$(this).parentsUntil("div.dropdownContentBox").find("input").prop("checked",false)});$(".tmJSDropdown1 .dropdown").each(function(){$(this).bind("mouseenter",function(){mouseoverFunction($(this))});$(this).bind("mouseleave",function(){mouseleaveFunction($(this))});if($(this).children("input").prop("checked")==false){$(this).children("div.dropdownarrow").hide()}})});$(document).ready(function(){if($("#search-views").length>0){$("#search-views .advancedsearch").each(function(){$(this).fancybox({autoDimensions:false,width:820,height:640,margin:30,onStart:function(){$("#advancedsearchModal").show()},onClosed:function(){$("#advancedsearchModal").hide()}})})}})
