function map24()
{
	this.sid = 0;
	this.mid = '';
	this.width = 0;
	this.height = 0;
	this.system = "maptp35.map24.com";
	this.lang = "nl-NL";
	this.agentID = "map24/webservices1.5/map24agent";
	this.skin = "map24portal_2006";
	this.pprop = "map24portal_2006/TAAND_EUROPE/TAAND";
	this.psym = "map24portal_2006/TAAND_EUROPE/symTAAND";
	this.archive = "map24portal_2006_TAAND_EUROPE_nl.zip";
	this.codebase = "MAP24_v3.7.03_20070612";
	this.code = "com.mapsolute.map24.Map24.class";
	this.initialized = false;
	this.logURI = '';
}

map24.prototype.setSid = function( sid )
{
	if(isset(sid))
	{
		this.sid = sid;
	}
	else
	{
		alert("Sid is niet gezet");
	}
}

map24.prototype.setMid = function( mid )
{
	if(isset(mid))
	{
		this.mid = mid;
	}
	else
	{
		alert("Mid is niet gezet");
	}
}

map24.prototype.setLogURI = function( sURI )
{
	if(isset(sURI))
	{
		this.logURI = sURI;
	}
	else
	{
		alert("LogURI is niet gezet");
	}
}

map24.prototype.getSystemURI = function()
{
	return "http://"+this.system+"/";
}

map24.prototype.getArchive = function()
{
	return this.getSystemURI()+"/"+this.codebase+"/"+this.archive;
}

map24.prototype.getMap = function( width, height )
{
	if(this.logRequest())
	{
		var sReturn = "<applet\n";
		sReturn += "width='"+width+"'\n";
		sReturn += "height='"+height+"'\n";
	    sReturn += "code = '"+this.code+"'\n";
	    sReturn += "codebase = '"+this.getSystemURI()+this.codebase+"'\n";
	    sReturn += "archive ='"+this.getArchive()+"'>\n";
	    sReturn += "<param name='map24agentid' value='"+this.agentID+"'>\n";
	    sReturn += "<param name='mid' value='"+this.mid+"'>\n";
	    sReturn += "<param name='sid' value='"+this.sid+"'>\n";
	    sReturn += "<param name='splash' value='none'>\n";
	    sReturn += "<param name='lang' value='"+this.lang+"'>\n";
	    sReturn += "<param name='skin' value='"+this.skin+"'>\n";
	    sReturn += "<param name='pprop' value='"+this.pprop+"'>\n";
	    sReturn += "<param name='psym' value='"+this.psym+"'>\n";
	    sReturn += "<param name='loctarget' value='MAIN'>\n";
	    sReturn += "&nbsp;";
	    sReturn += "</applet>\n";
    }
    else
    {
    	alert("Request kon niet worden gelogd.");
    	var sReturn = '';
    }
    return sReturn;
}

map24.prototype.logRequest = function()
{				
				return true;		
}

map24.prototype.setMap = function( width, height, dest )
{
	this.width = width;
	this.height = height;

	if(isset(dest))
	{
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;

		if(isIE)
		{	    
			var theHTML = "<div>"+this.getMap(width, height)+"</div>";

		    theHTML += '<div><applet code="MJavaDetection.class" align=baseline width="0" height="0" codebase="'+this.getSystemURI+'MAP24_v3.6.94_20060909" MAYSCRIPT>';
			theHTML += '<param name="startup_frame" value="_self"/>\n';
			theHTML += '<div class="java_error">Uw browser ondersteunt geen java. <br/>Om deze kaart te kunnen bekijken is java vereist.</div>';
			theHTML += '</applet></div>';
			dest.innerHTML = theHTML;
		}
		else if(navigator.javaEnabled() == false)
		{
			dest.innerHTML = '<div class="java_error">Uw browser ondersteunt geen java. <br/>Om deze kaart te kunnen bekijken is java vereist.</div>';
		}
		else
		{
			dest.innerHTML = this.getMap(width, height);		
		}
	}
	else
	{
		alert("destination doesn't exist!");
	}
}



function isset(a)
{
	var bReturn = (typeof(a) != 'undefined');
	if(bReturn)
	{
		bReturn = (a != null);
	}

	return bReturn; 
}

function getMapCopy(width, height, dest)
{
	
	parent.width = width;
	parent.height = height;
	parent.dest = dest;
	
	
	if(parent.maploaded == false)
	{
		//var log = document.createElement('script');
		//log.src 		= '?logTransactie=true';
		//document.getElementById('frame_form').appendChild(log); 
		
		parent.map.setMap(width, height, parent.frames['HIDDEN'].document.getElementById('map24framediv'));
		parent.maploaded = true;
	}
	
	setTimeout("showMap24()", 1000);
}

function getHTTPXML()
{
	xmlhttp=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	if (xmlhttp!=null)
	{
		return xmlhttp;
	}
	else
	{
		alert("Uw browser ondersteunt geen XML-HTTP en kan daarom geen kaart weergeven.");
		return false;
	}
}

function showMap24()
{
	parent.map.setMap(parent.width, parent.height, parent.dest);
}
