var CDs = new Array()
CDs[ 0] = "date:issue:genre:artist:title:price"
CDs[ 1] = "1994:DJC001:70's:Siren & Kevin Coyne:Rabbits:9.00"
CDs[ 2] = "1994:DJC002:70's:Siren & Kevin Coyne:Lets Do It:9.00"
CDs[ 3] = "1995:DJC003:70's:Siren:The Club Rondo:9.00"
CDs[ 4] = "1997:DJC004:Relax:Hamish Barker:Natural Culture:9.00"
CDs[ 5] = "1997:DJC005:70's:Roger Ruskin Spear:Electric Shocks +:9.00"
CDs[ 6] = "1997:DJC006:Perf:The Isles Theatre Co:The Isles:9.00"
CDs[ 7] = "1998:DJC007:Jazz:Marius Kahan:Tomorrow's Memories:9.00"
CDs[ 8] = "1998:DJC008:70's:The Bonzo Dog Band:Anthropology:11.50"
CDs[ 9] = "1999:DJC009:Folk:Hamilton Camp:Mardi's Bard:11.50"
CDs[10] = "1999:DJC010:Acoustic:Norvic Concordia:Purely Accordion:9.00"
CDs[11] = "2000:DJC011:Folk:Damien Barber:The Furrowed Field:11.50"
CDs[12] = "2000:DJC012:Folk:Damien Barber:Boxed:11.50"
CDs[13] = "2000:DJC013:Folk:Malarky:The Band That Plays At Night:9.00"
CDs[14] = "2000:DJC014:Folk:Lucas Hille:Lost & Found:9.00"
CDs[15] = "2000:DJC015:Rock:Roy Hollingworth:In The Flesh:9.00"
CDs[16] = "1999:DJCMIR:World:Mi<U>r</U>a`nda:So Bravely Human:11.50"
CDs[17] = "2001:DJC017:Sampler:DJC Records:The DJC Collection:4.00"
CDs[18] = "2002:DJC018:Class:Robert Millard:Rachmaninoff & Liszt:10.00"
CDs[19] = "2002:DJC019:Folk:The Demon Barbers:Uncut:11.50"
CDs[20] = "2002:DJC020:Perf:Cockburn & Hillier:Ship Without Rudder:11.50"
CDs[21] = "2002:DJC021:Perf:Adrienne Thomas:Speaking In Tongues:11.50"
CDs[22] = "2005:DJC022:70's:Siren:Ruffstuff:9.00"
CDs[23] = "2003:DJC023:World:Yamba Yamba:Mvula Kitombo (Rainstorm):10.00"
CDs[24] = "2003:DJC024:Class:Robert Millard:Chopin:10.00"
CDs[25] = "2004:DJC025:Class:Leonard Paice:The Ashgrove:10.00"
CDs[26] = "2005:DJC026:Folk:The Demon Barbers:Waxed:11.50"
CDs[27] = "2005:DJC027:Folk:Turtle Soup:The Caffeine Conspiracy:10.00"
CDs[28] = "2006:DJC029:Eclectic:Léanie Kaleido:Karamelién:10.00"
CDs[29] = "2008:DJC030:Acoustic:Norvic Concordia:Simply Accordion:9.00"

function Listing(column) {
  var CDlen = Math.floor(CDs.length/2)
  var CDbeg = column*(CDlen) + 1
  var CDfin = CDlen + column*(CDlen) + 1
  for(i=CDbeg;i<CDfin;i++) {
    document.write("<TR>")
    var ci = new Array(); ci = CDs[i].split(":")
    document.write("<TD><FONT SIZE=-2>",ci[1],"<TD><FONT SIZE=-2>",ci[3],"</TD><TD><A HREF=",ci[1].toLowerCase(),".htm><FONT SIZE=-2>",ci[4],"</A></TD><TD><FONT SIZE=-2>",ci[2])
    if(ci[2]=="") document.write("&nbsp;")
    document.writeln()
  }
}

function FormLines() {
  for(i=1;i<CDs.length;i++) {
    var cd = new Array(); cd = CDs[i].split(":")
    document.write("<TR>")
    document.write("<TD><B>",cd[1].toUpperCase(),"<TD><B>",cd[3].toUpperCase(),"<TD><B>",cd[4].toUpperCase())
    document.write("<TD ALIGN=right><B><INPUT NAME=p",i," TYPE=hidden VALUE='",cd[5],"'>&#163;",cd[5])
    document.write("<TD><INPUT NAME=q",i," SIZE=2 onChange='FormFill()'>")
    document.writeln("<TD><INPUT NAME=t",i," SIZE=6>")
  }
}

function FormFill() {
  len = document.cd.length-8
  cds = 0; total = 0
  for(i=6; i<len; i+=3) {
      val = document.cd.elements[i].value
      if(val != '') {
        pri = document.cd.elements[i-1].value
        document.cd.elements[i+1].value = Fix(val * pri)
        cds += +val; total += val * pri
      }
  }
  for(i=0; i<4; i++) {if(document.cd.pp[i].checked) {pri = document.cd.pp[i].value} }
  total += cds * pri
  document.cd.q99.value = cds
  document.cd.t99.value = Fix(cds * pri)
  document.cd.tt.value = Fix(total)
}

