
var measureXP = new Array();
var measureYP = new Array();

function initMeasure(){
	var newDivTag = document.createElement("div");
	newDivTag.setAttribute("id","showLength");
	
	document.getElementById('wmcPan7').appendChild(newDivTag);
	document.getElementById('showLength').style.visibility = 'hidden';
	document.getElementById('showLength').style.position = 'absolute';
	document.getElementById('showLength').style.left = 0;
	document.getElementById('showLength').style.top = 2;
	document.getElementById('showLength').style.height = 20;
	document.getElementById('showLength').style.width = 250;
	var lengthForm = '<form name="measureForm" style="font-family: Arial, Helvetica, sans-serif; font-size:9px;">Gesamt: <input type="text" name="completeLength" style="height:18px; width:60px; font-size:10px" />&nbsp;m';
	lengthForm += '&nbsp;&nbsp;&nbsp;Letztes: <input type="text" name="lastLength" style="height:18px; width:60px; font-size:10px" />&nbspm</form>';
	document.getElementById('showLength').innerHTML = lengthForm;					
}

function fireSetMeasure(){
	if(wmcMapFrame.document.getElementById(wmcMapFrame.showMeasureLayer).style.visibility == 'hidden'){
		wmcMapFrame.getClickLayer1(wmcAliasToLayer['showMeasureLayer'],true);
		wmcMapFrame.createGraphicObject();
	}
	if(document.getElementById('showLength')){
		document.getElementById('showLength').style.visibility = 'visible';
		if(document.measureForm.completeLength)
			document.measureForm.completeLength.value = 0;
		if(document.measureForm.lastLength)
			document.measureForm.lastLength.value = 0;
	}
	return true;
}

function fireDelMeasure(){
	wmcMapFrame.clearGraphicObject();
	measureXP = new Array();
	measureYP = new Array();
	if(document.measureForm.completeLength)
			document.measureForm.completeLength.value = 0;
		if(document.measureForm.lastLength)
			document.measureForm.lastLength.value = 0;
	if(top.mapTool != 'measure'){
		wmcMapFrame.getClickLayer1(wmcAliasToLayer['showMeasureLayer'],true);
		document.getElementById('showLength').style.visibility = 'hidden';
	}
}

function hideMeasureForm(){
	if(measureXP.length == 0)
		document.getElementById('showLength').style.visibility = 'hidden';
}



	