function placeObject(indhold) {   
    document.write(indhold);   
 }
 
 function testJava() {   
	var applet = document.getElementById("kortinfoapplet");
    if(applet == null)
    {
        installJava();
    } else {
		try {
			applet.getJavaVersion();
		}
		catch(exception) {
			installJava();
		}
	}
 }
 
 function installJava()
 {
    alert("For at køre KortInfo skal Java 1.6 være installeret. Du vil nu bliver videresendt til Java.Com hvor du let kan opgradere til Java 1.6.");
	window.location = "http://jdl.sun.com/webapps/getjava/BrowserRedirect?locale=en&host=www.java.com:80";
 }
 
function DoStuff(xmlPath)
{
    if (xmlPath != "")
    {
        DoLocalize(xmlPath);
    }
            
    var documentUrl = document.getElementById("txtJournalizationFilePath").value;
    if (documentUrl != "")
    {
        DoJournalize(documentUrl);
    }
    
    if ((xmlPath != "") || (documentUrl != ""))
    {
        window.close();
    }
}
  
function DoLocalize(xmlPath)
{
    var acadreApplication = null;
    
    try
    {
        acadreApplication = new ActiveXObject("AcadreBU.Application");
    }
    catch(err)
    {
        alert("ActiveX initialization failed. Please, check your IE Security Settings for Trusted Sites." + "\r" + "System error description: " + err.description);
    }
    
    if (acadreApplication != null) 
    {
        var importer = acadreApplication.Documents;
        if (importer != null)
        {
            //alert(xmlPath);
            importer.GISimport(xmlPath);
        }
    }
    importer = null;
    acadreApplication = null;
}

function DoJournalize(documentUrl)
{
    var acadreApplication = null;
    
    try
    {
        acadreApplication = new ActiveXObject("AcadreBU.Application");
    }
    catch(err)
    {
        alert("ActiveX initialization failed. Please, check your IE Security Settings for Trusted Sites." + "\r" + "System error description: " + err.description);
    }
    
    if (acadreApplication != null) 
    {
        var importer = acadreApplication.Documents;
        if (importer != null)
        {
            alert("Please, wait until the Acadre Document Importer is opened..."); 
            importer.Import(1, 0, documentUrl, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
        }
    }
    importer = null;
    acadreApplication = null;
}