window.onload = function ()
{
	if(typeof flowplayer == "function")
		addFlowPlayerVideos();
	if (typeof $.fn.lightBox == "function")
		addLightBox();
	if (typeof addCodeFrameEvents == "function")
		addCodeFrameEvents();
	if (typeof setBlogAdminActions == "function")
		setBlogAdminActions();
	addInputHighlights();
};

addFlowPlayerVideos = function ()
{
	//adds flow player video to each anchor with the flowPlayer class
	$("a.flowPlayer").each(function(i)
		{
			//demo reel is the only video which auto buffers
			if(this.href.indexOf("DemoReel3.mp4") > 0)
			{
				autoBuffer = true;
				this.innerHTML = "";
			}
			else
				autoBuffer = false;
				
			//add flow player
			flowplayer(this.id, "/swf/flowplayer-3.1.1.swf", { 
			    clip:
				{
					autoPlay: true,  
					autoBuffering: autoBuffer,
					scaling: 'fit'
			    } 
			});
		}
	)
};

//adds the light box image view
addLightBox = function ()
{
	$('.imageLink').lightBox();
}


addInputHighlights = function ()
{
	$('input.highlite,textarea.highlite').focus(function () {
	
         $(this).css("border-width", "2px");
		 $(this).css("margin", "4px");
		 $(this).css("margin-left", "0");
	});
	$('input.highlite,textarea.highlite').blur(function () {
	
         $(this).css("border-width", "1px");
		 $(this).css("margin", "5px");
		 $(this).css("margin-left", "1px");
	});
}