function top(obj) {
    var parent = obj.parentNode;
    for (var i=0;i<parent.childNodes.length;i++) {
        parent.childNodes[i].className="top";
    }
    obj.className="top active";
}


        var d = document;

     function $(id, f){
      	return eval('d.getElementById(id)' + (f? '.style' : ''));
      }


      function hideShow(id) {
	      if($(id))
          $(id).style.display =($(id).style.display=='')?'none':'';
      }

       function showdiv(id) {
        if (document.getElementById) {
          document.getElementById(id).style.display = 'block';
        }
      }



     function selectTab (newTabId, oldTabId, selTabNum){
        newTab = $(newTabId);
        newTab.className += " sel";
        if (oldTabId) {
          oldTab = $(oldTabId);
          oldTab.className = oldTab.className.substring(0,oldTab.className.length-3);
          hideShow (oldTabId+'c');
        }
        hideShow (newTabId+'c');
        switch(selTabNum) {
          case 1:
            selTab1 = newTabId;
            break;
          case 2:
            selTab2 = newTabId;
            break;
          case 3:
            selTab3 = newTabId;
            break;
          case 4:
            selTab4 = newTabId;
            break;
          default:
            selTab = newTabId;
        }

      }
            function getIntFromId (selObj){
        num = parseInt(selObj.substring((selObj.length - 1),selObj.length));
        return num;
      }


       function getTabId(type, newsCount){  // type is 'prev' or 'next'
        numId = getIntFromId(selTab4);
        if (type == 'next') {
          if (numId < newsCount) numId += 1;
          else  numId = 1;
        } else if (type == 'prev') {
          if (numId > 1) numId -= 1;
          else numId = newsCount;
        } else numId = 1;
        objId = 'n' + numId;
        return objId;
      }

