<!--



var PicWin;var Open=0;var Version;var Browser=navigator.appName;BVer=parseInt(navigator.appVersion);


        //Number Of Reconnects
        var rcount=0;
        //Maximum reconnects Setting
        var rmax = 6;
        function Reconnect(){
          rcount++;
          var d = new Date();
          var curr_hour = d.getHours();
          var curr_min = d.getMinutes();
          if (rcount < rmax){
            window.status = 'Refreshed ' + rcount + ' time(s) [' + curr_hour + ':' + curr_min + ']';
            var img = new Image(1,1);
            img.src = 'reconnect.aspx';
	    //alert('Session Refreshed : ' + curr_hour + ':' + curr_min)
	    
          }
         }
          window.setInterval('Reconnect()',900000);


function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v='hide')?'hidden':v;}
obj.visibility=v;}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&document.getElementById)x=document.getElementById(n);return x;}
function Dty(){this.obj=new Object();this.Count=0;function Dty_Add(key,value){if(this.obj[key]!=null)return null;this.obj[key]=value;this.Count++;return value;}
function Dty_Exists(key){return(this.obj[key]!=null);}
function Dty_Remove(key){if(this.obj[key]==null)return null;this.obj[key]=null;this.Count--;return key;}
function Dty_Items(){var returnArray=new Array();for(var i in this.obj){if(this.obj[i]!=null){returnArray.push(this.obj[i]);}}
return returnArray;}
function Dty_Keys(){var returnArray=new Array();for(var i in this.obj){if(this.obj[i]!=null){returnArray.push(i);}}
return returnArray;}
function Dty_RemoveAll(){this.obj=new Object();this.Count=0;}
function Dty_Item(key,value){if(value!=null){if(this.obj[key]!=null){this.obj[key]=value;return value;}else{return null;}}else{return this.obj[key];}}
function Dty_Key(key,newKey){if(this.obj[key]!=null){this.obj[newKey]=this.obj[key];this.obj[key]=null;return newKey;}else{return key;}}
this.Add=Dty_Add;this.Exists=Dty_Exists;this.Remove=Dty_Remove;this.Items=Dty_Items;this.Keys=Dty_Keys;this.RemoveAll=Dty_RemoveAll;this.Item=Dty_Item;this.Key=Dty_Key;}
function SpecialOfferOptionsCheck(form){var a=document.SpecialOfferForm;if(a!=undefined){if(document.SpecialOfferForm.SpecialOfferItem.length!=null){var RadioLength=document.SpecialOfferForm.SpecialOfferItem.length;for(var i=0;i<RadioLength;i++){checked=document.SpecialOfferForm.SpecialOfferItem[i].checked;if(checked){form.SpecialOffer.value=document.SpecialOfferForm.SpecialOfferItem[i].value;checked=false;}}}else{if(document.SpecialOfferForm.SpecialOfferItem.checked){form.SpecialOffer.value=document.SpecialOfferForm.SpecialOfferItem.value;}
checked=false;}}}
var exchangerate=1;function MoneyFormat(amount){var val=parseFloat(amount);if(isNaN(val)){return"0.00";}
val+="";val=(val==Math.round(val))?val+'.00':((val*10==Math.floor(val*10))?val+'':val);val=val*exchangerate
val=Math.round(val*100)/100;val+="";if(val.indexOf('.')==-1){return val+".00";}
else if((val.length-1)-val.indexOf('.')==1){return val+"0";}
return val;}
function ShowTable(Table){var wndTable;if(wndTable){wndTable.close();}
wndTable=window.open("","DemoWindow","width=640,height=450,resizable=yes,scrollbars=yes,Title=No");wndTable.document.writeln("<LINK HREF='Whitelabels/master/css.css' TYPE='text/css' REL='STYLESHEET'>")
wndTable.document.writeln(Table);wndTable.document.close();wndTable.focus();}
var changepics=false;function ChangePrice(Form,Options,ShowDesc){x=document.getElementById("OPTFORM"+Form)
var SC=x.item.value
scsplitsuffix=SC.split(";")
scsplit=scsplitsuffix[0].split("-")
SC=scsplit[0]
var SCSuffix=";"+scsplitsuffix[1]+";"+scsplitsuffix[2]
if(Options==true){for(i=0;i<x.length;i++){if(x[i].tagName=='SELECT'){SC+="-"+x[i].value}}}
if(ShowDesc==1){var Desc=window.open("showdescription.aspx?p="+SC+SCSuffix,"Desc","width=680,height=450,resizable=yes,scrollbars=yes,Title=No");Desc.focus();return false;}
var DTLS=eval("stock"+Form+".Item(SC+SCSuffix)")
if(DTLS==undefined){alert('The combination selected is not available please select again')
return false}
x.dtls.value=DTLS;x.selecteditem.value=SC+SCSuffix;params=DTLS.split("|")
if(Form==1&&params[4]=='5'){changepics=true;}else if(Form==1){if(document.images['IMG'+Form]){document.images['IMG'+Form].src='image.aspx?product='+SC+SCSuffix}}
if(Form>1&&changepics==true){document.images['IMG'+Form].src='image.aspx?M=0&product='+SC+SCSuffix}
x.Price.value=params[1]
x.D2D.value=params[5]
x.WEIGHT.value=params[6]
x.P4.value=params[7]
x.P2.value=params[8]
x=document.getElementById('COSTMAINSHOW')
x.innerHTML=params[1]
x=document.getElementById('DESPATCHEDMAINSHOW')
x.innerHTML=params[5]+1
if(document.getElementById('WEIGHTMAINSHOW')){x=document.getElementById('WEIGHTMAINSHOW')
x.innerHTML=params[6]}
x=document.getElementById('POINTSFORMAINSHOW')
x.innerHTML=params[7]
x=document.getElementById('POINTSTOBUYMAINSHOW')
x.innerHTML=params[8]
var Forms=document.forms
x=document.getElementById('ItemMain');x.dtls.value='';x.item.value='';GroupNumber=parseInt(x.Group.value,10);if(GroupNumber>=0){x.COSTMAIN.value=0;x.COSTMAIN.value=0;var CostMain;var Weight;var P4;var P2;var D2D;var D2D2;CostMain=0;Weight=0;D2D=0;D2D2=0;P4=0;P2=0;for(i=0;i<Forms.length;i++){if(Forms[i].name.indexOf("OPTFORM")==0){x.dtls.value+=Forms[i].dtls.value+"#^#";x.item.value+=Forms[i].selecteditem.value+"#^#";CostMain+=parseFloat(Forms[i].Price.value,10);P4+=parseInt(Forms[i].P4.value,10);P2+=parseInt(Forms[i].P2.value,10);Weight+=parseInt(Forms[i].WEIGHT.value,10);D2D2=parseInt(Forms[i].D2D.value,10);if(D2D2>D2D){D2D=D2D2;}}}
x.COSTMAIN.value=MoneyFormat(CostMain);x=document.getElementById('DESPATCHEDMAINSHOW');if(D2D==0){D2D="Today";}else if(D2D==1){D2D="Tomorrow";}else{D2D=D2D+" Days";}
x.innerHTML=D2D;if(GroupNumber>1){x=document.getElementById('ItemMain');params=x.ItemMaindtls.value.split("|");x=document.getElementById('POINTSFORMAINSHOW');x.innerHTML=params[7];x=document.getElementById('POINTSTOBUYMAINSHOW');x.innerHTML=params[8];x=document.getElementById('COSTMAINSHOW');x.innerHTML=MoneyFormat(params[1]);}else{x=document.getElementById('COSTMAINSHOW');x.innerHTML=MoneyFormat(CostMain);x=document.getElementById('POINTSFORMAINSHOW');x.innerHTML=P4;x=document.getElementById('POINTSTOBUYMAINSHOW');x.innerHTML=P2;}
if(document.getElementById('WEIGHTMAINSHOW')){x=document.getElementById('WEIGHTMAINSHOW')
x.innerHTML=Weight;}}
if($('PDT_SelFullDesc')){new Ajax(miBaseURL+'product/getdescription.aspx?p='+SC+SCSuffix,{method:'get',update:$('PDT_SelFullDesc')}).request();var myEffects=new Fx.Styles('PDT_SelDesc',{duration:500,transition:Fx.Transitions.linear});myEffects.start({'opacity':[0,1]});$('PDT_SelDesc').innerHTML=params[0];}}
function ChangeGroupPrice(Form,Options,ShowDesc){x=document.getElementById("OPTFORM"+Form);var DTLS=document.getElementById('Option'+Form+'dtls'+Options).value;params=DTLS.split("|");if(Form==1&&params[4]=='5'){changepics=true;}else if(Form==1){if(document.images['IMG'+Form]){}}
if(Form>1&&changepics==true){}
x=document.getElementById('COSTMAINSHOW')
x.innerHTML=params[1]
x=document.getElementById('DESPATCHEDMAINSHOW')
x.innerHTML=params[5]+1
if(document.getElementById('WEIGHTMAINSHOW')){x=document.getElementById('WEIGHTMAINSHOW')
x.innerHTML=params[6]}
x=document.getElementById('POINTSFORMAINSHOW')
x.innerHTML=params[7]
x=document.getElementById('POINTSTOBUYMAINSHOW')
x.innerHTML=params[8]
var Forms=document.forms
x=document.getElementById('ItemMain');x.dtls.value='';x.item.value='';GroupNumber=parseInt(x.Group.value,10);if(GroupNumber>=0){x.COSTMAIN.value=0;x.COSTMAIN.value=0;var CostMain;var Weight;var P4;var P2;var D2D;var D2D2;CostMain=0;Weight=0;D2D=0;D2D2=0;P4=0;P2=0;for(i=0;i<Forms.length;i++){if(Forms[i].name.indexOf("OPTFORM")==0){var myDtls=Forms[i].dtls.value;var myparams=myDtls.split("|");x.dtls.value+=myDtls+"#^#";x.item.value+=Forms[i].selecteditem.value+"#^#";CostMain+=parseFloat(myparams[1],10);P4+=parseInt(myparams[7],10);P2+=parseInt(myparams[8],10);Weight+=parseInt(myparams[6],10);D2D2=parseInt(myparams[5],10);if(D2D2>D2D){D2D=D2D2;}}}
x.COSTMAIN.value=MoneyFormat(CostMain);x=document.getElementById('DESPATCHEDMAINSHOW');x.innerHTML=D2D;if(GroupNumber>1){x=document.getElementById('ItemMain');params=x.ItemMaindtls.value.split("|");x=document.getElementById('POINTSFORMAINSHOW');x.innerHTML=params[7];x=document.getElementById('POINTSTOBUYMAINSHOW');x.innerHTML=params[8];x=document.getElementById('COSTMAINSHOW');x.innerHTML=MoneyFormat(params[1]);}else{x=document.getElementById('COSTMAINSHOW');x.innerHTML=MoneyFormat(CostMain);x=document.getElementById('POINTSFORMAINSHOW');x.innerHTML=P4;x=document.getElementById('POINTSTOBUYMAINSHOW');x.innerHTML=P2;}
if(document.getElementById('WEIGHTMAINSHOW')){x=document.getElementById('WEIGHTMAINSHOW')
x.innerHTML=Weight;}}}
function _ChangePrice(Form,Options,ShowDesc){x=document.getElementById("OPTFORM"+Form)
var SC=x.item.value
scsplitsuffix=SC.split(";")
scsplit=scsplitsuffix[0].split("-")
SC=scsplit[0]
var SCSuffix=";"+scsplitsuffix[1]+";"+scsplitsuffix[2]
if(Options==true){for(i=0;i<x.length;i++){if(x[i].tagName=='SELECT'){SC+="-"+x[i].value}}}
if(ShowDesc==1){var Desc=window.open("showdescription.aspx?p="+SC+SCSuffix,"Desc","width=680,height=450,resizable=yes,scrollbars=yes,Title=No");Desc.focus();return false;}
var DTLS=eval("stock"+Form+".Item(SC+SCSuffix)")
if(DTLS==undefined){alert('The combination selected is not available please select again')
return false}
x.dtls.value=DTLS;x.selecteditem.value=SC+SCSuffix;params=DTLS.split("|")
if(Form==1&&params[4]=='5'){changepics=true;}else if(Form==1){if(document.images['IMG'+Form]){document.images['IMG'+Form].src='image.aspx?product='+SC+SCSuffix}}
if(Form>1&&changepics==true){document.images['IMG'+Form].src='image.aspx?product='+SC+SCSuffix}
x.Price.value=params[1]
x.D2D.value=params[5]
x.WEIGHT.value=params[6]
x.P4.value=params[7]
x.P2.value=params[8]
x=document.getElementById('COSTMAINSHOW')
x.innerHTML=params[1]
x=document.getElementById('DESPATCHEDMAINSHOW')
x.innerHTML=params[5]+1
if(document.getElementById('WEIGHTMAINSHOW')){x=document.getElementById('WEIGHTMAINSHOW')
x.innerHTML=params[6]}
x=document.getElementById('POINTSFORMAINSHOW')
x.innerHTML=params[7]
x=document.getElementById('POINTSTOBUYMAINSHOW')
x.innerHTML=params[8]
var Forms=document.forms
x=document.getElementById('ItemMain');x.dtls.value='';x.item.value='';GroupNumber=parseInt(x.Group.value,10);if(GroupNumber>=0){x.COSTMAIN.value=0;x.COSTMAIN.value=0;var CostMain;var Weight;var P4;var P2;var D2D;var D2D2;CostMain=0;Weight=0;D2D=0;D2D2=0;P4=0;P2=0;for(i=0;i<Forms.length;i++){if(Forms[i].name.indexOf("OPTFORM")==0){x.dtls.value+=Forms[i].dtls.value+"#^#";x.item.value+=Forms[i].selecteditem.value+"#^#";CostMain+=parseFloat(Forms[i].Price.value,10);P4+=parseInt(Forms[i].P4.value,10);P2+=parseInt(Forms[i].P2.value,10);Weight+=parseInt(Forms[i].WEIGHT.value,10);D2D2=parseInt(Forms[i].D2D.value,10);if(D2D2>D2D){D2D=D2D2;}}}
x.COSTMAIN.value=MoneyFormat(CostMain);x=document.getElementById('DESPATCHEDMAINSHOW');x.innerHTML=D2D;if(GroupNumber>1){x=document.getElementById('ItemMain');params=x.ItemMaindtls.value.split("|");x=document.getElementById('POINTSFORMAINSHOW');x.innerHTML=params[7];x=document.getElementById('POINTSTOBUYMAINSHOW');x.innerHTML=params[8];x=document.getElementById('COSTMAINSHOW');x.innerHTML=MoneyFormat(params[1]);}else{x=document.getElementById('COSTMAINSHOW');x.innerHTML=MoneyFormat(CostMain);x=document.getElementById('POINTSFORMAINSHOW');x.innerHTML=P4;x=document.getElementById('POINTSTOBUYMAINSHOW');x.innerHTML=P2;}
if(document.getElementById('WEIGHTMAINSHOW')){x=document.getElementById('WEIGHTMAINSHOW')
x.innerHTML=Weight;}}}
var numFocusedSearch;numFocusedSearch=0;function PopUp(theURL,winName,features){window.open(theURL,winName,features);}
function usePoints(Pointer){var Points=parseInt(document.forms['__aspnetForm'].CURRENTPOINTS_X_.value,10)
var pairs=Pointer.value.split("!!");var Redeemed=parseInt(pairs[1],10)
if(Pointer.checked==true){if(Points>=Redeemed){Points=Points-Redeemed}else{alert("Sorry you do not have enough points")
Pointer.checked=false}}else{Points=Points+Redeemed}
document.forms['__aspnetForm'].CURRENTPOINTS_X_.value=Points
document.forms['__aspnetForm'].submit();}
function GiftWrap(Pointer){document.forms.__aspnetForm.submit();}
function useVoucher(){document.forms.__aspnetForm.submit();}
function RedeemNow()
{document.forms.__aspnetForm.action_X_.value='Redeem'
document.forms.__aspnetForm.STAGE_X_.value='32';document.forms.__aspnetForm.submit();}
function ProceedRedemtion()
{document.forms.__aspnetForm.action_X_.value='Checkout'
document.forms.__aspnetForm.STAGE_X_.value='4';document.forms.__aspnetForm.submit();}
function CheckEmail(EmailAddr)
{if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(EmailAddr))
{return(true)}
alert("Invalid Email Address")
return(false)}
function frmBasket_Submit(blnVoucher)
{if(document.forms.Form1.blnVoucher.value=='True')
{if(document.forms.Form1.txtRecipientName.value==""||document.forms.Form1.txtRecipientEmail.value==""||document.forms.Form1.txtSenderName.value==""||document.forms.Form1.txtMessage.value==""||CheckEmail(document.forms.Form1.txtRecipientEmail.value)==false)
{alert("Please enter the Voucher details below before proceeding to checkout")
return false;}}
return true;}
function gWin(URL)
{newWin=window.open(URL,"",'resizable,scrollbars=yes,toolbar=yes,status=yes,menubar=no,WIDTH=300,HEIGHT=250');return false;}
function pWin(URL)
{newWin=window.open(URL,"",'resizable,scrollbars=yes,toolbar=yes,status=yes,menubar=no,WIDTH=500,HEIGHT=350');return false;}
function nWin(URL,width,height)
{newWin=window.open(URL,"",'resizable,scrollbars=yes,toolbar=yes,status=yes,menubar=no,WIDTH='+width+',HEIGHT='+height);return false;}
function revWin(URL,features)
{newWin=window.open(URL,"",features);return false;}
function go2()
{if(document.selecter2.select2.options[document.selecter2.select2.selectedIndex].value!="none"){top.location.href=document.selecter2.select2.options[document.selecter2.select2.selectedIndex].value;}}
function go3()
{if(document.all.select3.options[document.all.select3.selectedIndex].value!=""){this.location.href=document.all.select3.options[document.all.select3.selectedIndex].value;}}
function go3a()
{if(document.pform.select3.options[document.pform.select3.selectedIndex].value!="none"){this.location.href=document.pform.select3.options[document.pform.select3.selectedIndex].value;}}
function go4()
{if(document.selecter2.select4.options[document.selecter2.select4.selectedIndex].value!="none"){this.location.href=document.selecter2.select4.options[document.selecter2.select4.selectedIndex].value;}}
if(document.layers)document.captureEvents(Event.KEYPRESS);window.onkeypress=keyhandler;function keyhandler(){if(window.event){if(window.event.keyCode==13)return false;}}
function validateCC(ccNum,dateString)
{return true;var nCheckSum=0;var fDbl=0;var nCharPos=0;var nChar=0;var valid=1;if(ccNum!="")
{for(var i=0;i<ccNum.length;i++)
{if((ccNum.substring(i,i+1)<'0')||(ccNum.substring(i,i+1)>'9'))
{if(ccNum.substring(i,i+1)!=" ")
{valid=0;}}}}
else
{valid=0;}
if(valid==1)
{for(nCharPos=ccNum.length;nCharPos>=1;nCharPos--)
{nChar=ccNum.substring(nCharPos,nCharPos-1);if(('0'<=nChar)&&('9'>=nChar))
{if(fDbl==1)
{nChar=nChar*2;if(10<=nChar){nChar=nChar-9}}
nCheckSum=nCheckSum+(nChar-0);if(fDbl==1){fDbl=0}
else{fDbl=1;}}}}
else
{nCheckSum=1;}
if(nCheckSum%10==0)
{var now=new Date();var today=new Date(now.getYear(),now.getMonth(),now.getDate());var date=new Date(dateString.substring(6,10),dateString.substring(3,5)-1,dateString.substring(0,2));var daysDifference=Math.floor((date.getTime()-today.getTime())/1000/60/60/24);if(daysDifference>0)
{return true;}
else
{alert("Your card has expired. Please enter correct expiry date.");return false;}}
else
{alert("Invalid credit card number. Please try again.");return false;}}
function inString(mystring,searchfor)
{var isIt=0;for(td1=1;td1<=mystring.length;td1++)
{if(mystring.substring(td1,1)=='x')
{isIt=1;}}
if(isIt==1)
{return false;}
else
{return true;}}
function changecountry(baseURL){var aa=window.open(baseURL+'Checkout/countries.aspx','new_window','scrollbars=NO,toolbar=no,menubar=no,title=no,resize=no,WIDTH=550,HEIGHT=350,top=100,left=100')}
function SpecialOfferOptionsCheck(form){var a=document.SpecialOfferForm;if(a!=undefined){if(document.SpecialOfferForm.SpecialOfferItem.length!=null){var RadioLength=document.SpecialOfferForm.SpecialOfferItem.length;for(var i=0;i<RadioLength;i++){checked=document.SpecialOfferForm.SpecialOfferItem[i].checked;if(checked){form.SpecialOffer.value=document.SpecialOfferForm.SpecialOfferItem[i].value;checked=false;}}}else{if(document.SpecialOfferForm.SpecialOfferItem.checked){form.SpecialOffer.value=document.SpecialOfferForm.SpecialOfferItem.value;}
checked=false;}}}
function AddToCart(item,dtls){document.forms['AddToCart'].dtls.value=dtls;document.forms['AddToCart'].item.value=item;document.forms.AddToCart.submit();}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&document.getElementById)x=document.getElementById(n);return x;}
function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v='hide')?'hidden':v;}
obj.visibility=v;}}
function changePriceSimple(Price){x=document.getElementById('COSTMAINSHOW');x.innerHTML=parseFloat(Price).toFixed(2);}
function menudirect(objSel){var pCode=objSel.options[objSel.selectedIndex].value
if(pCode!=""){window.location.href="Product/product2.aspx?dep=0&product="+pCode;}}
function showpic(ignore,alt){if(PicWin){PicWin.close()}
x=document.getElementById("OPTFORM1")
if(x!=null){alt=escape(alt);var SC=x.item.value;scsplit=SC.split(";")
SC=scsplit[0];for(i=0;i<x.length;i++){if(x[i].tagName=='SELECT'){SC+="-"+x[i].value;}}
SC=SC+";"+scsplit[1]+";"+scsplit[2]
PicWin=window.open('largeimage.aspx?product='+SC+'&alt='+alt,"","toolbar=no,location=no,directories=no,menubar=no,resizable=yes,width=700,height=700,scrollbars=yes,status=no");}
else{if(ignore!=""){PicWin=window.open('largeimage.aspx?product='+ignore+'&alt='+alt,"","toolbar=no,location=no,directories=no,menubar=no,resizable=yes,width=640,height=580,scrollbars=yes,status=no");}}
if(PicWin.opener==null)PicWin.opener=self;}
function showpic2(SC,alt){if(PicWin){PicWin.close()}
if(SC!=null){alt=escape(alt);PicWin=window.open('largeimage.aspx?product='+SC+'&alt='+alt,"","toolbar=no,location=no,directories=no,menubar=no,resizable=yes,width=800,height=800,scrollbars=yes,status=no");}
if(PicWin.opener==null)PicWin.opener=self;return false;}
function showcway(cway){var CwayWin
if(CwayWin){CwayWin.close()}
CwayWin=window.open(cway,"","toolbar=no,location=no,directories=no,menubar=no,resizable=no,width=200,height=200,scrollbars=no,status=no");if(CwayWin.opener==null)PicWin.opener=self;}
function spinner(spinner,value){sp=document.getElementById(spinner);if(sp.value>0){var id=spinner.replace(/sp/i,'');sp.value=parseInt(value,10)+parseInt(sp.value);if(maxqty(id,sp.value,value)==false){sp.value=sp.value-1;var message=javamessages.Item('SellandRetire').replace(/\[\%Qty\%\]/i,document.getElementById('max'+id).value)
alert(message)}}else{sp.value=1;}}


