<!--

function waithelp(message, time, color, background)
 {

var waitWindow, x, y, doc, content;
window.focus();
x = window.screenX + 150;
y = window.screenY + 150;
waitWindow = window.open("", "waitWindow",
                         "width=300,height=50,screenX=" + x + ",screenY=" + y);
content = "<html><head><title>Please Wait</title></head>" +
          "<body background=\"" + background + "\" bgcolor=\"" + color + "\">" +
          "<table border=\"0\" width=\"100%\" height=\"100%\">" +
          "<tr align=\"center\" valign=\"middle\">" +
          "<th><font face=\"helvetica\" size=\"2\">" + message + "<p>" +
          "<blink><font face=\"helvetica\" size=\"2\" color=\"red\"> Please wait while data is collected ...</font></blink></th>" +
          "</tr></table>" +
		  "<s" +
		  "cript>window.setTimeout('close()', " +time+ ")</" +
		  "script>" +
          "</font></body></html>";
doc = waitWindow.document;
doc.writeln(content);
doc.close();
return true;}

//--> 

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}



<!--  
function submitForm()
{
    document.geographic(Event.submit);
}


function popWebmap () 
{
    win = window.open("http://www.mbase.com.au/", "WIN", 
    "status=no,toolbar=no,location=yes,menu=yes,resizable=yes,width=700,height=600,scrollbars=yes");
}

function popatlas_infoType () 
{
    win = window.open("atlas_info.html#info_type", "WIN", 
    "status=no,toolbar=no,location=no,menu=no,resizable=yes,width=800,height=600,scrollbars=yes,screenX=150,screenY=100");
}

function popDisclaimer () 
{
    win = window.open("disclaimer_pop.html", "WIN", 
    "status=no,toolbar=no,location=no,menu=no,resizable=yes,width=800,height=600,scrollbars=yes,screenX=150,screenY=100");

}

function popLegalStat () 
{
    win = window.open("help_LegalStat.html", "WIN", 
    "status=no,toolbar=no,location=no,menu=yes,resizable=yes,width=690,height=400,scrollbars=yes");
}


function popSynonyms (str) 
{
    win = window.open("synonyms.jsp"+str, "WIN", 
    "status=no,toolbar=no,location=no,menu=yes,resizable=yes,width=700,height=500,scrollbars=yes");
}

function popWildCards () 
{
    win = window.open("help_useWildcards.html", "WIN",
    "status=no,toolbar=no,location=no,menu=no,width=600,height=400,resizable=yes,scrollbars=yes");
}


function popFeedback () 
{
    win = window.open("http://www.npws.nsw.gov.au/about/npwsmail.htm", "WIN", 
    "status=no,toolbar=no,location=yes,menu=yes,reziseable=yes,width=800,height=600,scrollbars=yes");
}



function focus_target(winname) 
{
    target = window.open('', winname, 'width=400,height=400,scrollbars=yes,resizable=yes,toolbar=no,status=yes');
    target.focus();
}


function showExtent()
{
    selection = document.extenttool.extent.selectedIndex; 
    selectedvalue = document.extenttool.extent.options[selection].value; 
    document.extenttool.submit();
}


function popupDataWindow(url)
{
	popup = window.open(url, 'data_display', 'status=yes,scrollbars=yes,resizable=yes,width=400,height=300');

	if((popup != null) && (typeof(popup.focus) == 'function'))
	{
		popup.focus();
	}

}


function start()
{
	keyedit = new LegendEdit('usl', document.legend);
}



 function update()
{
//  alert("got here");
	document.legend.method.value = "updatekey, setactivelayer, setcontext";
	keyedit.update();
//	alert(keyedit.display);
//	alert(keyedit.layer);
	document.legend.updatekey_layer.value = keyedit.layer;
	document.legend.updatekey_display.value = keyedit.display;
	document.legend.submit();
}



function pan(dx,dy)
{
	document.pantool.panX.value = dx;
	document.pantool.panY.value = dy;
    document.pantool.method.value = 'pan';
	document.pantool.submit();

}



