function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}

function navigateToAnchor(){
   var anchor = document.getElementById("anchor");
   if (anchor != null) {
      if (anchor.value != ""){
         location.hash = anchor.value;
      }
   }
}

function printdiv(printpage) {
	var headstr = "<html><head><title></title></head><body>";
	var footstr = "</body>";
	var newstr = document.all.item(printpage).innerHTML;
	var oldstr = document.body.innerHTML;
	document.body.innerHTML = headstr+newstr+footstr;
	window.print(); 
	document.body.innerHTML = oldstr;
	return false;
}

function backToAccounts() {
	window.location = "../secure/tradeaccmanagement.jsf";
}

