function show_mainbody(str)
{
  load_data('mainbody',str);
  do
  {
  var x = opacity('mainbody', 0, 100, 1000);
  }while(!x)
}


function refresh_page()
{
  if(navigator.appName == "Netscape"){
  windowwidth = window.innerWidth;
  windowheight = window.innerHeight;
  }else if(navigator.appName == "Microsoft Internet Explorer"){
  windowwidth = document.body.clientWidth;
  windowheight = document.body.clientHeight;
  }else{
  windowwidth = 0;
  windowheight = 0;
  }
  if (windowheight != 0)
  {
      document.getElementById('locklayer').style.height = windowheight;
      document.getElementById('detail').style.height = windowheight;
      document.getElementById('loading').style.height = windowheight;
      document.getElementById('backlayer').style.height = windowheight;

      /*if(navigator.appName == "Netscape"){
         document.getElementById('content').style.height = windowheight;
         document.getElementById('mainlist').style.height = document.getElementById('content').offsetHeight - 100;
      }
      else if(navigator.appName == "Microsoft Internet Explorer"){
         document.getElementById('mainlist').style.height = '10px';
         document.getElementById('content').style.height = '100%';
         document.getElementById('mainlist').style.height = document.getElementById('content').offsetHeight - 100;
      } */


  }
}

function show_detail(str)
{
  document.getElementById('main').disabled = true;
  document.getElementById('locklayer').style.visibility = 'visible';
  document.getElementById('detail').style.visibility = 'visible';
  load_data('detail',str);
  do
  {
  var x = opacity('detail', 0, 100, 1000);
  }while(!x)
}

function hide_detail()
{
  document.getElementById('detail').style.visibility = 'hidden';
  document.getElementById('locklayer').style.visibility = 'hidden';
  document.getElementById('main').disabled = false;
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    }
    return true;
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}

function selectitem(str)
{
  show_detail(str);
}

