
function copystatus(){
    window.status="© 2007 West Chester Area Sports Association.   All Rights Reserved.";
};


function limitext(TheForm,TheFld,Val,len,max)	{
	var maxlength = max;
	var currlength = len;	
	if(maxlength < currlength) {
		TheForm[TheFld].value = TheForm[TheFld].value.substring(0, maxlength);
		alert("Maximum Character Limit Met - " + maxlength);		
	}
};


function userConfirm() { 
	return window.confirm ("Are you sure you want to delete this record?");
} 


function popup(url,name,h,w) {
  window.open(url, name, 'left=340,top=80,width=' + w + ',height=' + h + ',scrollbars,resizable');
}


function disableButton(theButton)
{
 theButton.value="Processing...";
 theButton.disabled = true; 
}

function replace(string,text,by) {
    // Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}