function Fix(x) {
  x = String(x)
  if(x.indexOf('.')+1) {x+= '0'} else {x+= '.00'}
  return x
}

function CDvars(issue) {
  var id = new Array(); id = CDs[0].split(":")
  for(i=1;i<CDs.length;i++) {
    if(CDs[i].indexOf(issue)>0) {
      var cd = new Array(); cd = CDs[i].split(":")
      document.write("<SCRI","PT LANGUAGE=Javascript>var")
      for(j=0;j<cd.length;j++) {
        if(j!==0) document.write(",")
        document.write(" ",id[j],' = "',cd[j],'"')
      }
      document.writeln("</SCRI","PT>")
    }
  }
}

function PayLinks() {
  document.writeln('<A HREF=djcform.htm CLASS=linkbar>Cheque/MO</A><BR>')
  document.writeln('<A HREF="http://www.abicat.co.uk/djc/djc.htm" CLASS=linkbar>Credit/Debit</A><BR>')
//  document.write('<A HREF="Javascript:PpalSub(Ppal)" CLASS=linkbar>PayPal:&nbsp;Add</A>')
  document.writeln('<BR>')
//  document.writeln('<A HREF="Javascript:PpalSub(View)" CLASS=linkbar>PayPal:&nbsp;View</A>')
  document.writeln('<BR>')
}

function PpalForms() {
  document.writeln('<form name="Ppal" target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">')
  document.writeln('  <input type="hidden" name="add" value="1">')
  document.writeln('  <input type="hidden" name="cmd" value="_cart">')
  document.writeln('  <input type="hidden" name="business" value="clague','@','paston.co.uk">')
  document.writeln('  <input type="hidden" name="item_name" value="',artist,' - ',title,'">')
  document.writeln('  <input type="hidden" name="item_number" value="',issue,'">')
  document.writeln('  <input type="hidden" name="amount" value="',price,'">')
  document.writeln('  <input type="hidden" name="no_note" value="1">')
  document.writeln('  <input type="hidden" name="currency_code" value="GBP">')
  document.writeln('</form>')
  document.writeln('')
  document.writeln('<form name="View" target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">')
  document.writeln('  <input type="hidden" name="cmd" value="_cart">')
  document.writeln('  <input type="hidden" name="business" value="clague','@','paston.co.uk">')
  document.writeln('  <input type="hidden" name="business" value="clague@paston.co.uk">')
  document.writeln('  <input type="hidden" name="display" value="1">')
  document.writeln('</form>')
}

function PpalSub(formA) {formA.submit()}

function CD_image() {document.write('<IMG SRC="image/',issue.toLowerCase(),'.jpg" ALT="',artist,' - ',title,' (',issue,')" WIDTH=200 HEIGHT=178>')}

function CD_sound() {document.write('<A HREF="sound/',issue.toLowerCase(),'.mp3" CLASS=linkbar>Listening</A>')}

function CD_info(type) {
  var twin; var lines = new Array(); twinattr = "width=200,height=200,scrollbars=yes"

  Awidth = 9*(screen.width-250)/10; Aheight = 8*(screen.height-150)/10
  if(type=="Reviews") {
    if(review) {
      var revurl = "rev" + issue.substr(3,3) + ".htm"
      twin = window.open(revurl,type,twinattr)
      width = Awidth; height = Aheight
    }
    else {
//     twin = window.open("","No reviews available",twinattr+",resizeable=yes")
//     width=20; height = 1
    }
  }
  else {
    if(type=="Line_up") {
      if(lineup) {
        lines = lineup.split(":"); width = 0; height = lines.length

        twin = window.open("",type,"width=200,height=200,resizeable=yes,scrollbars=yes")
        twin.document.writeln("<html><head><title>",type,"</title></head><body text=blue vlink=red><b>")
        for(i=0;i<height;i++) {
          line=lines[i]; if(width < line.length) width=line.length
          twin.document.writeln(line,"<br>")
        }
        width = 8*width
      }
    }
    else {
      lines = tracks.split(":"); width = 0; height = lines.length
      var extr=lines[0]

      twin = window.open("",type,"width=200,height=200,resizeable=yes,scrollbars=yes")
      twin.document.writeln("<html><head><title>",type,"</title></head><body text=blue vlink=red><table width=100%>")
      for(i=1;i<height;i++) {
        line=lines[i]; if(width < line.length) width=line.length
        if(i==extr) {line = '<a href="sound/' + issue + '.mp3">' + line + '</a>' }
        twin.document.writeln("<tr><td align=right valign=top>",i,"<td><b>",line)
      }
      twin.document.writeln("</table>")
      width = 8*(width+7)
    }
    twin.document.writeln("</body></html>")
    twin.document.close()

        ; if(width >Awidth ) width  = Awidth
    height = 24*(height+2)+12; if(height>Aheight) height = Aheight
  }
  twin.moveTo(250,150); twin.resizeTo(width,height)
  twin.setTimeout("twin.close()",2000)
}

