$(function() {
	$('#tabs-popular > ul').tabs({ fx: { opacity: 'toggle' } });
	$('.main-content > .promotion-module > ul > li > p:even').css("height", "100px");	

	$('a.button > img').hover(
		function() {
			$(this).attr('src', function() {
				return this.src.replace(/_off/, '_on');
			});
		}, 
		function() {
			$(this).attr('src', function() {
				return this.src.replace(/_on/, '_off');
			});		
		}
	);	

	$('.close').hover(
		function() {
			$(this).attr('src', function() {
				return this.src.replace(/_off/, '_on');
			});
		}, 
		function() {
			$(this).attr('src', function() {
				return this.src.replace(/_on/, '_off');
			});		
		}
	);

	$('form > #searchInput').focus(
		function() {
			$(this).attr('value', function() {
				return (this.value == 'Search The Chronicle')? '' : this.value; 
			});
		}
	).blur(
		function() {
			$(this).attr('value', function() {
				return (this.value == '')? 'Search The Chronicle' : this.value;
			});
		}	
	);

	$('#jobsearch').focus(
		function() {
			$(this).attr('value', function() {
				return (this.value == 'Search Jobs')? '' : this.value; 
			});
		}
	).blur(
		function() {
			$(this).attr('value', function() {
				return (this.value == '')? 'Search Jobs' : this.value;
			});
		}	
	);
	
});

function btnOver(o){
 var img = o.getElementsByTagName('img')[0];
 var src = img.src.replace('_off', '_on');
 img.src = src;
}

function btnOut(o){
 var img = o.getElementsByTagName('img')[0];
 var src = img.src.replace('_on', '_off');
 img.src = src;
}

function mod_unescape (str)
{
	str = "" + str;
	while (true)
	{
		var i = str . indexOf ('+');
		if (i < 0)
			break;
		str = str . substring (0, i) + '%20' +
			str . substring (i + 1, str . length);
	}
	return unescape (str);
}

