// JavaScript Document

var currentItem = '';

function showSubNav(subNavItem) {
	thisItem = document.getElementById(subNavItem);
	thisItem.style.visibility = 'visible';
	currentItem = subNavItem;
	jQuery(document).ready(function(){
	jQuery(".subNavItem").fadeIn("slow");});
}

function hideSubNav() {
	thisItem = document.getElementById(currentItem);
	
	jQuery(document).ready(function(){
	jQuery(".subNavItem").fadeOut("slow");});
}

function fadeIn() {
	//alert("fadeIn");
	jQuery(document).ready(function(){
	jQuery(".subNavItem").fadeIn("slow");});	
}

function slowHide(subNavItem) {
	setTimeout(hideSubNav,5000);	
}

function fadeInTimer() {
	//alert("fadeInTime");
	setTimeout(fadeIn,1000);	
}

function popSubNav(subNavItem) {
	thisItem = document.getElementById(subNavItem);
	thisItem.style.visibility = 'visible';
	thisItem.style.display = 'inline';
	currentItem = subNavItem;
	
}

function init() {
	//popSubNav('nav5')
}

function expand(job) {
	//expand jobs
	count = document.getElementById('jobcount').value;
	for(i=1; i<count; i++) {
		tempObj = 'jobb' + i;
		//alert(tempObj);
		closeObj = document.getElementById(tempObj);
		closeObj.style.display = 'none';
	}
	
	//window.scroll(0,0);
	
	openObj = document.getElementById(job);
	openObj.style.display = 'inline';
	ofset = openObj.offsetTop;
	ofset = ofset + 190;
	window.scroll(0,ofset);
	//alert(ofset);


}
