// JavaScript Document
function playFlashVideo(__url){
	//alert("thisMovie.(" + document.getElementById('Splash').name.value + ")");
	thisMovie("Splash").receiveJSEvent("playStreamingVideo",__url);
}

function loadDefaultVideo(){
	__url = 'intro_loop_clouds.flv';
	//__url = 'web_intro_carlo_terri.flv';
	//__url = 'http://flash.vitalstream.com/flashgen.cgi?sname=terri_carlo_testimonial.flv&amp;aname=pri_vitalstream_com/_definst_';
	//__url = 'http://flash.vitalstream.com/flashgen.cgi?sname=susan_long1.flv&amp;aname=pri_vitalstream_com/_definst_';
	//alert("loadDefaultVideo " + __url);
	thisMovie("Splash").receiveJSEvent("playStreamingVideo",__url);
}

function playVideoFirstFrame (__url){
	thisMovie("Splash").receiveJSEvent("playStreamingVideoFirstFrame",__url);
}

function loadIntroVideo(){
	playFlashVideo('http://flash.vitalstream.com/flashgen.cgi?sname=terri_carlo_testimonial.flv&amp;aname=pri_vitalstream_com/_definst_');
}

function getVideoToPlayByName (__name){
	thisMovie("Splash").receiveJSEvent("getStreamingVideoToPlayByName",__name);
}

function getVideoToPlayByNameFirstFrame (__name){
	thisMovie("Splash").receiveJSEvent("getStreamingVideoToPlayByNameFirstFrame",__name);
}

function thisMovie(movieName) {	
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
	//
}

function loadPage(obj){
	document.location = "redirect.cfm?" + obj.urlstr;
}

function redirectThisFrame(obj){
	document.location = "../../../../redirect.cfm?" + obj.urlstr;
}

function loadFrame(obj){
	var frameid = document.getElementById("MainWrapperBottomRight");
	frameid.src = "redirect.cfm?" + obj.urlstr;
}

function loadFrameStr(str){
	var frameid = document.getElementById("MainWrapperBottomRight");
	frameid.src = "redirect.cfm?" + str;
}

function loadLeftPanelFrame(obj){
	var frameid = document.getElementById("MainWrapperBottomLeft");
	frameid.src = "redirect.cfm?" + obj.urlstr;
}

function loadRightPanelFrame(obj){
	var frameid = document.getElementById("MainWrapperBottomRight");
	frameid.src = "redirect.cfm?" + obj.urlstr;
}

function loadRightPanelFrameStr(urlstr){
	var frameid = document.getElementById("MainWrapperBottomRight");
	frameid.src = "redirect.cfm?" + urlstr;
}

function writePage(content){
	//alert(content);
	var writeToDiv = document.getElementById("SubWrapperRightContent");
	while (writeToDiv.childNodes.length > 0) {
		writeToDiv.removeChild (writeToDiv.childNodes[0]);
	}
	writeToDiv.innerHTML = content;
}

function showSearchAlert(alert_obj){
	alert(alert_obj.urlstr.alert_str + "\n" + alert_obj.urlstr.title_str);
}

function showAlert(ext_obj){
	alert(ext_obj.alert_obj.title_str + "\n" + ext_obj.alert_obj.alert_str);
}

function showAlternateContent (){
	var alternateContent = 'This site requires the Adobe Flash Player.';
	var flaLink = "<a href='http://www.macromedia.com/go/getflash' />Get Flash</a>";
	document.write(alternateContent + flaLink);  // insert non-flash content
}

function goHome(str){
	var frameid = document.getElementById("MainWrapperBottomRight");
	frameid.src = str;
}

function openWin (fileName, windowName) { 
	//alert("hi");
	window.open(fileName,windowName,'width=600,height=800,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no'); 
} 


function refreshLeftPanelFrame(tags, headline, tagstr){
	var frameid = document.getElementById("MainWrapperBottomLeft");
	frameid.src = "modules/Search/ViewIndex.cfm?tags=" + tags + "&headline=" + headline + "&tagstr=" + tagstr;
}