function spinner2(spinner,value){
	sp=document.getElementById(spinner);
	if(sp.value>0){
		var id=spinner.replace(/sp/i,'');
		sp.value=parseInt(value,10)+parseInt(sp.value);
		if(maxqty(id,sp.value,value)==false){
			sp.value=sp.value-1;
			var message=javamessages.Item('SellandRetire').replace(/\[\%Qty\%\]/i,document.getElementById('max'+id).value);
			alert(message);
		}
	} else{
		sp.value=1;
	}
}




function maxqty(id,val,val2){var qmax=document.getElementById('max'+id);if(qmax){if(parseInt(qmax.value,10)>0&&val2>0&&parseInt(qmax.value,10)<parseInt(val,10)){return false;}}
return true;}
function maxqty2(id,obj){var qmax=document.getElementById('max'+id);if((parseInt(qmax.value,10)>0&&(parseInt(qmax.value,10)<parseInt(obj.value,10)))||parseInt(obj.value,10)=='nan'){var message=javamessages.Item('SellandRetire').replace(/\[\%Qty\%\]/i,qmax.value)
alert(message)
obj.value=1;}else{if(parseInt(obj.value,10)=='nan'){obj.value=1;}}}
function UpdateTotals(num,submitform){var TotalPrice;var TotalPoints4;var TotalPointsR;var MaxD2D;var frmMain=document.getElementById('AddToCart');TotalPrice=0;TotalPoints4=0;TotalPointsR=0;MaxD2D=0;for(ut=1;ut<=num;ut++){if(eval("document.getElementById('sp"+ut+"')")!=null){var utQty=parseInt(eval("document.getElementById('sp"+ut+"').value"),10);var utdtls=eval("document.getElementById('dtls"+ut+"').value");var utitem=eval("document.getElementById('item"+ut+"').value");params=utdtls.split("|");utPrc=params[1];utpts4=params[7];utptsr=params[8];utd2d=params[5];TotalPrice+=(utQty*utPrc);TotalPoints4+=parseInt(utpts4,10)*utQty;TotalPointsR+=parseInt(utptsr,10)*utQty;if(utQty>0){frmMain['dtls'].value=frmMain['dtls'].value+utdtls+"#^#";frmMain['item'].value=frmMain['item'].value+utitem+"#^#";frmMain['qtys'].value=frmMain['qtys'].value+utQty+"#^#";if(parseInt(utd2d,10)>MaxD2D){MaxD2D=parseInt(utd2d,10);}}}}
document.getElementById("TotalPrice").innerText=MoneyFormat(TotalPrice);document.getElementById("TotalPointsEarned").innerText=TotalPoints4;document.getElementById("TotalPointsRequired").innerText=TotalPointsR;document.getElementById("TotalDays").innerText=MaxD2D;if(submitform){frmMain.submit();}}
function tellfriend(desc){var thisloc=location.href;var eml=document.getElementById("TellFriend").value;if(eml!=''){location.href='mailto:'+eml+'?subject=Take%20a%20look%20at '+desc+'&body=I%20saw%20this%20at%20'+thisloc+'%20and%20thought%20you%20might%20be%20interested.'}}


