$(document).ready(function() {
  setBackground('images/background1.jpg', 1920, 1200);
  
  addWindow("images/icon_display.png", "Welcome To NJEE", "centered=true&draggable=true&allowfullscreen=false&resizable=false&path=welcome.html&height=400&width=540&bgcolor=white&opacity=1");
});


function contact_submit() {
  $('#body_loading').css('display', 'block');
  data = { subject: $('#website_contact input[name=subject]').val(), email: $('#website_contact input[name=email]').val(), name: $('#website_contact input[name=name]').val(), message: $('#website_contact textarea[name=message]').val(),  };
  $.post('contact.php', data, contact_submitted);
  return false;
}
function contact_submitted(data) {
  $('#body_loading').text('Email sent! You may close the window');
}

function portfolio_load(url) {
  $('#website_portfolio .horizmenu:eq(0) span').removeClass('selected');
  $('#website_portfolio .horizmenu:eq(0) span').each(function(){
    attr = String($(this).attr('onclick'));
    if (attr.match(url)) {
      $(this).addClass('selected');
    }
  });
  $.get(url, function(data) {
    $('#portfolioloader').html(data);
  });
}

function inventory_load(url) {
  $('#website_inventory .horizmenu:eq(0) span').removeClass('selected');
  $('#website_inventory .horizmenu:eq(0) span').each(function(){
    attr = String($(this).attr('onclick'));
    if (attr.match(url)) {
      $(this).addClass('selected');
    }
  });
  $.get(url, function(data) {
    $('#inventoryloader').html(data);
  });
}
