/**
 * 
 * Copyright(c) 2008, VSA Partners, Inc.
 * http://www.vsapartners.com 
 * 
 * @author Ry Racherbaumer (rracherbaumer@vsapartners.com)
 * @version 1.0
 * 
 */

function closeAGvideo(){
	$('#ltrflash').html('').hide();
}

function loadLetterVideo(){
	var so = new SWFObject("../bin/pg_video_player_LetterToShareholders.swf", "c", "578", "447", "8", "#FFFFFF");
	so.useExpressInstall("expressinstall.swf");
	so.addParam('allowScriptAccess', 'always');
	so.addParam("allowFullScreen", "true");
	so.addParam("menu", "false");
	//so.addVariable();
	$('#ltrflash').fadeIn(500, function(){
		so.write("ltrflash");
	});
}

$(document).ready(function() {
	//open new window
	$('a.external-link').click(function() {
		window.open(this.href);
		return false;
	});
	//open layer with FEI video on letter page
	$('a.letter-video-launch').click(function() {
		loadLetterVideo();
		return false;
	});
	
	$('#header .nav ul.pgmenu').pgmenu({easing:'easeOutCubic',delay:1000});
	$('#header .tools ul li.downloads,#header .tools ul li.previousreports').hover(
		function(){$(this).addClass('hover');},
		function(){$(this).removeClass('hover');}
	);
	
	$('#header .previousreports').hover(function() {
			$(this).children('ul').removeClass('move_');
		}, 
		function() {
			$(this).children('ul').addClass('move_');
	});
	
	$('#header .downloads').hover(function() {
			$(this).children('.downloadslist').removeClass('move_');
		}, 
		function() {
			$(this).children('.downloadslist').addClass('move_');
	});
	
	$('#header li.previousreports a:first, #header li.downloads a:first').click(function(e){
		e.preventDefault();
	});
	
	//$('.defining-link').click(function(e){
	//	e.preventDefault();
	//	window.location.hash = '#/defining/';
	//});
	
	$('table.financial').not('.nohover_').thover();
	$('table.financial tbody tr td.totalpop').boxer({
		positionAlign: 'bottom',
		targetEvent: 'hover',
		boxStyle: {
			top:-216,
			left:-25,
			width:90,
			height:236,
			background:'#fff',
			border:'1px solid #ccc'
		},
		boxClass: 'popcontent',
		boxContent: '<div class="title">Total Comprehensive Income</div>'+
					'<div style="padding:9px 0 10px 0;">&nbsp;</div>'+
					'<div style="padding:3px 0;border-bottom:1px solid #ccc;margin:0 3px;padding-right:3px">6,923</div>'+
					'<div style="padding:3px 0 4px 0;border-bottom:1px solid #ccc;margin:0 3px">&nbsp;</div>'+
					'<div style="padding:3px 0 4px 0;border-bottom:1px solid #ccc;margin:0 3px;padding-right:3px">118</div>'+
					'<div style="padding:14px 0 4px 0;border-bottom:1px solid #ccc;margin:0 3px;padding-right:3px">135</div>'+
					'<div style="padding:3px 0;border-bottom:1px solid #ccc;margin:0 3px;padding-right:3px">(274)</div>'+
					'<div style="padding:4px 0 3px 0;border-bottom:2px solid #ccc;margin:0 3px;padding-right:3px;font-weight:bold;color:#0046ad">6,902</div>',
		shadow: true,
		shadowColor:'#ccc'
	});

});
