/*
  javascript functions for the install of the EMS - Service System

  Copyright (c) 2005-2007 Armadillo Technologies LLC
*/
  
function toggleBox(szDivID) {
  if (document.layers) { // NN4+
    if (document.layers[szDivID].visibility == 'visible') {
      document.layers[szDivID].visibility = "hide";
      document.layers[szDivID].display = "none";
      document.layers[szDivID+"SD"].fontWeight = "normal";
    } else {
      document.layers[szDivID].visibility = "show";
      document.layers[szDivID].display = "inline";
      document.layers[szDivID+"SD"].fontWeight = "bold";
    }
  } else if (document.getElementById) { // gecko(NN6) + IE 5+
    var obj = document.getElementById(szDivID);
    var objSD = document.getElementById(szDivID+"SD");

    if (obj.style.visibility == 'visible') {
      obj.style.visibility = "hidden";
      obj.style.display = "none";
      objSD.style.fontWeight = "normal";
    } else {
      obj.style.visibility = "visible";
      obj.style.display = "inline";
      objSD.style.fontWeight = "bold";
    }
  } else if (document.all) { // IE 4
    if (document.all[szDivID].style.visibility == 'visible') {
      document.all[szDivID].style.visibility = "hidden";
      document.all[szDivID].style.display = "none";
      document.all[szDivID+"SD"].style.fontWeight = "normal";
    } else {
      document.all[szDivID].style.visibility = "visible";
      document.all[szDivID].style.display = "inline";
      document.all[szDivID+"SD"].style.fontWeight = "bold";
    }
  }
}

function changeStyle(what, how) {
  if (document.getElementById) {
    document.getElementById(what).style.fontWeight = how;
  } else if (document.all) {
    document.all[what].style.fontWeight = how;
  }
}

function changeText(where, what) {
  if (document.getElementById) {
    document.getElementById(where).innerHTML = what;
  } else if (document.all) {
    document.all[where].innerHTML = what;
  }
}

function switchDiv(strDivName,bolVisible){
  var   isNS4 = (document.layers) ? true : false;
  var   isIE4 = (document.all && !document.getElementById) ? true : false;
  var   isIE5 = (document.all && document.getElementById) ? true : false;
  var   isNS6 = (!document.all && document.getElementById) ? true : false;
 if (isNS4) {
   objElement = document.layers[strDivName];
 } else if (isIE4) {
   objElement = document.all[strDivName].style;
 } else if (isIE5 || isNS6) {
   objElement = document.getElementById(strDivName).style;
 }
 if(isNS4){
     if(!bolVisible) {
       document.layers[strDivName].visibility ="hidden"
     } else {
       document.layers[strDivName].visibility ="visible"
     }     
 }else if(isIE4){
     if(!bolVisible) {
       document.all[strDivName].style.visibility = "hidden";
     } else {
       document.all[strDivName].style.visibility = "visible";
     }
}
 else if (isIE5 || isNS6) {
      if(bolVisible){
         document.getElementById(strDivName).style.display= "";
      } else {
        document.getElementById(strDivName).style.display = "none";
        }
      }
}

function ViewDetail(selObj) {
   page=selObj.options[selObj.selectedIndex].value;
   self.location.href = page;
}

function change(html){
  DESCRIPTION2.innerHTML=html
}

function openpopupForgotPassword(){
var popurl="forgotPassword.php"
winpops=window.open(popurl,"","width=473,height=237,scrollbars=no,resizable=no,location=no,directories=no,status=no,toolbar=no")
}


// 
// openSpellChecker()
//
// this function is an example that illustrates the various ways you can invoke
// the the Speller Pages spell-checking process
//
function openSpellChecker() {
	
	// example 1. 
	// Pass in the text inputs or textarea inputs that you 
	// want to spell-check to the object's constructor,
	// then call the openChecker() method.
	//var text1 = document.form1.text1;
	//var textarea1 = document.form1.textarea1;
	//var speller = new spellChecker( text1, textarea1 );
	//speller.openChecker();

	// example 2.
	// Rather than passing in the form elements to the object's
	// constructor, populate the object's textInputs property,
	// then call the openChecker() method.
	/*
	var speller = new spellChecker();
	var spellerInputs = new Array();
	for( var i = 0 ; i < document.form1.elements.length; i++ ) {
		if( document.form1.elements[i].type.match( /^text/ )) {
			spellerInputs[spellerInputs.length] = document.form1.elements[i];
		}
	}
	speller.textInputs = spellerInputs;
	speller.openChecker();
	*/

	// example 3.
	// use the spellCheckAll() method to check every text input
	// and textarea input in every form in the HTML document.
	// You can also use the checkTextBoxes() method or checkTextAreas()
	// method instead of spellCheckAll() to check only text inputs
	// or textarea inputs, respectively
	var speller = new spellChecker();
	speller.spellCheckAll();
	
}
function fillField(maxChar, nextId , nextField ){
     //alert(nextId);
     if ( nextId && obj.value.length == maxChar)
     {
		nextField.select();
		nextField.focus();
	 }
}
