$(function(){
	
	// Blinking Fields
	
	$('.blink').
        focus(function() {
            if(this.title==this.value) {
                this.value = '';
            }
        }).
        blur(function(){
            if(this.value=='') {
                this.value = this.title;
            }
        });
	
    // Other sites drop-down
    
	$('.other-sites').hover(
		function(){
			$(this).find('.dropMenu-sites').slideDown();
		},
		function(){
			$(this).find('.dropMenu-sites').stop(true, true).slideUp();
		}
	);
	
	// Login drop-down
    
	$('.global-login').hover(
		function(){ 
			$(this).find('#dropMenu-login').slideDown();
		},
		function(){
			$(this).find('#dropMenu-login').stop(true, true).slideUp();
		}
	);
	
	// Type Size
	var small_font = 11;
	var normal_font = 12;
	var big_font = 14;
	
	$('.type-size .size-1').click(
		function(){
			$('body').css('font-size', small_font + 'px');
			return false;	
		})
		
	$('.type-size .size-2').click(
		function(){
			$('body').css('font-size', normal_font + 'px');
			return false;	
		})
		
	$('.type-size .size-3').click(
		function(){
			$('body').css('font-size', big_font + 'px');
			return false;	
		})
		
	// Search Functionality
	$('#searchText').keypress(function(e){
		
		if(e.which == 13){
			$('#searchButton').click();									
		}
	});	
	
	$('#searchButton').click(function() {  										
		if($('#searchText').val())
		{
			
			var baseURL  = "Results.aspx?k="+$('#searchText').val();
			// window.location.replace(window.location.protocol + "//" + window.location.host + "/searchcenter/Pages/" + baseURL );
			window.location.replace(window.location.protocol + "//" + window.location.host + "/search/" + baseURL );
		}
	});

	// Hook up the print link.

        $( "a.print" )
	.attr( "href", "javascript:void( 0 )" )
	.click(
	function(){
	
	// Print the DIV.

	$("#printable").jqprint({ importCSS: true });

	// Cancel click event.

        return( false );
	});
	

})
