function stripURL(which){ //check postcode format is valid
	test = which.value; size = test.length
	while (test.slice(0,1) == " ") {//Strip leading spaces 
		test = test.substr(1,size-1);size = test.length
	}
	if (test.slice(0,7) == "http://") {//Strip leading spaces 
		test = test.substr(7,size-7);size = test.length
	}
	if (test.slice(0,7) == "mailto:") {//Strip leading spaces 
		test = test.substr(7,size-7);size = test.length
	}
	if (test.slice(0,6) == "ftp://") {//Strip leading spaces 
		test = test.substr(6,size-6);size = test.length
	}
	if (test.slice(0,8) == "https://") {//Strip leading spaces 
		test = test.substr(8,size-8);size = test.length
	}
	while (test.slice(0,1) == " ") {//Strip leading spaces 
		test = test.substr(1,size-1);size = test.length
	}
	while(test.slice(size-1,size)== " ") { //Strip trailing spaces
		test = test.substr(0,size-1);size = test.length
	}
	which.value = test; //write back to form field
	return true;
}

function PrintEmail(user, domain, display, props){
	document.write('<a href="mailto:' + user + '@' + domain + '" ' + props + '>');
	if (display != '' && display != null) {
		document.write(display);
	} else {
		document.write(user + '@' + domain);
	}
	document.write('</a>');
// useage: Place the following in script tages (the 'display' and 'props' parameters are optional):
//	PrintEmail('user','domain.tld','Display Name', 'additional attributes of the "a href" tag');
//	eg: PrintEmail('webservant','MennoniteMission.net','WebServant', 'class="Special_CSS_Class"');
//	OR: PrintEmail('webservant','MennoniteMission.net');
}

function checkNotNULL() {
	var argLength = checkNotNULL.arguments.length; 
	for(arg=0;arg<argLength;arg++) { 
		if (checkNotNULL.arguments[arg] == '') {
			arg++
			alert(checkNotNULL.arguments[arg]);
			return false;
		}
		arg++
    }
}

// Old Functions
function CreateWindow(url){
win = window.open(url,"_blank",'width=275,height=300,resizable');
};
function Show_Scripture(scripture){
url = "http://bible.gospelcom.net/bible?" + scripture;
win = window.open(url,"_blank",'width=500,height=300,scrollbars=yes,menubar=yes,resizable');
};
function ClearFormElement(whichbox,whatphrase){
if (whichbox.value == whatphrase){whichbox.value = "";}
}
