// toggle function
	function toggleLayer( whichLayer, n )
	{
		 var elem, vis;
		  if( document.getElementById ) // this is the way the standards work
		    elem = document.getElementById( whichLayer );
		  else if( document.all ) // this is the way old msie versions work
		      elem = document.all[whichLayer];
		  else if( document.layers ) // this is the way nn4 works
		    elem = document.layers[whichLayer];
		  vis = elem.style;
		  // if the style.display value is blank we try to figure it out here
		  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined){
		    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		  } else
		  {
			 
			  num = document.getElementById('num'+n);
			 
			  if(vis.display=='' || vis.display=='block'){
				vis.display = 'none'; 
				num.innerHTML= '&#9658;';
			  }
			  else{
				vis.display = 'block';
				num.innerHTML= '&#9660;';
			  }
		  }
	}

// clear text
	function clearText(field){
	    if (field.defaultValue == field.value) {
			field.value = '';
			field.style.color="#000000";
		}
	    else if (field.value == '') {
			field.style.color="#888888";
			field.value = field.defaultValue
		};
	}

// noenter
	function noenter()
	{
		return !(window.event && window.event.keyCode == 13);
	}
	
//trim 

String.prototype.trim = function()
	{
		a = this.replace(/^\s+/, '');
		return a.replace(/\s+$/, '');
	};
	
// togglesearchdiv

function togglesearchdiv( whichLayer)
	{
		 var elem, vis;
		  if( document.getElementById ) // this is the way the standards work
		    elem = document.getElementById( whichLayer );
		  else if( document.all ) // this is the way old msie versions work
		      elem = document.all[whichLayer];
		  else if( document.layers ) // this is the way nn4 works
		    elem = document.layers[whichLayer];
		  vis = elem.style;
		  // if the style.display value is blank we try to figure it out here
		  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined){
		    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		  } else
		  {
			 if(vis.display=='' || vis.display=='block'){
				vis.display = 'none'; 
				
			  }
			  else{
				vis.display = 'block';
				
				
			  }
		  }
	}