changeWindowStatus = function (text) {
	if(text) {
		window.status = text
	} else {
		window.status = ''
	}
}

buildSWF = function (fileName, width, height, hspace, vspace, transparent, bypassBrowserCache, flashVersion) {

	id 						= fileName.substring(0, fileName.lastIndexOf("."));
	t 						= transparent;
	fileName			= bypassBrowserCache ? fileName + "?" + new Date().getMilliseconds() : fileName;
	flashVersion	= (flashVersion) ? flashVersion : "6,0,0,0";

	document.write('<object')

	document.write('	id="' + id + '" ')
	document.write('	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ')
	document.write('	codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + flashVersion + " ')
	document.write('	width="' + width + '" ')
	document.write('	height="' + height + '" ')
	document.write('	hspace="' + hspace + '" ')
	document.write('	vspace="' + vspace + '">')


	document.write(' <param name="movie" value="' + fileName + '">')
	document.write('<param name="menu" value="false">')
	document.write('<param name="quality" value="high">')
	if(t) document.write('<param name="wmode" value="transparent">')

	document.write('<embed ')
	document.write('	id="' + id + '" ')
	document.write('	src="' + fileName + '" ')
	document.write('	width="' + width + '" ')
	document.write('	height="' + height + '" ')
	document.write('	hspace="' + hspace + '" ')
	document.write('	vspace="' + vspace + '" ')
	document.write('	quality="high" ')
	if(t) document.write('	wmode="transparent" ')
	document.write('	pluginspage="http://www.macromedia.com/go/getflashplayer" ')
	document.write('	type="application/x-shockwave-flash">')
	document.write('</embed>')

	document.write('</object>')
}



specialField = function (obj, dataType) {

	keyPressed = event.keyCode;

	switch(dataType) {

		case "numbers":
			if(!(keyPressed >= 48 && keyPressed <= 57)) { event.returnValue = false; }
		break;

		case "date":
			if(obj.value.length > 10 && keyPressed != 9 && keyPressed != 16) findNextFormElement(obj).focus();
			if(!(keyPressed >= 48 && keyPressed <= 57)) { event.returnValue = false; }
			if((obj.value.length == 2 || obj.value.length == 5) && (keyPressed != 8 || keyPressed !=37 || keyPressed != 39)) obj.value += "/";
		break;
	}
}



findNextFormElement = function (obj) {
	for(n=0;n<obj.form.length;n++) if(obj.form.elements[n].name == obj.name) return(obj.form.elements[n+1])
}


dropURLChanger = function (url) {
	url = url.split("|");
	if(url[0] == "#") return(false);
	siteURL = "http://www.ongrace.com/";
	if(location.href.indexOf("ongrace.com") == -1) siteURL = "/";
	if(url[0].indexOf("http://") > -1) siteURL = "";
	url[0] = siteURL + url[0];


	if(url.length == 1) {
		location.href = url[0];
	} else {
		if(url[1] == "popup") {
			width = url[2]; height = url[3];
			if(url[4] == 1) { scrollbars = 1; } else { scrollbars = 0; }
			window.open(url[0], url[0].length * height, 'width=' + width + ', height=' + height + ', scrollbars=' + scrollbars)
		} else if(url[1] == "blank") {
			window.open(url[0]);
		}
	}
}

