var currentHouseCallsChapter = "2294";
var currentHouseCallsCategory = "51";
function openHouseCalls() {
	var houseCallsUrl = "/primetime/bigbrother5/insider/index.php?chap=" + currentHouseCallsChapter + "&cat=" + currentHouseCallsCategory + "&hc=1";
	openWin(houseCallsUrl,758,517,'insWin','no');
}

//Variables for EmbedFlash function*******************************************
//****************************************************************************
var v_bio_nav="/primetime/bigbrother5/swf/bio_nav.swf";
var v_top_right="/primetime/bigbrother5/swf/top_right.swf";
//Image substitution
var v_bio_nav_image="/primetime/bigbrother5/images/swf/bio_nav.gif";
var v_top_right_image="/primetime/bigbrother5/images/swf/top_right.gif";
//var v_macromedia="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash target='_blank'";


//****************************************************************************
//topnav drop menu************************************************************
// all functions and variables were given bb5_ appended to the front to *******
// dinstinguish them from any functions and variables in core.js**************

if(document.images){
for (i=1; i<=7; i++)
{
eval("topnav_"+i+"_off = new Image()");eval("topnav_"+i+"_off.src = '/primetime/bigbrother5/images/topnav/topnav_"+i+"_off.gif'");
eval("topnav_"+i+"_on = new Image()");eval("topnav_"+i+"_on.src = '/primetime/bigbrother5/images/topnav/topnav_"+i+"_on.gif'");
}

}

function bb5_imgOn(Num) {
bb5_SubNavHideAll()
if (document.images) {
document.images["topnav_" +Num].src = eval("topnav_" +Num+ "_on.src")
}
}

function bb5_imgOff(Num) {
if (document.images) {
document.images["topnav_" +Num].src = eval("topnav_" +Num+ "_off.src")
}
}

//***START SUBNAVIGATION CODE*****************
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;
var bb5_hideMenu = null;

function bb5_SubNavHide(paramDiv){
if(bb5_IE)eval('document.all.'+paramDiv+'.style.visibility="hidden"');
if(bb5_NS)eval('document.'+paramDiv+'.visibility="hidden"');
if(bb5_N6)
	{
	bb5_elm = document.getElementById(paramDiv);
	bb5_elm.style.visibility = "hidden";
	}
}

function bb5_SubNavShow(paramDiv){
bb5_SubNavHideAll();
if(bb5_IE)eval('document.all.'+paramDiv+'.style.visibility="visible"');
if(bb5_NS)eval('document.'+paramDiv+'.visibility="visible"');
if(bb5_N6)
	{
	bb5_elm = document.getElementById(paramDiv);
	bb5_elm.style.visibility = "visible";
	}
}

function bb5_SubNavHideAll(){
bb5_SubNavHide('subnav_1');
bb5_SubNavHide('subnav_2');
bb5_SubNavHide('subnav_3');
bb5_SubNavHide('subnav_5');
bb5_SubNavHide('subnav_6');
bb5_SubNavHide('subnav_legend');
}
//***END SUBNAVIGATION CODE*****************




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




//Poll function*****************************************************
function vote(address,pollName){
var qID = 0
var radioGrp = document.forms[pollName].q1;
	for (var i = 0; i < radioGrp.length; i++){
		if (radioGrp[i].checked) {qID = radioGrp[i].value}}
	if (qID == 0) {
		alert('Please select an answer before voting.');
	} else {
		var whandle = window.open( address + qID, "pollWin", "width=510,height=420,menubar=0,location=0,scrollbars=0", "0" );
		whandle.focus();
	}
}
//**********************************************************************



//////////////////////////////////////////////////////////////////////////////////////////////
//Live Stream redirect script***************************************************
//*****************************************************************************
document.write('<OBJECT ID="IERPCtl" WIDTH=0 HEIGHT=0 CLASSID="CLSID:FDC7A535-4070-4B92-A0EA-D9994BCC0DC5"></OBJECT>');


