// browser, os check
function checkIt(string) {
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

// redirect
function goTo(strURL) {
	if(strURL != "") {
		document.location.href = strURL;
	}
}

// zet voor IE de goeie hoogte
function setTdHeight() {
	if(browser == "Internet Explorer") {
		
		// td --> main
		tdHeight = document.getElementById('mainWindow').offsetHeight - 36;
		if(tdHeight > 0)  {
			document.getElementById('mainWindow').style.height = tdHeight;
		}
		
		// div --> content_menuholder
		if(document.location.href.indexOf("index.php") <= 0 && document.location.href.indexOf("faq.php") <= 0 && document.location.href.indexOf(".php") >= 0) {
			divHeight = document.getElementById('content_menuholder').offsetHeight;
			if(divHeight < 173) {
				document.getElementById('content_menuholder').style.height = 173;
			}
		}
		
		// div --> mainContentVenster
		if(document.location.href.indexOf("index.php") <= 0 && document.location.href.indexOf(".php") >= 0) {
			divHeight = document.getElementById('mainContentVenster').offsetHeight;
			if(divHeight < 340) {
				document.getElementById('mainContentVenster').style.height = 340;
			}
		}
		
	}
}

// pure CSSmenu IE bug fix
function startList() {
	if (document.all && document.getElementById) {
		
		var menus = new Array();
		menus[0] = "menu";
		if(document.location.href.indexOf("index.php") <= 0 && document.location.href.indexOf(".php") >= 0) {
			menus[1] = "menu2";
			if(document.location.href.indexOf("zoeken.php") <= 0 && document.location.href.indexOf("faq.php") <= 0) {
				menus[2] = "menu3";
			}
		}
		
		for(x = 0; x < menus.length; x++) {
			navRoot = document.getElementById(menus[x]);
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				//voor node zelf (LI)
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
				
				//voor childnodes (LI LI)
				for (j=0; j<node.childNodes.length; j++) {
					childnode = node.childNodes[j];
					if (childnode.nodeName=="UL") {
						for (k=0; k<childnode.childNodes.length; k++) {
							grantchildnode = childnode.childNodes[k];
							
							if (grantchildnode.nodeName=="LI") {
								grantchildnode.onmouseover=function() {
									this.className+=" over";
								}
								grantchildnode.onmouseout=function() {
									this.className=this.className.replace(" over", "");
								}
							}
							
							//voor childnodes (LI LI LI)
							for (p=0; p<node.childNodes.length; p++) {
								childnode = node.childNodes[p];
								if (childnode.nodeName=="UL") {
									for (l=0; l<childnode.childNodes.length; l++) {
										grantchildnode = childnode.childNodes[l];
										if (grantchildnode.nodeName=="LI") {
											grantchildnode.onmouseover=function() {
												this.className+=" over";
											}
											grantchildnode.onmouseout=function() {
												this.className=this.className.replace(" over", "");
											}
										}
									}
								}
							}
							
						}
					}
				}
			}
		}	
		
	}
}

makeIEBug = function() {
	startList();
	setTdHeight();
}

// print function
function printNow() {
	print_window.focus();
	print_window.print();
}

function selectFieldValue(obj) {
	obj.select();
}

// Show flash
function showFlash(filename,width,height) {
	document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="'+filename+'" WIDTH="'+width+'" HEIGHT="'+height+'" ALIGN="middle">');
   	document.write ('		<PARAM NAME="movie" VALUE="'+filename+'"> ');
	document.write ('		<param name="menu" value="false" />');
	document.write ('		<param name="quality" value="high" />');
	document.write ('		<param name="wmode" value="transparent" />');
	document.write ('		<embed src="'+filename+'" menu="false" quality="high" bgcolor="#FFFFFF" wmode="transparent" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	document.write ('		</embed>');
	document.write ('</OBJECT>');
}