var prev_section = null;
var prev_content = null;
var flag = Array();

function Initialize_Menu(id){
    var menu_obj = findObj(id);
    menu_obj.style.display = "block";
    
}

function Initialize_Content(id){
    if(flag[id] == null){
       cont_obj = findObj(id);
       cont_obj.className = "hid";
       flag[id] = true;
    }

}

function UpdateContent(id, cont_id){
    var cur_section = findObj(id);   
    var cur_content = findObj(cont_id);
    if(prev_section==null) prev_section = "recovery";
    if(prev_content==null) prev_content = "content_recovery";
    prev_section =  findObj(prev_section);
    prev_content =  findObj(prev_content);
    prev_section.className = "menu_item2";
    cur_section.className = 'menu_item';
    prev_section = cur_section.id;
    prev_content.className = "hid";
    cur_content.className = 'show';
    prev_content = cur_content.id;
    
}
	
function findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}



// Forbid user's mouse selecting for the content 
//   (allow text selection in EditBox only)
function onSelect1(){
    if ( window.event.srcElement.tagName !="INPUT" ) {        
    window.event.returnValue = false;    
    window.event.cancelBubble = true;
    }
}

// Forbid IE context menu 
//  (allow in EditBox only)
//  (if the real context menu must be shown - Advance¢ Hosting 
//  Interfaces must be used)
function onContextMenu(){
     if ( window.event.srcElement.tagName !="INPUT" ) {        
    window.event.returnValue = false;    
    window.event.cancelBubble = true;
        return false;
    }
}

// Install Context Menu and Mark handlers on HTML loading.
//   
function onLoad()
{
    // forbid cursor change (except "INPUT"
    // entry box and "A" hyperlink) for HTML text.
    var Objs = document.all;
    for (i=0; i< Objs.length; i++)
        // "INPUT" entry box and "A" hyperlink
        if (Objs(i).tagName!="INPUT" && Objs(i).tagName!="A")
        Objs(i).style.cursor = "default";
        
    // event handler - content selection
    document.onselectstart = onSelect1;
    // event handler - context menu
    document.oncontextmenu = onContextMenu;

}