var offset = 0;

function changeInputBox(a,c)
{
   document.getElementById("inputBox"+a).style.color = "#000";
   document.getElementById("inputBox"+a).select();
}

function changeTB(a)
{
   document.getElementById("tb"+a).style.color = "#000";
   document.getElementById("tb"+a).select();
}

function checkTB(a)
{
   var x = document.getElementById("tb"+a);
   x.style.color = "#999";
   if (x.value == "" || x.value == " " || x.value == "  " || x.value == "   ") 
      x.value = x.defaultValue;
}

function checkValue(a)
{
   var x = document.getElementById("inputBox"+a);
   x.style.color = "#ccc";
   if (x.value == "") x.value = x.defaultValue;
}

function changeLine(a, b)
{
   switch (b)
   {
      case 0: document.getElementById(a).style.background = "#ccc"; break;
      case 1: document.getElementById(a).style.background = "#000"; break;
      default: break;
   }
}

// showConversation(a,b) 
// Brief description: Show Conversation Bubble
// Precondition: Variable b must be true or false.  
// Postcondition: If true, the corresponding "conversation bubble" needs to be set visible.
//                If false, the corresponding "conversation bubble" needs to be set hidden.
function showConversation(a,b) // a = selected conversation bubble || b = (1) true / (0) false
{  
   switch (b)
   {
      case 0: document.getElementById("bubble00" + a).style.visibility = "hidden"; break;
      case 1: document.getElementById("bubble00" + a).style.visibility = "visible"; break;
      default: break;
   }
}

// showBoxInfo(a,b) 
// Brief description: Show Information Box
// Precondition: Variable b must be true or false.  
// Postcondition: If true, the corresponding "information box" needs to be set visible.
//                If false, the corresponding "information box" needs to be set hidden.
function showBoxInfo(a,b) // a = selected conversation bubble || b = (1) true / (0) false
{  
   switch (b)
   {
      case 0: document.getElementById("info" + a).style.visibility = "hidden"; break;
      case 1: document.getElementById("info" + a).style.visibility = "visible"; break;
      default: break;
   }
}

// linkGo(a)
// Brief description: Short hand link
// Precondition: Variable b must be true or false.  
// Postcondition: If true, the corresponding "conversation bubble" needs to be set visible.
//                If false, the corresponding "conversation bubble" needs to be set hidden.
function linkGo(a)
{
   window.location.href = a;
}

// showSubMenu(a,b)
// Brief description: Expand/Collapse Side Menu
// Precondition: Variable -a- must be 3 <= a <= 7
//               Variable -b- must be 0 <= a <= 1 (true or false.
function showSubMenu(a,b)
{
   var closeCurrent = (document.getElementById("menu"+a).style.fontWeight == "bold") ? true : false;
   for (var i = 3; i <= 7; ++i)
   {
      document.getElementById("menu"+i).style.fontWeight = "normal";
      document.getElementById("submenu" + i).style.height = "0px";
      document.getElementById("sign" + (i-2)).innerHTML = "+";
   }   
   if (closeCurrent == false)
   {
      document.getElementById("menu"+a).style.fontWeight = "bold";
      document.getElementById("submenu" + a).style.height = b + "px";
      document.getElementById("sign" + (a-2)).innerHTML = "o";
   }
}

