// JavaScript Document

/////////////////////////////////
//	Function: Initialise UI
/////////////////////////////////
$(document).ready(function() {
  inputFillInText($('form[name="newsletter"] input[name="email"]') ,"Enter your email address");
  inputFillInText($('#search_txt') ,"Your query here");
  inputFillInText($('#postcode_txt') ,"Enter your Postcode");
});



// sets up a fillin text input - eg: search boxes where text "Enter your search query here" is inserted when nothing is contained in field.
function inputFillInText(input,fillin_str) {

	$(input).attr('value', fillin_str);
	$(input).data("fillin_str", fillin_str);
	$(input).focus( function() {
		if ($(this).attr('value') == $(this).data("fillin_str") ) {
			$(this).attr('value', '');
		}
	});

	$(input).blur( function() {
		if ($(this).attr('value') == "") {
			$(this).attr('value', $(this).data("fillin_str"));
		}
	});

}


/////////////////////////////////
//	footer Links slider
/////////////////////////////////

$(function(){
        
        
    	$("#location_links").hide(function(){
    	})
    	
        $("#locationTitle").click(function (event) {
			event.preventDefault();
			
			$("html, body").animate({ scrollTop: $(document).height() }, "fast");

			
			$(this).toggleClass("locationTitle_expanded");

        	$("#location_links").slideToggle("fast",function (){
        	});
        	

        });
        
                
	});