// Create an array

var groups = new Array();



function groupNames()

{



// Do a loop to find radio element names and add to the array if not already there.


	for(x = 0; x < document.legend.elements.length; x++)

		{var radioelement = document.legend.elements[x];		
	
				if((radioelement.type == "radio"))			// works on all radio elements only

				{	
					
				  layer = radioelement.name
				  var groupnum = groups.length			
				  var count = 0;		

					for(i = 0; i <= groupnum; i++)

						{							
								if (groups[i] == layer)	
								{	count = count + 1;	}
						}



					if (count == 0)
							{	groups[groupnum] = layer;	}


				}

		}




// Check to see names in array


				var grouplist = groups.length			
					for(i = 0; i < groupnum; i++)

						{
							groupname = groups[i];		
//							alert(groupname);
						}

}





function setlayerlist()

{


var layercnt, radioname, layerarray='', layerstate = '';


	groupNames();


	for(layercnt = 0, item = 0; item < document.legend.elements.length; item++)

		{		element = document.legend.elements[item];		
	
		if((element.name.substring(0, 6) == "layer_"))		
			
			{	

// Get layer names
				layercnt++;
				layerarray = layerarray + element.value + ",";

			}

		}




		var numbers = groups.length				//loops through array
		for( var i = 0; i < numbers; i++)

		{
			var count=0;
			var active;

				for( var x = 0; x < document.legend.elements.length; x++)

				{

						if ( document.legend.elements[x].name == groups[i] && document.legend.elements[x].type == "radio")

							{
//								alert(document.legend.elements[x].name);
								radiostate = 'document.legend.' + groups[i] + '[' + count + '].checked';
								radiochecked = eval(radiostate);
								layerstate = layerstate + radiochecked + ","

								if (document.legend.elements[x].checked) {
									active = x;
								}

								count++;
							}

				}

//		alert("active element" + active);
//		document.legend.elements[active].checked = true;

		}

	

	var arraylength = layerarray.length;
	var statelength	= layerstate.length;

	var layerarray1 = layerarray.substring(0, arraylength-1);
	var statelength1 = layerstate.substring(0, statelength-1);
		
//	alert(layerarray1);
//	alert(statelength1);


	document.legend.updatekey_layer.value = layerarray1;
	document.legend.updatekey_display.value = statelength1;
	document.legend.method.value = 'updatekey';
	document.legend.submit();	
	

}		



var alreadyOpen = false;
var popupWin;
function openWindow(url,name,w,h) {

if (parseInt(navigator.appVersion) > 2) {
    if (alreadyOpen) {
        if (popupWin.closed) {
            popupWin = window.open(url,name,'scrollbars=yes,resizable,width='+w+',height='+h);
        } else {
            popupWin.close();
            popupWin = window.open(url,name,'scrollbars=yes,resizable,width='+w+',height='+h);
        }
        } else {
            popupWin = window.open(url,name,'scrollbars=yes,resizable,width='+w+',height='+h);
            alreadyOpen = true;
        }
    }
}



// Create an array

var groups = new Array();



function groupNames()

{



// Do a loop to find radio element names and add to the array if not already there.


	for(x = 0; x < document.legend.elements.length; x++)

		{var radioelement = document.legend.elements[x];		
	
				if((radioelement.type == "radio"))			// works on all radio elements only

				{	
					
				  layer = radioelement.name
				  var groupnum = groups.length			
				  var count = 0;		

					for(i = 0; i <= groupnum; i++)

						{		
	
								if (groups[i] == layer)	
								{	count = count + 1;	}


						}



					if (count == 0)
							{	groups[groupnum] = layer;	}


				}

		}




// Check to see names in array


				var grouplist = groups.length			
					for(i = 0; i < groupnum; i++)

						{
							groupname = groups[i];		
//							alert(groupname);
						}

}





function setlayerlist()

