startList = function() {

	if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav");
	for (i=0; i<navRoot.childNodes.length; i++) {
	node = navRoot.childNodes[i];
	if (node.nodeName=="LI") {
	node.onmouseover=function() {
		this.className+=" over";
		if(this.id == 's_menu' || this.id == 'p_menu'){
		document.getElementById("cat_option").style.visibility = 'hidden';
		}
	  }
	  node.onmouseout=function() {
	 	 this.className=this.className.replace(" over", "");
	 	 document.getElementById("cat_option").style.visibility= 'visible';
	   }
	   }
	  }
	 }
}

function initOverLabels () {
  if (!document.getElementById) return;      

  var labels, id, field;

  // Set focus and blur handlers to hide and show 
  // labels with 'overlabel' class names.
  labels = document.getElementsByTagName('label');
  for (var j = 0; j < labels.length; j++) {

    if (labels[j].className == 'overlabel') {

      // Skip labels that do not have a named association
      // with another field.
      id = labels[j].htmlFor || labels[j].getAttribute('for');
      if (!id || !(field = document.getElementById(id))) {
        continue;
      } 

      // Change the applied class to hover the label 
      // over the form field.
      labels[j].className = 'overlabel-apply';

      // Hide any fields having an initial value.
      if (field.value !== '') {
        hideLabel(field.getAttribute('id'), true);
      }

      // Set handlers to show and hide labels.
      field.onfocus = function () {
        hideLabel(this.getAttribute('id'), true);
      };
      field.onblur = function () {
        if (this.value === '') {
          hideLabel(this.getAttribute('id'), false);
        }
      };

      // Handle clicks to label elements (for Safari).
      labels[j].onclick = function () {
        var id, field;
        id = this.getAttribute('for');
        if (id && (field = document.getElementById(id))) {
          field.focus();
        }
      };

    }
  }
};

function hideLabel (field_id, hide) {
  var field_for;
  var labels = document.getElementsByTagName('label');
  for (var j = 0; j < labels.length; j++) {
    field_for = labels[j].htmlFor || labels[j].getAttribute('for');
    if (field_for == field_id) {
      labels[j].style.textIndent = (hide) ? '-999999px' :'0px';
      return true;
    }
  }
}

/* START CHECK BOXES */

var Input = { 
  initialize: function() { 
    if(document.getElementsByTagName("form")) { 
      var divs = document.getElementsByTagName("div"); 
      for(var i = 0; i < divs.length; i++) { 
        if(divs[i].className.match("checkbox") || divs[i].className.match("checkbox2")) { 
          divs[i].onmousedown = Input.effect; 
          divs[i].onmouseup = Input.handle; 
          window.onmouseup = Input.clear; 
        } 
      } 
    } 
  }, 

  effect: function() { 
    if(this.className == "checkbox" || this.className == "checkbox2") { 
      this.style.backgroundPosition = "0 -26px"; 
    } else { 
      this.style.backgroundPosition = "0 -79px"; 
    } 
  }, 

  handle: function() { 
    selector = this.getElementsByTagName("input")[0]; 
    if(this.className == "checkbox") { 
      selector.checked = true; 
      this.className = "checkbox selected"; 
      this.style.backgroundPosition = "0 -52px"; 
    } else if(this.className == "checkbox selected") { 
      selector.checked = false; 
      this.className = "checkbox"; 
      this.style.backgroundPosition = "0 0"; 
    } else { 
      selector.checked = true; 
      this.className = "checkbox2 selected"; 
      this.style.backgroundPosition = "0 -52px"; 
      inputs = document.getElementsByTagName("input"); 
      for(i = 0; i < inputs.length; i++) { 
        if(inputs[i].getAttribute("name") == selector.getAttribute("name")) { 
          if(inputs[i] != selector) { 
            inputs[i].parentNode.className = "radio"; 
            inputs[i].parentNode.style.backgroundPosition = "0 0"; 
          } 
        } 
      } 
    } 
  }, 

  clear: function() { 
    divs = document.getElementsByTagName("div"); 
    for(var i = 0; i < divs.length; i++) { 
      if(divs[i].className == "checkbox" || divs[i].className == "checkbox2") { 
        divs[i].style.backgroundPosition = "0 0"; 
      } else if(divs[i].className == "checkbox selected" || divs[i].className == "checkbox2 selected") { 
        divs[i].style.backgroundPosition = "0 -52px"; 
      } 
    } 
  } 
} 


/* END CHECK BOXES */

function popUpWhatsthis(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=610,height=390,left = 540,top = 234');");
}

function popUpForgotpassword(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=610,height=170,left = 540,top = 234');");
}
function popUpDeleteClient()
  {
  var r=confirm("Are you sure you want to delete this Client?")
  if (r==true)
    {
    
    }
  else
    {
    
    }
  }
  function popUpDeleteUser()
  {
  var r=confirm("Are you sure you want to delete this User?")
  if (r==true)
    {
    
    }
  else
    {
    
    }
  }


window.onload = function () {
  setTimeout(initOverLabels, 50);
};
