/*
----- Made by WebForceOne ------------------
----- http://www.webforceone.nl --------
----- Contact: info@webforceone.info -------
----- Telephone: 070 767 00 43 -------------
*/

var base_url = "http://www.landstraatnoord.nl/";
//var base_url = "https://oppersmurf.webforceone.info:8443/sitepreview/http/landstraatnoord.nl/";
var admin_url = "http://beheer.webforceone.info/landstraat/";

// Animation -------------------------------
function displayNone() {
	
	$(".plaat").css("display", "none");	
	$(".plaat2").css("display", "none");	
	$(".menu_links").css("display", "none");
	$(".menu_rechts").css("display", "none");
	$(".logo").css("display", "none");
	//$(".banner").css("display", "none");
	$(".www").css("display", "none");
	$(".prijs").css("display", "none");
	$(".over7").css("display", "none");
	$(".info").css("display", "none");
	$(".kaart1").css("display", "none");
	$(".kaart2").css("display", "none");
	$(".kaart3").css("display", "none");		
	
}

// AnimationIn -----------------------------
function animate() {
	
	var EffectOptions = {
    	effect: "drop",
    	effectOptions: {
        	color: "#9e1037",
        	radius: 150,
    		duration: 1000,
    		width: 1,
    		delay: 300
    	}
    	
	};
	
	$(".plaat2").delay(1000).fadeIn(300).delay(2000).fadeIn(300, function() {
		
		$(".logo").fadeIn(500);
		/*$(".banner").fadeIn(500, function() {
			$(".banner").twinkle(EffectOptions);
		});*/
		$(".banner").twinkle(EffectOptions);
		$(".www").fadeIn(500);
		$(".lint").fadeOut(500);
				
	});
	
}

function pulsate() {
	
	var EffectOptions = {
    	effect: "drop",
    	effectOptions: {
        	color: "#9e1037",
        	radius: 150,
    		duration: 1000,
    		width: 1,
    		delay: 300
    	}
    	
	};
	
	$(".banner").twinkle(EffectOptions);
	
}

// resizeScreen ----------------------------
function resizeContainer() {
	
	var height = $(window).height();	
	height = height - 92;

	var width = $(window).width();
	width = width - 92;
	width = width - 90;
	
	var documentheight = $(document).height();
	documentheight = documentheight + 30;
	$(document).height(documentheight);
	
	//$(".container").css("height", height +"px");
	$(".container").css("width", width +"px");
	
}

// resizeScreen ----------------------------
function centerItem(Item) {
		
	var width = $(window).width();
	var item_width = $("."+Item+"").width();
	width = width - item_width;
	width = width - 92;
	width = width / 2;	
	$("."+Item+"").css("left", width +"px");
	
}

function centerKaart3(Item) {
		
	var width = $(window).width();
	var item_width = $("."+Item+"").width();
	width = width - item_width;
	width = width - 92;
	width = width / 2;
	width = width - 85;	
	$("."+Item+"").css("left", width +"px");
	
}

// Body onload
$(document).ready(function() {
			
// OnLoad ------------------------------------------------------------------------------------------
	
	// jScroll
	//$('.tekst').jScrollPane();
	
	// OnResize
	$(window).resize(function() {
		
		resizeContainer();
		centerItem("logo");
		centerItem("www");
		centerItem("prijs");
		centerKaart3("kaart3");
		
	});
	
	//Onload
	resizeContainer();
	centerItem("logo");
	centerItem("www");
	centerItem("prijs");
	centerKaart3("kaart3");
	
	// Pulsate	
	setInterval("pulsate()", 5000);
	
	// Placeholders Switch Text
	function switchText() {
		
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
			$(this).css("color","black");
		} else if ($.trim($(this).val()) == '') {
			$(this).val($(this).attr('title'));
			$(this).css("color","#929292");
		}
	}
	
	$('input[type=text][title != ""]').each(function() {
		
		if ($.trim($(this).val()) == '') {
			$(this).val($(this).attr('title'));
			$(this).css("color","#929292");
		}
		
	}).focus(switchText).blur(switchText);
	
	$('form').submit(function() {
		$(this).find('input[type=text][title != ""]').each(function() {
			if ($(this).val() == $(this).attr('title')) {
				$(this).val('');
			}
		});
	});
		
});
