function tabClicked( tabControl, tab, event )
{
    if (tab.cmd == "zionvier")
    {
      var ajax = new Ajax("getSite","site=http://www.zionvier.com");
      ajax.doGet('ZionVier');
    }
    if(tab.cmd == "wwwwami")
    {
        
    }
    if(tab.cmd == "contact")
    {
      var ajaxPhp = new Ajax("views/contactInfo.php", null);
      ajaxPhp.doSimpleGet("ContactInfo");
    }
    if(tab.cmd == "secure")
    {
      var ajaxPhp = new Ajax("update/index.php", null);
      ajaxPhp.doSimpleGet("SecureSection"); 
    }
    if(tab.cmd == "development")
    {
      var ajax = new Ajax("getSite","site=http://plaurina.is-a-geek.net");
      ajax.doGet("CurrentDevelopment"); 
    }
    tab.loaded();    
    
}

function wwwwAmITabClicked( tabControl, tab, event )
{
    var ajaxPhp;
    var action;
    var divID;
    
    if (tab.isLoaded) return; //if that tab was already loaded this session, don't bother reloading it again
    tab.loaded();
    var loading = document.getElementById("loading");
    loading.style.display = "block";
    if (tab.cmd == "who")
    {
      action = "views/who.php";
      divID = "who";
    }
    else if (tab.cmd == "what") //This is the default tab and was loaded initially, so nothing needs to be done.
    {
      return;
    }
    else if (tab.cmd == "when")
    {
      action = "views/when.php";
      divID = "when";
    }
    else if (tab.cmd == "where")
    {
      action = "views/where.php";
      divID = "where";
    }
    else
    {
      alert("unknown Tab clicked");
      return;
    }
    
    ajaxPhp = new Ajax(action,null); //, parameters, handler)
    ajaxPhp.doSimpleGet(divID);
    
    if (tab.cmd == "where")
    {
      setTimeout("mapload();",300);
    }
    
  loading.style.display = "none";
}

function init()
{
  var TabC = new TabControl('tabControl', 'static/images/');
  TabC.addTab('wwwwAmI', 'wwwwami', "wwwwami.gif", 'wwwwAmI.com').select();
  TabC.addTab('ZionVier', 'zionvier', "zv.gif", 'ZionVier.com');
  TabC.addTab('Resume', 'resume', "book_open.gif", 'Resume');
  TabC.addTab('AboutMe', 'about', "carabiner.gif", 'About Me');
  TabC.addTab('ContactInfo', 'contact', "user1_message.gif", 'Contact Info');
  TabC.addTab('SecureSection', 'secure', "cube_molecule.gif", 'Secure');
  TabC.onClick( tabClicked );
     
  //Adjust heights
  var main = document.getElementById('main');
  main.style.height = Utils.getWindowMetrics().height - TabC.displayDiv.offsetTop + "px";
  
  var wwwwTabC = new TabControl('wwwwamiTabControl', 'static/images/');
  wwwwTabC.addTab('who', 'who', 'ico-users.gif', 'Who?');
  wwwwTabC.addTab('what', 'what', 'help.gif', 'What?').select();
  wwwwTabC.addTab('when', 'when', 'alarmclock.gif', 'When?');
  wwwwTabC.addTab('where', 'where', 'car_sedan_blue.gif', 'Where?');
  wwwwTabC.onClick( wwwwAmITabClicked );
}

  function GetPeteLaurinaSite()
  {
    var ajax = new Ajax("getSite","site=http://www.petelaurina.com");
    ajax.doGet("wwwwAmI");  
  }
  
    function secureTabClicked(tabControl, tab, event)
  {
    if (tab.isLoaded) return;
      
    tab.loaded();
  }
  function secureLoad()
  {
    var secureTabC = new TabControl('secureTabControl', 'static/images/');
    secureTabC.addTab('location', 'location', null, 'Update Current Location').select();
    secureTabC.addTab('NewBlog', 'newBlog', null, 'Add Blog');
    secureTabC.onClick( secureTabClicked );
  }
  
