/**
 * @author Vlad
 */
function onBefore()
{
	$(this).children("div").children("img").attr("src",$(this).children("div").children("img").attr("src_new"));
	
}

$(document).ready(function() {
	
	var display_height = ($("#left_display").height() > $("#right_display").height()) ? $("#left_display").height() : $("#right_display").height();
	var album_height = $("#photo_album").height();
	
	
//$("#content").height(display_height + album_height + 540);


//sitemap functions
$("span.trigger").each(function(){
	$(this).toggle(
		function() {
				$(this).parent(".sitemap_holder").next(".sitemap_leaf_holder").slideUp(400);
				$(this).removeClass("trigger_minus").addClass("trigger_plus");
		},
		function() {
				$(this).parent(".sitemap_holder").next(".sitemap_leaf_holder").slideDown(400);
				$(this).removeClass("trigger_plus").addClass("trigger_minus");
		}
	);
});

//newsletter form code
$("#newsletter_box").hover(
	function(){
		$(this).css("background-color","#97CB64");
		$("#newsletter_over").hide();
		$("#newsletter_form").show();
	},
	function(){
		$(this).css("background-color","#009E58");		
		$("#newsletter_form").hide();
		$("#newsletter_over").show();
	}
);

$("#news_input").focus(function(){
	if($(this).val() == "E-mailadres") $(this).val("");
});

$("#news_input").blur(function(){
	if($(this).val().length == 0) $(this).val("E-mailadres");
});

$("#newsletter_submit").hover(
	function() {$(this).css("background","#B7B6B0 url('http://www.vdict.nl/vandoorngroep.nl/images/img_btn_search.gif') no-repeat scroll left -21px");},
	function() {$(this).css("background","#484846 url('http://www.vdict.nl/vandoorngroep.nl/images/img_btn_search.gif') no-repeat scroll left top");}
);


//small contact form code
/*
$("#contact_box").hover(
		function(){
			$(this).css("background-color","#97CB64");
			$("#contact_over").hide();
			$("#contact_form").show();
		},
		function(){
			$(this).css("background-color","#009E58");		
			$("#contact_form").hide();
			$("#contact_over").show();
		}
	);
	*/

	$("#contact_detail").focus(function(){
		if($(this).val() == "Dien hier uw informatie aanvraag in of stel uw vraag.") $(this).css("color","#000000").val("");
	});

	$("#contact_detail").blur(function(){
		if($(this).val().length == 0) $(this).css("color","#BFB3B3").val("Dien hier uw informatie aanvraag in of stel uw vraag.");
	});

	$("#contact_submit").hover(
		function() {$(this).css("background","#B7B6B0 url('http://www.vdict.nl/vandoorngroep.nl/images/img_btn_search.gif') no-repeat scroll left -21px");},
		function() {$(this).css("background","#484846 url('http://www.vdict.nl/vandoorngroep.nl/images/img_btn_search.gif') no-repeat scroll left top");}
	);

$("#unsub_sub").click(function(){
	var email = $("#unsub_text").val();
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(email))
		location.href="http://www.vdict.nl/vandoorngroep.nl/unsub.php?mail=" + email;
	else	
		alert("Invalid e-mail!");	

});

});