Yeah I think that may have been the problem, however I decided to use the window.open method instead plus I made my urls absolute instead of relative. I'm going to take out the styling for the finished site but here's the working code: Thanks
Code:
function uniqueRandomArray(limit,ex){
var i, j, q, rn, ar=[];
for(i=0;i<3;i++){
q=false
rn=Math.ceil(Math.random()*limit);
for(j=0;j<ar.length;j++){
if(rn==ar[j]){q=true;break}
}
rn==ex||q?i--:ar[ar.length]=rn;
}
return ar;
}
var x = [];
x[1] = ["£9.99","http://www.fkprint.com/african_kente_buy.php"];
x[2] = ["£9.99","http://www.fkprint.com/african_love.php"];
x[3] = ["£9.99","http://www.fkprint.com/too.php"];
x[4] = ["£14.99","http://www.fkprint.com/jon_f.php"];
x[5] = ["£14.99","http://www.fkprint.com/jon_fab.php"];
x[6] = ["£9.99","http://www.fkprint.com/ceo.php"];
x[7] = ["£9.99","http://www.fkprint.com/click.php"];
x[8] = ["£9.99","http://www.fkprint.com/jesus.php"];
x[9] = ["£14.99","http://www.fkprint.com/fabio.php"];
x[10] = ["£9.99","http://www.fkprint.com/live.php"];
var rands = uniqueRandomArray(10,1);
for(i=0;i<3;i++)
{
document.write("<div class='sug'><img onclick='sugPage(rands["+i+"])' border='0' style='position:absolute; padding-bottom:3px; clip:rect(0px,80px,80px,0px)' src='sug_img/Picture_"+rands[i]+".png'><div style='position:absolute;top:80px;width:95%;text-align:right'>"+x[rands[i]][0]+"</div></div>");
function sugPage(z){
window.open( x[z][1] ,"_top");
}
}
Bookmarks