// aimsSelect.js
aimsSelectPresent=true;
var selectData = new Array();
var selectLeft = new Array();
var selectRight = new Array();
var selectTop = new Array();
var selectBottom = new Array();
var selMaxEnvelope = new Array();
var selectLayer="";
var selectType = "";
var selectCount = 0;
var selectBlurb = "";
var selectEnvelope="";
var highlightedOne = "";
var queryMode=1;
var selectionMode=1;
var setQueryString="";
var shapeBufferDistance = 0;
// select feature
function select(e) {
getMapXY(mouseX,mouseY);
searchTolerance = (xDistance/iWidth) * pixelTolerance;
var tempWest = mapX - searchTolerance;
var tempNorth = mapY + searchTolerance;
var tempEast = mapX + searchTolerance;
var tempSouth = mapY - searchTolerance;
queryStartRecord=1;
selectEnvelope='maxy="' + forceComma(tempNorth) + '" maxx="' + forceComma(tempEast) + '" miny="' + forceComma(tempSouth) + '" minx="' + forceComma(tempWest) + '"';
selectionMode=2;
showRetrieveData();
var theString = writeGetFeatures2(tempWest,tempSouth,tempEast,tempNorth);
sendToServer(imsQueryURL,theString,selectXMLMode);
}
// start select box display
function startSelectBox(e) {
if (checkIfActiveLayerAvailable()) {
moveLayer("theMap",hspc,vspc);
getImageXY(e);
// keep it within the MapImage
if ((mouseX<iWidth) && (mouseY<iHeight)) {
if (selectBox) {
stopSelectBox(e);
} else {
x1=mouseX;
y1=mouseY
x2=x1+1;
y2=y1+1;
zleft=x1;
ztop=y1;
zbottom=y1;
zright=x1
boxIt(x1,y1,x2,y2);
selectBox=true;
showLayer("zoomBoxTop");
showLayer("zoomBoxLeft");
showLayer("zoomBoxRight");
showLayer("zoomBoxBottom");
}
highlightedOne="";
}
return false;
}

}

// stop select box display..... select
function stopSelectBox(e) {
selectBox=false;
hideLayer("zoomBoxTop");
hideLayer("zoomBoxLeft");
hideLayer("zoomBoxRight");
hideLayer("zoomBoxBottom");
if ((zright <zleft+2) && (zbottom < ztop+2)) {
getMapXY(mouseX,mouseY);
searchTolerance = (xDistance/iWidth) * pixelTolerance;
tempLeft = mapX-searchTolerance;
tempTop = mapY-searchTolerance;
tempRight = mapX+searchTolerance;
tempBottom = mapY+searchTolerance;
} else {
pixelX = xDistance / iWidth;
var theY = iHeight - ztop;
pixelY = yDistance / iHeight;
tempTop = pixelY * theY + eBottom;
tempRight = pixelX * zright + eLeft;
tempLeft = pixelX * zleft + eLeft;
theY = iHeight - zbottom;
pixelY = yDistance / iHeight;
tempBottom = pixelY * theY + eBottom;
}
window.scrollTo(0,0);

queryStartRecord=1;
var theString = writeGetFeatures2(tempLeft,tempBottom,tempRight,tempTop);
selectEnvelope='maxy="' + forceComma(tempTop) + '" maxx="' + forceComma(tempRight) + '" miny="' + forceComma(tempBottom) + '" minx="' + forceComma(tempLeft) + '"';
drawSelectBoundary=true;
showBuffer=false;
selectionMode=2;
//if (useTextFrame) parent.TextFrame.document.location = "text.htm";
sendToServer(imsQueryURL,theString,selectXMLMode);
return true;

}

// write out XML request to select features
function writeGetFeatures2(west1,south1,east1,north1) {
if (swapSelectFields) {
selectFields=selFieldList[ActiveLayerIndex];
//alert(selectFields);
}
var theEnvelope = 'maxy="' + forceComma(north1) + '" maxx="' + forceComma(east1) + '" miny="' + forceComma(south1) + '" minx="' + forceComma(west1 )+ '"';
var theString = writeEnvelopeXML(ActiveLayer,ActiveLayerType,selectFields,maxFeaturesReturned,queryStartRecord,theEnvelope,useLimitExtent);
//alert(theString);
selectLayer=ActiveLayer;
selectType=ActiveLayerType;
selectCount=0;
hightlightedOne="";
selectPoints.length=1;
selectLeft.length=1;
selectRight.length=1;
selectTop.length=1;
selectBottom.length=1;
return theString;
}

