function initsite(){
	var agent=navigator.userAgent.toLowerCase();
	var is_iphone = ((agent.indexOf('iphone')!=-1));
	if (is_iphone) { 
		window.location="iphone.aspx";
	};
		
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}
function addStyleDef(objectID, styleName, newVal){
 var object = document.getElementById(objectID);
 object.style[styleName] = newVal;
}

 // A "global" variable that is our XMLHttpRequest object reference.
    var xmlHttpObj1 = CreateXmlHttpRequestObject();
    var xmlHttpObj2 = CreateXmlHttpRequestObject();
	var xmlHttpObj3 = CreateXmlHttpRequestObject();
	var xmlHttpObj4 = CreateXmlHttpRequestObject();
	editMode=false
	var openLibOtion=0
	var menuMemObject = new Object();
    // Function to load the customer selection data into the <SELECT> drop list control
    function loadData(actie, pageid, hstid, itemid, extraid,  holder, xmlHttpObj)
    {
		var disp = document.getElementById(holder);
		disp.innerHTML = "<div align='center'><img src='images/loader.gif'></div>";
        if (xmlHttpObj)
        {
        
            // We want this request synchronous
            xmlHttpObj.open("GET","content.aspx?actie="+ actie +"&pageid="+pageid +"&hstid="+hstid +"&itemid="+itemid+"&extraid="+extraid+"&edit="+editMode, true);

            xmlHttpObj.onreadystatechange = function()
            {
                if (xmlHttpObj.readyState == READYSTATE_COMPLETE)
                {
                
                    // If the request was ok (ie. equal to a Http Status code of 200)            
                    if (xmlHttpObj.status == HTTPSTATUS_OK)
                    {
                       disp.innerHTML =  xmlHttpObj.responseText;
					}
					else
					{
						//disp.innerHTML = "status: "+xmlHttpObj.status;
                    }
				}
                 else
				 {
					//disp.innerHTML = "readystate: "+xmlHttpObj.readyState;
				}
            }
            // Execute the request            
            xmlHttpObj.send("SomeDataToSend");
            
        }
    }
	
	function openMenu(menuName, holder){
		if (menuMemObject[menuName]){
			setClassDef(menuMemObject[menuName], "")
			
		}
		setClassDef(holder, "sel")
		menuMemObject[menuName] = holder
		
	}
	
	function clearContent(holder){
		//var disp = document.getElementById(holder);
		//disp.innerHTML = "";
		hideContent(holder)
	}
	function hideContent(holder){
		addStyleDef(holder, "display", "none")
	}
	function showContent(holder){
		addStyleDef(holder, "display", "block")
	}
    
	function addStyleDef(objectID, styleName, newVal){
	 var object = document.getElementById(objectID);
	 object.style[styleName] = newVal;
	}
	function setClassDef(objectID, newVal){
		document.getElementById(objectID).className = newVal;
	}
	function resetOpt(){
		
		//setClassDef('opt07', 'unsel');
		openLibOtion=0;
		
	}
	function lastLibMem(){}
	
	
	function openOpt01(){
		resetOpt();
		loadData("openContent", 1, 0, 0, 0, "normalContentPanel", xmlHttpObj2);
		setInterface("normal");
		setClassDef('opt01', 'sel');
		pageTracker._trackPageview("/DittaEngel" ); 
	}
	function openOpt02(){
		resetOpt();
		loadData("showNewItemsLibrary", 0, 0, 0, 0, "libraryContentLibraryPanel", xmlHttpObj2);
		setInterface("lib");
		clearContent("libraryContentbrowserPanel");
		setClassDef('opt02', 'sel');
		pageTracker._trackPageview("/NieuweBeelden" ); 
	}
	function openOpt03(){
		resetOpt();
		loadData("openLibrary", 2, 0, 0, 0, "libraryContentLibraryPanel", xmlHttpObj2);
		loadData("openLibraryControls", 2, 0, 0, 0, "libraryContentbrowserPanel", xmlHttpObj3);
		setInterface("lib")
		setClassDef('opt03', 'sel');
		pageTracker._trackPageview("/GroteBeelden" ); 
	}
	function openOpt04(){
		resetOpt();
		loadData("openLibrary", 4, 0, 0, 0, "libraryContentLibraryPanel", xmlHttpObj2);
		loadData("openLibraryControls", 4, 0, 0, 0, "libraryContentbrowserPanel", xmlHttpObj3);
		setInterface("lib");
		setClassDef('opt04', 'sel');
		pageTracker._trackPageview("/KleineBeelden" ); 
	}
	function openOpt05(){
		resetOpt();
		loadData("openLibrary", 5, 0, 0, 0, "libraryContentLibraryPanel", xmlHttpObj2);
		loadData("openLibraryControls", 5, 0, 0, 0, "libraryContentbrowserPanel", xmlHttpObj3);
		setInterface("lib");
		setClassDef('opt05', 'sel');
		pageTracker._trackPageview("/BeeldenInOpdracht" ); 
	}
	function openOpt06(){
		resetOpt();
		
		setInterface("route");
		setClassDef('opt06', 'sel');
		pageTracker._trackPageview("/route" ); 
	}
	function openOpt07(){
		resetOpt();
		
		setInterface("normal");
		setClassDef('opt06', 'sel');
		pageTracker._trackPageview("/route" ); 
	}
	
	// AGENDASCRIPT
	
	
	var c=0;
	var t;
	function timedCount()
	{
	var x=document.getElementsByTagName("agenda");
	
	c=c+1;
	if(c>=x.length){
	c=0;	
	}
	if(x.length > 0){
 // document.write(x[c].innerHTML);
document.getElementById('zijContentPanel2').innerHTML = x[c].innerHTML
// document.getElementById('zijContentPanel2').innerHTML = c;
 }
 	//document.getElementById('zijContentPanel2').innerHTML =x[c].childNodes[0].innerHTML;
	
	
	t=setTimeout("timedCount()",8000);
	}
	
	function stopCount()
	{
	clearTimeout(t);
	}

