
function dovotehero(s) {
	if (document.getElementById("popupvotehero")) {
		if (document.getElementById("herocontainer")) {
			document.getElementById("slugvote").value = s;
			faderEx2("height", "", "px", "herocontainer", 300, 10, "dovotehero2()");
		} // endif
	} // endif
	return false;
} // end func.

function dovotehero2() {
	document.getElementById("popupvotehero").style.display = "block";
	document.getElementById("herocontainer").style.display = "none";
	document.getElementById("popupaftervotehero").style.display = "none";
	document.getElementById("popupfailvotehero").style.display = "none";
	document.getElementById("emailvote").value = "";
	faderEx2("height", "", "px", "popupvotehero", 10, 130, "dovotehero3()");
} // end func.

function dovotehero3() {
	try {
		document.getElementById("emailvote").focus();
	} catch (er) {
	} // endif
} // end func.

function afterheromailsend() {
	document.getElementById("popupvotehero").style.display = "none";
	document.getElementById("herocontainer").style.display = "none";
	document.getElementById("popupfailvotehero").style.display = "none";
	document.getElementById("popupaftervotehero").style.display = "block";
	faderEx("height", "", "px", "popupaftervotehero", 10, 80, "");
} // end func.

function failheromailsend() {
	document.getElementById("popupvotehero").style.display = "none";
	document.getElementById("herocontainer").style.display = "none";
	document.getElementById("popupaftervotehero").style.display = "none";
	document.getElementById("popupfailvotehero").style.display = "block";
	faderEx("height", "", "px", "popupfailvotehero", 10, 80, "");
} // end func.

function submitvotehero() {
  var email = "";
	email = trim(document.getElementById("emailvote").value);
	if (email.length) {
		pagegoto(gURL + "action/sendvote/?cmd=" + escape(document.getElementById("slugvote").value) + "&value=" + escape(email));
	} else {
		alert("Voer je emailadres in");
	}  // endif
	return false;
} // end func.

/**
  * ajaxinit()
  */
var xmlhttp;
var xml_use;
function ajaxinit() {
	xml_use = 1;
	if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		xml_use = 0;
	} // endif
} // end func.

/**
  * replace_links()
  */
function replace_links(c) {

	var lst = document.getElementsByTagName("a");
	for (var i = 0; i < lst.length; i++) {
		var lnk = lst[i];
		if (lnk.className) {
			if (lnk.className.toString().toLowerCase().indexOf(c) != -1) {
				var url = lnk.href;
				if (url.indexOf("?") == -1) { url += "?"; } else { url += "&"; }
				lnk.href = "javascript:pagegoto('" + url + "location=1" + "');";
			} // endif
		} // endif
	} // next

} // end func.

/**
  * pagegoto()
  */
function pagegoto(u) {

  var url;
	url = u;
	if (url.indexOf("?") == -1) {
		url += "?rnd=" + String(Math.round(Math.random()*100000000));
	} else {
		url += "&rnd=" + String(Math.round(Math.random()*100000000));
	} // endif
	xmlhttp.open("GET", url, true);
	xmlhttp.onreadystatechange = function() { ajaxread(); }; // end func.
	xmlhttp.send(null);

} // end func.

/**
  * pagegoto()
  */
