function createPdf()
{
	var site 	= window.top.location.toString();;
	site		= site.replace(root, "");
	site		= site.replace("&", "{amp}");
	site		= site.replace("https", "http");
	site		= site.replace("#createPdf", "");
	site		= site.replace("#print", "");
	
	if(site === "") {
		site = "index.php";
	}
	xmlhttpPost( root+"toolbox/createPdf.php?site="+site+"&gw_site="+gw_site+"&lang="+lang+"&url_base='"+root+"'" );
}

function xmlhttpPost(strURL)
{
    var xmlHttpReq 	= false;
    var self 		= this;
	
    // Mozilla/Safari
    if (window.XMLHttpRequest)
	{
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject)
	{
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	
	self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    
	self.xmlHttpReq.onreadystatechange = function()
	{
        if (self.xmlHttpReq.readyState == 4)
		{
            updatepage(self.xmlHttpReq.responseText);
        }
		else
		{
			document.getElementById("pdf_result").style.display = "block";
		}
    }
	
    self.xmlHttpReq.send("");
}


function updatepage(str)
{
   document.getElementById("pdf_result_text").innerHTML = str;
}

function closePDF()
{
	document.getElementById("pdf_result").style.display = "none";
}