
    var current;
    
    activateMenu = function(menu) 
    {
        /* currentStyle restricts the Javascript to IE only */        
    	if (document.getElementById(menu)) 
        {
            var navroot = document.getElementById(menu);

            /* Get all the list items within the menu */
            var lis=navroot.getElementsByTagName("LI");
            
            for (i=0; i<lis.length; i++) {
    
               /* If the LI has another menu level */
                if(lis[i].childNodes.length > 2)
                {
                	// Find elements
                	var currentLi = lis[i];
                	var currentUl = currentLi.childNodes[2];
                	
                	// Put the cursor to pointer
                    currentUl.style.display	= currentUl.id == 'active' ? 'block' : 'none';
                    
                	currentLi.firstChild.style.cursor	= 'pointer';
                    currentLi.firstChild.currentUl 	 	= currentUl;
                 	currentLi.firstChild.onmousedown	= function() 
                 	{
                       this.currentUl.style.display = (this.currentUl.style.display == 'none') ? 'block' : 'none';
                    }
                }
            }
        }
    }
    
    
    printImage = function(image)
    {
    	var url = 'http://www.fietseninflevoland.nl/image.php?act=displayPic&pic='+image;
    	
    	if (window.print && window.frames && window.frames.printerIframe) 
    	{
		    var html = '';
		    html += '<html>';
		    html += '<body onload="parent.printFrame(window.frames.urlToPrint);">';
		    html += '<iframe name="urlToPrint" src="' + url + '"><\/iframe>';
		    html += '<\/body><\/html>';
		    
		    var ifd = window.frames.printerIframe.document;
		    
		    ifd.open();
		    ifd.write(html);
		    ifd.close();
  		}
  		else
  		{
  			var win = window.open('', 'printerWindow', 'width=600,height=300,resizable,scrollbars,toolbar,menubar');
  			 
      		var html = '';
	      	html += '<html>';
	      	html += '<frameset rows="100%, *" onload="opener.printFrame(window.urlToPrint);">';
	        html += '<frame name="urlToPrint" src="' + url + '" \/>';
	        html += '<\/frameset><\/html>';
	      
	     	win.document.open();
	      	win.document.write(html);
	      	win.document.close();      
  		}
    }
   
    function printFrame (frame) 
    {
  		if (frame.print) 
  		{
    		frame.focus();
    		frame.print();
  		}
	}

	function openWinClick (location, name, width, height )
	{
	    popup = window.open(location, '_blank', 'menubar=no,resizable=yes,scrollbars=no,status=0,width='+width+',height='+height);
        
		if(popup == null) 
        {
        	window.location = location;
        }
        else
        {
        	popup.focus();	
        }
	}

window.onload = function()
{
	activateMenu('menu');
}
