// JScript File
var Timeout_MessageBox = null;
var MessageBoxID = null;

//closes the popup message
function closeMessageBox(popupid)
{
    var refPopup = null;
    refPopup = document.getElementById(popupid);
    if((refPopup.style)&&(refPopup.style.visibility!=null))
    {
      refPopup.style.visibility = 'hidden';
    }
    
    if (typeof Timeout_Messagebox != 'undefined')
    {
        clearTimeout(Timeout_Messagebox);
        MessageBoxID = null;
    }
}

function closeMessageBox_SetTime(popupid)
{
    MessageBoxID = popupid
    Timeout_MessageBox = setTimeout('closeMessageBox(MessageBoxID)', 10000);
}

function submitForm(frmName)
{
    document.getElementById(frmName).submit();
}

/*
function checkEnter(e)
{ //e is event object passed from function invocation
    var characterCode; //literal character code will be stored in this variable

    if(e && e.which)
    { //if which property of event object is supported (NN4)
        e = e;
        characterCode = e.which; //character code is contained in NN4's which property
    }
    else{
        e = event;
        characterCode = e.keyCode; //character code is contained in IE's keyCode property
    }

    if(characterCode == 13)
    { //if generated character code is equal to ascii 13 (if enter key)
        document.getElementById('frmLogin').submit(); //submit the form
        return false;
    }
    else
    {
        return true;
    }

}
*/
/*function setDate()
{
    Timeout_Date = setTimeout('showDate();', 3000);
}
function showDate()
{
    clearTimeout(Timeout_Date);
    document.getElementById('currDate').innerHTML = '11 jul 2008';
}


/*function showDate(refLI)
{
     clearTimeout(Timeout_Date);
     var now = new Date();
     //refLI.innerHTML = now.getDate();
     refLI.innerHTML = '11 jul 2008'
}*/





//Tabbed Panes Code

var panes = new Array();

function setupPanes(containerId, defaultTabId) {
  // go through the DOM, find each tab-container
  // set up the panes array with named panes
  // find the max height, set tab-panes to that height
  panes[containerId] = new Array();
  var maxHeight = 0; var maxWidth = 0;
  var container = document.getElementById(containerId);
  var paneContainer = container.getElementsByTagName("div")[0];
  var paneList = paneContainer.childNodes;
  for (var i=0; i < paneList.length; i++ ) {
    var pane = paneList[i];
    if (pane.nodeType != 1) continue;
    if (pane.offsetHeight > maxHeight) maxHeight = pane.offsetHeight;
    if (pane.offsetWidth  > maxWidth ) maxWidth  = pane.offsetWidth;
    panes[containerId][pane.id] = pane;
    pane.style.display = "none";
  }
    paneContainer.style.height = maxHeight + "px";
    paneContainer.style.width  = maxWidth + "px";
    document.getElementById(defaultTabId).onclick();
}

function showPane(paneId, activeTab, jump) {
  // make tab active class
  // hide other panes (siblings)
  // make pane visible
  
    for (var con in panes) {
     
    activeTab.blur();
    activeTab.className = "tab-active";
    if (panes[con][paneId] != null) { // tab and pane are members of this container
      
      var pane = document.getElementById(paneId);
      pane.style.display = "block";
      var container = document.getElementById(con);
      var tabs = container.getElementsByTagName("ul")[0];
      var tabList = tabs.getElementsByTagName("a")
      for (var i=0; i<tabList.length; i++ ) {
        var tab = tabList[i];
        if (tab != activeTab) tab.className = "tab-disabled";
      }
      for (var i in panes[con]) {
        var pane = panes[con][i];
        if (pane == undefined) continue;
        if (pane.id == paneId) continue;
        pane.style.display = "none"
      }
    }
  }
   return false;    
}
