$(document).ready(function(){$(function(){$('#order_popup_btn').bind('click',function(e){e.preventDefault();$('#orderfail_popup').bPopup();$('#orderfail_number').css('border-color','#ccc');$('#orderfail_nametxt').css('border-color','#ccc');$('#mobile_character_name_id').html('');$('#mobile_character_id').html('');$('#orderfail_number').val('');$('#orderfail_nametxt').val('');});});var austDay=new Date("Dec 19, 2016 23:59:59");$('.countdown').countdown({until:austDay,layout:'
'});$('#related_like_Product .scrollInner, .filter_inner_tr .scrollInner, .related_product_popup .scrollInner').slimscroll({wheelStep:10,railVisible:true,disableFadeOut:true,height:'auto'});$('html').click(function(){$("#livesearch").hide(200);$("#searchspring-autocomplete_results").html("");});$('input[id="s_brand"]').keyup(function(){var searchText=$(this).val();$('#left_sidebar_brand > ul > li').each(function(){var currentLiText=$(this).text().toLowerCase(),showCurrentLi=currentLiText.indexOf(searchText)!==-1;$(this).toggle(showCurrentLi);});});var timeout="";$('.cartContent').mouseenter(function(){$("#headerCart .HC_right").css({'cursor':'progress'});$('#cartContent_hoverSection').hide();$('#ccHoverSectionBg').html("");timeout=setTimeout(function(){$.ajax({url:'/core/ajax_functions.php',type:'POST',async:false,data:{'action':'cart_hover_data_display'},complete:function(){$("#headerCart .HC_right").css({'cursor':'default'});},success:function(get_cart_data){if(get_cart_data!==""){$('#ccHoverSectionBg').html(get_cart_data);$('#cartContent_hoverSection').slideDown(500);$("#headerCart .HC_right").css({'cursor':'default'});$('#ccHoverSectionBg .scrollInner').slimscroll({wheelStep:10,railVisible:true,disableFadeOut:true,height:'auto'});}}});return false;},100);});$('.cartContent').mouseleave(function(){$('#cartContent_hoverSection').slideUp(100);$('#ccHoverSectionBg').html("");clearTimeout(timeout);return false;});});function deliveryAddress(){if(document.checkout.same_delivery.checked==false){document.getElementById('delivery_address_hidden').style.display='none';$("input[name=delcompany]").attr('old_data',$("input[name=delcompany]").val());$("input[name=deladdress1]").attr('old_data',$("input[name=deladdress1]").val());$("input[name=deladdress2]").attr('old_data',$("input[name=deladdress2]").val());$("input[name=delcity]").attr('old_data',$("input[name=delcity]").val());$("input[name=delcounty]").attr('old_data',$("input[name=delcounty]").val());$("input[name=delpostcode]").attr('old_data',$("input[name=delpostcode]").val());$("input[name=delsalutation]").attr('old_data',$("input[name=delsalutation]").val());$("input[name=delfname]").attr('old_data',$("input[name=delfname]").val());$("input[name=delsname]").attr('old_data',$("input[name=delsname]").val());$("input[name=delphone]").attr('old_data',$("input[name=delphone]").val());$("input[name=delemail]").attr('old_data',$("input[name=delemail]").val());document.checkout.delcompany.value=document.checkout.company.value;document.checkout.deladdress1.value=document.checkout.address1.value;document.checkout.deladdress2.value=document.checkout.address2.value;document.checkout.delcity.value=document.checkout.city.value;document.checkout.delcounty.value=document.checkout.county.value;document.checkout.delpostcode.value=document.checkout.postcode.value;document.checkout.delsalutation.value=document.checkout.salutation.value;document.checkout.delfname.value=document.checkout.fname.value;document.checkout.delsname.value=document.checkout.sname.value;document.checkout.delphone.value=document.checkout.phone.value;document.checkout.delmobile_phone.value=document.checkout.mobile_phone.value;document.checkout.delemail.value=document.checkout.email.value;$("#invoice_address_lbl").html('Delivery Address');removeRAKDatePicker();}else{document.getElementById('delivery_address_hidden').style.display='block';document.checkout.delcompany.value='';if($("input[name=delcompany]").attr('old_data')!=""&&$("input[name=delcompany]").attr('old_data')!=null&&$("input[name=delcompany]").attr('old_data')!=undefined){document.checkout.delcompany.value=$("input[name=delcompany]").attr('old_data');}
document.checkout.deladdress1.value='';if($("input[name=deladdress1]").attr('old_data')!=""&&$("input[name=deladdress1]").attr('old_data')!=null&&$("input[name=deladdress1]").attr('old_data')!=undefined){document.checkout.deladdress1.value=$("input[name=deladdress1]").attr('old_data');}
document.checkout.deladdress2.value='';if($("input[name=deladdress2]").attr('old_data')!=""&&$("input[name=deladdress2]").attr('old_data')!=null&&$("input[name=deladdress2]").attr('old_data')!=undefined){document.checkout.deladdress2.value=$("input[name=deladdress2]").attr('old_data');}
document.checkout.delcity.value='';if($("input[name=delcity]").attr('old_data')!=""&&$("input[name=delcity]").attr('old_data')!=null&&$("input[name=delcity]").attr('old_data')!=undefined){document.checkout.delcity.value=$("input[name=delcity]").attr('old_data');}
document.checkout.delcounty.value='';if($("input[name=delcounty]").attr('old_data')!=""&&$("input[name=delcounty]").attr('old_data')!=null&&$("input[name=delcounty]").attr('old_data')!=undefined){document.checkout.delcounty.value=$("input[name=delcounty]").attr('old_data');}
document.checkout.delpostcode.value='';if($("input[name=delpostcode]").attr('old_data')!=""&&$("input[name=delpostcode]").attr('old_data')!=null&&$("input[name=delpostcode]").attr('old_data')!=undefined){document.checkout.delpostcode.value=$("input[name=delpostcode]").attr('old_data');}
document.checkout.delsalutation.value='';if($("input[name=delsalutation]").attr('old_data')!=""&&$("input[name=delsalutation]").attr('old_data')!=null&&$("input[name=delsalutation]").attr('old_data')!=undefined){document.checkout.delsalutation.value=$("input[name=delsalutation]").attr('old_data');}else{$("input[name=delsalutation]").val($("input[name=salutation]").val());}
document.checkout.delfname.value='';if($("input[name=delfname]").attr('old_data')!=""&&$("input[name=delfname]").attr('old_data')!=null&&$("input[name=delfname]").attr('old_data')!=undefined){document.checkout.delfname.value=$("input[name=delfname]").attr('old_data');}else{$("input[name=delfname]").val($("input[name=fname]").val());}
document.checkout.delsname.value='';if($("input[name=delsname]").attr('old_data')!=""&&$("input[name=delsname]").attr('old_data')!=null&&$("input[name=delsname]").attr('old_data')!=undefined){document.checkout.delsname.value=$("input[name=delsname]").attr('old_data');}else{$("input[name=delsname]").val($("input[name=sname]").val());}
document.checkout.delphone.value='';if($("input[name=delphone]").attr('old_data')!=""&&$("input[name=delphone]").attr('old_data')!=null&&$("input[name=delphone]").attr('old_data')!=undefined){document.checkout.delphone.value=$("input[name=delphone]").attr('old_data');}else{$("input[name=delphone]").val($("input[name=phone]").val());}
document.checkout.delemail.value='';if($("input[name=delemail]").attr('old_data')!=""&&$("input[name=delemail]").attr('old_data')!=null&&$("input[name=delemail]").attr('old_data')!=undefined){document.checkout.delemail.value=$("input[name=delemail]").attr('old_data');}else{$("input[name=delemail]").val($("input[name=email]").val());}
$("#invoice_address_lbl").html('Invoice Address');}}
function update_delivery_input(){if(document.checkout.same_delivery.checked==true){}
else{document.checkout.delcompany.value=document.checkout.company.value;document.checkout.deladdress1.value=document.checkout.address1.value;document.checkout.deladdress2.value=document.checkout.address2.value;document.checkout.delcity.value=document.checkout.city.value;document.checkout.delcounty.value=document.checkout.county.value;document.checkout.delpostcode.value=document.checkout.postcode.value;document.checkout.delsalutation.value=document.checkout.salutation.value;document.checkout.delfname.value=document.checkout.fname.value;document.checkout.delsname.value=document.checkout.sname.value;document.checkout.delphone.value=document.checkout.phone.value;document.checkout.delemail.value=document.checkout.email.value;document.checkout.delmobile_phone.value=document.checkout.mobile_phone.value;}}
function check_rak_datepicker(){var returnVal="1";if($(".formControl").hasClass("rak_checkout_datepicker")&&$('#delivery_date_info_div').css('display')!='none'){$('.rak_checkout_datepicker').css({'outline':'1px solid #A9A9A9','border':'1px solid transparent'});$.each($('.rak_checkout_datepicker'),function(){if($(this).val()==""){if($("#delpostcode").val()!=""&&$("#postcode").val()!=""){if(returnVal=="1"){$(this).focus();}
$(this).css({'outline':'1px solid red','border':'1px solid transparent'});var rak_top=$(".rak_checkout_datepicker").offset().top;var rak_plus=parseInt(rak_top)- 250;$('html, body').animate({scrollTop:rak_plus},1000);}else{if($('input[name="same_delivery"]').is(':checked')){$("#delpostcode").focus();var rak_top=$("#delpostcode").offset().top;var rak_plus=parseInt(rak_top)- 400;$('html, body').animate({scrollTop:rak_plus},1000);}else{$("#postcode").focus();$('#moveToTop').click();}}
returnVal="0";}});}
if($(".formControl").hasClass("check_delivery_btn")){$('.check_delivery_btn').css({'outline':'1px solid #A9A9A9','border':'1px solid transparent'});$.each($('.check_delivery_hide'),function(){if($(this).val()=="0"){if($("#delpostcode").val()!=""&&$("#postcode").val()!=""){$(this).parent().find('.check_delivery_btn').focus();$(this).parent().find('.check_delivery_btn').css({'outline':'1px solid red','border':'1px solid transparent'});var rak_top=$(".check_delivery_btn").offset().top;var rak_plus=parseInt(rak_top)- 250;$('html, body').animate({scrollTop:rak_plus},1000);}else{if($('input[name="same_delivery"]').is(':checked')){$("#delpostcode").focus();var rak_top=$("#delpostcode").offset().top;var rak_plus=parseInt(rak_top)- 400;$('html, body').animate({scrollTop:rak_plus},1000);}else{$("#postcode").focus();$('#moveToTop').click();}}
returnVal="0";}});}
if($(".formControl").hasClass("barwick_checkout_datepicker")&&$('#delivery_date_info_div').css('display')!='none'){$('.barwick_checkout_datepicker').css({'outline':'1px solid #A9A9A9','border':'1px solid transparent'});$.each($('.barwick_checkout_datepicker'),function(){if($(this).val()==""){if($("#delpostcode").val()!=""&&$("#postcode").val()!=""){$(this).focus();$(this).css({'outline':'1px solid red','border':'1px solid transparent'});var rak_top=$(".barwick_checkout_datepicker").offset().top;var rak_plus=parseInt(rak_top)- 250;$('html, body').animate({scrollTop:rak_plus},1000);}else{if($('input[name="same_delivery"]').is(':checked')){$("#delpostcode").focus();var rak_top=$("#delpostcode").offset().top;var rak_plus=parseInt(rak_top)- 400;$('html, body').animate({scrollTop:rak_plus},1000);}else{$("#postcode").focus();$('#moveToTop').click();}}
returnVal="0";}});}
if(returnVal=="0"){$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});return false;}else{return true;}}
function update_delivery(newDelivery){window.location='checkout.html?ud='+newDelivery;}
function update_delivery_cart(newDelivery){window.location='cart.html?ud='+newDelivery;}
var xmlHttp
function GetXmlHttpObject(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest();}
catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function addCart(cartNum,checkboxadded){fbq('track','AddToCart');if(typeof checkboxadded==="undefined"||checkboxadded===null){checkboxadded=false;}
var qty=document.getElementById("b_qty_"+cartNum).value;qty=(typeof qty=='undefined'||qty=='')?1:qty;i=0;var url='/cart_format.php?ajax_add=';for(i=0;i form:eq(0)").attr('name','cartform'+ cartNum+'_');var oldname=$(".new_product > form:eq(0)").attr('name');oldname=oldname.replace(/_+$/,'');$(".new_product > form:eq(0)").attr('name',oldname);}else{if(!$(".slideGo"+cartNum).hasClass("similar_product_class")){$(".related_product_popup > form:eq(0)").attr('name','cartform'+ cartNum);$(".new_product > form:eq(0)").attr('name','cartform'+ cartNum+'_');}}
if(checkboxadded==true){$(".related_product_popup").bPopup().close();}else{if($(".slideGo"+cartNum).hasClass("similar_product_class")){$("#cart_item_added_"+cartNum).show();setTimeout(function(){$("#cart_item_added_"+cartNum).fadeOut();},5000);}else{$(".related_product_popup").bPopup().show();}}}
function display_new_cart(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){eval(xmlHttp.responseText);}}
function addCartPre(cartNum){i=0;var url='/cart_format.php?ajax_add_2=';for(i=0;i';document.getElementById('verify-11').innerHTML='';document.getElementById('verify-12').innerHTML='';document.getElementById('postcode_anywhere_result').innerHTML='';}
function update_cart_message(){document.getElementById('cart_message').innerHTML='You have changed the quantity of a product in your shopping Basket.
Please click the "Update Basket" button to confirm this change
';}
function get_address_2(){xmlHttp=GetXmlHttpObject()
if(xmlHttp==null){alert("Browser does not support HTTP Request")
return}
var postcode=document.checkout.delpostcode.value;var url="/gadgets/postcode_finder.php?postcode_2=";var url=url+postcode
xmlHttp.onreadystatechange=display_postcode_results_2
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function display_postcode_results_2(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){document.getElementById('postcode_anywhere_result_2').innerHTML=xmlHttp.responseText;}}
function update_address_2(){xmlHttp=GetXmlHttpObject()
if(xmlHttp==null){alert("Browser does not support HTTP Request")
return}
var postcode=document.checkout.address_2.value;var url="/gadgets/postcode_finder.php?address_2=";var url=url+postcode
xmlHttp.onreadystatechange=display_update_address_results_2
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function display_update_address_results_2(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){eval(process_address_2(xmlHttp.responseText));}}
function process_address_2(line1){var address_line_2=line1;var address_lines_2=address_line_2.split("|");document.checkout.delcompany.value=address_lines_2[0];document.checkout.deladdress1.value=address_lines_2[1];document.checkout.deladdress2.value=address_lines_2[2];document.checkout.delcity.value=address_lines_2[3];document.checkout.delcounty.value=address_lines_2[4];document.getElementById('verify-21').innerHTML='';document.getElementById('verify-23').innerHTML='';document.getElementById('verify-24').innerHTML='';document.getElementById('postcode_anywhere_result_2').innerHTML='';}
(function($,document,window){var
defaults={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,fastIframe:true,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:false},colorbox='colorbox',prefix='cbox',event_open=prefix+'_open',event_load=prefix+'_load',event_complete=prefix+'_complete',event_cleanup=prefix+'_cleanup',event_closed=prefix+'_closed',event_purge=prefix+'_purge',isIE=$.browser.msie&&!$.support.opacity,isIE6=isIE&&$.browser.version<7,event_ie6=prefix+'_IE6',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,settings={},interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,index,photo,open,active,closing,handler,loadingTimer,publicMethod,boxElement=prefix+'Element';function $div(id,cssText){var div=document.createElement('div');if(id){div.id=prefix+id;}
div.style.cssText=cssText||'';return $(div);}
function setSize(size,dimension){dimension=dimension==='x'?$window.width():$window.height();return(typeof size==='string')?Math.round((/%/.test(size)?(dimension/100)*parseInt(size,10):parseInt(size,10))):size;}
function isImage(url){return settings.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(url);}
function process(settings){for(var i in settings){if($.isFunction(settings[i])&&i.substring(0,2)!=='on'){settings[i]=settings[i].call(element);}}
settings.rel=settings.rel||element.rel||'nofollow';settings.href=settings.href||$(element).attr('href');settings.title=settings.title||element.title;if(typeof settings.href==="string"){settings.href=$.trim(settings.href);}}
function trigger(event,callback){if(callback){callback.call(element);}
$.event.trigger(event);}
function slideshow(){var
timeOut,className=prefix+"Slideshow_",click="click."+prefix,start,stop,clear;if(settings.slideshow&&$related[1]){start=function(){$slideshow.text(settings.slideshowStop).unbind(click).bind(event_complete,function(){if(index<$related.length-1||settings.loop){timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed);}}).bind(event_load,function(){clearTimeout(timeOut);}).one(click+' '+event_cleanup,stop);$box.removeClass(className+"off").addClass(className+"on");timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed);};stop=function(){clearTimeout(timeOut);$slideshow.text(settings.slideshowStart).unbind([event_complete,event_load,event_cleanup,click].join(' ')).one(click,start);$box.removeClass(className+"on").addClass(className+"off");};if(settings.slideshowAuto){start();}else{stop();}}else{$box.removeClass(className+"off "+className+"on");}}
function launch(elem){if(!closing){element=elem;process($.extend(settings,$.data(element,colorbox)));$related=$(element);index=0;if(settings.rel!=='nofollow'){$related=$('.'+boxElement).filter(function(){var relRelated=$.data(this,colorbox).rel||this.rel;return(relRelated===settings.rel);});index=$related.index(element);if(index===-1){$related=$related.add(element);index=$related.length-1;}}
if(!open){open=active=true;$box.show();if(settings.returnFocus){try{element.blur();$(element).one(event_closed,function(){try{this.focus();}catch(e){}});}catch(e){}}
$overlay.css({"opacity":+settings.opacity,"cursor":settings.overlayClose?"pointer":"auto"}).show();settings.w=setSize(settings.initialWidth,'x');settings.h=setSize(settings.initialHeight,'y');publicMethod.position(0);if(isIE6){$window.bind('resize.'+event_ie6+' scroll.'+event_ie6,function(){$overlay.css({width:$window.width(),height:$window.height(),top:$window.scrollTop(),left:$window.scrollLeft()});}).trigger('resize.'+event_ie6);}
trigger(event_open,settings.onOpen);$groupControls.add($title).hide();$close.html(settings.close).show();}
publicMethod.load(true);}}
publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var $this=this,autoOpen;if(!$this[0]&&$this.selector){return $this;}
options=options||{};if(callback){options.onComplete=callback;}
if(!$this[0]||$this.selector===undefined){$this=$('');options.open=true;}
$this.each(function(){$.data(this,colorbox,$.extend({},$.data(this,colorbox)||defaults,options));$(this).addClass(boxElement);});autoOpen=options.open;if($.isFunction(autoOpen)){autoOpen=autoOpen.call($this);}
if(autoOpen){launch($this[0]);}
return $this;};publicMethod.init=function(){$window=$(window);$box=$div().attr({id:colorbox,'class':isIE?prefix+(isIE6?'IE6':'IE'):''});$overlay=$div("Overlay",isIE6?'position:absolute':'').hide();$wrap=$div("Wrapper");$content=$div("Content").append($loaded=$div("LoadedContent",'width:0; height:0; overflow:hidden'),$loadingOverlay=$div("LoadingOverlay").add($div("LoadingGraphic")),$title=$div("Title"),$current=$div("Current"),$next=$div("Next"),$prev=$div("Previous"),$slideshow=$div("Slideshow").bind(event_open,slideshow),$close=$div("Close"));$wrap.append($div().append($div("TopLeft"),$topBorder=$div("TopCenter"),$div("TopRight")),$div(false,'clear:left').append($leftBorder=$div("MiddleLeft"),$content,$rightBorder=$div("MiddleRight")),$div(false,'clear:left').append($div("BottomLeft"),$bottomBorder=$div("BottomCenter"),$div("BottomRight"))).children().children().css({'float':'left'});$loadingBay=$div(false,'position:absolute; width:9999px; visibility:hidden; display:none');$('body').prepend($overlay,$box.append($wrap,$loadingBay));$content.children().hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');}).addClass('hover');interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);$box.css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();$next.click(function(){publicMethod.next();});$prev.click(function(){publicMethod.prev();});$close.click(function(){publicMethod.close();});$groupControls=$next.add($prev).add($current).add($slideshow);$content.children().removeClass('hover');$overlay.click(function(){if(settings.overlayClose){publicMethod.close();}});$(document).bind('keydown.'+prefix,function(e){var key=e.keyCode;if(open&&settings.escKey&&key===27){e.preventDefault();publicMethod.close();}
if(open&&settings.arrowKey&&$related[1]){if(key===37){e.preventDefault();$prev.click();}else if(key===39){e.preventDefault();$next.click();}}});};publicMethod.remove=function(){$box.add($overlay).remove();$('.'+boxElement).removeData(colorbox).removeClass(boxElement);};publicMethod.position=function(speed,loadedCallback){var animate_speed,top=0,left=0;$box.hide();if(settings.fixed&&!isIE6){$box.css({position:'fixed'});}else{top=$window.scrollTop();left=$window.scrollLeft();$box.css({position:'absolute'});}
if(settings.right!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.right,'x'),0);}else if(settings.left!==false){left+=setSize(settings.left,'x');}else{left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2;}
if(settings.bottom!==false){top+=Math.max(document.documentElement.clientHeight-settings.h-loadedHeight-interfaceHeight-setSize(settings.bottom,'y'),0);}else if(settings.top!==false){top+=setSize(settings.top,'y');}else{top+=Math.max(document.documentElement.clientHeight-settings.h-loadedHeight-interfaceHeight,0)/2;}
$box.show();animate_speed=($box.width()===settings.w+loadedWidth&&$box.height()===settings.h+loadedHeight)?0:speed;$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(that){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=that.style.width;$loadingOverlay[0].style.height=$loadingOverlay[1].style.height=$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=that.style.height;}
$box.dequeue().animate({width:settings.w+loadedWidth,height:settings.h+loadedHeight,top:top,left:left},{duration:animate_speed,complete:function(){modalDimensions(this);active=false;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(loadedCallback){loadedCallback();}},step:function(){modalDimensions(this);}});};publicMethod.resize=function(options){if(open){options=options||{};if(options.width){settings.w=setSize(options.width,'x')-loadedWidth-interfaceWidth;}
if(options.innerWidth){settings.w=setSize(options.innerWidth,'x');}
$loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,'y')-loadedHeight-interfaceHeight;}
if(options.innerHeight){settings.h=setSize(options.innerHeight,'y');}
if(!options.innerHeight&&!options.height){var $child=$loaded.wrapInner("").children();settings.h=$child.height();$child.replaceWith($child.children());}
$loaded.css({height:settings.h});publicMethod.position(settings.transition==="none"?0:settings.speed);}};publicMethod.prep=function(object){if(!open){return;}
var speed=settings.transition==="none"?0:settings.speed;$window.unbind('resize.'+prefix);$loaded.remove();$loaded=$div('LoadedContent').html(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw1){if(typeof settings.current==="string"){$current.html(settings.current.replace(/\{current\}/,index+1).replace(/\{total\}/,total)).show();}
$next[(settings.loop||index')[0].src=nextSrc;}
if(isImage(prevSrc)){$('')[0].src=prevSrc;}}}else{$groupControls.hide();}
if(settings.iframe){iframe=$('').addClass(prefix+'Iframe')[0];if(settings.fastIframe){complete();}else{$(iframe).one('load',complete);}
iframe.name=prefix+(+new Date());iframe.src=settings.href;if(!settings.scrolling){iframe.scrolling="no";}
if(isIE){iframe.frameBorder=0;iframe.allowTransparency="true";}
$(iframe).appendTo($loaded).one(event_purge,function(){iframe.src="//about:blank";});}else{complete();}
if(settings.transition==='fade'){$box.fadeTo(speed,1,removeFilter);}else{removeFilter();}
$window.bind('resize.'+prefix,function(){publicMethod.position(0);});});}
if(settings.transition==='fade'){$box.fadeTo(speed,0,function(){setPosition(0);});}else{setPosition(speed);}};publicMethod.load=function(launched){var href,setResize,prep=publicMethod.prep;active=true;photo=false;element=$related[index];if(!launched){process($.extend(settings,$.data(element,colorbox)));}
trigger(event_purge);trigger(event_load,settings.onLoad);settings.h=settings.height?setSize(settings.height,'y')-loadedHeight-interfaceHeight:settings.innerHeight&&setSize(settings.innerHeight,'y');settings.w=settings.width?setSize(settings.width,'x')-loadedWidth-interfaceWidth:settings.innerWidth&&setSize(settings.innerWidth,'x');settings.mw=settings.w;settings.mh=settings.h;if(settings.maxWidth){settings.mw=setSize(settings.maxWidth,'x')-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.wsettings.mw){percent=(photo.width-settings.mw)/photo.width;setResize();}
if(settings.mh&&photo.height>settings.mh){percent=(photo.height-settings.mh)/photo.height;setResize();}}
if(settings.h){photo.style.marginTop=Math.max(settings.h-photo.height,0)/2+'px';}
if($related[1]&&(index<$related.length-1||settings.loop)){photo.style.cursor='pointer';photo.onclick=function(){publicMethod.next();};}
if(isIE){photo.style.msInterpolationMode='bicubic';}
setTimeout(function(){prep(photo);},1);});setTimeout(function(){photo.src=href;},1);}else if(href){$loadingBay.load(href,settings.data,function(data,status,xhr){prep(status==='error'?$div('Error').text('Request unsuccessful: '+xhr.statusText):$(this).contents());});}};publicMethod.next=function(){if(!active&&$related[1]&&(index<$related.length-1||settings.loop)){index=index<$related.length-1?index+1:0;publicMethod.load();}};publicMethod.prev=function(){if(!active&&$related[1]&&(index||settings.loop)){index=index?index-1:$related.length-1;publicMethod.load();}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup,settings.onCleanup);$window.unbind('.'+prefix+' .'+event_ie6);$overlay.fadeTo(200,0);$box.stop().fadeTo(300,0,function(){$box.add($overlay).css({'opacity':1,cursor:'auto'}).hide();trigger(event_purge);$loaded.remove();setTimeout(function(){closing=false;trigger(event_closed,settings.onClosed);},1);});}};publicMethod.element=function(){return $(element);};publicMethod.settings=defaults;handler=function(e){if(!((e.button!==0&&typeof e.button!=='undefined')||e.ctrlKey||e.shiftKey||e.altKey)){e.preventDefault();launch(this);}};if($.fn.delegate){$(document).delegate('.'+boxElement,'click',handler);}else{$('.'+boxElement).live('click',handler);}
$(publicMethod.init);}(jQuery,document,this));$(document).ready(function(){$("a[rel='largeimage1']").colorbox();$("a[rel='largeimage2']").colorbox();$("a[rel='largeimage3']").colorbox();$("#click").click(function(){$('#click').css({"background-color":"#f00","color":"#fff","cursor":"inherit"}).text("Open this window again and this message will still be here.");return false;});});(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'/images/lightbox-ico-loading.gif',imageBtnPrev:'/images/lightbox-btn-prev.gif',imageBtnNext:'/images/lightbox-btn-next.gif',imageBtnClose:'/images/lightbox-btn-close.gif',imageBlank:'/images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll").data("item.autocomplete",item).append(" | "+item.name+" |
").appendTo(ul);}
else{return $("").data("item.autocomplete",item).append("£"+item.price+"
| "+item.name+" Reference: "+item.reference+" |
").appendTo(ul);}}});function convertToList(){$(".gridbtn").css('opacity','1');$(".listbtn").css('opacity','.5');$(".product_brand").css('display','none');$(".product_refrence").css('display','none');$(".product_delivery").css('display','none');$(".ContentAlign").find('.clearfix').removeClass('grid_to_table');$(".pp-tmp-image").css({'width':'220px','max-width':'220px'});$(".pp-tmp-mid").css({'max-width':'260px'});}
function convertToGrid(){$(".gridbtn").css('opacity','.5');$(".listbtn").css('opacity','1');$(".product_brand").css('display','block');$(".product_refrence").css('display','block');$(".product_delivery").css('display','block');$(".ContentAlign").find('.clearfix').addClass('grid_to_table');}
function showMore(){$("#desc_sort").hide();$("#desc_full").fadeIn("slow");}
function showLess(){$("#desc_sort").fadeIn("slow");$("#desc_full").hide();}
function changequantity(sym,itemid){var oldValue=$("input#b_qty_"+ itemid).val();if(sym=="+"){var newVal=parseFloat(oldValue)+ 1;}else{if(oldValue>1){var newVal=parseFloat(oldValue)- 1;}else{newVal=1;}}
$("input#b_qty_"+ itemid).val(newVal);}
function isNumberKey(evt){var charCode=(evt.which)?evt.which:evt.keyCode;if(charCode!=46&&charCode>31&&(charCode<48||charCode>57))
return false;return true;}
function checkCartValue(){$('#loadDisp').css({'display':'block'});$('#fade').css({'display':'block'});$("#delpostcode").css('border','1px solid #ccc');$("#postcode").css('border','1px solid #ccc');$('#terms_and_conditions_error').hide();if(!$("input[name=terms_and_conditions_box]").is(':checked')){$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});$('#terms_and_conditions_error').show();$('#moveToTop').click();return false;}
var postcode=$("#postcode").val();if(!isValidPostcode(postcode)){$("#postcode").css('border','1px solid red').focus();$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});return false;}
if($("input[name=same_delivery]").is(':checked')){postcode=$("#delpostcode").val();if(!isValidPostcode(postcode)){$("#delpostcode").css('border','1px solid red').focus();$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});return false;}}
var empty_cart="true";$("#cart_empty").hide();$.ajax({url:'/core/ajax_functions.php',type:'POST',async:false,data:{'action':'check_empty_cart'},success:function(response){if(response==1){empty_cart="false";$("#cart_empty").show();alert("Your Shopping Cart is Empty!");$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});}}});if(empty_cart=="false"){$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});return false;}else{return validate_checkout();}}
function validate_checkout(){$("#mobile_error").hide();$("#delmobile_error").hide();var title=$('#ddlTitle');var first_name=$('#fname');var last_name=$('#sname');var postcode=$('#postcode');var address1=$('#addy1');var city=$('#city');var email=$('#email');var phone_number=$('#fld_phone');var mobile=$('#fld_mob_num');var css_error=({'border-color':'red'});var css_original=({'border-color':'#ccc'});title.css(css_original);first_name.css(css_original);last_name.css(css_original);email.css(css_original);phone_number.css(css_original);postcode.css(css_original);address1.css(css_original);city.css(css_original);mobile.css(css_original);var check_validate="1";var filter=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(title.val()==''){$('html,body').animate({scrollTop:35},'slow');title.css(css_error).focus();check_validate="0";}else if(first_name.val()==''){$('html,body').animate({scrollTop:35},'slow');first_name.css(css_error).focus();check_validate="0";}else if(last_name.val()==''){$('html,body').animate({scrollTop:35},'slow');last_name.css(css_error).focus();check_validate="0";}else if(email.val().trim()==""||!filter.test(email.val().trim())){$('html,body').animate({scrollTop:35},'slow');email.css(css_error).focus();check_validate="0";}else if(phone_number.val()==''||isNaN(phone_number.val())){$('html,body').animate({scrollTop:35},'slow');phone_number.css(css_error).focus();check_validate="0";}else if(phone_number.val()!=''&&!phone_number.val().match(/^\d+$/)){phone_number.css(css_error).focus();check_validate="0";}else if(postcode.val()==''){$('html,body').animate({scrollTop:35},'slow');postcode.css(css_error).focus();check_validate="0";}else if(address1.val()==''){$('html,body').animate({scrollTop:35},'slow');address1.css(css_error).focus();check_validate="0";}else if(city.val()==''){$('html,body').animate({scrollTop:35},'slow');city.css(css_error).focus();check_validate="0";}else if(mobile.val().trim()!=''){if(mobile.val().trim().substring(0,2)!="07"){mobile.css(css_error).focus();$("#mobile_error").show();$("#mobile_error").html('
Mobile number must start with 07');check_validate="0";}else if(mobile.val().length<11){mobile.css(css_error).focus();$("#mobile_error").show();$("#mobile_error").html('
Mobile number must be 11 digit');check_validate="0";}else if(!mobile.val().match(/^\d+$/)){mobile.css(css_error).focus();check_validate="0";}}
if($("input[name=same_delivery]").is(':checked')){var deltitle=$('input[name=delsalutation]');var delfirst_name=$('input[name=delfname]');var dellast_name=$('input[name=delsname]');var delpostcode=$('input[name=delpostcode]');var deladdress1=$('input[name=deladdress1]');var delcity=$('input[name=delcity]');var delemail=$('input[name=delemail]');var delphone_number=$('input[name=delphone]');var delmobile=$('input[name=delmobile_phone]');deltitle.css(css_original);delfirst_name.css(css_original);dellast_name.css(css_original);delemail.css(css_original);delphone_number.css(css_original);delpostcode.css(css_original);deladdress1.css(css_original);delcity.css(css_original);delmobile.css(css_original);if(deltitle.val()==''){$('html,body').animate({scrollTop:250},'slow');deltitle.css(css_error).focus();check_validate="0";}else if(delfirst_name.val()==''){$('html,body').animate({scrollTop:250},'slow');delfirst_name.css(css_error).focus();check_validate="0";}else if(dellast_name.val()==''){$('html,body').animate({scrollTop:250},'slow');dellast_name.css(css_error).focus();check_validate="0";}else if(delemail.val().trim()==""||!filter.test(email.val().trim())){$('html,body').animate({scrollTop:250},'slow');delemail.css(css_error).focus();check_validate="0";}else if(delphone_number.val()==''||isNaN(delphone_number.val())){$('html,body').animate({scrollTop:250},'slow');delphone_number.css(css_error).focus();check_validate="0";}else if(delphone_number.val()!=''&&!delphone_number.val().match(/^\d+$/)){delphone_number.css(css_error).focus();check_validate="0";}else if(delpostcode.val()==''){$('html,body').animate({scrollTop:250},'slow');delpostcode.css(css_error).focus();check_validate="0";}else if(deladdress1.val()==''){$('html,body').animate({scrollTop:250},'slow');deladdress1.css(css_error).focus();check_validate="0";}else if(delcity.val()==''){$('html,body').animate({scrollTop:250},'slow');delcity.css(css_error).focus();check_validate="0";}else if(delmobile.val().trim()!=''){if(delmobile.val().trim().substring(0,2)!="07"){delmobile.css(css_error).focus();$("#delmobile_error").show();$("#delmobile_error").html('
Mobile number must start with 07');check_validate="0";}else if(delmobile.val().length<11){delmobile.css(css_error).focus();$("#delmobile_error").show();$("#delmobile_error").html('
Mobile number must be 11 digit');check_validate="0";}else if(!delmobile.val().match(/^\d+$/)){delmobile.css(css_error).focus();check_validate="0";}}}
if(check_validate=="1"){return check_rak_datepicker();}else{$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});return false;}}
function selectProductOption(){var selected_url=$("#select_product_option").val();if(selected_url!=""){window.location.href="http://www.heatandplumb.com/acatalog/"+ selected_url;}}
function isValidPostcode(p){var postcodeRegEx=/[A-Z]{1,2}[0-9]{1,2}[A-Z]* ?[0-9][A-Z]{2}/i;return postcodeRegEx.test(p);}
function removeRAKDatePicker(){$(".rak_checkout_datepicker").val('');$("#delpostcode").css('border','1px solid #ccc');$("#postcode").css('border','1px solid #ccc');var postcode=$("#postcode").val().trim();if(!isValidPostcode(postcode)){$("#postcode").css('border','1px solid red');}else{$("#postcode").val(format_address(postcode.toUpperCase()));}
if($("input[name=same_delivery]").is(':checked')){postcode=$("#delpostcode").val().trim();if(!isValidPostcode(postcode)){$("#delpostcode").css('border','1px solid red');}else{$("#delpostcode").val(format_address(postcode.toUpperCase()));}}
if(postcode==""){return false;}
$('#loadDisp').css({'display':'block'});$('#fade').css({'display':'block'});$.ajax({'url':'/core/ajax_functions.php','type':'post',async:false,data:{'action':'remove_advance_delivery','postcode':postcode},success:function(res){var resArr=$.parseJSON(res);$("#delivery_vary_lbl").html("");$("#no_delivery_sentence").html("");if(resArr['sentence']!=""||resArr['sentence_1']!=""){if(resArr['sentence']==""){resArr['sentence']=resArr['sentence_1'];}
$("#delivery_date_info_div").hide();$("#delivery_vary_lbl").html(resArr['sentence']);$("#no_delivery_sentence").html(resArr['no_delivery_sentence']);$("#choose_delivery_date_lbl").hide();$("#select_delivery_date_legend").hide();$("#choose_delivery_date_main_div").css({'padding':'0','height':'10px'});$("#extra_delivery_info_lbl").css({'font-size':'16px'});$("#new_total_lbl").css({'font-size':'17px'});$("#extra_delivery_info_lbl").hide();$("#new_total_lbl").hide();$("#terms_and_conditions_box").attr('checked',false);$("#payment_options").hide();$("#payment_text").show();$("#supplier_delivery_tbl").html("");$("#extra_delivery_info_div").show();}else{$("#delivery_date_info_div").show();$("#extra_delivery_info_div").hide();$("#choose_delivery_date_lbl").show();$("#select_delivery_date_legend").show();$("#choose_delivery_date_main_div").css({'padding':'10px','height':'auto'});$("#extra_delivery_info_lbl").css({'font-size':'13px'});$("#new_total_lbl").css({'font-size':'14px'});$(".rak_checkout_datepicker").addClass('hasDatepicker').attr('disabled',false);if(resArr['charge_apply']=="1"){$("#extra_delivery_info_lbl").show();$("#new_total_lbl").show();$("#extra_del_span").html(resArr['advanced_delivery']);$("#extra_delivery_info_div").show();}else{$("#extra_delivery_info_lbl").hide();$("#new_total_lbl").hide();$("#extra_delivery_info_div").hide();}
$("#supplier_delivery_tbl").html(resArr['html']);}
if(resArr['html']==""){if(resArr['charge_apply']==1&&$("#delivery_date_info_div").find(".formControl.hasDatepicker").length==0){$("#special_del_main_tbl").show();$("#choose_delivery_date_lbl").hide();$("#select_delivery_date_legend").hide();$("#choose_delivery_date_main_div").css({'padding':'0','height':'10px'});$("#extra_delivery_info_lbl").css({'font-size':'16px'});$("#new_total_lbl").css({'font-size':'17px'});$("#delivery_date_info_div").hide();}else if($("#delivery_date_info_div").find(".formControl.hasDatepicker").length==0){$("#special_del_main_tbl").hide();}}
var pound_symbol=$("#pound_symbol").val();$("#new_total_span").html(pound_symbol+ resArr['cart_total']);$("#checkout_charge_price").html(pound_symbol+ resArr['cart_total']);$("#cart_value").html(pound_symbol+ resArr['cart_total']);$("#checkout_charge_price").html(pound_symbol+ resArr['cart_total']+resArr['exc_vat_text']);if($(".formControl").hasClass('check_delivery_btn')){$(".check_delivery_hide").val(0);$(".checkout_success_img").hide();}
$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});}});if(postcode!=""){$("#select_postcode_lbl").hide();$("#supplier_delivery_div").show();}else{$("#supplier_delivery_div").hide();$("#select_postcode_lbl").show();}}
function checkDeliveryCostCart(){$('#loadDisp').css({'display':'block'});$('#fade').css({'display':'block'});$.ajax({'url':'/core/ajax_functions.php','type':'post',async:false,data:{'action':'check_delivery_product_in_cart'},success:function(res){if(res.trim()=='goto_paypal'){paypal();}else{$("#extra_delivery_info_div").hide();$("#new_total_lbl").hide();$("#extra_delivery_info_lbl").hide();$("#check_delivery_charge_btn_div").hide();$("#del_postcode_cart").val('').focus();$("#delivery_charge_popup").bPopup();$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});}}});}
function checkDeliveryCostCartPostcode(){var postcode=$("#del_postcode_cart").val();$("#extra_delivery_info_div").hide();$("#new_total_lbl").hide();$("#extra_delivery_info_lbl").hide();$("#check_delivery_charge_btn_div").hide();var css_error=({'border-color':'red'});var css_original=({'border-color':'rgb(204, 204, 204)'});$("#del_postcode_cart").css(css_original);if(postcode==""||!isValidPostcode(postcode)){$("#del_postcode_cart").css(css_error).focus();return false;}else{$('#loadDisp').css({'display':'block'});$('#fade').css({'display':'block'});var sentance="";var charges_apply=0;var advanced_delivery_total=0;var cart_total=0;$.ajax({'url':'/core/ajax_functions.php','type':'post',async:false,data:{'action':'remove_advance_delivery','postcode':postcode},success:function(res){var resArr=$.parseJSON(res);$("#delivery_vary_lbl").html("");$("#no_delivery_sentence").html("");if(resArr['sentence']!=""||resArr['sentence_1']!=""){if(resArr['sentence']==""){resArr['sentence']=resArr['sentence_1'];}
sentance=resArr['sentence'];}else if(resArr['charge_apply']=="1"){charges_apply=1;advanced_delivery_total=resArr['advanced_delivery'];cart_total=resArr['cart_total']}
$('#loadDisp').css({'display':'none'});$('#fade').css({'display':'none'});}});if(charges_apply==1){$("#extra_del_span").html(advanced_delivery_total);$("#extra_delivery_info_lbl").show();}else{$("#extra_delivery_info_lbl").hide();}
var currency_symbol=$("#currency_symbol").val();$("#new_total_span").html(currency_symbol+cart_total);$("#extra_delivery_info_div").show();$("#new_total_lbl").show();$("#check_delivery_charge_btn_div").show();$("#no_delivery_sentense").html("");if(sentance!=""){$("#extra_delivery_info_lbl").hide();$("#new_total_lbl").hide();$("#check_delivery_charge_btn_div").hide();$("#no_delivery_sentense").html(sentance);}}}
function checkSearchText(){var css_error=({'border-color':'red'});var css_original=({'border-color':'rgb(204, 204, 204)'});$("#s_keyword").css(css_original);if($("#s_keyword").val()==""){$("#s_keyword").css(css_error).focus();return false;}else{return true;}}
function notifyUserForProduct(product_reference){var user_email=$("#notify_text").val();var css_error=({'border-color':'red'});var css_original=({'border-color':'rgb(204, 204, 204)'});$("#notify_text").css(css_original);var filter=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(user_email==""||!filter.test(user_email)){$("#notify_text").css(css_error).focus();return false;}else{$.ajax({url:'/core/ajax_functions.php',type:'POST',async:false,data:{'action':'notify_user_for_product','product_reference':product_reference,'email_id':user_email},success:function(res){$("#notify_user_main_div").hide();$("#notify_success").fadeIn('slow');}});}}
function format_address(postcode){var parts=postcode.match(/^([A-Z]{1,2}\d{1,2}[A-Z]?)\s*(\d[A-Z]{2})$/);parts.shift();return parts.join(' ');}