var imagelist="";
var newload;
function ajaxpage(keyPage, submenuitem) {
	

// Use AJAX to load other pages
    var pageContent;
    teller=Math.floor(Math.random()*1000000);


    // Check if the browser knows the standard request
    if(window.XMLHttpRequest) {
        
        // Mozilla etc
        pageContent = new XMLHttpRequest();
    
    // If it does not know the standard object, check if
    // it knows the activeX object.
    } else if(window.ActiveXObject) {
    
        // Internet Explorer 6
        pageContent = new ActiveXObject("Microsoft.XMLHTTP");            
    
    // It doesn't know any, so give an error    
    } else {
        
        alert('Browser doesn\'t support AJAX'); 
    
    }

    // Open the file
    pageContent.onreadystatechange = StateChange;
	
	pageContent.open('GET', keyPage, true);
	pageContent.send(null);

    // Listen for a change state
    function StateChange() {
    
//0: Request has not been initialized yet.
//1: The request is made.
//2: The request is sent.
//3: The request is handled by the server.
//4: The request is done.
		if(pageContent.readyState == 1) {
				StartProgress();
				//document.getElementById("loader").style.display = "block";
			
		}
        // The state is changed, but is it 4?
        if(pageContent.readyState == 4) {
			
			
            // yeah the state is 4; we can now use the response text!
            // I will save it in a division with the id "leftCol"
					  document.getElementById('iefixblend').innerHTML="y";

			document.getElementById("ajaxcontent").innerHTML = "<div id=\"acont\">"+pageContent.responseText+"</div>";
			submenuitem = 'menuitem' + submenuitem;
			 
			 // de variable in hoofdjavascript aanpassen
			defmenuitem = submenuitem;
			
			var A=0;
			while (A<25)
			{
				A++;
if (document.getElementById("fotolinksboven" + A)) { 
blendimagenew("fotolinksboven"+A,"blendimage",4100,A,1);
}
			EndProgress();
			}
        }
        
    }



}
var progressTimer = 0;
var progress = false;
var a,b;

function StartProgress() {
	progress = true;
	if (progressTimer != null)
		window.clearTimeout(progressTimer);
	
	progressTimer = window.setTimeout(showProgress, 220);
} // ajax.StartProgress


// hide any progress indicator soon.
function EndProgress() {
  progress = false;
  if (progressTimer != null)
    window.clearTimeout(progressTimer);
  
  progressTimer = window.setTimeout(showProgress, 20);
} // ajax.EndProgress

function showProgress()
{
	progressTimer = null;
	var a = document.getElementById("ajaxloader");
	
	if (progress && (a != null)) {
		// just display the existing object
		a.style.top = "400px";
		a.style.display = "";
		//b.style.display = "";
	}else if (progress){
		a = document.createElement("div");
		a.id = "ajaxloader";
		a.style.position = "absolute";
		a.style.top = "400px";
		a.style.width = "99%";
		a.style.height = "100px"
		 a.style.margin = "0px";
		a.style.padding = "0px";
		a.style.verticalalign = "bottom";
		a.style.textAlign = "center";
		// style="vertical-align:bottom
		a.innerHTML = "<img  src='/images/ajax-loader.gif'> even geduld...";
		document.body.appendChild(a);
 		
		
 
 	/*	b = document.createElement("div");
		b.id = "ajaxloaderbg";
		b.style.position = "absolute";
		b.style.top = "0px";
		b.style.left = "0px";
		b.style.width = "100%";
		b.style.height = "100%"
		b.style.backgroundColor = "#000000"; 
		  b.style.filter = "alpha(style=0,opacity:" + 40 + ")";
		  b.style.KHTMLOpacity = 40 / 100;
		  b.style.MozOpacity = 40 / 100;
		  b.style.opacity = 40 / 100;



		//document.body.appendChild(b); */
		

 		 
		
		
	}else if (a) {
		a.style.display = "none";
		//b.style.display = "none";
	}
    
	
}


 
