function ahah(url, target) {
  document.getElementById(target).innerHTML = ' Fetching data...';
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.send("");
  }
}  

function ahahDone(url, target) {
  if (req.readyState == 4) { // only if req is "loaded"
    if (req.status == 200) { // only if "OK"
      document.getElementById(target).innerHTML = req.responseText;
    } else {
      document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
    }
  }
}

function load(name, div) {
	ahah(name,div);
	return false;
}

// JavaScript Document
function fLoadFile(vPath,vMedia){
     //var sendText = inputValue.vars.value
	 var sendPath = vPath;
	 var vType = vMedia;
	 if (vType=="video"){
        window.document.mediaplayer.SetVariable("vVideoPath", sendPath);
     }
	 if (vType=="pic"){
	    window.document.mediaplayer.SetVariable("vPicturePath", sendPath);
		window.document.href='#top';
		window.location='#top';
	 }
	
	 clearTimeout(navTimeoutID);
}
  
  function fLoadPage(val){
  switch (val) {
   case 'home': window.document.location.href = '../'; break;
   case 'diary': window.document.location.href = '../diary/'; break;
   case 'dates': window.document.location.href = '../dates/'; break;
   case 'freebies':  break;
   case 'biog': window.document.location.href = '../biog/'; break;
   default: window.document.location.href = '../';
  }
}

 function callJavascript(){
     //var sendText = "freebies";
     //window.document.myMovie.SetVariable("navValue", sendText);
	 clearTimeout(navTimeoutID);
	 
	 showHide('mymenu1'); 
	 //fLoadFile('ac_football_01.flv','video');
  }
  function fStartTimer(){
    navTimeoutID = setTimeout ( "callJavascript()", 100 );
  }
  function fOnLoad(){
	//fStartTimer(); 
  }
  
menu_status = new Array();
var last_expanded = '';

function showHide(id){
 if (id != last_expanded) {
  var obj = document.getElementById(id);
  var status = obj.className;
 
  if (status == 'hide') {
    
	 if (last_expanded != '') {
      var last_obj = document.getElementById(last_expanded);
      last_obj.className = 'hide';
     }
    obj.className = 'show';
    last_expanded = id;
	
  } else {
    obj.className = 'hide';
  }
 }
}