var img=new Image();
img.onload=showalt;

function getalt(SC,ap){
img.src=miBaseURL+'product/image.aspx?product='+SC+'&'+ap;
}
function getlargealt(SC,ap){img.src='image.aspx?product='+SC+'&'+ap;}
function showalt(){
var myImage=document.getElementById("MainImage");
if(myImage==null){
myImage=document.getElementById("IMG1");
}
myImage.src=img.src;}
function ShowHideOptions(num,showhide){var i;for(i=0;i<10;i++){var myblock=document.getElementById('HiddenOptions'+i);if(myblock){if(myblock.style.display=='block'){document.getElementById('HiddenHide'+i).style.display='none';document.getElementById('HiddenShow'+i).style.display='block';}
myblock.style.display='none';}}
document.getElementById('HiddenOptions'+num).style.display=showhide;if(showhide=='block'){document.getElementById('HiddenHide'+num).style.display='block';document.getElementById('HiddenShow'+num).style.display='none';}}
var sThisURL=unescape(window.location.pathname);function breakframes(){if(top!=self){setTimeout("top.location.href = sThisURL",1.5*1000);}}
function changeselectedgroup(opt,det,showdiv){var myopt=document.getElementById('Option'+opt+'dtls'+det);var dtls=myopt.value;var params=dtls.split("|");x=document.getElementById('SelectedDetails'+opt);y=document.getElementById('Option'+opt+'Det'+det);x.innerHTML=y.innerHTML;x=document.getElementById('SelectedTitle'+opt).innerHTML=params[0];x=document.getElementById('SelectedImage'+opt);y=document.getElementById('Option'+opt+'Det'+det+'Image');x.src=y.src;x=document.getElementById('OPTFORM'+opt);x['dtls'].value=dtls;var selitem=document.getElementById('Option'+opt+'item'+det).value;x['dtls'].value=dtls;x['selecteditem'].value=selitem;if(x['selecteditem'+opt]){x['selecteditem'+opt].value=selitem;}
UpdateSelectedItems();ChangeGroupPrice(opt,det);if(showdiv){document.getElementById('Option'+opt+'Det'+det+'Hover').innerHTML=document.getElementById('GrpDetails').innerHTML;var obj=document.getElementById('Option'+opt+'Det'+det+'Hover').style;MM_showHideLayers('Option'+opt+'Det'+det+'Hover','','show');var offX=-300;var offY=-25;if(obj.left){obj.left=(parseInt(mouseX(event))+offX)+'px';obj.top=(parseInt(mouseY(event))+offY)+'px';}}
x=document.getElementById('ItemMain');x.dtls.value=x.ItemMaindtls.value+"#^#"+x.dtls.value
x.item.value=x.ItemMainitem.value+"#^#"+x.item.value
x.dtls1.value=x.dtls.value;x.item1.value=x.item.value;if(showdiv){document.getElementById('Option'+opt+'Det'+det+'Hover').innerHTML=x.GroupUpdatedText.value+'<br /><div class="HoverGrpTitle">'+params[0]+'</div><br/><br />'+document.getElementById('GrpDetails').innerHTML;}
popFooterForm()}
function UpdateSelectedItems(){z=document.getElementById('SelectedGroupItems');z.innerHTML="";y=document.getElementById('PDGGroupImages');if(y){y.innerHTML="";}
var i;for(i=2;i<=10;i++){x=document.getElementById('SelectedTitle'+i);v=document.getElementById('selecteditem'+i);if(x){z.innerHTML+=x.innerHTML+"<br />";}else{break;}
if(y&&v){y.innerHTML+="<img width=\"270\" src=\"image.aspx?M=0&amp;product="+v.value+"\" alt=\"\"/>";}else{break;}}}
function popFooterForm(){y=document.getElementById('ItemMainFooter');if(y){x=document.getElementById('ItemMain');fstr=x.innerHTML;fstr=fstr.replace(/sp1/,'sp2')
fstr=fstr.replace(/MAIN/,'MAIN_')
fstr=fstr.replace(/P4/,'P4_')
fstr=fstr.replace(/P2/,'P2_')
fstr=fstr.replace(/Name="SelectedGroupItems/ig,'Name="SelectedGroupItems_')
fstr=fstr.replace(/Name="Group/ig,'Name="Group_')
y.innerHTML=fstr;}}
function mouseX(evt){if(!evt)evt=window.event;if(evt.pageX)return evt.pageX;else if(evt.clientX)return evt.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);else return 0;}
function mouseY(evt){if(!evt)evt=window.event;if(evt.pageY)return evt.pageY;else if(evt.clientY)return evt.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);else return 0;}
function checkkey(){if(event.keyCode<45||event.keyCode>57){event.returnValue=false;return false;}}
function swapview(){x=document.getElementById('_ctl0_MainContent_VAL');x.checked=(x.checked==true)?false:true;__doPostBack('VAL','');}

