var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6plus = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
var IEmac = ((document.all) && (isMac)) ? true : false;
var IE4plus = (document.all) ? true : false;
var IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
var IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
var Opera7plus = ((document.all)&&(navigator.userAgent.indexOf("Opera 7")!=-1)) ? true : false;
var FF1 = (navigator.userAgent.indexOf("Firefox\/1")!=-1) ? true : false;
var Opera = (navigator.userAgent.indexOf("Opera")!=-1) ? true : false;
var Mozilla = (NS6plus && (navigator.userAgent.indexOf("Netscape") < 0));
var IsLocal = (location.href.indexOf("file://")>-1)? true : false;
var initPlayer = 0; 
var idI;

var oPres = 
{'SLIDES':[
{'SlideSeq': '1', 'Title': 'Intro  Bill Hazel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_1_17.png', 'TimePoint': 0},
{'SlideSeq': '2', 'Title': 'Government Intervention & The Economy  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_2_18.png', 'TimePoint': 186000},
{'SlideSeq': '3', 'Title': 'Events Around This Time Last Year  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_3_19.png', 'TimePoint': 274000},
{'SlideSeq': '4', 'Title': 'Thoughts Shared Last Year  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_4_20.png', 'TimePoint': 357000},
{'SlideSeq': '5', 'Title': 'Who Fills the Gap?  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_5_21.png', 'TimePoint': 497000},
{'SlideSeq': '6', 'Title': 'Market Value Gap  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_6_22.png', 'TimePoint': 552000},
{'SlideSeq': '7', 'Title': 'Fed Balance Sheet  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_7_23.png', 'TimePoint': 651000},
{'SlideSeq': '8', 'Title': 'TARP Investments in Banks  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_8_24.png', 'TimePoint': 684000},
{'SlideSeq': '9', 'Title': 'Economic Capacity  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_9_25.png', 'TimePoint': 739000},
{'SlideSeq': '10', 'Title': 'Population Growth  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_10_26.png', 'TimePoint': 819000},
{'SlideSeq': '11', 'Title': 'Population and Productivity  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_11_27.png', 'TimePoint': 834000},
{'SlideSeq': '12', 'Title': 'GDP  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_12_28.png', 'TimePoint': 851000},
{'SlideSeq': '13', 'Title': 'Unemployment  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_13_29.png', 'TimePoint': 918000},
{'SlideSeq': '14', 'Title': 'Savings Rate  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_14_30.png', 'TimePoint': 1019000},
{'SlideSeq': '15', 'Title': 'Inflation  Rob Suttman', 'ClipFile': '1.wmv', 'SlideFile': 'slide_15_31.png', 'TimePoint': 1190000},
{'SlideSeq': '16', 'Title': 'The Market: Stocks, Bonds, and Fixed Income Portfolios  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_16_32.png', 'TimePoint': 1396000},
{'SlideSeq': '17', 'Title': 'Point A to Point B  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_17_33.png', 'TimePoint': 1470000},
{'SlideSeq': '18', 'Title': 'Melt Down  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_18_34.png', 'TimePoint': 1510000},
{'SlideSeq': '19', 'Title': 'Melt Up  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_19_35.png', 'TimePoint': 1516000},
{'SlideSeq': '20', 'Title': 'Bearish Sentiment  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_20_36.png', 'TimePoint': 1555000},
{'SlideSeq': '21', 'Title': 'Volatility  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_21_37.png', 'TimePoint': 1635000},
{'SlideSeq': '22', 'Title': 'Prolonged Poor Performance Followed by Good Performance  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_22_38.png', 'TimePoint': 1693000},
{'SlideSeq': '23', 'Title': 'Reported vs. Operating Earnings  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_23_39.png', 'TimePoint': 1803000},
{'SlideSeq': '24', 'Title': 'Valuations: Price/Earnings  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_24_40.png', 'TimePoint': 1904000},
{'SlideSeq': '25', 'Title': 'Performance at Current Valuations (Reported EPS)  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_25_41.png', 'TimePoint': 1983000},
{'SlideSeq': '26', 'Title': 'Performance at Current Valuations (Operating EPS)  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_26_42.png', 'TimePoint': 2047000},
{'SlideSeq': '27', 'Title': 'Fixed Income  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_27_43.png', 'TimePoint': 2112000},
{'SlideSeq': '28', 'Title': 'Fixed Income  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_28_44.png', 'TimePoint': 2169000},
{'SlideSeq': '29', 'Title': 'Treasuries in 2008  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_29_45.png', 'TimePoint': 2227000},
{'SlideSeq': '30', 'Title': 'Treasuries and Corporates in 2008  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_30_46.png', 'TimePoint': 2304000},
{'SlideSeq': '31', 'Title': 'Long-Term History of Credit Spreads  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_31_47.png', 'TimePoint': 2330000},
{'SlideSeq': '32', 'Title': 'Treasuries and Corporates in 2009  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_32_48.png', 'TimePoint': 2370000},
{'SlideSeq': '33', 'Title': 'Bond Price Sensitivity  Ron Eubel', 'ClipFile': '1.wmv', 'SlideFile': 'slide_33_49.png', 'TimePoint': 2418000},
{'SlideSeq': '34', 'Title': 'Equity Strategies in the Portfolio  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_34_50.png', 'TimePoint': 2562000},
{'SlideSeq': '35', 'Title': 'Probabilities of Beating Market with Value Investing  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_35_51.png', 'TimePoint': 2580000},
{'SlideSeq': '36', 'Title': 'Performance of Low Price-To Strategies  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_36_52.png', 'TimePoint': 2707000},
{'SlideSeq': '37', 'Title': 'Academic Support for Low Price-To Investing  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_37_53.png', 'TimePoint': 2767000},
{'SlideSeq': '38', 'Title': 'Academic Studies Refuting Low Price-To Investing  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_38_54.png', 'TimePoint': 2812000},
{'SlideSeq': '39', 'Title': 'Additional Studies Confirming Low Price-To Investing  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_39_55.png', 'TimePoint': 2842000},
{'SlideSeq': '40', 'Title': 'Market Valuations: 1999 and 2009  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_40_56.png', 'TimePoint': 2934000},
{'SlideSeq': '41', 'Title': 'EBS All Cap Allocations: 1999 and 2009  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_41_57.png', 'TimePoint': 3060000},
{'SlideSeq': '42', 'Title': 'EBS vs. Market: Valuations  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_42_58.png', 'TimePoint': 3087000},
{'SlideSeq': '43', 'Title': 'Our Perspective  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_43_59.png', 'TimePoint': 3170000},
{'SlideSeq': '44', 'Title': 'Our Perspective: Common Theme  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_44_60.png', 'TimePoint': 3349000},
{'SlideSeq': '45', 'Title': 'Our Perspective: Summary  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_45_61.png', 'TimePoint': 3395000},
{'SlideSeq': '46', 'Title': 'Pledge of Stewardship  Mark Brady', 'ClipFile': '1.wmv', 'SlideFile': 'slide_46_62.png', 'TimePoint': 3528000},
{'SlideSeq': '47', 'Title': 'Closing  Scott Lundy', 'ClipFile': '1.wmv', 'SlideFile': 'slide_47_63.png', 'TimePoint': 3606000},
{'SlideSeq': '48', 'Title': 'Closing  Scott Lundy', 'ClipFile': '1.wmv', 'SlideFile': 'slide_48_64.png', 'TimePoint': 3669000},
{'SlideSeq': '49', 'Title': 'Finding Value Today, Creating Wealth For Tomorrow', 'ClipFile': '1.wmv', 'SlideFile': 'slide_49_65.png', 'TimePoint': 3799000}
]}
var currSlideSeq=1;
var currDivId = "nt1";

