//document.write('<scr'+'ipt type="text/javascript" src="/templates/home/scripts/js/jquery.cookie.js"></scr'+'ipt>');

$(document).ready(function(){ 

  var a = '#000000';
  var b = '#bebebe';
  $('.inputbox').css('color', b);
  var c = new Array;
  $('.inputbox').focus(function () {
    if (!c[this.id]) {
      c[this.id] = this.value
    }
    if (this.value == c[this.id]) {
      this.value = '';
      this.style.color = a
    }
    $(this).blur(function () {
      if (this.value == '') {
        this.style.color = b;
        this.value = c[this.id]
      }
    })
  });
  $('#message').css('color', b);
  $('#message').focus(function () {
    var b = $(this).val();
    if (b == 'Message *') {
      $(this).val('');
      $(this).css('color', a)
   }
  });
  $('#message').focusout(function () {
    var a = $(this).val();
    if (a == '') {
      $(this).val('Message *');
      $(this).css('color', b)
   }
  });
  
  /* menu stuff */
  $('#main-menu ul li.parent').hover(function(){
    var thisWidth = $(this).width();
	$(this).addClass('active');
	$(this).find('ul > li a').css({ 'min-width' : (thisWidth-35)+'px' });
	$(this).find('ul').first().show();
	$(this).find('ul.last-child').css({ 'left' : (thisWidth)+'px' });
  }, function(){
	$(this).find('ul').first().hide();
	$(this).not('.current').removeClass('active');
  });
  $('#main-menu ul li').find('#current').parent().parent().addClass('current');
  $('#main-menu ul li ul li ul').addClass('last-child');
  
  var screenWidth = $('html').width();
  if (screenWidth < 1025) {
    $('#main-menu ul li.parent').last().addClass('right');
  }
  
});
