var $j = jQuery; // mootools conflict over "$" so use $j for jQuery on homepage (http://docs.jquery.com/Using_jQuery_with_Other_Libraries)

$j(document).ready(function(){
	$j('.text').each(function() {
		var text = 'keyword search';
		$j(this).css('color', '#666'); // this could be in the style sheet instead
		$j(this).focus(function() {
			if(this.value == text) {
				this.value = '';
				$j(this).css('color', '#333');
			} else {
				$j(this).select();
			}
		});
		$j(this).blur(function() {
			if(this.value == '') {
				$j(this).css('color', '#666');
				this.value = text;
			}
		});
	});
	
	//blog titles
	$j('#latest').innerfade({ animationtype: 'fade', speed: 1000, timeout: 4000, type: 'sequence', containerheight: '12px' }).show(); 
	//highlight left navigation items with a child selected
	$j('#left_navigation li').each(function() { if ($j(this).find('#current_nav_item').length) $j(this).children('a').addClass('on'); });
});


function changeLanguage(lang) {
	var expiry = new Date(new Date().getTime() + 28 * 24 * 60 * 60 * 1000); 
	if (lang != null && lang != "") { 
		document.cookie= "lang=" + escape(lang) + "; expires=" + expiry.toGMTString(); 
	} 
	document.location.reload();
}

