ns = (document.layers)? true:false
ie = (document.all)? true:false
function show(id)
{
	if(ns){
	    document.layers[id].visibility = "show"
	    document.layers[id].style.display = "block"
	}
	else if(ie){
	    document.all[id].style.visibility = "visible"
	    document.all[id].style.display = "block"
	}
}

function hide(id)
{
	if(ns){
	    document.layers[id].visibility = "hide"
	    document.layers[id].style.display = "none"
	}
	else if(ie){
	    document.all[id].style.visibility = "hidden"
	    document.all[id].style.display = "none"
	}
}

function getObject(obj)
{
    var theObj
    if(typeof obj == "string"){
        theObj = eval("document." + coll + obj + styleObj)
    }else{
    theObj = obj
}
return theObj
}

function highlite(highlitecolor, theRow)
{
    if (highlitecolor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = highlitecolor;
    }

    return true;
}

var openedTab = null;
var SIZE = 5;

function swapTabs(tabId){
     if (openedTab){
        openedTab.style.display='none';
     }
     openedTab = document.getElementById( tabId );
     openedTab.style.display = 'block';   
}

function showTabes( value ){
     for ( ind=1; ind<=SIZE;  ind++)
          document.getElementById('header' + ind).style.display = 'block';
     for ( ind=value; ind>0;  ind--)
          document.getElementById('header' + ind).style.display = 'none';
}

function setchecked( checkId ){
   thisDoc = document.getElementById( checkId );
   thisDoc.checked = 'true';
}

function  killbackbutton(){
//    if(window.history.forward(1) != null)
//        window.history.forward(1);
//window.location.replace(this) 
//    alert('test');
}

function colorchange( itemId,v ){
    for(i=1; i<=v; i++){
       if(itemId == 'header'+i){
            thisItem = document.getElementById( itemId );
            thisItem.style.border = '1px solid red';
        }else{
            thisItem = document.getElementById( 'header'+i );
            thisItem.style.border = '1px solid black';
        }
    }
}

function create_time(divName,formName) {
  hour = document.forms[0].hour.value
  min = document.forms[0].minute.value;
  ampm = document.forms[0].ampm.value;
  tm = hour+':'+min+' '+ampm;
  alert(tm);
  return tm;
}

function add_employee() {
  emp = document.employee.employee.value;
//  alert(emp);
  return emp;
}

function add_element1() {
  element1 = document.assigned.assigned_group.value;
//  alert(element1);
  return element1;
}
function add_element2() {
  element2 = document.assigned.assigned.value;
//  alert(element2);
  return element2;
}