if(self!=top)document.write('<BASE target="main">');
var popupMini;
function miniBask(){
	var baskt=this.location.href.indexOf('basket');
	var myPrd=document.cookie.indexOf('TheBasket');
	sameday=document.cookie.indexOf('sameday');
	countbegin=(document.cookie.indexOf('=',myPrd)+1);
	countend=document.cookie.indexOf(';',myPrd);
	if(countend==-1){countend=document.cookie.length;}
	if(countend>5){
		fulllist=document.cookie.substring(countbegin,countend);
		if(sameday==-1){delTxt='excl';}
		else{delTxt='incl';}
		itemlist=0;
		totprice=0;
		totalitems=0;
		for(var i=0;i<=fulllist.length;i++){
			if(fulllist.substring(i,i+1)=='['){
				itemStart=i+1;
				thisitem=1;
			}else if(fulllist.substring(i,i+1)==']'){
				itemEnd=i;
				thequantity=fulllist.substring(itemStart,itemEnd);
				if(thequantity=='')theQuantity=0;
				itemtotal=0;
				itemtotal=(eval(theprice*thequantity));
				totprice=totprice+itemtotal;
				itemlist=itemlist+1;
				totalitems++;
			}else if(fulllist.substring(i,i+1)=='|'){
				if(thisitem==1)field1=fulllist.substring(itemStart,i);
				if(thisitem==2)theprice=fulllist.substring(itemStart,i);
				if(thisitem==3)field4=fulllist.substring(itemStart,i);
				thisitem++;
				itemStart=i+1;
			}
		}
		document.write('<NOBR>Your '
		+'<A href="javascript:showMini()" style="font-size:9pt" title="Click to view popup mini-basket">mini-basket</A> '
		+'contains<BR>'+totalitems+' item');
		if(totalitems!='1')document.write('s');
		document.write(' ~ $'+presentValue(totprice)+' '+delTxt+'&nbsp;delivery</NOBR>');
	}
}
function showMini(){
	if((window.navigator.appName.indexOf('Netscape')==-1)||(parseInt(window.navigator.appVersion)>=5)){
		if(popupMini&&!popupMini.closed){
			popupMini.history.go(0);
			popupMini.focus();
		}else{
			var Wide=screen.width-610;
			var High=screen.height-430;
			popupMini=window.open('/shop/basketmini.htm','BasketWindow','height=350,width=600,left='+Wide+',top='+High+',status=yes,toolbar=no,directories=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
		}
	}else{
		window.top.location.href='/shop/basket.htm';
	}
}
function presentValue(value){
	if(value<=0.9999){ newPounds='0'; }
	else{ newPounds=parseInt(value); }
	dec='1';
	for(var i=1;i<=2;i++){ dec=dec+'0'; }
	if(value>0){ newPence=Math.round((value+.000008-newPounds)*(eval(dec))); }
	else{ newPence=0; }
	compstring='9';
	for(var i=1;i<=2-1;i++){
		if(eval(newPence)<=eval(compstring))newPence='0'+newPence;
		compstring=compstring+'9';
	}
	newString=newPounds+'.'+newPence+'';
	return(newString);
}
