function getURLVar(t){var e=[],s=String(document.location).split("?");if(s[1]){var a=s[1].split("&");for(i=0;i<a.length;i++){var o=a[i].split("=");o[0]&&o[1]&&(e[o[0]]=o[1])}return e[t]?e[t]:""}}function addToCart(t,e){e=void 0!==e?e:1,$.ajax({url:"index.php?route=checkout/cart/add",type:"post",data:"product_id="+t+"&quantity="+e,dataType:"json",success:function(t){$(".success, .warning, .attention, .information, .error").remove(),t.redirect&&(location=t.redirect),t.success&&($("#notification").html('<div class="success" style="display: none;">'+t.success+'<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'),$(".success").fadeIn("slow"),$("#cart-total").html(t.total),$("html, body").animate({scrollTop:0},"slow"))}})}function addToCartFly(t,e,s){s=void 0!==s?s:1,$.ajax({url:"index.php?route=checkout/cart/add",type:"post",data:"product_id="+e+"&quantity="+s,dataType:"json",success:function(s){if($(".success, .warning, .attention, .information, .error").remove(),s.redirect&&(location=s.redirect),s.success){if($("#notification").html('<div class="success" style="display: none;">'+s.success+'<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'),$(".success").fadeIn("slow"),$("#cart-total").html(s.total),"enable"==t){var a=jQuery(".image-"+e).width()/5,i=jQuery(".image-"+e).height()/5;jQuery(".image-"+e).clone().css({position:"absolute","z-index":"100"}).prependTo("#cart").animate({opacity:.4},100).animate({opacity:.5,marginLeft:100,width:a,height:i},700,function(){jQuery(this).remove()})}$("html, body").animate({scrollTop:0},"slow")}}})}function addToWishList(t){$.ajax({url:"index.php?route=account/wishlist/add",type:"post",data:"product_id="+t,dataType:"json",success:function(t){$(".success, .warning, .attention, .information").remove(),t.success&&($("#notification").html('<div class="success" style="display: none;">'+t.success+'<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'),$(".success").fadeIn("slow"),$("#wishlist-total").html(t.total),$("html, body").animate({scrollTop:0},"slow"))}})}function addToCompare(t){$.ajax({url:"index.php?route=product/compare/add",type:"post",data:"product_id="+t,dataType:"json",success:function(t){$(".success, .warning, .attention, .information").remove(),t.success&&($("#notification").html('<div class="success" style="display: none;">'+t.success+'<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'),$(".success").fadeIn("slow"),$("#compare-total").html(t.total),$("html, body").animate({scrollTop:0},"slow"))}})}$(document).ready(function(){$(".button-search").bind("click",function(){url=$("base").attr("href")+"index.php?route=product/search";var t=$("input[name='search']").attr("value");t&&(url+="&search="+encodeURIComponent(t)),location=url}),$("#header input[name='search']").bind("keydown",function(t){if(13==t.keyCode){url=$("base").attr("href")+"index.php?route=product/search";var e=$("input[name='search']").attr("value");e&&(url+="&search="+encodeURIComponent(e)),location=url}}),$("#cart > .heading a").live("click",function(){$("#cart").addClass("active"),$("#cart").load("index.php?route=module/cart #cart > *"),$("#cart").live("mouseleave",function(){$(this).removeClass("active")})}),$("#menu ul > li > a + div").each(function(t,e){if($.browser.msie&&(7==$.browser.version||6==$.browser.version)){$(e).find("a");var s=$(e).find("ul").length;$(e).css("width",143*s+"px"),$(e).find("ul").css("float","left")}var a=$("#menu").offset(),o=$(this).parent().offset();i=o.left+$(this).outerWidth()-(a.left+$("#menu").outerWidth()),i>0&&$(this).css("margin-left","-"+(i+5)+"px")}),$.browser.msie&&($.browser.version<=6&&($("#column-left + #column-right + #content, #column-left + #content").css("margin-left","195px"),$("#column-right + #content").css("margin-right","195px"),$(".box-category ul li a.active + ul").css("display","block")),$.browser.version<=7&&($("#menu > ul > li").bind("mouseover",function(){$(this).addClass("active")}),$("#menu > ul > li").bind("mouseout",function(){$(this).removeClass("active")}))),$(".success img, .warning img, .attention img, .information img").live("click",function(){$(this).parent().fadeOut("slow",function(){$(this).remove()})})});