// ***********************************************************************
// Description:	JavaScript code for PaceMaker Choppers web site.
// Author:	Karl Harvey		09/06/2001
//
//	This page is deployed on Internet Explorer and
//	is intended to function the same on both.
//
// Public Functions:
//	-- Name -- 		-- Where Used --
//	popup
//	lastUpdated
//
// Utility functions:
//	-- Name -- 		-- Where Used --
//	fixString
//
// Required: none
//
// Usage:
// To use this file, include the following in your HTML file:
// <!-- The following JavaScript files are a part of this web page. -->
// <script type="text/javascript" language="JavaScript" src="./include/pmcsite.js"></script>
//
// ***********************************************************************
//                       R E V I S I O N   H I S T O R Y
// Author	Date		Description
// K. Harvey 10/06/08   Configured for PMC.
//
// ***********************************************************************
// ----------------------- //
// -- Public Functions --- //
// ----------------------- //

// ***********************************************************************
// Call syntax: <a href="javascript:popup('url','www','hhh');">link title</a>
// Input:
// 	url 		= (Required) the link URL
//	www 		= (Optional) window width, default = 500
//	hhh 		= (Optional) window height, default = 600
// ***********************************************************************
function popup(url,width,height){
	var w = (width  == undefined) ? 500 : width;
	var h = (height == undefined) ? 600 : height;
	var name = "PopUp";
	var spec1 = "width="+w+",height="+h+",";
	var spec2 = "titlebar=yes,scrollbars=yes,resizable=yes,";
	var spec3 = "menubar=no,toolbar=no,location=no,status=no";
	var spec  = spec1+spec2+spec3;
	var repl  = false;
//	var view_window = window.open(url,name,"width="+w+",height="+h+",scrollbars=yes,resizable=yes");
	var view_window = window.open(url,name,spec,repl);
	view_window.focus();
}

// ***********************************************************************
// This function prints the Last Updated date.
// Ref: 'footerForm'
// Input: none.
// ***********************************************************************
function lastUpdated(){
	document.write('Last Updated: <I>' + document.lastModified + '</I>');
}


// ***********************************************************************
// ----------------------- //
// -- Utility Functions -- //
// ----------------------- //

// ***********************************************************************
// This function returns the input string with all search characters
// replaced with input pad string if input, otherwise uses underscore "_"
// character.
// Input:
//	s		- (Required) String to be padded
//	r		- (Optional) Character to be replaced, default "&"
//	p		- (Optional) Pad character to use, default = "_"
// ***********************************************************************
function fixString(s,r,p) {
	var fix = (!r) ? "&" : r;
	var pad = (!p) ? "_" : p;
	var str = "";
	for(var i=0; i<s.length; i++){
		var c = s.charAt(i);
		if (c == fix) c = pad;
		str += c;
	}
	return str;
}

//alert("Loaded: bftcsite.js");
// ***********************************************************************
// End -->
