$(document).ready(function(){var zindex=1;if($('.shop-opt-order').length){$(".shop-opt-order").click(function(){var opts='';var opt_attr='';if(typeof aOptions!="undefined"){var bSelect=false;for(opt in aOptions){var op=$('#o'+aOptions[opt]).val();if(op==''){bSelect=true;}else if(op!='undefined'&&op!=null){opts+='|'+aOptions[opt]+'-'+op;opt_attr+='_'+op;}}if(bSelect){alert(prod_opts_txt);return false;}var combi=$(this).attr('combi');var attr_cnt='basket'+opt_attr;}else{var attr_cnt='basket';}if($(this).attr('i')!=null){var unique=getUniqueTime();var i=$(this).attr('i');if($('#inline-products').length&&$("#shop-prod-"+i).length){var prod=$("#shop-prod-"+i);var productX=prod.offset().left;var productY=prod.offset().top;var gotoX=$("#inline-products").offset().left-productX;var gotoY=$("#inline-products").offset().top-productY;var newImageWidth=16;var newImageHeight=16;var stock=$(this).attr('st');if(stock!=""){if($(this).attr(attr_cnt)>stock){$.blockUI({message:'<h1>'+prod_opts_stock+'</h1><a href="?basket">'+prod_goto_cart_txt+'</a> &rsaquo;',fadeIn:700,fadeOut:700,timeout:5000,showOverlay:false,centerY:false,css:{width:'300px',left:'',top:'10px',right:'10px',border:'none',padding:'5px',backgroundColor:'#000','-webkit-border-radius':'5px','-moz-border-radius':'5px',opacity:.8,color:'#fff'}});return false;}}$('<div class="product-select" style="width:'+prod.width()+'px;height:'+prod.height()+'px;position:absolute;z-index:1000" id="shop-box'+unique+'"></div>').prependTo($("#shop-prod-"+i)).animate({opacity:0.1,marginLeft:gotoX,marginTop:gotoY,width:newImageWidth,height:newImageHeight},1000,function(){$('#shop-box'+unique).remove();});if($(this).attr(attr_cnt)!=null){setCookie('shopBasket['+$(this).attr('product')+opts+']',$(this).attr(attr_cnt)+';'+$(this).attr('page'),null,'fillBasketInline()');$(this).attr(attr_cnt,parseInt($(this).attr(attr_cnt))+1)}else{setCookie('shopBasket['+$(this).attr('product')+opts+']',$(this).attr('page'),null,'fillBasketInline()');}}else{if($(this).attr(attr_cnt)!=null){setCookie('shopBasket['+$(this).attr('product')+opts+']',$(this).attr(attr_cnt)+';'+$(this).attr('page'));$(this).attr(attr_cnt,parseInt($(this).attr(attr_cnt))+1)}else{setCookie('shopBasket['+$(this).attr('product')+opts+']',$(this).attr('page'));}}$.blockUI({message:'<h1>'+prod_add_txt+'</h1><a href="?basket">'+prod_goto_cart_txt+'</a> &rsaquo;',fadeIn:700,fadeOut:700,timeout:5000,showOverlay:false,centerY:false,css:{width:'300px',left:'',top:'10px',right:'10px',border:'none',padding:'5px',backgroundColor:'#000','-webkit-border-radius':'5px','-moz-border-radius':'5px',opacity:.8,color:'#fff'}});}});}if($('.shop-opt-compare').length){$(".shop-opt-compare").click(function(){if($(this).attr('product')!=null){var unique=getUniqueTime();setCookie('shopCompare['+$(this).attr('product')+']',$(this).attr('page'));$.blockUI({message:'<h1>'+prod_compare_add_txt+'</h1><a href="?compare">'+prod_goto_compare_txt+'</a> &rsaquo;',fadeIn:700,fadeOut:700,timeout:5000,showOverlay:false,centerY:false,css:{width:'300px',left:'',top:'10px',right:'10px',border:'none',padding:'5px',backgroundColor:'#000','-webkit-border-radius':'5px','-moz-border-radius':'5px',opacity:.8,color:'#fff'}});}});}var options={success:formResponse,dataType:'json'};if($('.shop-form').length)$('.shop-form').ajaxForm(options);});function toBasket(iprod,a){if(typeof aOptions!="undefined"){var bSelect=false;var opts='';for(opt in aOptions){var op=$('#o'+aOptions[opt]).val();if(op==''){bSelect=true;}else if(typeof op!="undefined"){opts+='|'+aOptions[opt]+'-'+op;}}if(bSelect){alert(prod_opts_txt);return false;}document.location='?basket&add='+iprod+opts+'&a='+a;}else{document.location='?basket&add='+iprod+'&a='+a;}}function fillBasketValues(lang,fillinline){$.ajax({type:"POST",url:'/_src/shop.basket.php',data:'lang='+lang,dataType:"json",success:function(data){if(data!=null){$('.iShopSubTotal').html(data.subtotal);$('.iShopTotal').html(data.total);$('.iShopTaxTotalInc').html(data.taxinc);$('.iShopTaxTotalEx').html(data.taxex);$.each(data.prod,function(i,item){$('.iShopProd'+item.classs+'').html(item.price);$('.iShopProdTotal'+item.classs+'').html(item.total);});if(fillinline&&$('#inline-basket').length){fillBasketInline();}}}});}function fillBasket(lang,cookie,val,fillinline){fillinline=(fillinline==null)?false:fillinline;if(cookie!=null&&val!=null){$.ajax({type:"POST",url:"/_src/cookie.php",data:'c='+cookie+'&v='+val+'&t=c',dataType:"json",success:function(data){fillBasketValues(lang,fillinline);}});}else{fillBasketValues(lang,fillinline);}}function getUniqueTime(){var time=new Date().getTime();while(time==new Date().getTime());return new Date().getTime();}function setCookie(cookie,val,type,onsuccess){if(type==null)type='c';$.ajax({type:"POST",url:"/_src/cookie.php",data:'c='+cookie+'&v='+val+'&t='+type,dataType:"json",success:function(data){if(onsuccess!=null)eval(onsuccess);}});}function getCookie(cookie,type){if(type==null)type='c';$.ajax({type:"POST",url:"/_src/cookie.php",data:'c='+cookie+'&t='+type,dataType:"json",success:function(data){return data.ok;}});}function delCookie(cookie,del,type){if(type==null)type='c';if(del==null)del=0;$.ajax({type:"POST",url:"/_src/cookie.php",data:'c='+cookie+'&t='+type+'&del='+del,dataType:"json",success:function(data){return data.ok;}});}