function isRealOne() {

        RealOneInst = 'undetermined';
        
        var agt=navigator.userAgent.toLowerCase();
        var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                        && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                        && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
        if (is_nav) {
                IERPCtl = 0;
        }
        
	

      
        if (navigator.plugins) {
                if ((navigator.userAgent.charAt(8)) >= ('3'))
                {
                var nPlayerInstalled=2;
                var i=0;
                while (navigator.plugins[i])
                        {
                        if ((navigator.plugins[i].name) == 'RealOne Player Version Plugin')
                                {
                                        nPlayerInstalled=1;
                                        szPlayerVersion=navigator.plugins[i].description;
                                        break;
                                }
                        i++;
                        }
        
                        if ( nPlayerInstalled == 2 )
                        {
                                var nRPVersion = IERPCtl.RealPlayerVersion;
                                if ( nRPVersion == null )
                                {
                                nPlayerInstalled=2;
                                } else {
                                nPlayerInstalled=1;
                                }
                        }
                }       

                if (nPlayerInstalled == 1)
                {
                RealOneInst = 'installed';  
                } 
                if (nPlayerInstalled == 2)
                {
                RealOneInst = 'notinstalled';
                }
        } else {
        RealOneInst = 'undetermined';
        }
        if (RealOneInst == 'installed') {
                if (agt.indexOf("(r1 ") != -1) {
                        RealOneInst = 'using';
                }
        }

        return RealOneInst;     
		
}

		
function loadlink(page,premium) {

	var checkbrowser = isRealOne();

	if (checkbrowser == 'using') {
	     window.location = (page);
	}

	if (checkbrowser == 'installed') {
	     window.location = (page);
	}

	if (checkbrowser =='undetermined' || checkbrowser =='notinstalled') {

		
		if (navigator.userAgent.indexOf("Mac") != -1) {
			
		document.location = "http://www.real.com/partners/bigbrother/?pcode=cbs&cpath=R1R&rsrc=cbs.bb5";	
		}
		else {if (navigator.userAgent.indexOf("95") != -1) {
		document.location = "http://www.real.com/partners/bigbrother/?pcode=cbs&cpath=R1R&rsrc=cbs.bb5";
		}
		else {if (navigator.userAgent.indexOf("Linux") != -1) {
		window.open('/primetime/bigbrother5/popups/otherOS.html','r1popup','width=250,height=180,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');	
		}
		else {
			if (premium == 'yes') {
			document.location = "http://www.real.com/partners/bigbrother/?pcode=cbs&cpath=R1R&rsrc=cbs.bb5";
			}
	
			if (premium == 'no') {
			//do nothing
			//window.open('/primetime/bigbrother3/popups/free.html','r1popup','width=250,height=160,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
			}
		};
	    };
		};


	}

}


function golivestream() {
	//window.open('/primetime/bigbrother5/popups/247_closed.html','247','width=510,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
	loadlink('http://start.real.com/rd?pid=bb5&url=bb5_start.smil&pcode=cbs&cpath=CNT&rsrc=cbs.bb5','yes');
}

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

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



// this is for dynamic positioning of the dhtml nav
function dhtmlPos(siteNavHeight) {
	cbsHeader = 50;
	if(document.getElementById('divAdTop') != null) 	{
		var thiselement = document.getElementById('divAdTop');
		vAdTop = thiselement.offsetTop; 
	}
	if(vAdTop==null||vAdTop=="") {
		var vAdTop = 1;
	}
	if(document.getElementById('subnav_1') != null)
		document.getElementById('subnav_1').style.top = vAdTop + cbsHeader + siteNavHeight;
	if(document.getElementById('subnav_2') != null)
		document.getElementById('subnav_2').style.top = vAdTop + cbsHeader + siteNavHeight;
	if(document.getElementById('subnav_3') != null)
		document.getElementById('subnav_3').style.top = vAdTop + cbsHeader + siteNavHeight;
	if(document.getElementById('subnav_4') != null)
		 document.getElementById('subnav_4').style.top = vAdTop + cbsHeader + siteNavHeight;
	if(document.getElementById('subnav_5') != null)
		document.getElementById('subnav_5').style.top = vAdTop + cbsHeader + siteNavHeight;
	if(document.getElementById('subnav_6') != null)
		document.getElementById('subnav_6').style.top = vAdTop + cbsHeader + siteNavHeight;

}