
/******************/
/* START - JQUERY */
/******************/

/* Initiate JQuery for page */
$(document).ready( function () {
							
	/* Place HOVER on LHS Menu */
	$("#main #left_menu dt").hover(
		function(){
			if ( $("a",this).size()  ) {
				$(this).addClass("hover");		
				$("a",this).addClass("hover");		
			}	
		},
		function(){
			if ( $("a",this).size()  ) {
				$(this).removeClass("hover");		
				$("a",this).removeClass("hover");		
			}																	
		}
	);
	
	/* Place CLICK on LHS Menu */
	$("#main #left_menu dt").click(
		function(){
		 	if ( $("a",this).size()  && $("a",this).attr("href").search("http://") == -1) {
				document.location.href = $("a",this).attr("href");				
			}
		}
	);
	
	/**********************/
	/* START - Search box */
	/**********************/
	// SEARCH box - display default text, remove when input field has the focus
	// TOP LHS SEARCH BOX
	var cSEARCH_DEFAULT_TEXT = "Search...";
	
	$("#searchFieldLeft").focus
	(
		function()
		{
		 	if ($(this).attr("value") == cSEARCH_DEFAULT_TEXT)
		 	{
				$(this).attr("value","");
			}
		}
	);
	
	$("#searchFieldLeft").blur
	(
		function()
		{
		 	if (!$(this).attr("value"))
		 	{
				$(this).attr("value",cSEARCH_DEFAULT_TEXT);
			}
		}
	);
	// RHS CONTENT SEARCH BOX
	$("#searchFieldRight").focus
	(
		function()
		{
		 	if ($(this).attr("value") == cSEARCH_DEFAULT_TEXT)
		 	{
				$(this).attr("value","");
			}
		}
	);
	
	$("#searchFieldRight").blur
	(
		function()
		{
		 	if (!$(this).attr("value"))
		 	{
				$(this).attr("value",cSEARCH_DEFAULT_TEXT);
			}
		}
	);
	
	// SEARCH paging buttons - add hover effect
	$(".SearchSummaryBottom .SearchSummaryBottomItem").hover(
		function(){
			if ( $("a",this).size()  ) {
				$(this).addClass("hover");		
				$("a",this).addClass("hover");		
			}
		},
		function(){
			if ( $("a",this).size()  ) {
				$(this).removeClass("hover");		
				$("a",this).removeClass("hover");		
			}									
		}
	); 
	
	// Make whole button clickable
	$(".SearchSummaryBottom .SearchSummaryBottomItem").click(
		function(){
		 	if ( $("a",this).size()  && $("a",this).attr("href").search("http://") == -1) {
				document.location.href = $("a",this).attr("href");		
			}
		}
	);
	
	// Remove UNDERLINE and ADD CURSOR = HAND on paging links if JQuery is active
	$(".SearchSummaryBottom .SearchSummaryBottomItem").css("cursor","pointer").css("text-decoration","none");
	// Remove CURSOR = HAND on currently selected page link
	$(".SearchSummaryBottom .selected").css("cursor","default");
	
	
	/********************/
	/* END - Search box */
	/********************/
	
	/* HOME PAGE NEWS ITEMS */
	$("#main #content #right_frame .rightFrameContent ul li").hover(
		function(){
			$(this).addClass("hover");			
		},
		function(){
			$(this).removeClass("hover");											
		}
	);
/*	$("#main #content #right_frame .rightFrameContent ul li").click(
		function(){
			document.location.href = $("a",this).attr("href");													
		}
	);
*/
} ) ;

/****************/
/* END - JQUERY */
/****************/

/*///////////////////////////////////////////////////////////////////
Function to send a mail with the link to the current page
///////////////////////////////////////////////////////////////////*/
function fnMailAFriend (){
	var SubjectLine=top.document.title; 
	var BodyText='The sender of this link has forwarded the url because of your interest in Values Centred Schools:\n\n'+top.document.location.href;
	
	var Message='<A HREF="mailto:?SUBJECT='+escape(SubjectLine)+'&BODY='+escape(BodyText)+'" class="email">Email page<\/A>';
	
	document.write(Message); 
	}
	