function postform(f, param, from, val, cmd) {

  var url;
  var data;
	url  = f.action;
	data = "location=1";
	if (param.length) { if (document.getElementById(param)) data += "&param=" + escape(document.getElementById(param).value); } // endif
	if (from.length) { if (document.getElementById(from)) data += "&from=" + escape(document.getElementById(from).value); } // endif
	if (val.length) { if (document.getElementById(val)) data += "&value=" + escape(document.getElementById(val).value); } // endif
	if (cmd.length) { if (document.getElementById(cmd)) data += "&cmd=" + escape(document.getElementById(cmd).value); } // endif
	xmlhttp.open("POST", url, true);
	xmlhttp.onreadystatechange = function() { ajaxread(); }; // end func.
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send(data);
	return false;

} // end func.
function postform2(f, param, from, val, cmd, query, stat) {

  var url;
  var data;
	url  = f.action;
	data = "location=1";
	if (param.length) { if (document.getElementById(param)) data += "&param=" + escape(document.getElementById(param).value); } // endif
	if (from.length) { if (document.getElementById(from)) data += "&from=" + escape(document.getElementById(from).value); } // endif
	if (val.length) { if (document.getElementById(val)) data += "&value=" + escape(document.getElementById(val).value); } // endif
	if (cmd.length) { if (document.getElementById(cmd)) data += "&cmd=" + escape(document.getElementById(cmd).value); } // endif
	if (query.length) { if (document.getElementById(query)) data += "&query=" + escape(document.getElementById(query).value); } // endif
	if (stat.length) { data += "&stat=" + escape(stat); } // endif
	xmlhttp.open("POST", url, true);
	xmlhttp.onreadystatechange = function() { ajaxread(); }; // end func.
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send(data);
	return false;

} // end func.
function postform3(f, param, from, val, cmd, query, stat, xval) {

  var url;
  var data;
	url  = f.action;
	data = "location=1";
	if (param.length) { if (document.getElementById(param)) data += "&param=" + escape(document.getElementById(param).value); } // endif
	if (from.length) { if (document.getElementById(from)) data += "&from=" + escape(document.getElementById(from).value); } // endif
	if (val.length) { if (document.getElementById(val)) data += "&value=" + escape(document.getElementById(val).value); } // endif
	if (cmd.length) { if (document.getElementById(cmd)) data += "&cmd=" + escape(document.getElementById(cmd).value); } // endif
	if (query.length) { if (document.getElementById(query)) data += "&query=" + escape(document.getElementById(query).value); } // endif
	if (xval.length) { if (document.getElementById(xval)) data += "&xval=" + escape(document.getElementById(xval).value); } // endif
	if (stat.length) { data += "&stat=" + escape(stat); } // endif
	xmlhttp.open("POST", url, true);
	xmlhttp.onreadystatechange = function() { ajaxread(); }; // end func.
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send(data);
	return false;

} // end func.
function postform33(f, param, param2, param3, from, val, cmd, query, stat, xval) {

  var url;
  var data;
	url  = f.action;
	data = "location=1";
	if (param.length) { if (document.getElementById(param)) data += "&param=" + escape(document.getElementById(param).value); } // endif
	if (param2.length) { if (document.getElementById(param2)) data += "&middle_name=" + escape(document.getElementById(param2).value); } // endif
	if (param3.length) { if (document.getElementById(param3)) data += "&last_name=" + escape(document.getElementById(param3).value); } // endif
	if (from.length) { if (document.getElementById(from)) data += "&from=" + escape(document.getElementById(from).value); } // endif
	if (val.length) { if (document.getElementById(val)) data += "&value=" + escape(document.getElementById(val).value); } // endif
	if (cmd.length) { if (document.getElementById(cmd)) data += "&cmd=" + escape(document.getElementById(cmd).value); } // endif
	if (query.length) { if (document.getElementById(query)) data += "&query=" + escape(document.getElementById(query).value); } // endif
	if (xval.length) { if (document.getElementById(xval)) data += "&xval=" + escape(document.getElementById(xval).value); } // endif
	if (stat.length) { data += "&stat=" + escape(stat); } // endif
	xmlhttp.open("POST", url, true);
	xmlhttp.onreadystatechange = function() { ajaxread(); }; // end func.
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send(data);
	return false;

} // end func.
/**
  * ajaxread()
  */
function ajaxread() {
	if (xmlhttp.readyState == 4) {
		try {
			eval(xmlhttp.responseText);
		} catch (ex) {
		} // endtry
	} // endif
} // end func.

/**
  * scriptinit()
  */
