// JavaScript Document
$(document).ready(function() { 
	
	// add hover class to element
	$(".addhover").hover(
	  function () {
		$(this).addClass("hover");
	  },
	  function () {
		$(this).removeClass("hover");
	  }
	);
	
	// add corners for IE
	if ($('blockquote').length != 0){
		if ($.browser.msie && $.browser.version.substr(0,1)<9) { 
			$('blockquote').prepend('<b class="tl cnr"></b><b class="tr cnr"></b><b class="bl cnr"></b><b class="br cnr"></b>');
		}
	} 
	// set value on newsletter text input
	$('#email_subscribe').focus(function(){
		$(this).attr('value', '')	
	});
	$('#email_subscribe').blur(function(){
		if ( $(this).attr('value') == ''){
			$(this).attr('value', 'Your email address');
		}	
	});
	
	//add default search text if it is empty
	if( $("#search-text").attr("value") == "" ){
		$("#search-text").attr("value", "Search");
	}
		
	//remove default search text
	$("#search-text").focus(function(){
		if( $(this).attr("value") == "Search" ){
			$(this).attr("value", "");
		}
	});

	//check search text before submitting
	$(".submit-search-button").click(function(){			
		if( $("#search-text").attr("value") == "Search" ){
			$("#search-text").attr("value", "");
		}
	});	
	
	//homepage newsletter modal
	var triggers = $(".modalInput").overlay({
	
		// some mask tweaks suitable for modal dialogs
		mask: {
			color: '#999',
			loadSpeed: 200,
			opacity: 0.9
		},
	
		closeOnClick: false
	});
	
});