function TabSelected(sel) { 
	tmpC=(parent.tabs.document.getElementById('tabNavigation').children.length -1)
	
	for (var i = 0; i < tmpC; i++) { 
		style2=parent.tabs.document.getElementById('tabNavigation').children[i]		
		if (i==sel) { 
			style2.className="selectedTab"
		} else { 
			style2.className=""	
		}
		
	} 

} 

function ChangeTab() {	
	var argv = ChangeTab.arguments;
	var argc = argv.length;
	for (var i = 0; i < argc; i++) {		
		style1=parent.tabcontent.document.getElementById(argv[i]).style
			
		if (i==0) { 
			style1.display="block"			
		} else { 
			style1.display="none"			
		} 
		if (argv[i]=='outline') { 
			parent.tabs.document.getElementById('tabNavBar').innerHTML="<div id='tabNavBar' style='background: #6D6FF9;border-top: line-height: 20px;text-align:right;padding: 0 0 0 0;color: #FFF;font-weight: bold;'>&nbsp;</div>"
		} else { 
			parent.tabs.document.getElementById('tabNavBar').innerHTML="<div id='tabNavBar' style='background: #6D6FF9;border-top: line-height: 20px;text-align:right;padding: 0 0 0 0;color: #FFF;font-weight: bold;'>Time Point</div>"
		} 
	}	
	return false; 	
}

