//
// Copyright 2007, 2008 Zebek. All rights reserved.
//
// Duplication, reproduction or use of any kind without explicit written permission from
// Zebek is strictly prohibited.
//
//
function ShowHideObj(Obj,ShowHide,ObjLink)
{
  if (isObject(Obj))
  {
    if(ShowHide == 'A' || ShowHide == 'a')
    { 
      if (Obj.style.display == 'block')
      { 
	Obj.style.display = 'none'; 
	plusMinus(ObjLink,'+');
      } 
      else
      { 
	Obj.style.display = 'block';
	plusMinus(ObjLink,'-');
      }
    }
    else if(ShowHide == 'S' || ShowHide == 's')
    { 
      Obj.style.display = 'block';
      plusMinus(ObjLink,'-');
    }
    else if(ShowHide == 'H' || ShowHide == 'h')
    { 
      Obj.style.display = 'none';
      plusMinus(ObjLink,'+');
    }
  }
  else
  {
    Obj = document.getElementsByName(Obj);
    if (Obj)
    {
      for (var i=0; i< Obj.length; i++)
      {
	if(ShowHide == 'A' || ShowHide == 'a')
	{ 
	  if (Obj[i].style.display == 'block' ){ Obj[i].style.display = 'none';plusMinus(ObjLink,'+'); } else{ Obj[i].style.display = 'block';plusMinus(ObjLink,'-'); }
	}
	else if(ShowHide == 'S' || ShowHide == 's')
	{ 
	  Obj[i].style.display = 'block'; 
	  plusMinus(ObjLink,'-')
	    }
	else if(ShowHide == 'H' || ShowHide == 'h')
	{ 
	  Obj[i].style.display = 'none'; 
	  plusMinus(ObjLink,'+')
	    }
      }
    }
  }
}
function plusMinus(o,txt)
{ 
	if(txt=="-")
		o.src = MAIN_URL_BASE+"images/button_close.gif";	
	else if(txt=="+")
		o.src = MAIN_URL_BASE+"images/button_open.gif";
//		o.innerHTML = txt;
}
function isObject(o) {return (o && "object" == typeof o)}
function isUndefined(o) {return 'undefined' == typeof o;}
function isFunction(o) {return 'function' == typeof o;}
//
function ShowHideElements(objList, hideableObj)
{
  if (objList)
  {
    var obj = document.getElementById(hideableObj);

    if (objList.selectedIndex -0 != objList.options.length - 1)
    {
      if (obj)
      {
	obj.style.display="none";
      }
    }
    else
    {
      if (obj)
      {
	obj.style.display="block";
      }
    }
  }
}

