// JavaScript Document



				
				function valid(sText){
					
				if(sText == '' || sText.length >6){return false;}
					
					var ValidChars = "0123456789";
					var IsNumber=true;
					var Char;

 
					   for (i = 0; i < sText.length && IsNumber == true; i++) { 
				
						  Char = sText.charAt(i); 
						  if (ValidChars.indexOf(Char) == -1) {
							 IsNumber = false;
						  }
					   }
					
					   return IsNumber;
			   }
				
	
	
				function numberFormat(nStr,prefix){

				var prefix = prefix || '';
				nStr += '';
				x = nStr.split('.');
				x1 = x[0];
				x2 = x.length > 1 ? '.' + x[1] : '';
				var rgx = /(\d+)(\d{3})/;
				while (rgx.test(x1))
					x1 = x1.replace(rgx, '$1' + ' ' + '$2');
				return prefix + x1 + x2;
				
				}
				
				
				
				 function showhide(divid){
			
					thediv = document.getElementById(divid);
				
					if(thediv.style.display == 'none' ){
				
						thediv.style.display ='block';
			
					}else{
					
						thediv.style.display='none';
						
					}
				}
				
				
				function showandhide(showDiv,hideDiv){
					

					thedivShow = document.getElementById(showDiv);
					thedivHide = document.getElementById(hideDiv);
					
						if(thedivShow.style.display == 'none'){
							
							
								thedivShow.style.display = 'block';
								thedivHide.style.display = 'none';
						
						}else{
							
			
								thedivShow.style.display = 'none';
								thedivHide.style.display = 'block';
								
						}
							
								
					
				}
				
				
				
	function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
		window.onload = func;
	  } else {
		window.onload = function() {
		  oldonload();
		  func();
		}
	  }
	}




function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.parentNode.getElementsByTagName("span")[1]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.parentNode.getElementsByTagName("span")[1].style.display = "inline";
			}
			
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.parentNode.getElementsByTagName("span")[1].style.display = "none";
			}
		}
	}
	// repeat the same tests as above for selects
	var selects = document.getElementsByTagName("select");
	for (var k=0; k<selects.length; k++){
		if (selects[k].parentNode.parentNode.getElementsByTagName("span")[1]) {
			selects[k].onfocus = function () {
				this.parentNode.parentNode.getElementsByTagName("span")[1].style.display = "inline";
			}
			selects[k].onblur = function () {
				this.parentNode.parentNode.getElementsByTagName("span")[1].style.display = "none";
			}
		}
	}
	  var textareas = document.getElementsByTagName("textarea");
  for (var m=0; m<textareas.length; m++){
    textareas[m].onfocus = function () {
      this.parentNode.parentNode.getElementsByTagName("span")[1].style.display = "inline";
    }
    textareas[m].onblur = function () {
      this.parentNode.parentNode.getElementsByTagName("span")[1].style.display = "none";
    }
  }
}