
// initialize arrays containing a selection possible adverts for right hand side of page

var ads = new Object(); // not used?

var pagelink = [];
var graphiclink = [];
var alt = [];

pagelink[0] = 'greeting_cards.php';
graphiclink[0] = 'a4paper.gif';
alt[0] = 'Greeting Cards';

pagelink[1] = 'cd_dvd_cases.php';
graphiclink[1] = 'cases.gif';
alt[1] = 'CD / DVD Cases';

pagelink[2] = 'cd_labels.php';
graphiclink[2] = 'cdlabels.gif';
alt[2] = 'CD / DVD Labels';

pagelink[3] = 'printer_list.php?cat=Canon_Laser';
graphiclink[3] = 'canon_LASER.jpg';
alt[3] = 'Canon Laser Toners';

pagelink[4] = 'printer_list.php?cat=HP_Laser';
graphiclink[4] = 'HP_LASER.jpg';
alt[4] = 'HP Laser Toners';

pagelink[5] = 'Canon-PGI520-CLI521.php';
graphiclink[5] = 'pgi520.gif';
alt[5] = 'Canon PGI520 CLI521';

pagelink[6] = 'Epson-D120.php';
graphiclink[6] = 'D120_ink.gif';
alt[6] = 'D120 Inks';

pagelink[7] = 'tshirt.php';
graphiclink[7] = 'glitter.gif';
alt[7] = 'Glitter T-Shirt Transfer Paper';

pagelink[8] = 'Epson_T870-9.php';
graphiclink[8] = 'R1900_ink.gif';
alt[8] = 'r1900 Inks';

pagelink[9] = 'greeting_cards.php';
graphiclink[9] = 'make_your.gif';
alt[9] = 'Greeting Cards';

pagelink[10] = 'label_kit.php';
graphiclink[10] = 'pens.gif';
alt[10] = 'CD Pens';

pagelink[11] = 'banner_roll_paper.php';
graphiclink[11] = 'picture_print.gif';
alt[11] = 'Banner Roll Paper';

pagelink[12] = 'Epson_Printers.php';
graphiclink[12] = 'sx405.gif';
alt[12] = 'Epson Stylus Photo SX405 Printer';

pagelink[13] = 'refill.php';
graphiclink[13] = 'refill_kits.gif';
alt[13] = 'Universal Refill Kits';

pagelink[14] = 'kodak-10.php';
graphiclink[14] = 'kodak_10.gif';
alt[14] = 'Kodak 10 Inks';

pagelink[15] = 'For_Canon_Compatible_Ink.php';
graphiclink[15] = 'chip_re-setter.gif';
alt[15] = 'canon Chip Re-Setter';

pagelink[16] = 'printer_list.php?cat=Lexmark_Laser';
graphiclink[16] = 'lexmark_LASER.gif';
alt[16] = 'Lexmark Laser Toners';

pagelink[17] = 'OKI_View_By_Laser_Cartridge.php';
graphiclink[17] = 'oki_LASER.gif';
alt[17] = 'Oki Laser Toners';

pagelink[18] = 'Skype_phones.php';
graphiclink[18] = '141205/sml_vtraveller.jpg';
alt[18] = 'Skype Phones';

pagelink[19] = 'laminators.php';
graphiclink[19] = '141205/sml_peach_lam.jpg';
alt[19] = 'Laminators';

pagelink[20] = 'Brother-LC980.php';
graphiclink[20] = 'brother_LC980-1100.gif';
alt[20] = 'Brother LC980-1100';

pagelink[21] = 'HP21-22.php';
graphiclink[21] = 'hp21-22.gif';
alt[21] = 'HP21-22';

pagelink[22] = 'HP350-351.php';
graphiclink[22] = 'hp350-351.gif';
alt[22] = 'HP350-351';

pagelink[23] = 'disc_cleaning.php';
graphiclink[23] = 'skipdr.gif';
alt[23] = 'Skipdr Disc Cleaning Products';

pagelink[24] = 'printer_list.php?cat=Olivetti';
graphiclink[24] = 'olivetti-ink.gif';
alt[24] = 'Olivetti Inks';

pagelink[25] = 'printer_list.php?cat=Olivetti';
graphiclink[25] = 'lex16-26.gif';
alt[25] = 'Lexmark 16-26 Inks';

pagelink[26] = 'Canon_PG40-50_CL41-51.php';
graphiclink[26] = 'canon-40_50_41_51.gif';
alt[26] = 'canon PG40 CL41 PG50 CL51';

pagelink[27] = 'Lexmark_18C0031-32-33-34-35.php';
graphiclink[27] = 'lex31-34-35.gif';
alt[27] = 'Lexmark 31-32-33-34-35 Inks';

pagelink[28] = 'Epson_T003-T005.php';
graphiclink[28] = 'epson-t003-05.gif';
alt[28] = 'Epson t003 t005 inks';

pagelink[29] = 'Epson_T711-T714_Gen6.php';
graphiclink[29] = 'd78g6.gif';
alt[29] = 'Epson T711-4 Gen6 inks';

pagelink[30] = 'HP88-BCMY.php';
graphiclink[30] = 'HP88.gif';
alt[30] = 'HP88 iNKS';

pagelink[31] = 'Canon_BCI24B-C.php';
graphiclink[31] = 'bci24.gif';
alt[31] = 'BCI-24 Inks';


// randomly select 3 of the adverts to display

var array_length = pagelink.length;
var number_of_elements = 3;

var myArray = [];
var outputArray = [];

var i = 0;

for (i = 0; i < array_length; i++){
  myArray.push(i);
}

var array_index = 0;
var j = 0;

for (j = 0; j < number_of_elements; j++){

  array_length = myArray.length;
  array_index = Math.floor(Math.random()*array_length);
  outputArray.push(myArray[array_index]);
  myArray.splice(array_index,1);
  
}

var rnd1= outputArray[0];
var rnd2= outputArray[1];
var rnd3= outputArray[2];


// write the html to display the adverts

<!--document.writeln(ads[rnd1]);   // not used?

var header='<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD ALIGN=CENTER>';

document.writeln(header
+'</TD><TR></TR><TD><A HREF="http://www.discandink.co.uk/acatalog/'+pagelink[rnd1]+'" TARGET'
+'="_top"><CENTER><IMG SRC="http://www.discandink.co.uk/ads/'+graphiclink[rnd1]+'" width="120" height="98" BORDER=0 ALT="'+alt[rnd1]+'"></CENTER>'
+'</A></TD></TR></TABLE></CENTER></td></tr><tr><td class="adbox">');

document.writeln(header
+'</TD><TR></TR><TD><A HREF="http://www.discandink.co.uk/acatalog/'+pagelink[rnd2]+'" TARGET'
+'="_top"><CENTER><IMG SRC="http://www.discandink.co.uk/ads/'+graphiclink[rnd2]+'" width="120" height="98" BORDER=0 ALT="'+alt[rnd2]+'"></CENTER>'
+'</A></TD></TR></TABLE></CENTER></td></tr><tr><td class="adbox">');

document.writeln(header
+'</TD><TR></TR><TD><A HREF="http://www.discandink.co.uk/acatalog/'+pagelink[rnd3]+'" TARGET'
+'="_top"><CENTER><IMG SRC="http://www.discandink.co.uk/ads/'+graphiclink[rnd3]+'" width="120" height="98" BORDER=0 ALT="'+alt[rnd3]+'"></CENTER>'
+'</A></TD></TR></TABLE></CENTER></td></tr><tr><td class="adbox">');
