$(document).ready(function() {

	/**
	 * Nav roll overs
	**/
	$('#nav li a').hover(
		function()
		{
			$(this).parent().css('background', 'url(Images/nav-hover2.png) repeat-x');
		},
		function()
		{
			if($(this).parent().attr('class')!='on')
			{
				$(this).parent().css('background', 'none');
			}
		}
	);

	/**
	 * Second level nav roll overs
	**/
	$('#nav-second-level li a').hover(
		function()
		{
			if($(this).parent().attr('class')!='on')
			{
				$(this).parent().css('background', 'url(Images/nav-second-level-hover.jpg) no-repeat');
				$(this).css('color', 'fff');
			}
		},
		function()
		{
			if($(this).parent().attr('class')=='on')
			{
				$(this).parent().css('background', 'url(Images/nav-second-level-on.jpg) no-repeat');
			}
			else
			{
				$(this).parent().css('background', 'url(Images/nav-second-level-off.jpg) no-repeat');
				$(this).css('color', '6e6e74');				
			}
		}		
	);
	
	
	$('#form-name').click(
		function()
		{
			if($(this).val()=='Name')
			{
				$(this).val('');
			}
		}
	);
	
	$('#form-email').click(
		function()
		{
			if($(this).val()=='Email')
			{
				$(this).val('');
			}
		}
	);
	
	$('#form-name').blur(
		function()
		{
			if($(this).val()=='')
			{
				$(this).val('Name');
			}
		}
   );

	$('#form-email').blur(
		function()
		{
			if($(this).val()=='')
			{
				$(this).val('Email');
			}
		}
   );

	/**
	 * Get rid of cellpading, border and cellspacing on tables (for all, but intented for tables added through wysiwig)
	 */
	$('table').each(
		function()
		{
			$(this).attr('cellpadding', 0);
			$(this).attr('cellspacing', 0);
			$(this).attr('border', 0);
		}
	);	
});