function getElem(name) {
	if (document.getElementById) // this is the way the standards work
		elem = document.getElementById(name);
	else if (document.all) // this is the way old msie versions work
		elem = document.all[name];
	else if (document.layers) // this is the way nn4 works
		elem = document.layers[name];
	return elem;
}

function switchDiv(div) {
	elemnt = getElem(div);
	if (elemnt.style.display == 'block') {
		elemnt.style.display = 'none';
	} else {
		elemnt.style.display = 'block';
	}
}

function switchClass(itemname, classname) {
	if (itemname != null) {
		getElem(itemname).className = classname;
	}
}

function showDiv(div){
	elemnt = getElem(div);
	elemnt.style.display = 'block';
}

function hideDiv(div){
	elemnt = getElem(div);
	elemnt.style.display = 'none';		
}

function switchLogin(divA,divB){
	showDiv(divA);
	hideDiv(divB);
}

function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function checkNumber(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);
  
  if (cCode < 48 || cCode > 57 ) 
  {
	  if ( cCode != 43 )
	  {
		  var myNumber = val.value.substring(0, (strLength) - 1);
		  val.value = myNumber;
	  }
  }
  return false;
}

function goURL(url) {
	window.location = url;

}



