<!--

 /* POPUP */
function popUp(url){var width=450;var height=350;var left=(screen.width-width)/2;var top=(screen.height-height)/2;var params='width='+width+', height='+height;params += ', top='+top+', left='+left;params += ', directories=no';params += ', location=no';params += ', menubar=no';params += ', resizable=no';params += ', scrollbars=no';params += ', status=no';params += ', toolbar=no';newwin=window.open(url,'EnquiryForm',params);if(window.focus){newwin.focus()}return false;}

/* ADDED TO BASKET MESSAGE */
function basketDivFadeIn(divname){var position = $('#basket_button_1').position();var pos_top = position.top - 70;var pos_left = position.left - 60;document.getElementById(divname).style.top = pos_top + 'px';document.getElementById(divname).style.left = pos_left + 'px';$('#'+divname+':hidden:first').fadeIn('slow').animate({opacity:1},5000).fadeOut('slow');}

/* JUMPMENU*/
function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if (restore) selObj.selectedIndex=0;}

/* MAIN LAYOUT COLUMNS*/
function bodychangeSize(){var divh=document.getElementById('main_content').offsetHeight;divh=divh-1;var navh=document.getElementById('navigation').offsetHeight;if (divh < navh){document.getElementById('navigation').style.height='auto';}else{document.getElementById('navigation').style.height=divh+'px';}}

/* BULK AJAX */
function doAjax(method,loc,param,success_msg){$.ajax({type: method,url: loc,data: param,dataType: 'text',success: function(msg){alert(success_msg);}});}

/* BASKET BUY */
function BasketBuy(varid,row_count){
var qty_value=document.getElementById('qty_'+row_count).value; if(!qty_value || qty_value=='' || qty_value=='0'){$('#basket_add_failed_dialog').dialog({bgiframe: true,width:340,height:200,modal: true,buttons: {Ok: function() {$(this).dialog('close');}}});$('#basket_add_failed_dialog').dialog('open');} else {$.ajax({type: 'GET',url: '/purple_cms/shop.php',data: 'action=addtobasket&varid='+varid+'&varqty='+document.getElementById('qty_'+row_count).value,dataType: 'text',success: function(){$('#basket_add_success_dialog').dialog({bgiframe: true,width:340,height:200,modal: true,buttons: {Ok: function() {$(this).dialog('close');}}});$('#basket_add_success_dialog').dialog('open');var b_d=document.getElementById('cart_qty');var b_t=b_d.innerHTML;var b_a=document.getElementById('qty_'+row_count).value;num_b_t=parseInt(b_t);num_b_a=parseInt(b_a);b_c_t=num_b_t+num_b_a;b_d.innerHTML=b_c_t;var C_2=document.getElementById('cart_number2');C_2.innerHTML=b_c_t;b_d.style.fontWeight='bold';b_d.style.color='#FFF';document.getElementById('BASKET_TD').style.background = 'transparent url(/images/header/h_basket_full.jpg) no-repeat center';document.getElementById('qty_'+row_count).value='';}});}}

/* VARIENT SWITCHER */
function multiVarientSwitch(myswitch,varid,spanid,rowid){$.ajax({type: "GET",url: "/includes/multi_varient_switcher.php",data: "switch=" + myswitch + "&varid=" + varid,dataType: 'text',success: function(msg){document.getElementById(spanid).innerHTML = msg;}});
}

/* AJAX */
var http_request=true; function makeLightboxRequest(url, parameters){http_request=false;if(window.XMLHttpRequest){http_request= new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType("text/html"); }} else if (window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } } } if(!http_request){alert("Cannot create XMLHTTP instance"); return false;}http_request.onreadystatechange=alertLightboxContents;http_request.open("GET",url + parameters,true);http_request.send(null);}function alertLightboxContents(){if(http_request.readyState==4){if(http_request.status==200){} else {alert("Error");}}}

/*NUMBERS ONLY*/
function numbersOnly(el){el.value = el.value.replace(/[^0-9]/g, "");}

