
function updateMap(field,v){
	/*Set the new Form Field*/
	document.getElementById(field).value=v;
	/*Set the Action Value*/
	document.getElementById('action').value='update_'+field;
	/*Submit the Form*/
	document.M.submit();
}


function switchSub(object){
	if(object.getElementsByTagName('ul').length > 0){
		fUl = object.getElementsByTagName('ul')[0];
		if(fUl.style['visibility'] != 'visible'){
			fUl.style['visibility'] = 'visible'
		}else{
			fUl.style['visibility'] = 'hidden'
		}
	}
}



function toggleLayer( 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';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}




function showSubmenu(whichDiv)
{
	var menus = new Array("subHome", "subProducts", "subData", "subServices","subPublications");
	
	for(var i = 0; i < menus.length; i++){
		
		if (document.getElementById)
		{
		// this is the way the standards work
		var style = document.getElementById(menus[i]).style;
		style.display = "none";
		}
		else if (document.all)
		{
		// this is the way old msie versions work
		var style = document.all[menus[i]].style;
		style.display = "none";
		}
		else if (document.layers)
		{
		// this is the way nn4 works
		var style = document.layers[menus[i]].style;
		style.display = "none";
		}		
	}
	
	
	if(whichDiv != 'none'){
	
	if (document.getElementById)
		{
		// this is the way the standards work
		var style = document.getElementById(whichDiv).style;
		style.display = "inline";
		}
	else if (document.all)
		{
		// this is the way old msie versions work
		var style = document.all[whichDiv].style;
		style.display = "inline";
		}
	else if (document.layers)
		{
		// this is the way nn4 works
		var style = document.layers[whichDiv].style;
		style.display = "inline";
		}
	
	}

}

var win_flag = 0;
function popNewWindow(url,name,features)
{
	win_flag = name
   new_window = window.open(url,name,features);
	new_window.focus();
}