function writeGetFeatures3() {
if (swapSelectFields) {
selectFields=selFieldList[ActiveLayerIndex];
}
var theString = writeEnvelopeXML(ActiveLayer,ActiveLayerType,selectFields,maxFeaturesReturned,queryStartRecord,selectEnvelope,useLimitExtent);
//alert(theString);
selectLayer=ActiveLayer;
selectType=ActiveLayerType;
selectCount=0;
hightlightedOne="";
selectPoints.length=1;
selectLeft.length=1;
selectRight.length=1;
selectTop.length=1;
selectBottom.length=1;
return theString;
}

// generic envelope select xml write routine
function writeEnvelopeXML(theLayer,theLayerType,theFields,maxReturned,startRec,theEnvelope,hasLimit) {

var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_FEATURES outputmode="xml" envelope="true" geometry="false" checkesc ="true"';
theString += ' featurelimit="' + maxReturned + '" beginrecord="' + startRec + '">\n';
theString += '<LAYER id="' + theLayer + '" />';
if(ActiveLayerIndex==parent.ParametersFrame.HCenterLayerIndex)
{
Str = "";
for (i=1; i<4; i++)
{
if (parent.ParametersFrame.HealthCentersVisible[i] == 1)
Str += " type = "+i+" or ";
}
Str += " type = -1 ";
str1 = '<SPATIALQUERY subfields="' + theFields + '" where= "('+Str+')';
str1 += addJoinExp(ActiveLayerIndex);
str1 += " >";
theString += str1;
		
}
else
{
theString += '<SPATIALQUERY subfields="' + theFields + '"';
theString += addJoinExpWhere(ActiveLayerIndex);
theString += " >";

}
theString += '<SPATIALFILTER relation="area_intersection" >';
theString += '<ENVELOPE ' + theEnvelope + ' />';
theString += '</SPATIALFILTER>';
if (hasLimit) {
// keep this within the limitExtent
theString += '<SPATIALFILTER relation="area_intersection">\n';
theString += '<ENVELOPE maxx="' + forceComma(limitRight) + '" maxy="' + forceComma(limitTop) + '" minx="' + forceComma(limitLeft) + '" miny="' + forceComma(limitBottom) + '" />\n';
theString += '</SPATIALFILTER>\n';
}
theString += '</SPATIALQUERY>';
theString += '</GET_FEATURES>';
theString += '</REQUEST>';
theString += '</ARCXML>';
return theString;
}
// write out xml request for selection by shape
function writeShapeSelect(theType) {
if (swapSelectFields) {
selectFields=selFieldList[ActiveLayerIndex];
}
var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_FEATURES outputmode="xml" envelope="true" geometry="false" checkesc ="true"';
theString += ' featurelimit="' + maxFeaturesReturned + '" beginrecord="' + queryStartRecord + '">\n';
theString += '<LAYER id="' + ActiveLayer + '" />';
if(ActiveLayerIndex==parent.ParametersFrame.HCenterLayerIndex)
{
Str = "";
for (i=1; i<4; i++)
{
if (parent.ParametersFrame.HealthCentersVisible[i] == 1)
Str += " type = "+i+" or ";
}
Str += " type = -1 ";
str1 = '<SPATIALQUERY subfields="' + selectFields + '" where= "('+Str +')';
str1 += addJoinExp(ActiveLayerIndex);
str1 += " >";
theString += str1;
}
else
{
theString += '<SPATIALQUERY subfields="' + selectFields + '">';
}
theString += '<SPATIALFILTER relation="area_intersection" >';
if ((shapeSelectBuffer) && (shapeBufferDistance>0)||((use_jsgraphics)&&(toolMode==22)))
{
// do a buffer around the shape before selecting
theString += '<BUFFER distance="' + forceComma(shapeBufferDistance) + '" ';
theString += ' bufferunits="' + ScaleBarUnits + '"';
theString += ' />\n';
}
if (theType==1) {
theString += '<POLYLINE>\n<PATH>\n';
} else if (theType==2) {
theString += '<POLYGON>\n<RING>\n';
} else {
theString += '<MULTIPOINT>\n';
}
if (theType==0) {
if ((use_jsgraphics)&&(toolMode==22)) theString += '<POINT x="' + circleCenterX + '" y="' + circleCenterY + '" />\n';
else theString += '<POINT x="' + clickPointX[clickCount-1] + '" y="' + clickPointY[clickCount-1] + '" />\n';
} else {
for (var i=0;i<clickCount;i++) {
theString += '<POINT x="' + clickPointX[i] + '" y="' + clickPointY[i] + '" />\n';
}
}
if (theType==0) {
theString += '</MULTIPOINT>\n';
} else if (theType==2) {
theString += '</RING>\n</POLYGON>\n';
} else {
theString += '</PATH>\n</POLYLINE>\n';
}
theString += '</SPATIALFILTER>';
if (useLimitExtent) {
// keep this within the limitExtent
theString += '<SPATIALFILTER relation="area_intersection">\n';
theString += '<ENVELOPE maxx="' + forceComma(limitRight) + '" maxy="' + forceComma(limitTop) + '" minx="' + forceComma(limitLeft) + '" miny="' + forceComma(limitBottom) + '" />\n';
theString += '</SPATIALFILTER>\n';
}
theString += '</SPATIALQUERY>';
theString += '</GET_FEATURES>';
theString += '</REQUEST>';
theString += '</ARCXML>';
//alert(theString);
selectLayer=ActiveLayer;
selectType=ActiveLayerType;
selectCount=0;
hightlightedOne="";
selectPoints.length=1;
selectLeft.length=1;
selectRight.length=1;
selectTop.length=1;
selectBottom.length=1;
return theString;
}
// request a selection using a shape
function sendShapeSelect(theType) {
queryStartRecord=1;
selectionMode=3;
showBuffer=false;
if (theType==2) {
if ((clickPointX[0]!=clickPointX[clickCount-1]) && (clickPointY[0]!=clickPointY[clickCount-1])) {
clickPointX[clickCount]=clickPointX[0];
clickPointY[clickCount]=clickPointY[0];
clickCount=clickCount+1;
}
}
showRetrieveData();
var theString = writeShapeSelect(theType);
sendToServer(imsQueryURL,theString,selectXMLMode);
}
// request more records to display
function getMoreData(startRecord) {
var theString = "";
queryStartRecord = startRecord;
//	alert("selectionMode in get more data==="+selectionMode);
if (selectionMode==1) {
//query
theString = writeQueryXML(setQueryString);
} else if (selectionMode==2) {
theString = writeGetFeatures3();
} else {
var theType = clickType-1;
theString = writeShapeSelect(theType);
}
showRetrieveData();
sendToServer(imsQueryURL,theString,selectXMLMode);
}
// refresh map with hightlighted selection
function showHighlight(selNum) {
	
	if (FindisBeingUsed){

LayerVisible[parent.ParametersFrame.GovLayerIndex]=1;
LayerVisible[parent.ParametersFrame.TrinLayerIndex]=1;
LayerVisible[parent.ParametersFrame.RoyalLayerIndex]=1;
LayerVisible[parent.ParametersFrame.PrivLayerIndex]=1;
LayerVisible[parent.ParametersFrame.HCenterLayerIndex] = 1;
		parent.ParametersFrame.HealthCentersVisible[1] = 1;
				parent.ParametersFrame.HealthCentersVisible[2] = 1;
						parent.ParametersFrame.HealthCentersVisible[3] = 1;
		
	}
if (parent.ParametersFrame.Arabic)
{
	parent.SearchFrame.document.location.href = "ASearchBar.htm";
}else
{
	parent.SearchFrame.document.location.href = "SearchBar.htm";
}




highlightedOne = LayerIDField[ActiveLayerIndex] + " = " + selectPoints[selNum];
var fWidth = selectRight[selNum] - selectLeft[selNum];
var fHeight = selectTop[selNum] - selectBottom[selNum];
var mWMargin = 0;
var mHMargin = 0;
if (selectType=="point") {
mWMargin = fullWidth * selectPointMargin;
mHMargin = fullHeight * selectPointMargin;
if (mWMargin > xDistance/2) {
mWMargin = xDistance/2;
mHMargin = yDistance/2;
}
} else {
mWMargin = fWidth * selectMargin;
mHMargin = fHeight * selectMargin;
}
saveLastExtent();
eLeft = selectLeft[selNum] - mWMargin;
eRight = selectRight[selNum] + mWMargin;
eTop = selectTop[selNum] + mHMargin;
eBottom = selectBottom[selNum] - mHMargin;
legendTemp=legendVisible;
legendVisible=false;
sendMapXML();
}
function calcSelectEnvelope() {
//alert("calcSelectEnvelope selectCount"+selectCount);
if (selectCount>0) {
selMaxEnvelope[0] = parseFloat(selectLeft[0]);
selMaxEnvelope[1] = parseFloat(selectBottom[0]);
selMaxEnvelope[2] = parseFloat(selectRight[0]);
selMaxEnvelope[3] = parseFloat(selectTop[0]);
if (selectCount>1) {
for (var i=1;i<selectCount;i++) {
if (parseFloat(selectLeft[i])<selMaxEnvelope[0]) selMaxEnvelope[0] = parseFloat(selectLeft[i]);
if (parseFloat(selectBottom[i])<selMaxEnvelope[1]) selMaxEnvelope[1] = parseFloat(selectBottom[i]);
if (parseFloat(selectRight[i])>selMaxEnvelope[2]) selMaxEnvelope[2] = parseFloat(selectRight[i]);
if (parseFloat(selectTop[i])>selMaxEnvelope[3]) selMaxEnvelope[3] = parseFloat(selectTop[i]);
}
}
}
}
function getSelectedEnvelope()
{
calcSelectEnvelope();
var fWidth = selMaxEnvelope[2] - selMaxEnvelope[0];
var fHeight = selMaxEnvelope[3] - selMaxEnvelope[1];
var mWMargin = 0;
var mHMargin = 0;
if ((fWidth==0) && (fHeight==0)) {
mWMargin = fullWidth * selectPointMargin;
mHMargin = fullHeight * selectPointMargin;
if (mWMargin > xDistance/2) {
mWMargin = xDistance/2;
mHMargin = yDistance/2;
}
} else {
mWMargin = fWidth * selectMargin;
mHMargin = fHeight * selectMargin;
}
saveLastExtent();
eLeft = selMaxEnvelope[0] - mWMargin;
eRight = selMaxEnvelope[2] + mWMargin;
eTop = selMaxEnvelope[3] + mHMargin;
eBottom = selMaxEnvelope[1] - mHMargin;
selectEnvelope='maxy="' + forceComma(eBottom) + '" maxx="' + forceComma(eRight) + '" miny="' + forceComma(eTop) + '" minx="' + forceComma(eLeft) + '"';
}
//////////////////////////////////
function zoomToReturnedRecords() {
	
	if (FindisBeingUsed){

LayerVisible[parent.ParametersFrame.GovLayerIndex]=1;
LayerVisible[parent.ParametersFrame.TrinLayerIndex]=1;
LayerVisible[parent.ParametersFrame.RoyalLayerIndex]=1;
LayerVisible[parent.ParametersFrame.PrivLayerIndex]=1;
LayerVisible[parent.ParametersFrame.HCenterLayerIndex] = 1;
		parent.ParametersFrame.HealthCentersVisible[1] = 1;
				parent.ParametersFrame.HealthCentersVisible[2] = 1;
						parent.ParametersFrame.HealthCentersVisible[3] = 1;
		
	}

if (parent.ParametersFrame.Arabic)
{
	parent.SearchFrame.document.location.href = "ASearchBar.htm";
}else
{
	parent.SearchFrame.document.location.href = "SearchBar.htm";
}

calcSelectEnvelope();
var fWidth = selMaxEnvelope[2] - selMaxEnvelope[0];
var fHeight = selMaxEnvelope[3] - selMaxEnvelope[1];
var mWMargin = 0;
var mHMargin = 0;
if ((fWidth==0) && (fHeight==0)) {
mWMargin = fullWidth * selectPointMargin;
mHMargin = fullHeight * selectPointMargin;
if (mWMargin > xDistance/2) {
mWMargin = xDistance/2;
mHMargin = yDistance/2;
}
} else {
mWMargin = fWidth * selectMargin;
mHMargin = fHeight * selectMargin;
}
saveLastExtent();
eLeft = selMaxEnvelope[0] - mWMargin;
eRight = selMaxEnvelope[2] + mWMargin;
eTop = selMaxEnvelope[3] + mHMargin;
eBottom = selMaxEnvelope[1] - mHMargin;

sendMapXML();

}
// clear current selection
function clearSelection() {
var theCount = selectCount;
var theHL = highlightedOne;
selectCount=0;
showBuffer=false;
highlightedOne="";
selectPoints.length=0;
selectLeft.length=0;
selectRight.length=0;
selectTop.length=0;
selectBottom.length=0;
drawSelectBoundary=false;
showGeocode=false;
clickCount=0;
totalMeasure=0;
currentMeasure=0;
if (useTextFrame) {
parent.TextFrame.document.open();
parent.TextFrame.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=' + charSet + '"><html>');
parent.TextFrame.document.writeln('<body bgcolor="White" text="Black" link="Blue" vlink="Blue">');
parent.TextFrame.document.writeln('<FONT FACE="Arial" SIZE="-1"><b>' + LayerName[ActiveLayerIndex] + '</b><br>');
if (toolMode==20) {
parent.TextFrame.document.writeln(msgList[70]);
updateMeasureBox()
}
else
parent.TextFrame.document.writeln(msgList[71]);
parent.TextFrame.document.writeln('</body></html>');
parent.TextFrame.document.close()
} else {
if (toolMode==20) {
showLayer("measureBox");
updateMeasureBox()
alert(msgList[70]);
} else {
alert(msgList[71]);
}
}

selectBlurb="";
sendMapXML();
}
function addSelectToMap(){
var highlightedPoints = LayerIDField[ActiveLayerIndex] + " = " + selectPoints;
var hlpnts=" or " + LayerIDField[ActiveLayerIndex] + " = ";
for (var j=0; j<highlightedPoints.length;j++)
{
highlightedPoints = highlightedPoints.replace(",",hlpnts);
}
var selString = "";
var sFactor = (eRight-eLeft) / iWidth
if (((sFactor>=LayerMinScale[ActiveLayerIndex]) && (sFactor<=LayerMaxScale[ActiveLayerIndex]) && (LayerVisible[ActiveLayerIndex]==1)) || (canSelectInvisible)) {
if ((selectCount>0) && (showSelectedFeatures)) {
selString +='<LAYER type="featureclass" name="' + titleList[22] + '" visible="true">\n';
selString +='<DATASET fromlayer="' + LayerID[ActiveLayerIndex] + '" />\n';
if (selectionMode==1)
{
if (selectCount<25)
{
selString +='<QUERY  where="' + highlightedPoints + '" />\n';
}else
{
selString +='<SPATIALQUERY  where= "(' + setQueryString+')';
if (useLimitExtent) {
selString += addJoinExp(ActiveLayerIndex);
selString +='>\n<SPATIALFILTER relation="area_intersection">\n';
selString +='<ENVELOPE maxx="' + forceComma(limitRight) + '" maxy="' + forceComma(limitTop) + '" minx="' + forceComma(limitLeft) + '" miny="' + forceComma(limitBottom) + '" />\n';
selString +='</SPATIALFILTER>\n';
selString +='</SPATIALQUERY>\n';

} else {
selString += addJoinExp(ActiveLayerIndex);
selString +='>\n';
selString +='</SPATIALQUERY>\n';
}
}
} else {
if(ActiveLayerIndex==parent.ParametersFrame.HCenterLayerIndex)
{
Str = "";
for (i=1; i<4; i++)
{
if (parent.ParametersFrame.HealthCentersVisible[i] == 1)
Str += " type = "+i+" or ";
}
Str += " type = -1 ";
str1 = '<SPATIALQUERY  where= "('+Str +')';
str1 += addJoinExp(ActiveLayerIndex);
str1 += " >";
selString += str1;
}
else
{
selString +='<SPATIALQUERY>\n';
}

selString +='<SPATIALFILTER relation="area_intersection" >\n';
if (selectionMode==2) {
selString +='<ENVELOPE ' + selectEnvelope + ' />\n';
} else {
if (((shapeSelectBuffer) && (shapeBufferDistance>0))||(toolMode==22)) {
selString += '<BUFFER distance="' + forceComma(shapeBufferDistance) + '" ';

selString += ' bufferunits="' + ScaleBarUnits + '"';
selString += ' />\n';
}
if (clickType==2) {
selString +='<POLYLINE>\n<PATH>\n';
} else if (clickType==3) {
selString +='<POLYGON>\n<RING>\n';
} else {
selString +='<MULTIPOINT>\n';
}
if (clickType==1)
{
if ((use_jsgraphics)||(toolMode==22)) selString +='<POINT x="' + circleCenterX + '" y="' + circleCenterY + '" />\n';
else selString +='<POINT x="' + clickPointX[clickCount-1] + '" y="' + clickPointY[clickCount-1] + '" />\n';
}
else
{
for (var i=0;i<clickCount;i++) {
selString +='<POINT x="' + clickPointX[i] + '" y="' + clickPointY[i] + '" />\n';
}
}
if (clickType==3) {
selString +='</RING>\n</POLYGON>\n';
} else if (clickType==2) {
selString +='</PATH>\n</POLYLINE>\n';
} else {
selString +='</MULTIPOINT>\n';
}
}
selString +='</SPATIALFILTER>\n';
if (useLimitExtent) {
selString +='<SPATIALFILTER relation="area_intersection">\n';
selString +='<ENVELOPE maxx="' + forceComma(limitRight) + '" maxy="' + forceComma(limitTop) + '" minx="' + forceComma(limitLeft) + '" miny="' + forceComma(limitBottom) + '" />\n';
selString +='</SPATIALFILTER>\n';
}
selString +='</SPATIALQUERY>\n';
}
selString +='<SIMPLERENDERER>\n';
selectType = LayerType[ActiveLayerIndex];
if (selectType=="point") {
selString +='<SIMPLEMARKERSYMBOL color="' + selectColor + '" type="Circle" width="10" />\n';
} else if (selectType=="line") {
selString +='<SIMPLELINESYMBOL type="SOLID" color="' + selectColor + '" width="3" />\n';
} else {
//selString +='<SIMPLEPOLYGONSYMBOL FILLCOLOR="' + selectColor + '" FILLTYPE="Gray" ';
selString +='<SIMPLEPOLYGONSYMBOL fillcolor="' + selectColor + '" filltype="solid" transparency="' + forceComma(transparentLevel) + '" boundarycolor="255,255,255" />\n';
}
selString +='</SIMPLERENDERER>\n';
selString +='</LAYER>\n';
}
if (selectBlurb!="") {
// add SelectBlurb to Map XML request
selString +='<LAYER type="featureclass" name="' + titleList[22] + '" visible="true">\n';
//selString +='<DATASET fromlayer="' + ActiveLayer + '" />\n';
selString +='<DATASET fromlayer="' + LayerID[ActiveLayerIndex] + '" />\n';
selString +='<QUERY where="' + selectBlurb + '" />\n';
selString +='<SIMPLERENDERER>\n';

if (selectType=="point") {
selString +='<SIMPLEMARKERSYMBOL color="' + selectColor + '" type="Circle" width="10" />\n';
} else if (selectType=="line") {
selString +='<SIMPLELINESYMBOL type="SOLID" color="' + selectColor + '" width="3" />\n';
} else {
selString +='<SIMPLEPOLYGONSYMBOL fillcolor="' + selectColor + '" filltype="solid" transparency="' + forceComma(transparentLevel) + '" boundarycolor="255,255,255" />\n';
}
selString +='</SIMPLERENDERER>\n';
selString +='</LAYER>\n';
}

if (!isArcMapService) {
if (highlightedOne!="")
{
// add Draw Highlighed Feature to Map XML request
selString +='<LAYER type="featureclass" name="' + titleList[23] + '" visible="true">\n';
//selString +='<DATASET fromlayer="' + ActiveLayer + '" />\n';
selString +='<DATASET fromlayer="' + LayerID[ActiveLayerIndex] + '" />\n';
selString +='<QUERY where="' + highlightedOne + '" />\n';
selString +='<SIMPLERENDERER>\n';

if (selectType=="point") {
selString +='<SIMPLEMARKERSYMBOL color="' + highlightColor + '" type="Circle" width="10" />\n';
} else if (selectType=="line") {
selString +='<SIMPLELINESYMBOL type="SOLID" color="' + highlightColor + '" width="3" />\n';
} else {
//selString +='<SIMPLEPOLYGONSYMBOL FILLCOLOR="' + highlightColor + '" FILLTYPE="Gray" ';
selString +='<SIMPLEPOLYGONSYMBOL fillcolor="' + highlightColor + '" filltype="solid" transparency="' + forceComma(transparentLevel) + '" boundarycolor="255,255,255" />\n';
}
selString +='</SIMPLERENDERER>\n';
selString +='</LAYER>\n';

}
}
}
return selString;
}


