
	 
 //IN DEZE FUNCTIE WORDT HET AJAX OBJECT AANGEMAAKT 
function ajaxFunction2()
 { 
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	

	
 }
 
 function loadjscssfile(filename, filetype){
				 if (filetype=="css"){ //if filename is an external CSS file
				  var fileref=document.createElement("link")
				  fileref.setAttribute("rel", "stylesheet")
				  fileref.setAttribute("type", "text/css")
				  fileref.setAttribute("href", filename)
				 }
				 if (typeof fileref!="undefined")
				  document.getElementsByTagName("head")[0].appendChild(fileref)
				}
					
					

  function setSession(tekstgrootte,filename,url)
 {
	loadjscssfile(filename, 'css')
	
	
	xmlHttp.open("POST",url,true);
	
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.send('SESSION_tekstgrootte='+tekstgrootte);	 	
 }



function GetXmlHttpObject()
 {
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				xmlHttp=new IFrameRequest();

			}
		}
	}
	return xmlHttp;
 }
 
 function IFrameRequest() 
{
  var reqCount = 0;
  this.readyState = 0;
  this.status = 0;
  this.responseText = "";    
  reqCount++;
  this.req_id = reqCount;
}
IFrameRequest.prototype = {
  open: function(protocol, url, async) {
    this.protocol = protocol;
    this.url = url;  
  },
  
  onreadystatechange: function() { },
  
  send: function(postBody) {
    var self = this;    
    if(this.protocol.toUpperCase()=='POST')
    {
      this.url = this.url + "&" + postBody;
    }
    var IFrameDoc = document.createElement('iframe');
    IFrameDoc.setAttribute('id', 'req'+this.req_id);
    IFrameDoc.setAttribute('name', 'req'+this.req_id);
    IFrameDoc.style.width = "0";IFrameDoc.style.height = "0";IFrameDoc.style.border = "0";          
    document.body.appendChild(IFrameDoc);    
    
    try {      
      IFrameDoc.src = this.url;   
    }
    catch(e)
    {
      return false;
    }
 
    this.readyState = 1; this.onreadystatechange();
 
    setTimeout(function(){self.IFht(4);}, 4);     
  },
  
  overrideMimeType: function() { },
  
  getResponseHeader: function (name) { return ''; },
  
  setRequestHeader: function (name, data) { },
  
  IFht: function (d) { var self=this;var el=document.getElementById('req'+self.req_id); if(el.readyState=='complete') { self.responseText = document.frames['req'+self.req_id].document.body.innerHTML.replace(/[\n\r]+/ig, ""); el.parentNode.removeChild(el); self.status = 200; self.readyState = 4; self.onreadystatechange(); }else{ d*=1.5; setTimeout(function(){self.IFht(d);},d); } }
  }
