var textPointX=new Array();
var textPointY=new Array();
var text1=new Array();
var textCount=0;
var temptext="";
var textpos= new Array();
var textcolour= new Array();
var textfontsize = new Array();
var temppos="";
var tempcolour="";
var tempfontsize="";
var hasf1 = false;

var availColours = new Array();
availColours.Black = "0,0,0;";
availColours.White = "255,255,255;";
availColours.Red = "255,0,0;";
availColours.Yellow = "255,255,0;";
availColours.Blue ="0,0,255;";
availColours.Green ="0,255,0;";



function f1(b){ //clickTextArea
	hasf1 = b;
}

function f2(){ //addTextDiv
	showLayer("addText");
	addtext();
}

function addtext(){

		panning=false;
		f73g=false;
		selectBox=false;
		if (clickCount>0) {
			if (totalMeasure==0) f8();
		}
		toolMode = 2000;
}


function f3(e) { //textAddPoint
	temptext = document.getElementById("TITLE").value;

	thePos="right";
	var textPosList = document.getElementsByName("textPosition");
	for (i=0;i<textPosList.length;i++) {
		if (textPosList[i].checked) {
			thePos = textPosList[i].value;
		}
	}
	temppos = thePos;

	tempcolour = document.getElementById("TXTCOLOUR").options[document.getElementById("TXTCOLOUR").selectedIndex].text;
	tempfontsize =document.getElementById("TXTFONTSIZE").options[document.getElementById("TXTFONTSIZE").selectedIndex].text;

	
	if (temptext != "")
	{
		var theX = mouseX;
		var theY = mouseY;
		f71(theX,theY);
		textPointX[textCount]=mapX;
		textPointY[textCount]=mapY;
		text1[textCount]=temptext;
		textpos[textCount]=temppos;
		
		textcolour[textCount]=availColours[tempcolour];
		textfontsize[textCount]=tempfontsize;

		textCount += 1;
		selectCount=0;

		legendTemp=legendVisible;
		legendVisible=false;

		shwRetrMap();
		writeXMLASP(99);
	}else
		alert("No text has been entered");

}



function f5() { //removeText
	textCount = 0;

	legendTemp=legendVisible;
	legendVisible=false;

	showLayer("LoadData");
	writeXMLASP(99);

}

