function currentYear()
{
	var theDate=new Date();
	return(theDate.getFullYear());
}

$(document).ready(function(){
	$('#imageMenu').imagemenu({
		openWidth: 310, 
		menuenter: function(evt,el) {
			console.log("entered "+el);
		}
	});
	
});

$(document).ready(function(){
	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	$("ul.topnav li span").mouseover(function() { //When trigger is clicked...
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
});

$('#banner1').cycle({
    fx:    'fade',
    sync:   1,
    delay: 1000,
    speed: 1000,
    timeout: 8000,
    random: 1
});

$(document).ready(function(){
	$("#request").validate({
        wrapper: "div",
        rules: {
        
			tbSchool: {
				required: true
			},
    	tbName: {
    	    required: true
    	},
			tbHighschool: {
				required: true
			},
			tbAddress: {
				required: true
			},
			tbHomePhone: {
				required: true
			},
			tbEmail: {
				required: true,
				email: true
			},
			tbParentName: {
				required: true
			},
			tbParentAddress: {
				required: true,
			}
        },
        messages: {
			
      dateformat: "Choose your preferred dateformat",
      
      tbSchool: {
				required: "Please choose a type of school."
			},
          	tbName: {
          	   required: "Enter your name."
          	},
			tbHighschool: {
				required: "Enter the name of your high school."
			},
			tbAddress: {
				required: "Enter an address."
			},
			tbHomePhone: {
				required: "Enter a phone number."
			},
			tbEmail: {
				required: "Enter a valid Email."
			},
			tbParentName: {
				required: "Parent(s) or Guardian(s) must be provided."
			},
			tbParentAddress: {
				required: "Address of Parent(s) or Guardian(s) must be provided."
			}
			
        }
	});	
});

$(document).ready(function(){
	$("#refer").validate({
        wrapper: "div",
        rules: {
        
    	tbName: {
    	    required: true
    	},
			tbCompany: {
				required: true
			},
			tbReferred: {
				required: true
			},
			tbReferredPhone: {
				required: true
			}
        },
        messages: {

    	tbName: {
    	   required: "Enter your name."
    	},
			tbCompany: {
				required: "Enter YOUR company."
			},
			tbReferred: {
				required: "Enter your referral."
			},
			tbReferredPhone: {
				required: "Enter your referral&rsquo;s phone number."
			}
        }
	});	
});


