// JavaScript Document

function checkIE(){
	if (isIE()) {
		document.getElementById('fadePic').style.top = '5px';
		document.getElementById('tempPic').style.top = '5px';
		document.getElementById('welcomeTitle').style.fontSize = '23px';
	}
	return
}	

function isIE()  {
	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}



function FlipFlop(thisOne, thatOne, TB, IO)
{
	document.getElementById(thisOne).src = 'images/' + thatOne;
	if (isIE()) {
		return
	}
	else {
		if (TB == "top") {
			if (IO == "in") 
				document.getElementById("headerWrapper").style.borderTopColor = '#B68E2E;';
			if (IO == "out") 
				document.getElementById("headerWrapper").style.borderTopColor = '#969697;';
		}
		if (TB == "bot") {
			if (IO == "in") 
				document.getElementById("headerWrapper").style.borderBottomColor = '#B68E2E;';
			if (IO == "out") 
				document.getElementById("headerWrapper").style.borderBottomColor = '#969697;';
		}
	}
}

function tabOn(thisOne, thatOne)
{
	document.getElementById(thisOne).src = 'images/header/' + thatOne;
	document.getElementById('header').style.borderBottomColor = '#B68E2E;';
}

function tabOff(thisOne, thatOne)
{
	document.getElementById(thisOne).src = 'images/header/' + thatOne;
	document.getElementById('header').style.borderBottomColor = '#969697;';
}

/* Maybe some day
function goMedia()
{
	var mediaDiv = document.createElement('div');
  	mediaDiv.setAttribute('id','mediaTest');
	document.getElementById('mediaFade').style.visibility = 'visible';
	fadeIn('mediaFade', 0);
}
*/

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/99.99;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/99.99;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
    }
	else	window.location.href = "media/index.html";
  }
}

