Ok, i'll try to make this a bit clearer - sorry you have not understood me as yet! Lets say I have one file which I call with the includes function. Forget about size. It contains 3 different adverts from 3 different affiliate sites: "<scrpt language="javascript"> var uri = 'http://impgb.tradedoubler.com/imp/js/106094/1287396?' + new String (Math.random()).substring (2, 11); document.write('<sc'+'ript language="JavaScript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>'); </scrpt> <scrpt language="JavaScript" src="http://www.awin1.com/cawshow.php?s=55653&v=669&q=43980&r=66540"></scrpt><noscrpt><iframe src="http://www.awin1.com/cawshow.php?s=55653&v=669&q=43980&r=66540&iframe=1&target=blank" width=468 height=60 frameborder=0 border=0 scrolling=no marginheight=0 marginwidth=0></iframe></noscrpt> <scrpt type="text/javascript" language="javascript" src="http://www.kqzyfj.com/placeholder-1288778?target=_top&mouseover=N"></scrpt> " I want to randomly select one of the above adverts to display on the page where I have the includes function. Any ideas? I hope i'm making myself clear, my terminology isn't brilliant. Many thanks.