$(document).ready(function() {
	
	$("#menu-header li ul").hide(); 

	$("#menu-header li").hover(
        function () {
		$(this).children("ul").show();
        },function(){
		$(this).children("ul").hide();
	});//hover

});// document ready
$(document).ready(function() {
    $('.slideshow, .slideshow_gw') 
.cycle({ 
	  fx:     'fade', 
    speed:   1300, 
    timeout: 10000, 
    pager:  '#fade_nav',
    next:   '.next', 
    prev:   '.prev',
      pause:   1 
});

	
	$('.default-value').each(function() {
 	   var default_value = this.value;
 	   $(this).css('color', '#666'); // this could be in the style sheet instead
 	   $(this).focus(function() {
       	 if(this.value == default_value) {
          	  this.value = '';
           	 $(this).css('color', '#333');
      	  }
   	 });
   	 
    $(this).blur(function() {
      if(this.value == '') {
            $(this).css('color', '#666');
            this.value = default_value;
            }
    });
});
$('#bSubmit').click(function () {
		errorMsg = "";

		if ($('#yourname').val() == "" || $('#yourname').val() == "Name")
		{
			errorMsg += "Name is a required field\n";
		}

		if ($('#email').val() == "" || $('#email').val() == "E-Mail")
		{
			errorMsg += "E-Mail is a required field\n";
		}

		if ($('#phone').val() == "" || $('#phone').val() == "Phone")
		{
			errorMsg += "Phone is a required field\n";
		}

		if ($('#url').val() == "" || $('#url').val() == "Website URL")
		{
			errorMsg += "Website URL is a required field\n";
		}

		if (errorMsg == "")
		{
			return true;
		}

		alert(errorMsg);
		return false;
	});

});
 
$(function() {
	$("#phone").keyup(function() {
		var curchr = this.value.length;
		var curval = $(this).val();
		if (curchr == 3) {
			$("#phone").val("(" + curval + ")" + "-");
		} else if (curchr == 9) {
			$("#phone").val(curval + "-");
		}
	});
	$("#phone").numeric();
});
