function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else 
countfield.value = maxlimit - field.value.length;}

function confirmVoidPayment(url) {
if (confirm("Are you sure you want to void Payment?")) {
document.location = url; }}

function confirmVoidShipment(url) {
if (confirm("Are you sure you want to void Shipment?")) {
document.location = url; }}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=800');");
}

function get(name,type){if(type=='id'){if(!document.getElementById(name)){alert('I cannot find element with an id of'+name);return false}return document.getElementById(name)}else{if(!document.getElementsByTagName(name)){alert('I cannot find element with name of'+name);return false}return document.getElementsByTagName(name)}}