
var s = 0

for (q=0; q<records.length; q++) {
if(records[q].oos != "YES"){
	status = 'Only '+(records.length-q)+' items remain to be added to the Page. If asked to "abort the script?" Click the "No" button.'
	if(q==0){
		document.write("<tr>")
		if(records[q].amount!=""){
			document.write("<td valign='top' bgcolor='#ffffff'><a name="+s+"></a>")
			document.write("<b><font size='+1'>"+records[q].item_name+"</font></b><div class='scrollBox'>")}
		else{
//  was purple		document.write("<td valign='top' bgcolor='#550e51'><a name="+s+"></a>")
			document.write("<td valign='top' bgcolor='#000000'><a name="+s+"></a>")
			document.write("<b><font size='+1' color='#ffff00'>"+records[q].item_name+"</font></b><div>")}
		}
	else{
		if(records[q].item_name!=records[q-1].item_name){
			document.write("<tr>")
			if(records[q].amount!=""){
				document.write("<td valign='top' bgcolor='#ffffff'><a name="+s+"></a>")
				document.write("<b><font size='+1'>"+records[q].item_name+"</font></b><div class='scrollBox'>")}
			else{		
// was purple			document.write("<td valign='top' bgcolor='#550e51'><a name="+s+"></a>")
				document.write("<td valign='top' bgcolor='#000000'><a name="+s+"></a>")
				document.write("<b><font size='+1' color='#ffff00'>"+records[q].item_name+"</font></b><div>")}
		}
	}
	if(records[q].image_name!=""){document.write("<img src='shop/"+records[q].image_name+"' alt='' width='100' border='0' align='left' hspace='10' vspace='10' >")}
	if(records[q].video_clip!=""){
		if(records[q].video_clip.substring(0,7)!="http://"){
			document.write('<a href="http://'+records[q].video_clip+'"><img src="images/video.gif" alt="Video Clip Available" width="90" height="68" border="0" align="right"></a>')
			document.write('<div align="right"><a href="http://'+records[q].video_clip+'">Video Clip Available</a></div>')}
		else{
			document.write('<a href="'+records[q].video_clip+'"><img src="images/video.gif" alt="Video Clip Available" width="90" height="68" border="0" align="right"></a>')
			document.write('<div align="right"><a href="'+records[q].video_clip+'">Video Clip Available</a></div>')}
		}
	if(records[q].amount!=""){	
		document.write(records[q].description+"</div>")}
	else{
		document.write("<font color='#ffff00' size='+1'>"+records[q].description+"</font></div>")}
	if(records[q].link_page!=""){
		if(records[q].link_page.substring(0,4)=="http"){
			document.write('<a href="'+records[q].link_page+'" target="_blank"><img src="images/more.gif" alt="More Information in a new Window" width="116" height="24" border="0"></a>')}
		else{
			document.write('<a href="'+records[q].link_page+'.htm"><img src="images/more.gif" alt="More Information" width="116" height="24" border="0"></a>')}
	}

//	if(records[q].link_page!=""){
//		document.write("<br clear='all'>")
//		var printline="";
//		printline='<a href="javascript:showmore('
//		printline+="'"+records[q].link_page+"'"
//		printline+=')"><img src="images/more.gif" alt="" width="116" height="24" border="0" align="left"></a><br clear="all">'
//		document.write(printline)
//	}
	if(q==records.length-1||records[q].item_name!=records[q+1].item_name){		
		s = s+1
//		document.write("<br clear='all'>")
		if(records[q].amount!=""){
			document.write('<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">')
			document.write('<input src="images/sc-but-03.gif" name="submit" alt="Make payments with PayPal - it is fast, free and secure!" border="0" hspace="0" align="right" type="image">')
			document.write('<input name="add" value="1" type="hidden">')
			document.write('<input name="cmd" value="_cart" type="hidden">')
			document.write('<input name="business" value="danata@lineone.net" type="hidden">')
			incode = false
			itemstr = ""
			for(qq=0; qq<records[q].item_name.length; qq++){
				itemchar = records[q].item_name.charAt(qq)			
				if(itemchar != "<" && incode == false && itemchar != unescape("%22")){itemstr = itemstr + itemchar}
				if(itemchar == "<"){incode = true}
				if(itemchar == ">"){incode = false}
			}
			document.write('<input name="item_name" value="'+itemstr+'" type="hidden">')
			document.write('<input name="amount" value="'+records[q].amount+'" type="hidden">')
			document.write('<input name="no_note" value="1" type="hidden">')
			document.write('<input name="currency_code" value="GBP" type="hidden">')
			document.write('</form>')
			document.write('Price <b>&pound;'+records[q].amount+'</b>&nbsp;&nbsp;')
			document.write('<a href="javascript:showconvert('+records[q].amount+')">Use Currency Converter</a>')
		}
		document.write('</td>')		
		
	
			
		document.write("</tr>")
		if(q % 5==4 && q!=records.length-1){
			document.write('<tr><td align="center">')
			document.write('<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">')
			document.write('<input type="hidden" name="cmd" value="_cart">')
			document.write('<input type="hidden" name="business" value="danata@lineone.net">')
			document.write('<input type="image" src="images/view_basket.gif" border="0" name="submit" alt="View Shopping Cart" align="middle">')
			document.write('<input type="hidden" name="display" value="1">')
			document.write('<input type="hidden" name="page_style" value="Primary">')
			document.write('</form>')
			document.write('</td></tr>')}
		else{
			document.write("<tr><td align='center'><font size='-2'><a href='javascript:history.go(-1)'><img src='images/back.gif' alt='Page Back' width='116' height='24' border='0' align='middle'><\/a></font></td></tr>")
		}
	}
}	
}

function showconvert(price){
	expireDate = new Date
	expireDate.setMonth(expireDate.getMonth()+1)
	document.cookie = "amount="+price+";expires=" + expireDate.toGMTString()
	newWindow = window.open('currency.htm','newWin','toolbar=no,location=no,scrollbars=no,resizable=yes,width=795,height=720')
	newWindow.focus()
}

status = "Page complete, with "+(records.length-topofpage)+" items."
 
 