function logOut(){
	top.location = '/ChristianRent/Disconnect.jsp'
}

function trim(s) 
{
  // Remove leading spaces and carriage returns
  
  while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
  {
    s = s.substring(1,s.length);
  }

  // Remove trailing spaces and carriage returns

  while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
  {
    s = s.substring(0,s.length-1);
  }
  return s;
}

function toggle(el,classname1,classname2){
	if(el.className==classname1){
		el.className=classname2;
	}else{
		el.className=classname1;
	}
}

function toggleText(el,text1,text2){
	if(el.innerText==text1){
		el.innerText=text2;
	}else{
		el.innerText=text1;
	}
}
function setText(el,text){
		el.innerText=text;
}

function toggleCheck(element, numEl){
	for(x=1;x<=numEl;x++){
		if(!eval("document."+element+x+".checked")){
			eval("document."+element+x+".checked = true")
		}else{
			eval("document."+element+x+".checked = false")
		}
	}
}
function numbersonly(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
 key = window.event.keyCode;
else if (e)
 key = e.which;
else
 return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) || 
 (key==9) || (key==27) )
 return true;
// numbers
else if ((("0123456789").indexOf(keychar) > -1))
 return true;
// decimal point jump
else if (dec && (keychar == "."))
 {
 myfield.form.elements[dec].focus();
 return false;
 }
else
 return false;
}

function getLocalTime() {
	var dDay = new Date();
	var nYear = dDay.getFullYear();
	var nMonth = dDay.getMonth() + 1;
	var nDate = dDay.getDate()
	var nHours = dDay.getHours();
	var nMinutes = dDay.getMinutes();
	var nSeconds = dDay.getSeconds();
	if(nMonth<10){
		nMonth = "0" + nMonth
	}
	if(nDate<10){
		nDate = "0" + nDate
	}
	if(nHours<10){
		nHours = "0" + nHours
	}
	if(nMinutes<10){
		nMinutes = "0" + nMinutes
	}
	if(nSeconds<10){
		nSeconds = "0" + nSeconds
	}

	var localTime = nYear + "-" + nMonth + "-" + nDate + " " + nHours + ":" + nMinutes+":" + nSeconds

	return localTime;
}



