var showAds = new Array();
showAds[0] = "underground.php";
showAds[1] = "main.html";
showAds[2] = "feature.php";
showAds[3] = "logos.php";
showAds[4] = "logos.php?col=band";
showAds[5] = "logos.php?col=fash";

function getHeight(){
  if( typeof( document.body.offsetHeight) == 'number')
    return document.body.offsetHeight;
  return 0;
}


function setHeight(container,height){
  document.getElementById(container).style.overflow = "hidden";
  document.getElementById(container).style.height = height;
}


function setFrame(reqHeight){
  var minHeight = 450; 
  var height = 0;
  
  if( reqHeight == 0 && document.layers )
    reqHeight = document.contentFrame.document.height;
  
  if( reqHeight > 0 ){
    document.getElementById("contentFrame").style.overflow = "hidden";
    document.getElementById("contentFrame").style.height   = reqHeight+"px";

  }else{
        
    //Non-IE
    if( typeof( window.innerWidth ) == 'number' )
      height = window.innerHeight;

    //IE 6+ in 'standards compliant mode'
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
      height = document.documentElement.clientHeight;

    //IE 4 compatible
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      height = document.body.clientHeight;
//    document.getElementById("contentFrame").style.height   = (height-215)+"px";

//    if(height-215 > document.getElementById("contentFrame").scrollHeight)
//      document.getElementById("contentFrame").style.overflow = "hidden";
//    else
//      document.getElementById("contentFrame").style.overflow = "visible";
  }
}


function loadPage(fileUrl,frameId,fixedSize){
  if( frameId == "headerFrame" )
    if( parent.headerFrame )
      parent.headerFrame.location.href = fileUrl;
    else
      document.headerFrame.location.href = fileUrl;

  else{
    parent.contentFrame.document.clear();
    parent.setHeight("contentFrame",400);
    parent.contentFrame.location.href = fileUrl;
    if( fixedSize > 0 )
      setFrame(fixedSize);
    else
      setFrame(0);
      
 /**   var advertFrame = parent.document.getElementById("hdromeAdverts");
    if(advertFrame != null){
      var show = false;
      for(i=0; i<showAds.length; i++){
        if(fileUrl == showAds[i]){
          show = true;
          break;
        }
      }

      // Show ads
      if(show && advertFrame)
        advertFrame.style.visibility = "visible";
        
      // hide ads
      else if(advertFrame)
        advertFrame.style.visibility = "hidden";
      else
        return;
    }*/
  }
}


// Helper
function min(a,b){
  if( a < b )
    return a;
  return b;
}