function getCookieData(name){

var arg=name+"="
var aLen=arg.length
var cLen=document.cookie.length
var i=0
var cEnd
while (i<cLen){

var j=i+aLen
if(document.cookie.substring(i,j)==arg){
cEnd=document.cookie.indexOf(";",j)
if(cEnd==-1)
{cEnd=cLen}
return unescape(document.cookie.substring(j,cEnd))

}

i++

}

return ""

}



var userSheet=getCookieData("sheet");
if (userSheet=="hotpink") {document.write("<LINK REL=stylesheet HREF=\"/stylesheets/newstyle.css\" TYPE=\"text/css\">");} 

else if (userSheet=="greystyle"){document.write("<LINK REL=stylesheet HREF=\"/stylesheets/newstyle.css\" TYPE=\"text/css\">");} 

else if (userSheet=="mainstyle"){document.write("<LINK REL=stylesheet HREF=\"/stylesheets/mainstyle.css\" TYPE=\"text/css\">")}


else if (userSheet=="work"){document.write("<LINK REL=stylesheet HREF=\"/stylesheets/work.css\" TYPE=\"text/css\">")}


else {

document.write("<LINK REL=stylesheet HREF=\"/stylesheets/newstyle.css\" TYPE=\"text/css\">");} 

var make = navigator.appName;
var type = navigator.appVersion;
var split = type.split("MSIE");
var right_bit = split[1];
version = parseFloat(right_bit);


// the number of lead captions

var arraysize=     8;

// create the arrays

var LinkList=      new Array(arraysize);
var CaptionList=   new Array(arraysize);
var AltList =      new Array(arraysize);

// create the variable that will hold the random index. Change the value to 1 less than the size of the arrays

var myrandom=      Math.round(Math.random()*(arraysize-1));

// the leadstories

LinkList[0] =      " /sendtucolaemail.asp";
CaptionList[0]=    "“sly as a fox, smooth as hennessy over the rocks”";
AltList[0] =       "Mail me";

LinkList[1]=       " /sendtucolaemail.asp";
CaptionList[1]=    "“i’d rather kick it on the layback than contemplate karma payback”";
AltList[1] =       "Mail me";


LinkList[2]=       " /sendtucolaemail.asp";
CaptionList[2]=    "“a bunch of stuff by tucola”";
AltList[2] =       "Mail me";

LinkList[3]=       " /sendtucolaemail.asp";
CaptionList[3]=    "“famed for his long drive and his amazingly bizarre behaviour”";
AltList[3] =       "Mail me";

LinkList[4]=       " /sendtucolaemail.asp";
CaptionList[4]=    "“punks step up and get beat down”";
AltList[4] =       "Mail me";


LinkList[5]=       " /sendtucolaemail.asp";
CaptionList[5]=    "“cos i’m too large and i’m too dope”";
AltList[5] =       "Mail me";

LinkList[6]=       " /sendtucolaemail.asp";
CaptionList[6]=    "“if you don’t know, now you know”";
AltList[6] =       "Mail me";

LinkList[7]=       " /sendtucolaemail.asp";
CaptionList[7]=    "“ding, dong, the WHICH is dead?”";
AltList[7] =       "Mail me";


// the variables that hold the leadstory

var randomLink=    LinkList[myrandom];
var randomCaption= CaptionList[myrandom];
var randomAlt=     AltList[myrandom];

// the functions that write out the image and caption.

function writeCaption()
{document.writeln("<a href='" + randomLink + "' title='"+randomAlt+"'>"+randomCaption+"</a>"); 	}  

