//functions to be executed on page load
$(function(){
						   
	//Open all links with rel="external" in new window
	$('a[rel="external"]').click( function() {
			window.open( $(this).attr('href') );
			return false;
    });
	
	//Clear value of input boxes
	$(function() {
		swapValues = [];
		$("#Header1_T_KEYWORDS,.m_input").each(function(i){
			swapValues[i] = $(this).val();
			$(this).focus(function(){
				if ($(this).val() == swapValues[i]) {
					$(this).val("");
				}
			}).blur(function(){
				if ($.trim($(this).val()) == "") {
					$(this).val(swapValues[i]);
				}
			});
		});
	});

	
	//Show Year
	var today = new Date;
  	var year = today.getFullYear();
	$('#year').html(year);
	
});

//functions to be executed inline
var mylib =
{
	showreel :
	{
		init : function()
		{
			$('#slideshow').cycle({ timeout: 6000, cleartype: 1, speed: 1100 });
			$('.slideTxt').css({'position':'absolute','right':'0'});
		}
	},
	printpage :
	{
		init : function()
		{
			//Print Menu
			$('#addprint').prepend('<div id="print"><a href="#print">Print this page</a></div>');
			$('#print a').click(function() {
				window.print();
				return false;
			});
		}
	},
	showreel2 :
	{
		init : function()
		{
			$('#slideshow2').cycle({ timeout: 6000, cleartype: 1, speed: 1100 });
		}
	}
}
