﻿function Load_Content_Pages(tmpSubPage, tmpLoadMail) {
	var tmpUrl ;
	tmpUrl = "Pages/" + tmpSubPage+ ".htm";

	Load_ByAjax ("GET", tmpUrl, "div_content");
	
	
	if (tmpLoadMail == true ) {
		//Load_content_contact_email_address();

		if (navigator.userAgent.indexOf("MSIE") != -1) {
			//IE: direct inladen
			Load_content_contact_email_address();
		}
		if ( (navigator.appName =='Netscape') && ( navigator.userAgent.indexOf('Opera') == -1) ) {
			//lukt niet: timeout toevoegen...
			
			
		}
		
	}	
}

function Load_ByAjax(tmpOpenType, tmpUrl, tmpDestinationDiv) {
	
	var xmlhttp=false;
	
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} 
	catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (E) {
			xmlhttp = false;
		}
	}
	@end @*/
	
	if (!xmlhttp) {
		if (window.XMLHttpRequest) {
			//alert(1);
			xmlhttp = new XMLHttpRequest();
			/*
			try {
            	netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
       		} 
       		catch (e) {
            	alert("Permission could be denied for cross-domain scripting.");
        	}
        	*/
		}
		// code for IE
		else if (window.ActiveXObject) {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
		
	//xmlhttp.open("GET", tmpUrl ,true);
	xmlhttp.open(tmpOpenType , tmpUrl , true);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4) {
			document.getElementById(tmpDestinationDiv).innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
		
}


function Load_content_contact_email_address() {
	var sTransform = transformXML("XML/Mail.xml","XML/Mail.xsl", "temp");
	//alert(sTransform );
	document.getElementById("div_content_contact_email_address").innerHTML = sTransform;
}
	

