function rowHilite(rowID,bcolorValue,linkID,colorValue){ 
	document.getElementById(rowID).bgColor = bcolorValue;
	document.getElementById(linkID).style.color = colorValue;
}

function onbutton(imgName) {
  if (document.images)
    document.images[imgName].src = eval(imgName + "_on.src");
}
function offbutton(imgName) {
  if (document.images)
    document.images[imgName].src = eval(imgName + "_off.src");
}

/* open window script */
function openWin(url,w,h,winName,scroll,resize) { 
	if(winName==''){winName='CbsWindow';}if(scroll==''){scroll='yes';}/* edited by AFA popwin */
	window.open(url,winName,"width="+w+",height="+h+",status=0,scrollbars="+scroll+",resizable="+resize+",location=0,menubar=0").focus();
}

function linkRollover(linkID,colorValue) { 
	document.getElementById(linkID).style.color = colorValue;
}

function dropdownOn(linkID,bcolorValue,colorValue){ 
	document.getElementById(linkID).bgColor = bcolorValue;
	document.getElementById(linkID).color = colorValue;
}

function dropdownOff(linkID,bcolorValue,colorValue){ 
	document.getElementById(linkID).bgColor = bcolorValue;
	document.getElementById(linkID).color = colorValue;
} 

/* this global function rotates callouts on ALL pages */
function linkRotator() {

/* add more callouts if necessary to this array as new array elements */
myCalloutArray = new Array(18);
myCalloutArray[0] = "<a href=\"/originals/inturn2/vote.php?v=1&c=1&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[1] = "<a href=\"/originals/inturn2/vote.php?v=1&c=2&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[2] = "<a href=\"/originals/inturn2/vote.php?v=1&c=3&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[3] = "<a href=\"/originals/inturn2/vote.php?v=1&c=4&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[4] = "<a href=\"/originals/inturn2/vote.php?v=1&c=5&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[5] = "<a href=\"/originals/inturn2/vote.php?v=1&c=6&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[6] = "<a href=\"/originals/inturn2/vote.php?v=1&c=7&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[7] = "<a href=\"/originals/inturn2/vote.php?v=1&c=8&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[8] = "<a href=\"/originals/inturn2/vote.php?v=1&c=9&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[9] = "<a href=\"/originals/inturn2/vote.php?v=2&c=1&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[10] = "<a href=\"/originals/inturn2/vote.php?v=2&c=2&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[11] = "<a href=\"/originals/inturn2/vote.php?v=2&c=3&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[12] = "<a href=\"/originals/inturn2/vote.php?v=2&c=4&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[13] = "<a href=\"/originals/inturn2/vote.php?v=2&c=5&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[14] = "<a href=\"/originals/inturn2/vote.php?v=2&c=6&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[15] = "<a href=\"/originals/inturn2/vote.php?v=2&c=7&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[16] = "<a href=\"/originals/inturn2/vote.php?v=2&c=8&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
myCalloutArray[17] = "<a href=\"/originals/inturn2/vote.php?v=2&c=9&p=0\"><img src=\"/originals/inturn2/images/callouts/2.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";

/* this is the meat'n'gravy shuffle function definition, shuffles a sequence of non-repeating values */
shuffle = function(o){ 
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};

/* if adding new elements, extend this array as well */ 
myArray = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17);

/* execute shuffle once */
shuffle(myArray);

/* this snapshots the three top values in the shuffled array for our 3 callouts per page */
var callout1 = myArray[0];

/* this writes out table row */
// document.write(myCalloutArray[callout1]);


/*this is an enhancement to rotate all callouts */

mainCalloutArray = new Array(4);
mainCalloutArray[0] = "<a href=\"/originals/inturn2/blog.shtml\"><img src=\"/originals/inturn2/images/callouts/1.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
mainCalloutArray[1] = "<a href=\"/daytime/atwt/updates/daily/\"><img src=\"/originals/inturn2/images/callouts/3.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
mainCalloutArray[2] = "<a href=\"http://boards.cbs.com/n/pfx/forum.aspx?folderId=7&listMode=13&nav=messages&webtag=cbsawtmb\"><img src=\"/originals/inturn2/images/callouts/4.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
mainCalloutArray[3] = "<a href=\"/originals/inturn2/gallery.php?set=c\"><img src=\"/originals/inturn2/images/callouts/5.jpg\" alt=\"\" width=\"319\" height=\"132\" border=\"0\" /></a>";
mainCalloutArray[4] = myCalloutArray[callout1];

mainArray = new Array(0,1,2,3,4);
shuffle(mainArray);
var maincallout1 = mainArray[0];
var maincallout2 = mainArray[1];
var maincallout3 = mainArray[2];

document.write("<tr><td valign=\"top\" align=\"left\"><img src=\"/Common/images/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"5\" /></td><td valign=\"top\" align=\"left\">");
document.write(mainCalloutArray[maincallout1]);
document.write("</td><td valign=\"top\" align=\"left\"><img src=\"/Common/images/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"8\" /></td><td valign=\"top\" align=\"left\">");
document.write(mainCalloutArray[maincallout2]);
document.write("</td><td valign=\"top\" align=\"left\"><img src=\"/Common/images/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"8\" /></td><td valign=\"top\" align=\"left\">");
document.write(mainCalloutArray[maincallout3]);
document.write("</td><td valign=\"top\" align=\"left\"><img src=\"/Common/images/spacer.gif\" alt=\"\" border=\"0\" height=\"1\" width=\"5\" /></td></tr>");

}

