$(document).ready(function() {
	
	
	//add a pint page link
	$('#midCol').append('<p class="print"><a href="javascript:window.print();" title="Print this page"><img src="/wp-content/themes/tressimple/images/design/icon-print.gif" alt="" /> Print this page</a></p>');
	
	//insert banner ul
	$('.banner').replaceWith('<ul id="banner"><li><img src="/wp-content/themes/tressimple/images/design/banner1.jpg" alt="More than 60% of Britons have a library card" /></li> <li><img src="/wp-content/themes/tressimple/images/design/banner2.jpg" alt="There are more than 92 million books in UK libraries" /></li> <li><img src="/wp-content/themes/tressimple/images/design/banner3.jpg" alt="Libraries support formal and informal learning for people of all ages" /></li>	<li><img src="/wp-content/themes/tressimple/images/design/banner4.jpg" alt="Knowledge is free at libraries" /></li> </ul>')
	   
   	//hompage rotating banner 
   	$('#banner').innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '284px' }); 
	
	//hide content and add links to toggle
	$('.expand').next().hide();
	
	$('.expand').wrapInner('<a href="#non"></a>');  
	
	$('.expand a').click(function() {
		$(this).parent().next('div').slideToggle();
	});
	
	
	//search keyword value
	var searchTxt = "Search";
	$('#fSearch').attr("value",searchTxt);
	$('#fSearch').focus(function () {
         $(this).attr("value","");
    });
	$('#fSearch').blur(function () {
		if ($(this).attr("value") == "") {
			$(this).attr("value", searchTxt);
		}
    });
	//username value
	var userTxt = $('#fUser').attr("value");
	$('#fUser').attr("value",userTxt);
	$('#fUser').focus(function () {
         $(this).attr("value","");
    });
	$('#fUser').blur(function () {
		if ($(this).attr("value") == "") {
			$(this).attr("value", userTxt);
		}
    });
	//username value
	var passTxt = $('#fPass').attr("value");
	$('#fPass').attr("value",passTxt);
    
	$('#fPass').focus(function () {
         $(this).attr("value","");
    });
	$('#fPass').blur(function () {
		if ($(this).attr("value") == "") {
			$(this).attr("value", passTxt);
		}
    });
});
