//---------------------------------------------------------------------------
//This section will check and see if the user is using IE and if 
//they are do some horrible hacks to get everything to look right.
function add_background(){
	try{
		var div = document.getElementById('content');
		//div.style.position = "absolute";
		//div.style.top = "-25px";
		//div.style.left = "-80px";
		div.style.width= "925px";
		div.style.height = "615px";
		div.style.backgroundcolor= "#FF3366";
		
		var img = document.createElement("IMG");
		div.style.backgroundImage = "url('style/background_IE2.gif')"; 
	}
	catch(err)
	{
		txt="There was an error on this page.\n\n";
		txt+="Error description: " + err.description + "\n\n";
		txt+="Click OK to continue.\n\n";
		alert(txt);
	}
}
function checkVersion(){
  var ver = getInternetExplorerVersion();
  if ( ver > -1 )
  {
	if ( ver <= 8.0 )
	{
		add_background();
	}
  }
}
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
function getInternetExplorerVersion(){
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
	var ua = navigator.userAgent;
	var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
	if (re.exec(ua) != null)
	  rv = parseFloat( RegExp.$1 );
  }
  return rv;
}


//---------------------------------------------------------------------------
function toggle_visibility(id){
	var div = document.getElementById(id);
	if(div.style.visibility == "hidden")
		div.style.visibility = "visible";
	else
		div.style.visibility = "hidden";
}

function toggle_menu_visibility(){
	var menu = document.getElementById("menu_bar");
	var img_open=document.getElementById("menu_open");
	var img_closed=document.getElementById("menu_closed");
	
	if(menu.style.visibility == "hidden"){
		menu.style.visibility = "visible";
		img_open.style.visibility = "visible";
		img_closed.style.visibility = "hidden";
	}
	else{
		menu.style.visibility = "hidden";
		img_open.style.visibility = "hidden";
		img_closed.style.visibility = "visible";
	}
}

function toggle_details_visibility(id){
	var background = document.getElementById("what_we_build");
	var details=document.getElementById(id);
	
	if(background.style.visibility == "hidden"){
		background.style.visibility = "visible";
		details.style.visibility = "hidden";
	}
	else{
		background.style.visibility = "hidden";
		details.style.visibility = "visible";
	}
}