{


var layercnt, radioname, layerarray='', layerstate = '', item;


	groupNames();



	for(layercnt = 0, item = 0; item < document.legend.elements.length; item++)

		{			element = document.legend.elements[item];		


		if((element.name.substring(0, 6) == "layer_"))		
			
			{	

// Get layer names
				layercnt++;
				layerarray = layerarray + element.value + ",";
			}

		}



		var numbers = groups.length				//loops through array
		for( var i = 0; i < numbers; i++)

		{
			var count=0;
			var active;
			currentlayer="";
			singlelayer="";

				for( var x = 0; x < document.legend.elements.length; x++)

				{

						if ( document.legend.elements[x].name == groups[i] && document.legend.elements[x].type == "radio")

							{

// In some cases there will only be one layer in a group.  This needs to be noted so that the correct syntax is used (arrays will not work
// for an element with only one item


								singlecount = 0;
								currentlayer = groups[i];

								for( var c = 0; c < document.legend.elements.length; c++)
								{
									 
										if (document.legend.elements[c].name == currentlayer && document.legend.elements[c].type == "radio")
										{
										singlecount = singlecount + 1;
										}									  
		
								}

										if (singlecount < 2) 								
										{ singlelayer = currentlayer; currentlayer=""; }
	


								if ( singlelayer == groups[i] )			// if there is only one layer in a group, use this syntax
								{ radiostate = 'document.legend.' + groups[i] + '.checked'; }
								else
								{ radiostate = 'document.legend.' + groups[i] + '[' + count + '].checked';}  //else use this syntax
							
								radiochecked = eval(radiostate);
								layerstate = layerstate + radiochecked + ","

								if (document.legend.elements[x].checked) {
									active = x;
								}

								count++;
							}

				}

//		alert("active element" + active);
//		document.legend.elements[active].checked = true;

		}

	

	var arraylength = layerarray.length;
	var statelength	= layerstate.length;

	var layerarray1 = layerarray.substring(0, arraylength-1);
	var statelength1 = layerstate.substring(0, statelength-1);
		
//	alert(layerarray1);
//	alert(statelength1);


	document.legend.updatekey_layer.value = layerarray1;
	document.legend.updatekey_display.value = statelength1;
	document.legend.method.value = 'updatekey';
	document.legend.submit();	
	

}		


function indicator(feature)
	
	{
		document.imagelabel.label.value=feature;
	}





function getapplication()

{

selection = document.form.application.selectedIndex; 
selectedvalue = document.form.application.options[selection].value; 
alert(selectedvalue);

document.form.action= selectedvalue;
document.form.submit;

}


var myseconds="";
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
myseconds= mydate.getSeconds();
weekday= myweekday;
myyear= mydate.getYear();
year = (myyear < 1900) ? myyear +1900 : myyear;
myhours = mydate.getHours();
ampmhour  =  (myhours > 12) ? myhours - 12 : myhours;
ampm =  (myhours >= 12) ? 'PM' : 'AM';
mytime = mydate.getMinutes();
myminutes =  ((mytime < 10) ? ':0' : ':') + mytime;
myseconds =  ((myseconds < 10) ? ':0' : ':') + myseconds;
if(myday == 0)
day = "Sun ";
else if(myday == 1)
day = "Mon ";
else if(myday == 2)
day = "Tues ";
else if(myday == 3)
day = "Wed ";
else if(myday == 4)
day = "Thur ";
else if(myday == 5)
day = "Fri ";
else if(myday == 6)
day = "Sat ";
if(mymonth == 0) {
month = "01";}
else if(mymonth ==1)
month = "02";
else if(mymonth ==2)
month = "03";
else if(mymonth ==3)
month = "04";
else if(mymonth ==4)
month = "05";
else if(mymonth ==5)
month = "06";
else if(mymonth ==6)
month = "07";
else if(mymonth ==7)
month = "08";
else if(mymonth ==8)
month = "09";
else if(mymonth ==9)
month = "10";
else if(mymonth ==10)
month = "11";
else if(mymonth ==11)
month = "12";



//-->
