	function createHTTPHandler(){
		httphandler = 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 {
		httphandler = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
		httphandler = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		httphandler = false;
		}
		}
		@end @*/
		if (!httphandler && typeof XMLHttpRequest!='undefined') {
			httphandler = new XMLHttpRequest();
		}
			return httphandler;
	}
	var XMLHTTPObject = null;
	var inhoudDiv = null;
	
	function ajax(pagesource,destination){
		var AJAXHTTPObject = new createHTTPHandler();
		destination.innerHTML = "";
		
		AJAXHTTPObject.onreadystatechange=function() {
			if (AJAXHTTPObject.readyState == 4) {
				var found = "true";
				var startindex=0;
				
				$(destination).html(AJAXHTTPObject.responseText);
			}
		}

		AJAXHTTPObject.open('GET', pagesource, true);
		AJAXHTTPObject.send(null);
	}
	
	function ajaxReturn(pagesource){
			var AJAXHTTPObject = new createHTTPHandler();	
			var response = "";
			AJAXHTTPObject.open('GET', pagesource, false);
			AJAXHTTPObject.send(null);
			eval(AJAXHTTPObject.responseText.substring((AJAXHTTPObject.responseText.indexOf("<script>")+8), AJAXHTTPObject.responseText.indexOf("</script>")));
			return AJAXHTTPObject.responseText;
	}
	
	function ajaxPOST(pagesource,destination,args){
		var AJAXHTTPObject = new createHTTPHandler();
		destination.innerHTML = "<img src='images/ajax-loader.gif' align='center'>";
		
		AJAXHTTPObject.onreadystatechange=function() {
			if (AJAXHTTPObject.readyState == 4) {
				destination.innerHTML = AJAXHTTPObject.responseText;
			}
		}
		
		AJAXHTTPObject.open('GET', pagesource+'?'+args, true);
		AJAXHTTPObject.send(null);
	}
	
	function ajaxLogin(pagesource,destination,args){
		var AJAXHTTPObject = new createHTTPHandler();
		destination.innerHTML = "<img src='images/ajax-loader.gif' align='center'>";
		
		AJAXHTTPObject.onreadystatechange=function() {
			if (AJAXHTTPObject.readyState == 4) {
				destination.innerHTML = AJAXHTTPObject.responseText;
				if(destination.innerHTML == ''){document.getElementById('form').submit();}
			}
		}

		AJAXHTTPObject.open('GET', pagesource+'?'+args, true);
		AJAXHTTPObject.send(null);
	}
	
	function ajaxLoadlogo(icon_id){
		var AJAXHTTPObject = new createHTTPHandler();
		destination=document.getElementById("winkelDiv");
		destination.innerHTML = "<img src='images/ajax-loader.gif' align='center'>";
		
		AJAXHTTPObject.onreadystatechange=function() {
			if (AJAXHTTPObject.readyState == 4) {
				destination.innerHTML = AJAXHTTPObject.responseText;
				if(destination.innerHTML == ''){document.getElementById('form').submit();}
			}
		}

		AJAXHTTPObject.open('GET', "pages/iconpage.php?icon_id="+icon_id, true);
		AJAXHTTPObject.send(null);
	}
	
	function ajaxLoadWinkel(sortpos){
		var AJAXHTTPObject = new createHTTPHandler();
		destination=document.getElementById("pageContent");
		changeOpac(0,'pageContent');
		//destination.innerHTML = "<img src='images/ajax-loader.gif' align='center'>";
		
		AJAXHTTPObject.onreadystatechange=function() {
			if (AJAXHTTPObject.readyState == 4) {
				destination.innerHTML = AJAXHTTPObject.responseText;
				if(destination.innerHTML == ''){document.getElementById('form').submit();}
				shiftOpacity('pageContent', 300);
			}
		}

		AJAXHTTPObject.open('GET', "pages/winkel.php?sortpos="+sortpos, true);
		AJAXHTTPObject.send(null);
	}
	
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

	function shiftOpacity(id, millisec) { 
    //if an element is invisible, make it visible, else make it ivisible 
    if(document.getElementById(id).style.opacity == 0) { 
        opacity(id, 0, 100, millisec); 
    } else { 
        opacity(id, 100, 0, millisec); 
    } 
} 