function GoFullScreen() { 	
	if (parent.frames['player'].document.MediaPlayer.playState == 2 || parent.frames['player'].document.MediaPlayer.playState == 3) {		
		parent.frames['player'].document.MediaPlayer.fullscreen = 'true';	
	} 
} 

function BuildPlayer(asxFile, StartTime) {
	if (StartTime>=500) StartTime = StartTime - 500;

	var sMediaURL=asxFile;  

	var sHTML1	= ''; 
	var sHTML2	= '';
	var sHTML3	= '';
	var sOut	= ''; 
	var sWMP 	= ''; 
	
	sWMP = sWMP + '<OBJECT WIDTH="320" HEIGHT="240" ID="MediaPlayer" NAME="MediaPlayer" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">'
	sWMP = sWMP + '<PARAM NAME="URL" VALUE="' + sMediaURL + '">'
	sWMP = sWMP + '<PARAM NAME="DefaultFrame" VALUE="slidearea">'
	sWMP = sWMP + '<PARAM NAME="stretchToFit" VALUE="1" >'
	sWMP = sWMP + '<PARAM NAME="ShowStatusBar" VALUE="1">'
	sWMP = sWMP + '<PARAM NAME="CurrentPosition" VALUE="True">'
	sWMP = sWMP + '<EMBED SRC="' + sMediaURL + '" WIDTH="320" HEIGHT="290" stretchToFit="1" DEFAULTFRAME="slidearea" AUTOSIZE="0" TYPE="application/x-mplayer2" PLUGINSPAGE="http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx" ID="MediaPlayer" NAME="MediaPlayer" SHOWSTATUSBAR="1">'
	sWMP = sWMP + '</EMBED>'
	sWMP = sWMP + '</OBJECT>'	
	
	if (screen.width <= 800) {
		var w="100%"; 
	} else {
		var w="100%"; 
	}	
					
	sHTML1 = "<link rel='stylesheet' type='text/css' href='default.css'>"  
	sHTML1 += "<body style='background-color:#f4f4f4;margin:0px;padding:0px;'><div style='margin-top:10px;'>" 
	sHTML2 += "</div>"
	
	sHTML3 += "<SCRIPT LANGUAGE=\"JavaScript\" FOR=\"MediaPlayer\" EVENT=\"ScriptCommand( scType, Param )\">"	
	sHTML3 += "if (scType==\"IP\") { "
	sHTML3 += "parent.frames['slidearea'].document.slide.src = Param;"
	sHTML3 += "parseparam=Param.split('_');" 
	sHTML3 += "nextSlide=parseparam[1];"
	sHTML3 += "parent.SetCurrentSlide(nextSlide);"
	sHTML3 += "}" 
		
	sHTML3 += "if (scType==\"IPEND\") { "
	sHTML3 += "f=Param.split('&');" 
	sHTML3 += "s=f[0].split('=');" 
	sHTML3 += "nextSlide=s[1];"
	sHTML3 += "c=f[1].split('=');"
	sHTML3 += "nextClip=c[1];"
	sHTML3 += "if (nextSlide=='END') { return false; } else { parent.frames['player'].document.MediaPlayer.Controls.fileName = nextClip;parent.SetCurrentSlide(nextSlide);}"
	sHTML3 += "}"
	
	sHTML3 += "if (scType==\"URL\") { " 
	sHTML3 += "return false;"
	sHTML3 += "}"

	sHTML3 += "<\/SCRIPT>"	
	
	sHTML3 += "<SCRIPT LANGUAGE=\"JavaScript\" FOR=\"MediaPlayer\" EVENT=\"Buffering(Start)\">"	
	sHTML3 += "/*if (true == Start){ "
	sHTML3 += "parent.idI = window.setInterval(\"parent.UpdateDP()\", 1000);parent.tabcontent.document.getElementById('outline').style.display='none';parent.thumbs.document.getElementById('thumbs').style.display='none';"
	sHTML3 += "}"
	sHTML3 += "else{"
	sHTML3 += "window.clearInterval(parent.idI);"
	sHTML3 += "}*/"
	sHTML3 += "<\/SCRIPT>"		
	
	if (initPlayer==0 || FF1==true) { 
		window.frames['player'].document.open("text/html");
		sOut=sHTML1 + sWMP + sHTML2 + sHTML3; 
		window.frames['player'].document.write(sOut);
		window.frames['player'].document.close();	
		initPlayer=1;
	
	} else {  
		StartTime=Math.round(StartTime/1000);
		parent.frames['player'].document.MediaPlayer.Controls.CurrentPosition=StartTime;
		parent.frames['player'].document.MediaPlayer.Controls.Play();	
	}
	
	return false;
}

