
//Right Navigation for the Show Pages*****************************************

var bb5_NS = (document.layers) ? 1 : 0;
var bb5_IE = (document.all && document.getElementById) ? 1 : 0;
var bb5_N6 = (!document.all && document.getElementById) ? 1 : 0;
/*
for (i=1; i<8; i++){ 
eval("wk"+i+"_on = new Image()");eval("wk"+i+"_on.src = '/primetime/bigbrother6/_images/show/nav/wk"+i+"_on.gif'");
eval("wk"+i+"t_on = new Image()");eval("wk"+i+"t_on.src = '/primetime/bigbrother6/photos/shownav/wk"+i+"t_on.gif'");
eval("wk"+i+"w_on = new Image()");eval("wk"+i+"w_on.src = '/primetime/bigbrother6/photos/shownav/wk"+i+"w_on.gif'");
eval("wk"+i+"f_on = new Image()");eval("wk"+i+"f_on.src = '/primetime/bigbrother6/photos/shownav/wk"+i+"f_on.gif'");
}
*/
stayOn = new Array()
stayOn[0] = "#f5ca93";
stayOn[1] = "#f5ca93";
stayOn[2] = "#f5ca93";
stayOn[3] = "#f5ca93";
stayOn[4] = "#f5ca93";
stayOn[5] = "#f5ca93";
stayOn[6] = "#f5ca93";
stayOn[7] = "#f5ca93";
stayOn[8] = "#f5ca93";
stayOn[9] = "#f5ca93";
stayOn[10] = "#f5ca93";
stayOn[11] = "#f5ca93";
stayOn[12] = "#f5ca93";
stayOn[13] = "#f5ca93";

function change(id, newClass, theTDrow, tdToStay) {
	if(tdToStay != "")
		document.images['nav_'+theTDrow].src = '/primetime/bigbrother7/images/wk_nav/wk'+tdToStay+'_on.gif'

	if(newClass != "") {
		identity=document.getElementById(id);
		identity.className=newClass;
	}

	if(bb5_IE)eval('document.all.'+theTDrow+'.style.backgroundColor="#ffebc8"');
	if(bb5_NS)eval('document.'+theTDrow+'.backgroundColor="#ffebc8"');
	if(bb5_N6) {
		bb6_td = document.getElementById(theTDrow);
		bb6_td.style.backgroundColor = "#ffebc8";
	}
	
	stayOn[tdToStay] = "#ffebc8"
}

//***************************************************************************
//Right Navigation for the Freeze Pages*****************************************

//*******************************************************************************
//Right side dropdown navigation for fantasy league
function houseguestPoints() {
	Item = pointsby.houseguest.selectedIndex;
	if(pointsby.houseguest.options[Item].value != '--- Choose Houseguest ---') document.location = pointsby.houseguest.options[Item].value;
}

function categoryPoints() {
	Item = pointsby.category.selectedIndex;
	if(pointsby.category.options[Item].value != '--- Choose Houseguest ---') document.location = pointsby.category.options[Item].value;
}



// Callout-related functions

var rand1 = 0;
var useRand1 = 0;
var useRand2 = 0;
var useRand3 = 0;

main_image = new Array;
main_image[1] = new Image();
main_image[1].src = "/primetime/bigbrother7/images/callouts/callouts_bot_vote.jpg";
main_image[2] = new Image();
main_image[2].src = "/primetime/bigbrother7/images/callouts/callouts_bot_housecalls.jpg";
//main_image[3] = new Image();
//main_image[3].src = "/primetime/bigbrother7/images/callouts/callouts_bot_revenge.jpg";
//main_image[4] = new Image();
//main_image[4].src = "/primetime/bigbrother7/images/callouts/callouts_bot_hg_wanted.jpg";

