
var _rootSite = 'http://bventertainment.go.com/tv/buenavista/regisandkelly/';
//var _rootSite = 'http://localhost:8080/regisandkelly/beta/';

function params(wut,qp,dflt){ dflt=(dflt==null)?'':dflt; try{r=unescape(wut.match(new RegExp(qp+"=+([^&;]*)"))[1]);}catch(qp){r=dflt;} return r; }

function DoFlashDetection(_ver){
	if (params(document.cookie,'NO_FLASH_DETECT','false')!='true'){
		_ver=(_ver==null)?"8":_ver;
		CreateInterface(); DetectFlash(_ver,_rootSite+"/noflash.html");
	}
}

var _objNavigator = [
  { id: 'nav01', image: _rootSite + 'images/navigator/RK_navigator_homeActive_87x36.jpg', left: 0, width: 87, height: 36, active: false},
  { id: 'nav02', image: _rootSite + 'images/navigator/RK_navigator_showInfoActive_126x36.jpg', left: 87, width: 126, height: 36, active: false},
  { id: 'nav03', image: _rootSite + 'images/navigator/RK_navigator_hostsActive_79x36.jpg', left: 213, width: 79, height: 36, active: false},
  { id: 'nav04', image: _rootSite + 'images/navigator/RK_navigator_videosPhotosActive_180x36.jpg', left: 292, width: 180, height: 36, active: false},
  { id: 'nav05', image: _rootSite + 'images/navigator/RK_navigator_funStuffActive_110x36.jpg', left: 472, width: 110, height: 36, active: false},
  { id: 'nav06', image: _rootSite + 'images/navigator/RK_navigator_ticketActive_77x36.jpg', left: 582, width: 77, height: 36, active: false},
  { id: 'nav07', image: _rootSite + 'images/navigator/RK_navigator_helpActive_69x36.jpg', left: 659, width: 69, height: 36, active: false}
];


function importJavaScript(id,URL){
	var script = document.createElement('script');
	script.src = URL;
	script.type = 'text/javascript';
	script.defer = true;
	script.id = id; // This will help in referencing the object later for removal
	/* Insert the created object to the html head element */
	var head = document.getElementsByTagName('head').item(0);
	head.appendChild(script);
}

function gid(id){
	return document.getElementById(id);
}

function inner(id,text){
	gid(id).innerHTML=text;
}

function writeHighlightHeading(objFlashHighlightHeader){
	/**
		* Uses ./swf/subheader.swf Flash file
		* objFlashHighlightHeader = { text:'', color:'', width:'', height:'', wmode:'' , scale:'' }
		*/
	_scaleParamIE = (objFlashHighlightHeader.scale==null)?'exactfit':objFlashHighlightHeader.scale;
	_scaleParamOthers = (objFlashHighlightHeader.scale==null)?'noorder':objFlashHighlightHeader.scale;
	try{
		document.writeln('<object id="flashmovie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"' +
			'width="'+objFlashHighlightHeader.width+'"'+
			'height="'+objFlashHighlightHeader.height+'" />' +
			'<param name="wmode" value="'+objFlashHighlightHeader.wmode+'" />' +
			'<param name="movie" value="swf/subheader.swf" />' +
			'<param name="quality" value="high" />' +
			'<param name="menu" value="false" />' +			
			'<param name="scale" value="'+_scaleParamIE+'" />' +
			'<param name="allowScriptAccess" value="always" />' +
			'<param name="show" value="#ffffff" />' +
			'<param name="flashVars" value="text='+objFlashHighlightHeader.text+'&amp;color='+objFlashHighlightHeader.color+'" />' +
			'<embed name="flashmovie" id="flashmovie" src="swf/subheader.swf" menu="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
				' type="application/x-shockwave-flash" swliveconnect="true" scale="'+_scaleParamOthers+'" allowscriptaccess="always"' +
				' wmode="'+objFlashHighlightHeader.wmode+'" flashvars="text='+objFlashHighlightHeader.text+'&amp;color='+objFlashHighlightHeader.color+'"' +
				' width="'+objFlashHighlightHeader.width+'" height="'+objFlashHighlightHeader.height+'" />' +
			'</object>');
	}
	catch(e){	}
}

function showMenu(id){
	try{
		gid(id).style.display = 'block';		
	}
	catch(e){}
}

function hideMenu(id){
	try{
		gid(id).style.display = 'none';
	}
	catch(e){}
}

function focusMenuItem(id){
	try{
		inner(id,'<img src="./images/navigator/active/'+id+'.png" width="65" height="22" alt="" border="0" />');
	}
	catch(e){}
}

function unFocusMenuItem(id){
	try{
		inner(id,'<img src="./images/navigator/inactive/'+id+'.png" width="65" height="22" alt="" border="0" />');
	}
	catch(e){}
}


//popup
function popup( url, w, h, windowName, r, s ) {
	win = window.open(url, windowName, 'height=' +h+ ', width=' +w+ ', resizable=' +r+ ', status=no, scrollbars=' +s+ ', location=no, menubar=no, toolbar=no, left=50, top=50');
}
//feedback
function feedback(){ popup(_rootSite+'/feedback.html', 400, 510, 'feedback', 'no', 'no'); }