function scriptinit() {
	ajaxinit();
	if (xml_use) {
		xmlhttp.onreadystatechange = function() { ajaxread(); }; // end func.
		// replace_links("herolink");
	} // endif
	try {
		loadsshow();
	} catch(e) {
		// ignore
	} // end try
	/*
	if (document.getElementById("page")) {
		var t = document.getElementById("page").offsetHeight;
		var a = document.getElementById("header").offsetHeight;
		var b = document.getElementById("wrapper").offsetHeight;
		var c = document.getElementById("footer").offsetHeight;
		var h = docSizes(1);
		if ((a + c) < h) {
		alert(b);
			document.getElementById("wrapper").style.minHeight = h - (a + c) + "px";
		} // endif
	} // endif
	*/
	fix_sizer();
	/*
	if (document.getElementById("page")) {
		if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			document.body.style.backgroundImage = "url('http://89.43.126.200/alex/werkenaandezorg.nl/www/storage/images/background-ie.gif')";
		} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
			document.body.style.backgroundImage = "url('http://89.43.126.200/alex/werkenaandezorg.nl/www/storage/images/background-ie.gif')";
		} // endif
		var xdiv = document.getElementsByTagName("DIV");
		for (var i = 0; i < xdiv.length; i++) {
			var divx = xdiv[i];
			if (divx.className) {
				if (divx.className.toString().toLowerCase().indexOf("makeopac") != -1) {
					var scls = divx.className.toString().toLowerCase().substring(divx.className.toString().toLowerCase().indexOf("makeopac") + 8);
					var icls = parseInt(scls);
					divx.style.opacity = icls / 100;
					divx.style.filter  = "alpha(opacity="+icls+")";
				} // endif
			} // endif
		} // next (i)
	} // endif
	*/
} // end func.
function fix_sizer() {
	if (document.getElementById("page")) {
		try {
			if (document.getElementById("page").offsetHeight < document.documentElement.clientHeight) {
				document.getElementById("page").style.height = document.documentElement.clientHeight + "px";
			} // endif
		} catch (er) {
		} // end try
	} // endif
	window.setTimeout("fix_sizer()", 1000);
} // end func.
function docSizes(i) {
  var myWidth = 0, myHeight = 0;
	if (typeof(window.innerWidth) == 'number') {
		// Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		// IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		// IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	} // endif
	if (i = 1) return myHeight;
	return myWidth;
} // end func.

if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", scriptinit, false);
} else {
	window.onload = scriptinit;
} // endif
window.onresize = function (ev) { fix_sizer(); };

/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
var tmrFADER;
var tmrCLOSE;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
function fader(element, from, to, exe) {
  if (tmrFADER) window.clearTimeout(tmrFADER);
  var x = from;

	if (from < to) from = from + 10;
	if (from > to) from = from - 10;
	try {
		document.getElementById(element).style.filter   = "alpha(opacity=" + from + ")";
		document.getElementById(element).style.opacity  = (from / 100);
	} catch (er) {
	} // end try
	if (from != to) {
		tmrFADER = window.setTimeout("fader('" + element + "', " + from + ", " + to + ", '" + exe + "')", 5);
	} else {
		try { eval(exe); } catch (er) {
		} // end try
	} // endif

} // end func.
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
function faderEx(attribute, prefix, suffix, element, from, to, exe) {
  if (tmrFADER) window.clearTimeout(tmrFADER);
  var x = from;
  var ele;
  var arrEle;

	if (from < to) from = from + 10;
	if (from > to) from = from - 10;
	try {
		arrEle = element.split(" ");
		for (var i = 0; i < arrEle.length; i++) {
			ele = arrEle[i];
			document.getElementById(ele).style[attribute] = prefix + from + suffix;
		} // next
	} catch (er) {
	} // end try
	if (from != to) {
		tmrFADER = window.setTimeout("faderEx('" + attribute + "', '" + prefix + "', '" + suffix + "', '" + element + "', " + from + ", " + to + ", '" + exe + "')", 5);
	} else {
		try { eval(exe); } catch (er) {
		} // end try
	} // endif

} // end func.
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
function faderEx2(attribute, prefix, suffix, element, from, to, exe) {
  if (tmrFADER) window.clearTimeout(tmrFADER);
  var x = from;
  var ele;
  var arrEle;
  var aop = 100;

	if (from < to) from = from + 10;
	if (from > to) from = from - 10;
	try {
		arrEle = element.split(" ");
		for (var i = 0; i < arrEle.length; i++) {
			ele = arrEle[i];
			aop = from;
			document.getElementById(ele).style[attribute] = prefix + from + suffix;
			if (aop < 1) aop = 1;
			if (aop > 100) aop = 100;
			document.getElementById(ele).style.filter   = "alpha(opacity=" + aop + ")";
			document.getElementById(ele).style.opacity  = (aop / 100);
		} // next
	} catch (er) {
	} // end try
	if (from != to) {
		tmrFADER = window.setTimeout("faderEx2('" + attribute + "', '" + prefix + "', '" + suffix + "', '" + element + "', " + from + ", " + to + ", '" + exe + "')", 5);
	} else {
		try { eval(exe); } catch (er) {
		} // end try
	} // endif

} // end func.
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */

/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
} // end func.
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
} // end func.
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
} // end func.
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */

