$(document).ready(function()
{
  $("#icon1").mouseover(function()
  {
    $("#explaination").html("Toevoegen aan favorieten");
  });
  $("#icon1").mouseleave(function()
  {
    $("#explaination").html("");
  });
  $("#icon2").mouseover(function()
  {
    $("#explaination").html("Beleving toevoegen");
  });
  $("#icon2").mouseleave(function()
  {
    $("#explaination").html("");
  });
  $("#icon3").mouseover(function()
  {
    $("#explaination").html("Doorsturen naar vrienden");
  });
  $("#icon3").mouseleave(function()
  {
    $("#explaination").html("");
  });
  $("#icon4").mouseover(function()
  {
    $("#explaination").html("Objectlijst bekijken");
  });
  $("#icon4").mouseleave(function()
  {
    $("#explaination").html("");
  });
  $("#icon5").mouseover(function()
  {
    $("#explaination").html("Print deze pagina");
  });
  $("#icon5").mouseleave(function()
  {
    $("#explaination").html("");
  });
});

$(document).ready(function()
{
  $('#favo_sluit').click(function()
  {
    $('#favo_sluit').fadeOut(500, function() {});
    $('#favo_size').animate({ width: 0 }, 500, function() {});
  });
});

$(document).ready(function()
{
  $('#icon1').click(function()
  {
    if ($('#favo_size').css('width') == '170px')
    {
      $('#favo_sluit').fadeOut(500, function() {});
      $('#favo_size').animate({ width: 0 }, 500, function()
      {
        $('#dialog').fadeIn(500, function() {});
      });
    }
    else if ($('#slideshow_size').css('width') == '580px')
    {
      $('#slideshow_sluit').fadeOut(500, function() {});
      $('#slideshow_size').animate({ width: 0 }, 500, function()
      {
        $('#dialog').fadeIn(500, function() {});
      });
    }
    else
    {
      $('#dialog').fadeIn(500, function() {});
    }
  });
});

$(document).ready(function()
{
  $('#icon4,#icon4text').click(function()
  {
    if ($('#slideshow_size').css('width') === '580px')
    {
      $('#slideshow_sluit').fadeOut(500, function() {});
      $('#slideshow_size').animate({ width: 0 }, 500, function() {});
    }
    else if ($('#favo_size').css('width') == '170px')
    {
      $('#favo_sluit').fadeOut(500, function() {});
      $('#favo_size').animate({ width: 0 }, 500, function()
      {
        ajaxdetail('ajaxObjectlist.php');
        $('#slideshow_size').animate({ width: 580 }, 500, function()
        {
          $('#slideshow_sluit').delay(500).fadeIn(500, function() {});
        });
      });
    }
    else if ($('#dialog').css('display') != 'none')
    {
      $('#dialog').fadeOut(500, function()
      {
        ajaxdetail('ajaxObjectlist.php');
        $('#slideshow_size').animate({ width: 580 }, 500, function()
        {
          $('#slideshow_sluit').delay(500).fadeIn(500, function() {});
        });
      });
    }
    else
    {
      ajaxdetail('ajaxObjectlist.php');
      $('#slideshow_size').animate({ width: 580 }, 500, function()
      {
        $('#slideshow_sluit').delay(500).fadeIn(500, function() {});
      });
    }
  });
});

function ajaxpage(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)
    {
      $('#info').html(html);
    }
  });
}

function ajaxobject(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)
    {
      $('#info').html(html);
    }
  });
}

function ajaxdetail(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)
    {
      $('#slideshow').html(html);
    }
  });
}

function ajaxdialog(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)
    {
      $('#dialog').html(html);
    }
  });
}

function ajaxregion(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)
    {
      $('#bottom').html(html);
    }
  });
}

function addfavorite(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)
    {
      $('#favorites').html(html);
    }
  });
}

function ajaxfavorite(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)
    {
      $('#favorites').html(html);
    }
  });
}

function deletefavorite(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)
    {
      $('#favorites').html(html);
    }
  });
}

function logout(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)
    {
      $('#info').html(html);
    }
  });
}

function login(url)
{
  var email = $('#email').val();
  var pass = $('#pass').val();
  var dataString = 'email='+ email + '&pass=' + pass;
  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,
    data: dataString,
    dataType: "html",
    success: function(html)
    {
      $('#info').html(html);
    }
  });
  ajaxexplaination('ajaxExplaination.php');
  ajaxheader('ajaxHeader.php');
  ajaxfavorite('ajaxFavorite.php');
}

function signup(url)
{
  var name = $('#sname').val();
  var email = $('#semail').val();
  var pass1 = $('#spass1').val();
  var pass2 = $('#spass2').val();
  var dataString = 'name=' + name + '&email=' + email + '&pass1=' + pass1 + '&pass2=' + pass2;
  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,
    data: dataString,
    dataType: "html",
    success: function(html)
    {
      $('#info').html(html);
    }
  });
  ajaxexplaination('ajaxExplaination.php');
  ajaxheader('ajaxHeader.php');
  ajaxfavorite('ajaxFavorite.php');
}

function editaccount(url)
{
  var name = $('#ename').val();
  var email = $('#eemail').val();
  var pass1 = $('#epass1').val();
  var pass2 = $('#epass2').val();
  var dataString = 'name=' + name + '&email=' + email + '&pass1=' + pass1 + '&pass2=' + pass2;
  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,
    data: dataString,
    dataType: "html",
    success: function(html)
    {
      $('#info').html(html);
    }
  });
}

function getpassword(url)
{
  var name = $('#ename').val();
  var email = $('#gemail').val();
  var pass1 = $('#epass1').val();
  var pass2 = $('#epass2').val();
  var dataString = 'name=' + name + '&email=' + email + '&pass1=' + pass1 + '&pass2=' + pass2;
  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,
    data: dataString,
    dataType: "html",
    success: function(html)
    {
      $('#info').html(html);
    }
  });
}

function ajaxexplaination(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)
    {
      $('#explaination').html(html);
    }
  });
}

function ajaxheader(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)
    {
      $('#header').html(html);
    }
  });
}

