var show = new Array();
show['about']=0;
show['luge']=0;
show['team']=0;
show['news']=0;
show['events']=0;
show['involvement']=0;

var lastMenu = new Array();

function showMenu(object) {
	hideAll();
	lastMenu[object]=document.getElementById(object).src;
	document.getElementById(object).src=eval(object+"On.src");
	if (document.getElementById("dd_"+object)) {
 	show[object]=1;
  document.getElementById("dd_"+object).style.visibility="visible";
	}
}

function hideMenu(object) {
	if (show[object]==0) {
		if (lastMenu[object]) document.getElementById(object).src=lastMenu[object];
		if (document.getElementById("dd_"+object)) document.getElementById("dd_"+object).style.visibility="hidden";
	}
}

function preHide(object) {
 show[object]=0;
	if (document.getElementById("dd_"+object)) {
  setTimeout("hideMenu('"+object+"')",1000);
	} else
	 hideMenu(object);
}

function hideAll() {
	show['about']=0;
	show['luge']=0;
	show['team']=0;
	show['news']=0;
	show['events']=0;
	show['involvement']=0;
 hideMenu('about');
 hideMenu('luge');
 hideMenu('team');
 hideMenu('news');
 hideMenu('events');
 hideMenu('involvement');
}

function showVideo() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="320" height="282" id="2009-04-07-sponsorship-ctv"><param name="movie" value="../2009-04-07-sponsorship-ctv.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="../2009-04-07-sponsorship-ctv.swf" quality="high" wmode="transparent" width="320" height="282" name="2009-04-07-sponsorship-ctv" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>');
}

function checkEmail(email) {
 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.toLowerCase())) {
  return true;
 } else {
  return false;
 }
}

function isInt(myNum) {
 // get the modulus: if it's 0, then it's an integer
  var myMod = myNum % 1;
 if (myMod == 0) {
  return true;
 } else {
  return false;
 }
}

function urlEncode(sStr) {
 sStr = escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 return sStr;
}
