$(document).ready(function() {
$('#thenav li ul').hide();
$('#thenav li').mouseover(function () {
	$(this).find('ul').stop(true, true).show();
});

$('#thenav li').mouseout(function(){$(this).find('ul').stop(true, true).hide();});


//VIDEO
$(".playtrailer").click(function() {
$("#videoplayer").html('<iframe width="520" height="318" src="http://www.youtube.com/embed/vCzavqxIu3k?modestbranding=1&version=3&hl=en_US&rel=0&theme=dark&color=red&showinfo=0&hd=1&autoplay=1" frameborder="0" allowfullscreen></iframe>');
return false;  });


$(".clicktowatch").click(function() {
var thevideo = $(this).attr("rel");
$("#videoplayer").html('<iframe width="520" height="318" src="http://www.youtube.com/embed/'+thevideo+'?modestbranding=1&version=3&hl=en_US&rel=0&theme=dark&color=red&showinfo=0&hd=1&autoplay=1" frameborder="0" allowfullscreen></iframe>');
return false;  });
	// HOVER-FADE FUNCTIONS$("a.fade img").hover(function() {// animate opacity to full$(this).stop().animate({ opacity: 0.75 }, 200); },// on mouse outfunction () {// animate opacity to nill$(this).stop().animate({ opacity: 1 }, 200);});



//SCROLLING
$(".scroll").click(function(event){
//prevent the default action for the click event
event.preventDefault();
//get the full url - like mysitecom/index.htm#home
var full_url = this.href;
//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
var parts = full_url.split("#");
var trgt = parts[1];
//get the top offset of the target anchor
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top;
//goto that anchor by setting the body scroll top to anchor top
$('html, body').animate({scrollTop:target_top}, 500);
});


$("input#zipcode").focus(function () {
if ($(this).val() == "Enter Zip") {
$(this).val("");
}
});

//CLEAR FORM FIELDS
$("input#CustomFields_37_35").focus(function () {
if ($(this).val() == "xxx-xxx-xxxx") {
$(this).val("");
}
});

});//end DOM Load


// CHECK REGISTRATION
function SignupCheck(form) {
valcheck = form.email;hasDot = valcheck.value.indexOf(".");hasAt = valcheck.value.indexOf("@");if (hasDot == -1 || hasAt == -1) {	alert("Please enter your Email Address.");	valcheck.focus();	return false;}//First Name Checkvalcheck = document.getElementById("CustomFields_1_35");if (valcheck.value == "" || valcheck.length < 2) {	alert("Please enter your First Name");	valcheck.focus();	return false;}//Last Name Check			valcheck = document.getElementById("CustomFields_2_35");if (valcheck.value == "" || valcheck.length < 2) {	alert("Please enter your Last Name");	valcheck.focus();	return false;} //State Check			valcheck = document.getElementById("CustomFields_13_35");if(valcheck.selectedIndex == -1 || valcheck.value == "") {	alert("Please enter your State");	valcheck.focus();	return false;}//Zip Check	valcheck = document.getElementById("CustomFields_3_35");if (valcheck.value == "" || valcheck.length < 2) {	alert("Please enter your Zip Code");	valcheck.focus();	return false;}
 else {	return true;}}

