/*
$(window).click(function() {
  
  var websitepopup = getCookie('websitepopup');
  
  if (!websitepopup) {
    var width = 960,
        height = 600,
        left = (screen.width - width) / 2;
        top = (screen.height - height) / 2;
    
    //var bigboxwindow = window.open("http://bigbox.com", "bigboxWindow", "location=1,status=1,scrollbars=1,left="+ left +",top="+ top +",width="+ width +",height="+ height);
    
    setCookie('websitepopup', 1);
  }
});
*/

$(function() {

  $('#datepicker').datepicker({dateFormat: 'yy-mm-dd'});

  // Initialize form field labels inside the fields
  $('input[type="text"], textarea, select').each(function(i){
    if ($(this).val() == '' || $(this).val() == $(this).attr('title')) {
      $(this).val($(this).attr('title'));
      $(this).addClass('field-label');
    }
  });

  // Determine if the form field labels inside the field need to be cleared
  $('input[type="text"], textarea').bind('click', function(e){
    if ($(this).val() == $(this).attr('title')) {
      $(this).val('');
      $(this).removeClass('field-label');
    }
  }).bind('blur', function(e){
    if ($(this).val() == '') {
      $(this).val($(this).attr('title'));
      $(this).addClass('field-label');
    }
  });

  // Determine if the form field labels inside the field need to be cleared
  $('select').bind('click', function(e){
    if ($(this).val() != '') {
      $(this).removeClass('field-label');
    }
  }).bind('blur', function(e){
    if ($(this).val() == '') {
      $(this).addClass('field-label');
    }
  });

});
