
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function hideLayers(main,sub) 
{
	if (main>0) {
		obj=findObj("contentArea");
		obj.style.visibility='hidden';
	}

}



function showLayers(main,sub) 
{
	if (main>0) {
		obj=findObj("contentArea");
		obj.style.visibility='visible';
	}
}


function insertBg(sectionName)
{
  // path to background image/movie
  var flashPath = "/flash/";
  var imagePath = "/pics/";

  var MM_contentVersion = 4;
  var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if (plugin)
  {
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i)
    {
      if (isNaN(parseInt(words[i])))
      continue;
      var MM_PluginVersion = words[i]; 
    }
    var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
  }
  else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1))
  {
    for (var version = 15; version > 0; version--)
    {
      try
      {
        var flash = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + version);
        var MM_FlashCanPlay = version;
      }
      catch (e) {}
    }
  }
  
  if (MM_FlashCanPlay && navigator.userAgent.indexOf("Linux") == -1)
  {

  	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
  	document.write(' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"');
  	document.write(' width="1280" height="1024" id="anim_bg" align="middle"><param name="allowScriptAccess" value="sameDomain" />');
  	document.write(' <param name="movie" value="/bo2007/flash/blauorange.swf" /><param name="menu" value="false" />');
  	document.write(' <param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />'); 
  	document.write(' <embed src="/bo2007/flash/blauorange.swf" quality="high" wmode="transparent" bgcolor="#ffffff"');
  	document.write(' width="1280" height="1024" name="blauorange" align="middle" allowScriptAccess="sameDomain"');
  	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  	document.write('</object>');
  }
  else
  {
  	document.write('<img src="' + imagePath + 'bg_' + sectionName + '.gif" width="1280" height="1024" alt="" />');
  }
}
