

//css
/*if(typeof fdc_nocss == 'undefined') {
	if (navigator.appName.indexOf("Netscape") != -1) {
		document.write ('<LINK REL="STYLESHEET" TYPE="text/css" HREF="style_ns.css">');
	} else {
		document.write ('<LINK REL="STYLESHEET" TYPE="text/css" HREF="style_ie.css">');
	}
}*/

var pageArr = new Array('home','job_seekers','employers','news');


/*var pageURLArr = new Array('/home','/my_space/','/search_jobs/','/my_account/');*/
	




//page
if ((typeof viewpage == "undefined") || (viewpage == "")) {
	if ((typeof CurrentPage != "undefined") && (CurrentPage != "")) {
		if (CurrentPage == 'home')  CurrentPage = 'home';
		viewpage = CurrentPage;
	}
	else {
		var pageIndex = this.location.href.indexOf('viewpage=');
		if (pageIndex == -1) viewpage = 'home';
		else {
			viewpage =  this.location.href.substr(pageIndex+8);
			var pageEnd = viewpage.indexOf('&');
			if (pageEnd>-1) viewpage = viewpage.substr(0,pageEnd);
		}
	}
}

count=0;
for (i=0;i<pageArr.length;i++) {
	if(pageArr[i] == viewpage) {
		break;
	}
	count++;
}







var homeArr = new Array();

var job_seekersArr = new Array();
var employersArr = new Array();
var newsArr = new Array();


var hTimer;
var vTimer;
var thisSection;
var htimer = 0;
var lastSection;
var thisAdDiv;
var vSection;

homeArr[0] = new Array("");

job_seekersArr[0] = new Array("My CVs","my_cvs.php");
job_seekersArr[1] = new Array("Post a CV","post_cv.php");
job_seekersArr[2] = new Array("Saved Searches","saved_searches.php");
job_seekersArr[3] = new Array("Saved Jobs","saved_jobs.php");

employersArr[0] = new Array("My Jobs","my_jobs.php");
employersArr[1] = new Array("Post a Job","post_job.php");
employersArr[2] = new Array("CV Folders","cv_folders.php");
employersArr[3] = new Array("Saved Searches","emp_saved_searches.php");
employersArr[4] = new Array("Post a Banner","post_banner.php");



newsArr[0] = new Array("");


var hiColor = '#000000';
var loColor ='#ffffff';
var lastColor;
var userIni = 0;
var displayedSectionVar;





function showHMenu(page) 
{

	
	keepMenu();
	hideVMenu();
	hover(page);
	if ((typeof curPage == 'undefined') || (page != curPage) || (page == viewpage)) {
		curPage = page;
		hideVMenu();
		thisChannArr = eval(page+'Arr');
		thisChannStr = "";
		thisWidth = 0;
		thisChannX = document.getElementById(page).offsetParent.offsetLeft;
		thisChannWidth = document.getElementById(page).offsetWidth;
		if (navigator.appName == 'Microsoft Internet Explorer') thisChannWidth += 8;
		for(i=0;i<thisChannArr.length;i++) {
			if ((typeof displayedSectionVar != "undefined") && (page + i == displayedSectionVar)) thisHC = "hirizItem";
			else thisHC = "horizItem";
			thisChannStr += '<span id="'+page+i+'"onMouseOver="showVMenu(\''+page+i+'\')" onMouseOut="hideMenu()" class="' + thisHC + '" onMouseUp="javascript:go_url(\''+thisChannArr[i][1]+'\')">'+thisChannArr[i][0]+'<\/span>';
		}
	
		document.getElementById('hRO').innerHTML = thisChannStr;
	
		for(i=0;i<thisChannArr.length;i++) {
			thisWidth += document.getElementById(page+i).offsetWidth;
		}
		thisPadding = (500 - thisWidth)/2;
		if (500-thisChannX>=thisWidth) thisPadding = thisChannX;
		else if (thisChannX+thisChannWidth>=thisWidth) thisPadding = thisChannX + thisChannWidth - thisWidth -6;
		if (thisPadding<0) thisPadding = 0;
	
	
		document.getElementById('hRO').style.width = "500px";
		document.getElementById('hRO').style.paddingLeft = thisPadding+"px";
		
		if (document.getElementById('hRO').offsetWidth > 500) {
			document.getElementById('hRO').style.width = (500 - thisPadding)+"px";
		}

		if(page != viewpage) {
			for(i=0;i<pageArr.length;i++) {
				thisPage = pageArr[i];
				if(thisPage != viewpage) {
					document.getElementById(thisPage).style.backgroundColor = 'transparent';
					document.getElementById(thisPage).style.color = '#ffffff';
				}
			}
			document.getElementById(page).style.backgroundColor = '#2C95B5';
			document.getElementById(page).style.color = '#000000';
			document.getElementById(viewpage).style.backgroundColor = 'transparent';
			document.getElementById(viewpage).style.color = loColor;
			lastColor = loColor;
			
		} else {
			for(i=0;i<pageArr.length;i++) {
				thisPage = pageArr[i];
				if(thisPage != viewpage) {
					document.getElementById(thisPage).style.backgroundColor = 'transparent';
				}
			}
			document.getElementById(viewpage).style.backgroundColor = '#2C95B5';
			if (!userIni) document.getElementById(viewpage).style.color = hiColor;
			lastColor = hiColor;
			showSection();
		}
	}
	userIni=0;
}

function go_url(URL) {
	this.location.href=URL;
}
function hover(page) {
	document.getElementById(page).style.color = "#000000";
}
function hideHMenu() {
	document.getElementById('hRO').innerHTML = "";
	document.getElementById('hRO').style.width = 500+"px";
	showHMenu(viewpage);
	showAd();
}
function hideVMenu() {
	if ((typeof thisSection != "undefined") && (document.getElementById(thisSection))) {
		if((typeof displayedSectionVar != "undefined") && (displayedSectionVar == thisSection)) document.getElementById(thisSection).style.color = hiColor;
		else document.getElementById(thisSection).style.color = "#ffffff";
	}
	if ((typeof vSection != "undefined") && (document.getElementById(vSection))) document.getElementById(vSection).style.backgroundColor = 'transparent';
	if (lastSection) lastSection = "";
	document.getElementById('vRO').innerHTML = "";
	document.getElementById('vRO').style.display = 'none';
}
function hideMenu() {
	if ((typeof thisSection != "undefined") && (document.getElementById(thisSection))) {
		if((typeof displayedSectionVar != "undefined") && (displayedSectionVar == thisSection)) document.getElementById(thisSection).style.color = hiColor;
		else document.getElementById(thisSection).style.color = "#ffffff";
	}
	for(i=0;i<pageArr.length;i++) {
		thisPage = pageArr[i];
		if (thisPage != viewpage) document.getElementById(thisPage).style.color = '#ffffff';
		else document.getElementById(thisPage).style.color = lastColor;
	}
	hTimer = setTimeout('hideHMenu()',1000);
}
function showVMenu(section) {
	keepMenu();
	hideVMenu();
	document.getElementById(section).style.color ="#000000";
	
	thisSection = section;
	showMenu(section);
}
function keepMenu() {
	if (hTimer) clearTimeout(hTimer);
	if (vTimer) clearTimeout(vTimer);
}





