// JavaScript Document

$(document).ready(function () {
	//slickBox
	
	
	//remove search text from text box 	
	function search_widget_onLoad() {
	jQuery('#searchsubmit').val('');	
	}
	if (window.attachEvent) {window.attachEvent('onload', search_widget_onLoad);}
	else if (window.addEventListener) {window.addEventListener('load', search_widget_onLoad, false);}
	else {document.addEventListener('load', search_widget_onLoad, false);} 
	
	//default value dissapear on focus
	var active_color = '#3B678E'; // Colour of user provided text
	var inactive_color = '#A5A5A5'; // Colour of default text
	$("input.default-value").css("color", inactive_color);
  var default_values = new Array();
  $("input.default-value").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
	
	//Dropdown menus
	
	
	$("#nav ul li a").hover(function(){
	$(this).parent().find("ul.children").slideDown('fast').show();
	},function(){
		$(this).parent().hover(function(){
	}, function(){
		$(this).parent().find("ul.children").slideUp('slow');
		});	
	});
				   
	
	
	//Form Validation
	$("#contactForm").validate();

	
});





