<?
include('../include/init.php');
include('../include/function.php');
?>

function login(url)
{
  var page_request = false
  if (window.XMLHttpRequest)
  page_request = new XMLHttpRequest()
  else if (window.ActiveXObject)
  {
    try
    {
      page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        page_request = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
  return false
  $.ajax(
  {
    type: "GET",
    url: url,
    dataType: "html",
    success: function(html)
    {
      $('#login').html(html);
    }
  });
}

function menu(url)
{
  var page_request = false
  if (window.XMLHttpRequest)
  page_request = new XMLHttpRequest()
  else if (window.ActiveXObject)
  {
    try
    {
      page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        page_request = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
  return false
  $.ajax(
  {
    type: "GET",
    url: url,
    dataType: "html",
    success: function(html)
    {
      $('#menu').html(html);
    }
  });
}

function subfooter(url)
{
  var page_request = false
  if (window.XMLHttpRequest)
  page_request = new XMLHttpRequest()
  else if (window.ActiveXObject)
  {
    try
    {
      page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        page_request = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
  return false
  $.ajax(
  {
    type: "GET",
    url: url,
    dataType: "html",
    success: function(html)
    {
      $('#subfooter').html(html);
    }
  });
}

function intro_container(url)
{
  var page_request = false
  if (window.XMLHttpRequest)
  page_request = new XMLHttpRequest()
  else if (window.ActiveXObject)
  {
    try
    {
      page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        page_request = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
  return false
  $.ajax(
  {
    type: "GET",
    url: url,
    dataType: "html",
    success: function(html)
    {
      $('#intro_container').html(html);
    }
  });
}

function content(url)
{
  var page_request = false
  if (window.XMLHttpRequest)
  page_request = new XMLHttpRequest()
  else if (window.ActiveXObject)
  {
    try
    {
      page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        page_request = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
  return false
  $.ajax(
  {
    type: "GET",
    url: url,
    dataType: "html",
    success: function(html)
    {
      $('#content').html(html);
    }
  });
}

$(document).ready(function()
{
  $('#login_open').click(function()
  {
    $('#login_open').animate({ top: -50 }, 500, function() {
      $('#login').animate({ top: 0 }, 500, function() {});
      $('#login_close').fadeIn(1200, function() {});
    });
  });

  login('ajax/login.php');
  menu('ajax/menu.php');
  intro_container('ajax/intro.php?visable=1');
});