function UpdateDP(){ 
	x  = parent.tabcontent.document.getElementById("loading");
	if (parent.frames['player'].document.MediaPlayer.Network.downloadProgress==100) { 
		parent.ChangeTab('outline','keywords','search');
		parent.TabSelected(0);	
		parent.tabcontent.document.getElementById('loading').style.display="none";
		parent.thumbs.document.getElementById('thumbs').style.display="block";
		x.innerHTML="Donwload Complete." 
	} else { 
		//x.innerHTML = "<img src='loading.gif' />Download progress: " + parent.frames['player'].document.MediaPlayer.Network.downloadProgress + " percent complete";
		x.innerHTML = "Downloading media...  Progress: " + parent.frames['player'].document.MediaPlayer.Network.downloadProgress + " % complete";
	} 
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos) {
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=yes,toolbar=no,resizable=yes';
	win=window.open(mypage,myname,settings);
}

function SetCurrentSlide(sSeq){
	for (i=0;i<parent.oPres.SLIDES.length;i++) { 
		elem = parent.tabcontent.document.getElementById('row_' + parent.oPres.SLIDES[i].SlideSeq);
		elem1 = parent.thumbs.document.getElementById('trow_' + parent.oPres.SLIDES[i].SlideSeq);
		elem2 = parent.thumbs.document.getElementById('trow_' + parent.oPres.SLIDES[i].SlideSeq + 'a');
		elem3 = parent.thumbs.document.getElementById('trow_' + parent.oPres.SLIDES[i].SlideSeq + 'b');
		if (sSeq == parent.oPres.SLIDES[i].SlideSeq) { 			
			elem.className = 'current';
			elem1.className = 'current';
			elem2.className = 'current';
			elem3.className = 'current';			
			currSlideSeq=sSeq; 
		}  else { 
			elem.className = '';
			elem1.className = '';
			elem2.className = '';
			elem3.className = '';
		} 

	} 	
	parent.togDiv('nt' + currSlideSeq);
	
}
function togDiv(id) {
	if(currDivId) setDisplay(currDivId, "none");
	if(id) setDisplay(id, "block");
	currDivId = id;
}

function setDisplay(id,value) {
	var el = parent.tabcontent.document.getElementById(id);
	el.style.display = value;
}
