/** RedLaw website
 * 
 *  Studio Output (www.studio-output.com)
 *  Developer: Gurhan Mermer (gurhan@ppfn.co)
 * 
**/

/* ### TOP MENU PICKER ### */
function placeMenuTicker() {
	var appPath = window.location.pathname.split('/');
	
	appPath.shift();
	if (!appPath[appPath.length - 1]) appPath.pop();
	
	if (appPath[0] === undefined) appPath[0] = 'home';
	
	if ($('m' +appPath[0])) {	
		$('menuPicker').style.display = 'block';
		$('menuPicker').style.left = parseInt(fPos($('m' +appPath[0]))[0] + ($('m' +appPath[0]).offsetWidth / 2) - 6) +'px';
	}
}

placeMenuTicker();

/* ### INPUT BOX EVENTS ### */
function boxFocus(iO, pText) {
	iO.className = 'focus';
	if (iO.value === pText)
		iO.value = '';
}

function boxBlur(iO, pText) {
	if (!iO.value) {
	    iO.className = 'blur';
	    iO.value = pText;
	}
}


if ($('jobsSearchBox')) {
	var jobsSearchText = 'Search and find the job for you';
	if ($('jobsSearchBox').value.length)
		$('jobsSearchBox').className = 'focus';
	else
		$('jobsSearchBox').value = jobsSearchText;
	$('jobsSearchBox').onfocus = function() { boxFocus(this, jobsSearchText); };
	$('jobsSearchBox').onblur  = function() { boxBlur(this, jobsSearchText); };
	$('podPerPage').onchange  = function() { createCookie(this.id, this.value, 1500); window.location.reload(); };
	$('podPerPageBottom').onchange  = function() { createCookie('podPerPage', this.value, 1500); window.location.reload(); };
}


