var myVideo = '';
$(document).ready( function(){
		
		
// Home page script
	
	//flash a-feature on home page settings
	var flashvars = {};
	var params = {};
	var attributes = {};
	params.wmode = "opaque";
	params.base = ".";
	attributes.id = "a_feature";
	swfobject.embedSWF("/lib/swf/afeature.swf", "a_feature", "960", "475", "9.0.0", false, flashvars, params, attributes);
	
	$(document).pngFix();
	// end home page script
	
	/* add .last to final left nav item */
	$("#leftNav ul li:last").addClass("last");



	//videoplayer on content pages
	if($("#videoplayer").length  >0){

		if (videoFlashVars == "/lib/swf/videoplayer/settings_campaign.xml") {
			flashvars = {
				file: myVideo,
				plugins: "gapro-1",
				autostart: "true",
				"gapro.accountid": "UA-872605-1",
				"viral.callout": "none",
				"viral.onpause": "false"
			};
			params = {
				wmode: 'opaque',
				menu: 'false',
				allowscriptaccess: 'always',
				allowFullScreen: 'true'
			};
			attributes = {};
			if (myVideo) {
				$('.videoWrapper').css('height', '500px');
				swfobject.embedSWF("/lib/swf/player.swf", "videoplayer", "880", "516", "9.0.115.0", "", flashvars, params, attributes);
			}
		} else {
			var flashvars = {};
			var params = {};
			var attributes = {};
			params.bgcolor = "#f0f3f1";
			params.wmode = "opaque";
			params.base = ".";
			flashvars.settingsXML = videoFlashVars;
			attributes.id = "videoplayer";

		    swfobject.embedSWF("/lib/swf/videoplayer/videoplayer.swf", "videoplayer", "880", "300", "9.0.0", false, flashvars, params, attributes);
		}
		
	}
	
 // Font resizing - using jQuery plugin jquery.cookie.js
	// Reset Font Size
	var originalFontSize = $('html').css('font-size');
	var $bt_fontSize = "bt-FontSize";
	// if exists load saved value
	if ($.cookie($bt_fontSize)) {
		var $getSize = $.cookie($bt_fontSize);
		$("html").css({
			fontSize: $getSize + ($getSize.indexOf("px") != -1 ? "" : "px")
		}); // IE fix for double "pxpx" error
	}
	$(".resetFont").click(function() {
		$('html').css('font-size', originalFontSize); //reset to original size of HTML - 16px
		$.cookie($bt_fontSize, '', {
			expires: -1
		}); // delete cookie
		return false;
	});
	// Increase Font Size
	$(".increaseFont").click(function() {
		//alert($.cookie('bt-FontSize'));
		if ('18' > $.cookie($bt_fontSize) || $.cookie($bt_fontSize) == null) {
			var currentFontSize = $('html').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum + 1; //1px increase up to 20px
			$('html').css('font-size', newFontSize);
			$.cookie($bt_fontSize, newFontSize);
		}
		return false;
	});
	// Decrease Font Size
	$(".decreaseFont").click(function() {
		//alert($.cookie('bt-FontSize'));
		if ('14' < $.cookie($bt_fontSize) || $.cookie($bt_fontSize) == null) {
			var currentFontSize = $('html').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum - 1; //1px decrease down to 14px
			$('html').css('font-size', newFontSize);
			$.cookie($bt_fontSize, newFontSize);
		}
		return false;
	});
	

	// print button
	$(".printBtn").click( function(){
		window.print();
		return false;
	});
	
	// CTA menu - prototype only
	$(".ctaSubmit").click( function (){
		location.href = "?id=" + $(".ctaSelect option:selected").val();
		return false;
	});
	
     //jQuery solution for megamenu hovering class switch
     $("li.AspNet-Menu-WithChildren").mouseover(function() {
         $(this).addClass("hovering");
     });
     $("li.AspNet-Menu-WithChildren").mouseout(function() {
         $(this).removeClass("hovering");
     });
	

});


