var t;
function shovSubMenu() {
  document.getElementById('subnavlist').style.display = "block";
}

function hideSubMenu() {
  t = setTimeout('hhideSubMenu()', 1000);
}

function hhideSubMenu() {
  document.getElementById('subnavlist').style.display = "none";
  clearTimeout(t);
}

function sshow() {
  clearTimeout(t);
  document.getElementById('subnavlist').style.display = "block";
}

function initNav() {  
	if($(currNav)) {
		$(currNav).down('a').addClassName('on');
		}

	if($(currSNav)) {
		$(currSNav).addClassName('on');
		}
	}

function initHome() {
	// Randomize main background image
	rand=Math.floor(Math.random()*3);
	$('homepage').style.backgroundImage = "url(/images/home" + rand + ".jpg)";
		}

function showFeature(id) {
	$('feature').replace("<div id='feature'>" + $(id).innerHTML + "</div>");
	new Effect.Appear('feature-wrap',{from:0.0, to: 1.0, duration: 1.5});
	$('learn-more').replace('<span id="learn-more"><a href="/services/' + id + '.php">Learn more in Services</a></span>')
	}

function hideIt(id) {
	new Effect.Fade(id,{from:1.0, to: 0.0, duration: 1.5});
	}	

var player;
function playerReady(obj) {
	player = document.getElementById(obj['id']);
};


function hideVideo() {
	player.sendEvent("STOP","true");
	hideIt('video-wrap');
	}	

function showVideo() {
	var so = new SWFObject('/_resources/player.swf','mpl','300','225','9');
	so.addParam('allowscriptaccess','always');
	so.addParam('allowfullscreen','false');
	so.addParam('flashvars','&file=/images/welcome.flv&controlbar=over&stretching=fill&autostart=true');
	so.write('mediaspace');
	$('video-wrap').style.display="block";
	}



	