/*SAGE PAY JAVASCRIPT8*/ 
function submitForm(formName,navigateValue){if(navigateValue != null && navigateValue != ""){document.forms[formName].navigate.value=navigateValue;}document.forms[formName].submit();}function getCountryOptionsListHtml(strSelectedValue){var strCountryOptionsList='<option value="">Please select...</option>\n';for (var i=0; i < countries.length; i++){strCountryOptionsList += '<option value="' + countries[i].code + '"';if(strSelectedValue==countries[i].code){strCountryOptionsList += " SELECTED";}strCountryOptionsList += ">" + countries[i].name + "</option>\n";}return strCountryOptionsList;}function getCountryName(strCountryCode){for(var i=0; i < countries.length; i++){if(strCountryCode==countries[i].code){return countries[i].name;}}return "";}countries=[{code: "GB",name: "United Kingdom"}];function IsDeliverySame_clicked(){if(document.customerform.IsDeliverySame.checked){document.customerform.DeliveryFirstnames.value="";document.customerform.DeliveryFirstnames.className="inputBoxDisable";document.customerform.DeliveryFirstnames.disabled=true;document.customerform.DeliverySurname.value="";document.customerform.DeliverySurname.className="inputBoxDisable";document.customerform.DeliverySurname.disabled=true; document.customerform.DeliveryAddress1.value="";document.customerform.DeliveryAddress1.className="inputBoxDisable";document.customerform.DeliveryAddress1.disabled=true;document.customerform.DeliveryAddress2.value="";document.customerform.DeliveryAddress2.className="inputBoxDisable";document.customerform.DeliveryAddress2.disabled=true;document.customerform.DeliveryCity.value="";document.customerform.DeliveryCity.className="inputBoxDisable";document.customerform.DeliveryCity.disabled=true;document.customerform.DeliveryPostCode.value="";document.customerform.DeliveryPostCode.className="inputBoxDisable";document.customerform.DeliveryPostCode.disabled=true;document.customerform.DeliveryCountry.value="";document.customerform.DeliveryCountry.className="inputBoxDisable";document.customerform.DeliveryCountry.disabled=true;document.customerform.DeliveryPhone.value="";document.customerform.DeliveryPhone.className="inputBoxDisable";document.customerform.DeliveryPhone.disabled=true;}else{document.customerform.DeliveryFirstnames.disabled=false;document.customerform.DeliveryFirstnames.className="inputBoxEnable";document.customerform.DeliveryFirstnames.focus(); document.customerform.DeliverySurname.disabled=false;document.customerform.DeliverySurname.className="inputBoxEnable";document.customerform.DeliveryAddress1.disabled=false;document.customerform.DeliveryAddress1.className="inputBoxEnable";document.customerform.DeliveryAddress2.disabled=false;document.customerform.DeliveryAddress2.className="inputBoxEnable";document.customerform.DeliveryCity.disabled=false;document.customerform.DeliveryCity.className="inputBoxEnable";document.customerform.DeliveryPostCode.disabled=false;document.customerform.DeliveryPostCode.className="inputBoxEnable";document.customerform.DeliveryCountry.disabled=false;document.customerform.DeliveryCountry.className="inputBoxEnable";document.customerform.DeliveryPhone.disabled=false;document.customerform.DeliveryPhone.className="inputBoxEnable";}} /* Slimbox v2.02 - The ultimate lightweight Lightbox clone for jQuery (c) 2007-2009 Christophe Beyls <http://www.digitalia.be> MIT-style license. */ (function(w){var E=w(window),u,g,F=-1,o,x,D,v,y,L,s,n=!window.XMLHttpRequest,e=window.opera&&(document.compatMode=="CSS1Compat")&&(w.browser.version>=9.3),m=document.documentElement,l={},t=new Image(),J=new Image(),H,a,h,q,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('<div id="lbOverlay" />')[0],a=w('<div id="lbCenter" />')[0],G=w('<div id="lbBottomContainer" />')[0]]).css("display","none"));h=w('<div id="lbImage" />').appendTo(a).append(q=w('<div style="position: relative;" />').append([I=w('<a id="lbPrevLink" href="#" />').click(B)[0],d=w('<a id="lbNextLink" href="#" />').click(f)[0]])[0])[0];c=w('<div id="lbBottom" />').appendTo(G).append([w('<a id="lbCloseLink" href="#" />').add(H).click(C)[0],A=w('<div id="lbCaption" />')[0],K=w('<div id="lbNumber" />')[0],w('<div style="clear: both;" />')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:100,resizeDuration:100,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:100,captionAnimationDuration:100,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+((e?m.clientHeight:E.height())/2);L=u.initialWidth;s=u.initialHeight;w(a).css({top:Math.max(0,y-(s/2)),width:L,height:s,marginLeft:-L/2}).show();v=n||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();k(1);g=O;u.loop=u.loop&&(g.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q<R;++Q){if(T[Q]==S){U=Q}T[Q]=P(T[Q],Q)}return w.slimbox(T,U,M)})};function z(){var N=E.scrollLeft(),M=e?m.clientWidth:E.width();w([a,G]).css("left",N+(M/2));if(v){w(H).css({left:N,top:E.scrollTop(),width:M,height:E.height()})}}function k(M){w("object").add(n?"select":"embed").each(function(O,P){if(M){w.data(P,"slimbox",P.style.visibility)}P.style.visibility=M?"hidden":w.data(P,"slimbox")});var N=M?"bind":"unbind";E[N]("scroll resize",z);w(document)[N]("keydown",p)}function p(O){var N=O.keyCode,M=w.inArray;return(M(N,u.closeKeys)>=0)?C():(M(N,u.nextKeys)>=0)?f():(M(N,u.previousKeys)>=0)?B():false}function B(){return b(x)}function f(){return b(D)}function b(M){if(M>=0){F=M;o=g[F][0];x=(F||(u.loop?g.length:0))-1;D=((F+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";l=new Image();l.onload=j;l.src=o}return false}function j(){a.className="";w(h).css({backgroundImage:"url("+o+")",visibility:"hidden",display:""});w(q).width(l.width);w([q,I,d]).height(l.height);w(A).html(g[F][1]||"");w(K).html((((g.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,g.length));if(x>=0){t.src=g[x][0]}if(D>=0){J.src=g[D][0]}L=h.offsetWidth;s=h.offsetHeight;var M=Math.max(0,y-(s/2));if(a.offsetHeight!=s){w(a).animate({height:s,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+s,marginLeft:-L/2,visibility:"hidden",display:""});w(h).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,i)})}function i(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function r(){l.onload=null;l.src=t.src=J.src=o;w([a,h,c]).stop(true);w([I,d,h,G]).hide()}function C(){if(F>=0){r();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,k)}return false}})(jQuery); jQuery(function($){$("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el){return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));});});


//-->