/**
 *
 * Functies die uitgevoerd moeten worden na het laden
 *
 **/
 $(document).ready(function(){
 	// Weghalen titel als die toch leeg is
 	if($('#ContentTitel').text() == '') {
 		$('#ContentTitel').hide()
 	}
 	
 	/**
 	 * Fixen hoogte streepje
 	 **/
 	// Afhankelijk van of er MainContent is kiezen welke hoogte
 	var mainHeight = ($(".MainContent").height() == null)? $("#Content").height()+30 : $(".MainContent").height()+58;
 	
 	// Minimale hoogte checken
 	$("#MainMenu").css("min-height", mainHeight);
 	
 	// Toevoegen hover effect bedrijven selector
	$(".BedrijfField").hover(
		function() {
			// Alle andere disabelen
			$(".BedrijfInfo").hide()
			$(".BedrijfField").css('background-image',''); 
			// Huidige aanzetten
			$(this).css('background-image','url(/images/bg_bedrijven_selected.gif)');
			$('#'+ $(this).attr("id") +'Info').show()
		},
		function() {}
	)	
	
	// Toevoegen hover effect
	$(".ExtraBedrijfInfo div p").hover(
		function() {
			// Alle andere disabelen
			$(".BedrijfUitleg").hide()
			$(".ExtraBedrijfInfo div p").css('background-image', 'url(/images/bg_info_small.gif)');
			$(".ExtraBedrijfInfo div p").css('background-color', 'white');
			$(".ExtraBedrijfInfo div p").css('color', '');
				 	
			// Huidige aanzetten
			$(this).css('background-image', 'url(/images/bg_info_small_selected.gif)');
			$(this).css('background-color', '#E7E7E7');
			$(this).css('color', 'black');
			$('#'+ $(this).attr("id") +'Uitleg').show()
		},
		function() {}
	)

	// Hoveren van een tabel rij
	 $(".ColorRow").hover(
	 	function() {
	 		$(this).css('background-color','#F4F4F4');
	 	},
	 	function() {
	 		$(this).css('background-color','');
	 	}
	 )
	
	/**
	 * @name FixenLogoPosities
	 * Alle logo posities fixen
	 */
	fixLogoPosities()
	
	/**
	 * @name input text fix
	 * Zorgen dat nooit meer dan database aankan ingevoerd wordt
	 */
	$('input[type="text"]').each(
		function() {
			if(!($(this).attr("maxlength") < 255)) {
				$(this).attr("maxlength", "255")
			}
		}
	)
	
	/**
	 * @name GoogleAnalytics
	 */
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	// Via jQuery vind ik mooier!
	$.getScript(gaJsHost + "google-analytics.com/ga.js", function() {
		try {
			var pageTracker = _gat._getTracker("UA-11235605-1");
			pageTracker._setDomainName("none");
			pageTracker._setAllowLinker(true);
			pageTracker._trackPageview();
		} catch(err) {} 	
	})
	
})

