/****************** GENERAL  **********************/function handleAjaxErrorContent (XMLHttpRequest, textStatus, errorThrown) {	alert(textStatus);}var popWin = "";function popupWindow(url, strHeight, strWidth, strScroll) {	if (popWin != "") {popWin.close()}	if (strScroll=="ja") {strScroll="yes"};	if (strScroll=="nee") {strScroll="no"};	leftStr = (screen.width-strWidth)/2;	topStr = (screen.height-strHeight)/2-50;	windowProperties = "toolbar=no,menubar=no,scrollbars="+strScroll+",statusbar=no,height="+strHeight+",width="+strWidth+",left="+leftStr+",top="+topStr+"";	popWin = window.open(url,'newWin',windowProperties);}/****************** RESIZEN EN VERTICAL CENTERING  **********************/$(document).ready(function() {	resize();	$(window).bind("resize", resize );});// MME: g_orgPageWrapWitdh houdt de orginele grote van page-wrap bijvar g_orgPageWrapWitdh = -1;function resize() {	var $winheight = $(window).height();	var $winwidth = $(window).width();	var siteH = $('div#page-wrap').height();	var siteW = $('div#page-wrap').width();			//toegevoegd MME	if(g_orgPageWrapWitdh==-1){		// de orginele grote van page-wrap opslaan		g_orgPageWrapWitdh=siteW;	}	//einde toegevoegd MME		if (siteH > $winheight) { // de windowhoogte is kleiner dan de benodigde hoogte		$winheight = siteH + 5;	}		if ($winwidth < siteW) {		$("div#page-wrap").css("width", $winwidth + "px");			} else {		//toegevoegd MME				// kijken of page-wrap weer moet worden vergroot		if(siteW<g_orgPageWrapWitdh){			// page-wrap is ooit verkleint en moet dus worden vergroot						// kijken of scherm groot genoeg is om complete page-wrap div te tonen			if($winwidth>=g_orgPageWrapWitdh){				// scherm is groot genoeg 				$("div#page-wrap").width( g_orgPageWrapWitdh );			} else {				// scherm is nog steeds te klein, voledige breedte gebruiken				$("div#page-wrap").width( $winwidth );			}		}		// einde toegevoegd MME	}		adjustTickerAndFlash();	setBackgroundImage();	centerInWindow();}function adjustTickerAndFlash() {	var $winheight = $(window).height();	var $winwidth = $(window).width();	var siteH = $('div#page-wrap').height();	var siteW = $('div#page-wrap').width();		var blankwidth =  (($winwidth-siteW)/2);	var blankheight = (($winheight-siteH)/2);		if (blankwidth >0 ) {		$("div#tickerblock").css("left", 135 + blankwidth + "px");			$("div#tickerhoek").css("left", 725 + blankwidth + "px");			$("#flashblock").css("left", 716 + blankwidth + "px");					}	if (blankheight > 0 ) {			$("div#tickerblock").css("top", 496 + blankheight + "px");		$("div#tickerhoek").css("top", 451 + blankheight + "px");		$("#flashblock").css("top", 37 + blankheight + "px");	}			//var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");   		//if (badBrowser) {   		  // 	$("div#tickerhoek").css("left", 712 + blankwidth + "px");					//$("div#tickerhoek").css("top", 469 + blankheight + "px");   		//} else {   			   		//}}function setBackgroundImage() {	//alert(screen.width);	var sW = screen.width;	if (sW <= 1024) {		$('body').css({			'backgroundImage': 'url(' + dbPath + 'images/bg_1024.jpg)'		});	} else if( sW > 1024 && sW<=1280) {			$('body').css({			'backgroundImage': 'url(' + dbPath + 'images/bg_1280.jpg)'		});	} else if( sW > 1280 && sW<=1440) {			$('body').css({			'backgroundImage': 'url(' + dbPath + 'images/bg_1440.jpg)'		});	} else if( sW > 1440 && sW<=1680) {			$('body').css({			'backgroundImage': 'url(' + dbPath + 'images/bg_1680.jpg)'		});	} else if( sW > 1680) {		$('body').css({			'backgroundImage': 'url(' + dbPath + 'images/bg_1920.jpg)'		});	}		$('body').css({		'backgroundRepeat': 'no-repeat',		'backgroundPosition': 'center center', 		'backgroundAttachment': 'fixed'	});}function centerInWindow() {	var $winheight = $(window).height();	var $winwidth = $(window).width();		var siteH = $('div#page-wrap').height();	var blankheight = $winheight - siteH;  // blanco hoogte die boven/onder verdeeld moet worden		if ($winheight  > siteH) {		topH = blankheight/2			$('div#page-wrap').css("top", topH + "px");	}	}/****************** ALERTA FLASH **********************/var params =    { wmode: "transparent" };var attributes = { };$(document).ready(function() {	if ( getCookie('vkbfm') != '1'  ) {		document.cookie = 'vkbfm=1';				//Alerta met loopje laten zien		var flashvars = { walk: "true"	};		swfobject.embedSWF(dbPath + "alerta.swf", "flashblock", "518", "540", "10.0.0", dbPath + "expressInstall.swf", flashvars, params, null, flashcallback);			if(noFlash('flashblock')) { 			gNoFlash = true;			var noFlashDiv = document.getElementById( 'noFlashText' );			if(noFlashDiv) { 				noFlashDiv.style.display = 'block'; 			}				}	} else {		// alerta zonder loopje laten zien		var flashvars = { walk: "false"	};		swfobject.embedSWF(dbPath + "alerta.swf", "flashblock", "518", "540", "10.0.0", dbPath + "expressInstall.swf", flashvars, params, null, flashcallback);		}})function flashcallback(e){	adjustTickerAndFlash();}function noFlash(id){	var htmlFlashDiv = document.getElementById(id).innerHTML;	return htmlFlashDiv.indexOf( '<embed type') ==-1 && htmlFlashDiv.indexOf( '<OBJECT' ) == -1;}function getCookie(c_name){	if (document.cookie.length>0)	  {	  c_start=document.cookie.indexOf(c_name + "=");	  if (c_start!=-1)	    { 	    c_start=c_start + c_name.length+1; 	    c_end=document.cookie.indexOf(";",c_start);	    if (c_end==-1) c_end=document.cookie.length;	    return unescape(document.cookie.substring(c_start,c_end));	    } 	  }	return "";}/****************** CONTACT FORM **********************/var showContactForm;$().ready(function() { 			if (showContactForm=="1") {			}	})function showWerk(strvalue){	$('div#voormijnwerk').toggle();	$('.scroll-pane').jScrollPane(scrollpanesettings);}function submitContactForm() {	//validate and submit form	$("#ContactForm").submit();}/****************** MENU **********************/$().ready(function() {	$("div#menu ul li:last-child").each(function(){		curheight = $(this).height();		if (curheight==33) {			$(this).css("height","41px")		} else {			$(this).css("height","55px")		}	})})/****************** SCROLLING PANE **********************/var scrollpanesettings; $(function(){	scrollpanesettings = {					scrollbarWidth: 10,					dragMinHeight:100,					dragMaxHeight:100,					reinitialiseOnImageLoad: true,					showArrows:true						};	$('.scroll-pane').jScrollPane(scrollpanesettings);	$('.scroll-pane').css("visibility","visible");		h = $('#content').height(); 	// als er geen scrollbar nodig is voor de content, dan de breedte van de content net zo groot maken als dat er wel een scrollbar zou zijn.	if (h<=428) {		$('#content').width(488);	}});/****************** TICKER TAPE  **********************/$(function(){ 	var settings = {					travelocity:0.10					};	$("ul#ticker").show();	$("ul#ticker").liScroll(); }); /****************** MATERIAAL SEARCH  **********************/var strrisicogroep;var strwerknemers;var strcontext;var searchmateriaal;$().ready(function() {	if( searchmateriaal=="1" ) {		getMateriaalList();	}});function getMateriaalList() {	frm = document.formmateriaal;	strrisicogroep = frm.risicogroep[frm.risicogroep.selectedIndex].value;	strwerknemers = frm.werknemers[frm.werknemers.selectedIndex].value;	strwerknemers = strwerknemers.split('<').join('k')	strwerknemers = strwerknemers.split('>').join('g')	strurl = dbPath + "wwwSearchMaterialen?openagent&risico=" + strrisicogroep + "&medewerker="+ strwerknemers + "&context=" + strcontext + "&nocache=" + gnocache;	$.get(strurl, function(data) {		//alert(data);		$('div#materiaalresultaat').html(data);		$('.scroll-pane').jScrollPane(scrollpanesettings);	});}
