<!--

/* THE FOLLOWING SCRIPT ARE VARIABLES FOR AD PLACEMENT */
var axel = Math.random() + "";
var ord = axel * 1000000000000000000;
/* END OF VARIABLES FOR AD PLACEMENT */


//This will adjust size of textarea
function FixedTextArea(TA)
{
  	if (navigator.platform == 'MacPPC')
	{

 	 	if ((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)>=5)) {TA.cols=53;}
    	else if ((navigator.appName.indexOf("Microsoft")!=-1) && (parseInt(navigator.appVersion)>3)) {TA.cols=82;}
    }
   	 else
    {
    	if ((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)>=5)) {TA.cols=53;}
    	else if ((navigator.appName.indexOf("Microsoft")!=-1) && (parseInt(navigator.appVersion)>3)) {TA.cols=54;}
    }
}


function doHelp(url) {
		 var windowprops = "resizable=yes,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=300,top=0,height=600,left=0";
		 popup = window.open(url,'HELP',windowprops);
}

function doHelp_EXT(url) {
		 var windowprops = "resizable=yes,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=300,top=0,height=600,left=0";
		 popup = window.open(url,'EXTENTIONS',windowprops);
}

//this will resize textarea whenver the resolution or the window of the brwoser is resized.

function resizeTextArea(TA)
{

  	var winW, winH, ta_width, ta_height;
	if (navigator.platform == 'MacPPC')
	{

 	 	if ((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)>=5))
    	{
      		winW = window.innerWidth;
      		winH = window.innerHeight;
      		ta_width = winW / 11
      		TA.cols = ta_width - 12;
      		if (TA.cols<70) {TA.cols=70;}
    	}
    	else if ((navigator.appName.indexOf("Microsoft")!=-1) && (parseInt(navigator.appVersion)>3))
    	{
      		winW = document.body.offsetWidth;
      		winH = document.body.offsetHeight;
      		ta_width = winW / 7
 			TA.cols = ta_width;
 			if (TA.cols<70) {TA.cols=70;}
    	}
    }
    else
    {
    	if ((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)>=5))
    	{
      		winW = window.innerWidth;
      		winH = window.innerHeight;
      		ta_width = winW / 11
      		TA.cols = ta_width - 15;
      		if (TA.cols<70) {TA.cols=70;}
    	}
    	else if ((navigator.appName.indexOf("Microsoft")!=-1) && (parseInt(navigator.appVersion)>3))
    	{
      		winW = document.body.offsetWidth;
      		winH = document.body.offsetHeight;
      		ta_width = winW / 11
 			TA.cols = ta_width;
 			if (TA.cols<70) {TA.cols=70;}
    	}

    }
}



//This will focus cursor in the first form field
function FocusOnField()
{
   if (document.forms.length > 0)
   {
      var pForm = document.forms[0];
      for (i=0;i<pForm.length;i++)
      {
         if ((pForm.elements[i].type=="text") || (pForm.elements[i].type=="textarea") || (pForm.elements[i].type=="password") || (pForm.elements[i].type.toString().charAt(0)=="s"))
         {
            if ( (pForm.elements[i].type.toString().charAt(0)!="s") && (pForm.elements[i].value != "")) {i=i+1;}
            document.forms[0].elements[i].focus();
            break;
         }
      }
   }
}

// Function used in the co-locations access to the community search tool

var copiedOptions = null; // used to prevent multiple copies of the same option

function setupCopiedOptions(selectBox) {
	copiedOptions = new Object();
	for (var i=0; i<selectBox.options.length; i++) {
		copiedOptions[selectBox.options[i].value] = true;
	}
}


function copySelectedOptions(firstBox, lastBox) {
	if (copiedOptions == null) setupCopiedOptions(lastBox);
	for (var i=0; i<firstBox.options.length; i++) {
		if (firstBox.options[i].selected && copiedOptions[firstBox.options[i].value] != true) {
			lastBox.options[lastBox.options.length] = new Option(firstBox.options[i].text,firstBox.options[i].value, firstBox.options[i].defaultSelected, firstBox.options[i].selected);
			copiedOptions[firstBox.options[i].value] = true;
		}
		firstBox.options[i].selected = false;

	}
}

function deleteSelectedOptions(selectBox) {
	if (copiedOptions == null) setupCopiedOptions(selectBox);
	for (var i=0; i<selectBox.options.length; i++) {

		if (selectBox.options[i].selected) {
			copiedOptions[selectBox.options[i].value] = null;
			selectBox.options[i--] = null;

		}

	}
}

function selectAllOptions(selectBox) {
	for (var i = 0; i < selectBox.options.length; i++) {
		if (!selectBox.options[i].selected) selectBox.options[i].selected = true;
	}
}

// Below used for tab box on homepage
	last_tab = 'tab1';
	function show(layerName) {
	document.getElementById(layerName).style.display = '';
	}
	
	function hide(layerName) {
	document.getElementById(layerName).style.display = 'none';
	}
	function show_next_A(tab_name) {
	document.getElementById(last_tab).className = 'tab';
	var curr = document.getElementById(tab_name);
	curr.className='tab_hover';
	hide(last_tab+'_data');
	show(tab_name+'_data');
	last_tab=tab_name;
	}

	last_tab_B = 'tab4';
	function show(layerName_B) {
	document.getElementById(layerName_B).style.display = '';
	}
	
	function hide(layerName_B) {
	document.getElementById(layerName_B).style.display = 'none';
	}
	function show_next_B(tab_name_B) {
	document.getElementById(last_tab_B).className = 'tab';
	var curr = document.getElementById(tab_name_B);
	curr.className='tab_hover';
	hide(last_tab_B+'_data');
	show(tab_name_B+'_data');
	last_tab_B=tab_name_B;
	}

	function ShowDate()
		{
     		var theDate = new Date();
    		document.writeln("<input type=hidden name=tz value=\"" + theDate.getTimezoneOffset() + "\">");
		}


// Below preloads rolloever image for .button_120 class
/* REMOVED - BRENDA - USING A SPRITE INSTEAD */
/*if (document.images)
{
  pic1= new Image(120,20); 
  pic1.src="/images/LAYOUT/common/button_blue_120_hover.gif"; 
}*/

//end of all used functions -->


