

if (!window.XMLHttpRequest){
    window.XMLHttpRequest = function(){
        var types = ['Microsoft.XMLHTTP',
                'MSXML2.XMLHTTP.5.0',
                'MSXML2.XMLHTTP.4.0',
                'MSXML2.XMLHTTP.3.0',
                'MSXML2.XMLHTTP' ];
		
        for(var i = 0; i < types.length; i++){ 
            try
			{
                return new ActiveXObject(types[i]);
            }
            catch(e) {}
        }
		
        return undefined;
    }
}

var req = [];

/* 11042010 */
function pherio_popup( idcontent, _title, _width, _height )
{	
	if (! _width) {_width = 500;}
	if (! _height) {_height = 400;}
	var reqCnt = req.length;
	req[reqCnt] = new XMLHttpRequest();

	req[reqCnt].open("GET", "templates/ajax_getcontent.php?idcontent=" + idcontent, true);
	req[reqCnt].onreadystatechange = function()
	{
		if(req[reqCnt].readyState==4 || req[reqCnt].readyState=="complete")
		{
			//alert(req[reqCnt].responseText);
			//var omschrijving = req[reqCnt].responseXML.documentElement.getElementsByTagName('omschrijving')[0].childNodes[0].nodeValue;
			//contentfield.innerHTML = omschrijving;				
			
			var $dialogContent = $("#pherio_popupvenster");
					    
				var s = req[reqCnt].responseText;
				
				$dialogContent.find("#pherio_popupvenster_content").html(s);	   			
				
			    $dialogContent.dialog({
			        modal: true,
			        width: _width,
			        height: _height,
			        title: _title,
			        close: function()
			        {
			           $dialogContent.dialog("destroy");
			           $dialogContent.hide();
			        },
			        
	                buttons:
	                {	                
	                    "Sluiten" : function()
	                    {
	                        $dialogContent.dialog("close");
	                    }
	                }    
                                			        
			    }).show();									
		}
	}
	req[reqCnt].send(null);
}