main_image2 = new Array;
main_image2[1] = new Image();
main_image2[1].src = "/primetime/bigbrother7/images/callouts/callouts_bot_freezeframes.jpg";
main_image2[2] = new Image();
main_image2[2].src = "/primetime/bigbrother7/images/callouts/callouts_bot_mobile.jpg";
/*main_image2[3] = new Image();
main_image2[3].src = "/primetime/bigbrother7/images/callouts/callouts_bot_evictee.jpg";
main_image2[4] = new Image();
main_image2[4].src = "/primetime/bigbrother7/images/callouts/callouts_bot_mobile.jpg";*/
/*main_image2[2] = new Image();
main_image2[2].src = "/primetime/bigbrother7/images/callouts/callouts_bot_247feed.jpg";
main_image2[3] = new Image();
main_image2[3].src = "/primetime/bigbrother7/images/callouts/callouts_bot_revenge.jpg";
main_image2[4] = new Image();
main_image2[4].src = "/primetime/bigbrother7/images/callouts/callouts_bot_housecalls.jpg";*/

var droplinks=new Array();
droplinks[1]="/primetime/bigbrother7/polls/love.shtml"
droplinks[2]="/primetime/bigbrother7/housecalls/"
//droplinks[3]="/primetime/bigbrother7/show/wk10/revenge_blog.php"
//droplinks[4]="/primetime/bigbrother_application/"

var droplinks2=new Array();
droplinks2[1]="/primetime/bigbrother7/show/wk10/freezeframe.shtml"
droplinks2[2]="http://mobile.cbs.com/"
/*droplinks2[3]="/primetime/bigbrother7/extras/ask/"
droplinks2[4]="http://mobile.cbs.com/"*/
/*droplinks2[2]="/primetime/bigbrother7/polls/index.shtml"
droplinks2[3]="/primetime/bigbrother7/polls/index.shtml"
droplinks2[4]="/primetime/bigbrother7/polls/index.shtml"*/

function swapPic1() {
	var imgnum = main_image.length - 1;
	do {
		var randnum = Math.random();
		rand1 = Math.round((imgnum - 1) * randnum) + 1;
	} while (rand1 == useRand1);
	useRand1 = rand1;
	document.co_01.src = main_image[useRand1].src;
}

function rotatelink(){
	if ((droplinks[rand1] != 'http://mobile.cbs.com/')&&(droplinks[rand1] != '/primetime/bigbrother_application/')) {
		window.location=droplinks[rand1]
	}
	else {
		window.open(droplinks[rand1])
	}
}

function swapPic2() {
	var imgnum = main_image2.length - 1;
	do {
		var randnum2 = Math.random();
		rand2 = Math.round((imgnum - 1) * randnum2) + 1;
	} while (rand2 == useRand2);
	useRand2 = rand2;
	document.co_02.src = main_image2[useRand2].src;
}

function rotatelink2(){
	if (droplinks2[rand2] != 'http://mobile.cbs.com/') {
		window.location=droplinks2[rand2]
	}
	else {
		window.open(droplinks2[rand2])
	}
}


function rotateCallouts(){
setTimeout("swapPic1()",0);
setTimeout("swapPic2()",0);
}
//

//document.onload= rotateCallouts();
 // Script for Flash integration

	var me; //represents the swf id
	//get the correct reference
	function getID(swfID) {
		if (navigator.appName.indexOf("Microsoft") > -1) {
			me = window['mainNav'];
		} else {
			me = document['mainNav'];
		}
	}
//this will call the onGetCurrentSection event back in Flash
function onGetCurrentSection () {
	me.onGetCurrentSection(currentSection)
}
function getCurrentSection () {
	onGetCurrentSection ()
}

function onGetCurrentPage () {
	me.onGetCurrentPage(currentPage)
}
function getCurrentPage () {
	onGetCurrentPage ()
}


function openChat(){
	var popurl="http://forums.prospero.com/n/pfx/forum.aspx?nav=chat&webtag=cbsbb"
	winpops=window.open(popurl,"","width=680,height=540,")
}

/*function onJsLoaded () {
	me.startFlash()
}

onJsLoaded ();*/
