$(document).ready(function() {        

		$("#ft ul.st li a:first").addClass("first");
		$("#ft ul.nd li a:first").addClass("first");
		//$("#ft .copyright a:first").css({'margin-left' : '10px'});
		$("form#FormSubscribe").validate();
});



// pop - slide up menu

$(document).ready(function() {
	createMenu("div.navigation");
});

function createMenu(container) {
	var speed = 500;
	$(container).queue("fx", []);
	
	//Hide all submenu items li > ul and save necessary data to be used in the furture
	$("li > ul", container).each(function () {		
		$(this)
			.data("prop", {height: $(this).outerHeight() })			
			.css({top: "0px", height: "0px", visibility: "visible", display: "none"});
	});
	
	//Add events on mouse over and out
	$("li > ul", container)
		.parent().hover(
			function() {
				//Check whether the menu is highlighted or not
				$(this).data("highlighted", $("> a", this).hasClass("highlight"));
				//Highlight the hovered menu				
				$("> a", this).addClass("highlight");
				//Animate sub menu
				var prop = $("> ul", this).data("prop");
				$("> ul", this).stop().animate({top: ((prop.height + 0) * - 1) + "px", height: prop.height + "px", opacity: 1}, {duration: speed});
			}
			, function() {
				//Remove highlight from the hovered menu				
				if (!$(this).data("highlighted")) $("> a", this).removeClass("highlight");
				var me = this;
				//Animate sub menu
				$("> ul", me).stop().animate({top: "0px", height: "0px", opacity: 0}, {duration: speed});
			}
		);				
}

function doPage(frm, page,pagename) {  
    $("input[name=" + pagename + "]", frm).val(page);
    $(frm).submit();
}

//Subscribe Newsletter

$(document).ready(function() {        
    $(".btnSubscribe").click(function() {        
        if(isValidEmail($('#emailSubscribe').val())){
        $('#txtEmail').val($('#emailSubscribe').val());
        $('#email').val($('#emailSubscribe').val());
        $.blockUI({
            message: $("#NewsLetterSubscribe")
            , css: {
                backgroundColor: "white"
				,border: "5px solid white"
                ,width:"395px"
				,left: "30%"
				,top: "20%"
				,cursor: "default"
				
            }
            , overlayCSS: {
				backgroundColor: "#E3D19E"
                ,opacity: 0.5
				,cursor: "default"
            }
        });
        }
        else{
            $('#emailSubscribe').focus()
            alert('Please input correct email.');
        }
        //setTimeout(function() { $.unblockUI(); }, 3000);
		return false;
    });
});

$(document).ready(function() {        
	
	  $("#btnSubscribeClose").click(function() {        
			$.unblockUI();
			return false;
			
	  });
   
});

