function XBrowserAddHandler(target,eventName,handlerName) { if ( target.addEventListener ) target.addEventListener(eventName, handlerName, false); else if ( target.attachEvent ) target.attachEvent("on" + eventName, handlerName); else target["on" + eventName] = handlerName; } function initAdSpace(e){ //if(!e && window.event) e=window.event; //adspace=document.getElementById('adspace'); //if(adspace) adspace.innerHTML="l"; //alert(window.innerWidth); oispoi=document.getElementById("adspace"); pixw=document.body.clientWidth-330; oispoi.style.width=pixw; oispoi.innerHTML=""; //oispoi.innerHTML=adSpace.length; n=Math.floor(pixw/135); i=0; nT=document.createElement('table'); nB=document.createElement('tbody'); nR=document.createElement('tr'); nT.appendChild(nB); nB.appendChild(nR); while(n > i && adSpace.length>i){ nEl=document.createElement('td'); nEl.style.textAlign="center"; nAC=document.createElement('a'); nAC.style.fontSize="10px"; nAC.href="http://www.craftpacks.co.uk/?page=main/browse&cid="+adSpace[i].product_category; nAC.innerHTML=adSpace[i].category_name; nEl.appendChild(nAC); nEl.appendChild(document.createElement('br')); if(adSpace[i].product_subcat){ nAS=document.createElement('a'); nAS.style.fontSize="10px"; nAS.href="http://www.craftpacks.co.uk/?page=main/browse&cid="+adSpace[i].product_category+"&scid="+adSpace[i].product_subcat; nAS.innerHTML=adSpace[i].subcat_name; nEl.appendChild(nAS); nEl.appendChild(document.createElement('br')); } nIm=document.createElement('div'); nIm.style.width="130px"; nIm.style.height="100px"; nIm.style.backgroundImage="url(http://www.craftpacks.co.uk/images.php?&thumb=150&id="+adSpace[i].product_id+")"; nIm.style.backgroundRepeat="no-repeat"; nIm.style.backgroundPosition="top center"; //nIm.style.border="1px solid black"; nEl.appendChild(nIm); nR.appendChild(nEl); i++; } oispoi.appendChild(nT); //oispoi.style.border="1px solid black"; } XBrowserAddHandler(window,'load',initAdSpace) ; XBrowserAddHandler(window,'resize',initAdSpace) ; var adSpace=new Array(); // adSpace[adSpace.length]={ product_id:"1933",product_name:"MAGNETIC COINS - ALL DENOMINATIONS",product_desc:"Pack of 80 coins . These coins show the new designs for the U.K. money and have a magnetic back so that they can be used on metallic boards(see products MBA4 and MBA3).To aid ease of use they are slightly larger than the actual coins but still in proportion to each other (from 27mm to 40mm). This pack contains the following: 20 x 1p, 10 x 2p, 10 x 5p, 10 x 10p, 5 x 20p, 5 x 50p, 10 x £1 and 10 x £2.",product_supercat:"1",product_category:"4",product_subcat:"65",product_cdate:"1232012574",product_mdate:"2009-05-29 11:40:25",product_image:"1933_465689.jpg",product_box:"",product_outofstock:"-1",product_featured:"1",product_list_order:"15",product_is_header:"",product_special:"0",product_suspend:"0",xref_id:"3185",supercat_id:"1",category_id:"4",subcat_id:"117",list_order:"6",subcat_parent:"4",subcat_name:"Money",subcat_desc:"",keywords:"Boards and Hook & Loop, Dice, Playing Cards & Dominoes, Large Floor Equipment, Number Lines, Fractions, Decimals & Percentages, Number Grids & Squares, Bead Strings, Number Cards & Fans, Geometric Shapes, Measuring & Weighing, Flip Books, Time & Money, Nu",long_desc:"",vat_rate:"17.5",unspsc:"60100000",color:"",category_name:"Maths",category_desc:"Boards and Hook & Loop, Dice, Playing Cards & Dominoes, Large Floor Equipment, Number Lines, Fractions, Decimals & Percentages, Number Grids & Squares, Bead Strings, Number Cards & Fans, Geometric Shapes, Measuring & Weighing, Flip Books, Time & Money, Nu",category_parent:"1"}; adSpace[adSpace.length]={ product_id:"1661",product_name:"POM POMS WITH HOLES",product_desc:"Each pom pom has a plastic lined hole big enough to thread chenille stems. Each bag contains 100 pom poms with holes in assorted colours and sizes ranging from 13mm to 40mm. ",product_supercat:"1",product_category:"2",product_subcat:"87",product_cdate:"1159439021",product_mdate:"2009-09-28 09:08:13",product_image:"1661_585528.jpg",product_box:"",product_outofstock:"-1",product_featured:"1",product_list_order:"97",product_is_header:"",product_special:"0",product_suspend:"0",xref_id:"2936",supercat_id:"1",category_id:"2",subcat_id:"87",list_order:"2",subcat_parent:"2",subcat_name:"Beads, Balls, Eyes & Feathers",subcat_desc:"Wooden and plastic beads.Toy eyes,stick on eyes and self adhesive eyes. Muticoloured feathers. Wooden balls.",keywords:"Crayons and Paints, Batik and Candlemaking, Modelling Materials, Dyes and Inks, Glue, Paste & Brushes, Tissue & Gummed Paper, Beads, Balls, Eyes & Feathers, Christmas Items, Chenille Stems & Sequins, Bookbinding, Scissors and Knives, Craft Kits, finger pu",long_desc:"",vat_rate:"17.5",unspsc:"60120000",color:"#ff0000",category_name:"Art & Craft",category_desc:"Crayons and Paints, Batik and Candlemaking, Modelling Materials, Dyes and Inks, Glue, Paste & Brushes, Tissue & Gummed Paper, Beads, Balls, Eyes & Feathers, Christmas Items, Chenille Stems & Sequins, Bookbinding, Scissors and Knives, Craft Kits",category_parent:"1"}; adSpace[adSpace.length]={ product_id:"1662",product_name:"POM POM KITS",product_desc:"Each pack makes 30 creatures and contains pom poms, accessories and instructions. The Bee and Ladybird kits contain self adhesive feet allowing the completed creature to be attached to flat surface. All kits require a glue such as PVA in order to be assembled. ",product_supercat:"1",product_category:"2",product_subcat:"113",product_cdate:"1159439894",product_mdate:"2009-09-23 10:12:52",product_image:"1662_915427.jpg",product_box:"",product_outofstock:"-1",product_featured:"1",product_list_order:"25",product_is_header:"",product_special:"0",product_suspend:"0",xref_id:"2937",supercat_id:"1",category_id:"2",subcat_id:"113",list_order:"25",subcat_parent:"2",subcat_name:"Craft Kits",subcat_desc:"Felt puppet kits, felt finger puppet kits and pom pom kits. Xmas snowman, Father Xmas and Christmas stocking kits. Pre-punched felt kits. Animal finger puppets. Ladybird, bee, panda and bear pompom kits",keywords:"Crayons and Paints, Batik and Candlemaking, Modelling Materials, Dyes and Inks, Glue, Paste & Brushes, Tissue & Gummed Paper, Beads, Balls, Eyes & Feathers, Christmas Items, Chenille Stems & Sequins, Bookbinding, Scissors and Knives, Craft Kits, finger pu",long_desc:"",vat_rate:"17.5",unspsc:"60120000",color:"#ff0000",category_name:"Art & Craft",category_desc:"Crayons and Paints, Batik and Candlemaking, Modelling Materials, Dyes and Inks, Glue, Paste & Brushes, Tissue & Gummed Paper, Beads, Balls, Eyes & Feathers, Christmas Items, Chenille Stems & Sequins, Bookbinding, Scissors and Knives, Craft Kits",category_parent:"1"}; adSpace[adSpace.length]={ product_id:"1207",product_name:"WORLD GLOBE SET",product_desc:"A giant, 850mm (approx.)fabric covered globe with 195 items. Each item has a hook dot attached and will adhere to the globe instantly. A lovely teaching resource for interactive learning about the world, countries, cities, environments, landscapes and inhabitants. Pieces include 64 city, country and place labels, 7 continent labels, 6 river labels, 2 canal labels, 7 mountain labels, 6 latitude and longitude labels, 5 ocean and sea labels, 30 wild animals, 20 sea creatures, 7 famous buildings, 20 peoples of the world and 10 transport items.",product_supercat:"1",product_category:"18",product_subcat:"",product_cdate:"1081608506",product_mdate:"2008-12-06 13:13:29",product_image:"1207_189888.jpg",product_box:"",product_outofstock:"-1",product_featured:"1",product_list_order:"6",product_is_header:"",product_special:"0",product_suspend:"0",xref_id:"2552",supercat_id:"1",category_id:"18",subcat_id:"",list_order:"5",subcat_parent:"",subcat_name:"",subcat_desc:"",keywords:"rivers, capital cities, people, transport, countries, continents",long_desc:"",vat_rate:"",unspsc:"60100000",color:"",category_name:"World Globe & Accessories",category_desc:"rivers, capital cities, people, transport, countries, continents",category_parent:"1"};