$(document).ready(function(){

$("#"+getPageNameParts()[0]).attr('class', 'active');
$("#navigation ul:visible").hide();
$(".active + ul").show();
//    $("#navigation h4").hover(function() {
//	  $(this).find("ul").slideDown(1000);
//	}, function() {
//	  $(this).find("ul").slideUp(500);
//	});
	
	

	$(".lightbox").lightBox();
});

function validateForm(url) {
    var theAction = 'http://' + window.location.host + url.join('/');
    //console.log(theAction);
    $('#mail_form').attr({action: theAction});
    $('#submit_mail').attr({name: ['request', 'SendMail'].join('')});
}

function validateNewsletterForm() {
    var theAction = 'http://' + window.location.host + "/index.php/newsletter";
    //console.log(theAction);
    $('#newsletter_form').attr({action: theAction});
    $('#newsletter_mail').attr({name: ['request', 'SendMail'].join('')});
}

function getPageNameParts() {
    $parts = document.location.pathname.split("/").reverse();
    return $part = $parts[0].split("_");
}