function getbrand() {
	if(document.getElementById("_ctl0_manlist_ManList").options[document.getElementById("_ctl0_manlist_ManList").selectedIndex].value!="none"){
		var params =document.getElementById("_ctl0_manlist_ManList").options[document.getElementById("_ctl0_manlist_ManList").selectedIndex].value.split("|");
		top.location.href="/"+params[1];
	}
 }

function getDespatched(hasoptions){
	var now=new Date();
	var Despatched;
	var myToday="Today";
	var myTomorrow="Tomorrow";
	var myOptions="See options";
	var thisDay= now.getDay();
	
	Despatched = myTomorrow;
	if(hasoptions <= 0){
		Despatched = myOptions;
	} else if(thisDay == 1 || thisDay == 3 || thisDay == 5){
		if(now.getHours() < 14){
			Despatched = myToday;
		}
	} else if(thisDay == 5 || thisDay == 6){
		if(now.getHours() < 14){
			Despatched = "Monday";
		}
	}
	return Despatched;
}

function updateitem(id,qtyold,sc,rem){
	var qtynew = document.getElementById("BasketItem-"+id).value;
	
	if(rem == 1){
		qtynew = 0;
	}
	
	if (qtynew > qtyold){
 		var myqty = qtynew - qtyold;
		document.location.href = miBaseURL+'/product/update.aspx?rem=0&sc='+ sc +'&qty='+myqty;
	} else if (qtynew < qtyold){
 		var myqty = qtyold - qtynew;
		document.location.href = miBaseURL+'/product/update.aspx?rem=1&sc='+ sc +'&qty='+myqty;
	}
}

function mifatt(params){
window.location.href=miBaseURL+"product/productlist.aspx?"+params;
}