function initSplash(){
  try{
    if(getElement("splash")){
	    setTimeout("fadeSplash();",2000);
  	  setTimeout("hideSplash();",3000);
  	}
  }catch(e){
    alert(e.message);
  }
}
function hideSplash(){
  try{
   	var splash=getElement("splash");
    splash.style.display="none";
  }catch(e){
    alert(e.message);
  }
}
function fadeSplash(){
  try{
   	var splash=getElement("splash");
   	splash.anim=new Animator({duration: 1000}).addSubject(new NumericalStyleSubject(splash, 'opacity', 1, 0));
   	splash.anim.play();
  }catch(e){
    alert(e.message);
  }
}


addEvent(window,"load",initSplash);


function mainMenuClick(url){
  try{
    var menu=getElement("menu");
    menu.anim=new Animator({duration: 500})
			.addSubject(new NumericalStyleSubject(menu, 'left', menu.offsetLeft+133, 6+133));
    menu.anim.play();
    navigateURL=url;
    var wtf =getElement("wtf");
    wtf.style.display="block";

    var logo=getElement("logo");
    setOpacity(logo,0);
    logo.style.display="block";
   	logo.anim=new Animator({duration: 500}).addSubject(new NumericalStyleSubject(logo, 'opacity', 0, 1));
    logo.anim.play();

    setTimeout("mainMenuNavigate();",500);
    return false;
  }catch(e){
    alert(e.message);
  }
}

function mainMenuNavigate(){
  try{
    document.location=navigateURL;
  }catch(e){
    alert(e.message);
  }
}
