function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function makeArray(n)
{
	this.length = n
	return this
}

monthNames = new makeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"

// Function to check the search field
    function CheckSearch () {
        //var SearchForm        = self.SearchForm;
        var SearchForm  = this.document.SearchForm;
        var SearchField = SearchForm.plainstring;

        if (SearchField.value == '')
		{
            var Warning = 'Search field is empty!';
            alert(Warning);
            SearchField.focus();
            return
        }
	        SearchForm.submit()
    }

function dateString(oneDate)
{
	var theMonth = monthNames[oneDate.getMonth() + 1]
	var theYear = oneDate.getFullYear()
	return theMonth + " " + oneDate.getDate() + ", " + theYear
}

// FORM VALIDATION BEGIN
// Function to reset form
function ClearForm () {
	var ContactForm = window.document.ContactForm;
	ContactForm.reset()
}

// Function to check form content
function CheckForm() {
	var ContactForm = window.document.ContactForm;
	var Required = new Object;

		// Define required fields object
		Required['contact_email'] = 'Email Address';
		Required['contact_greeting'] = 'Please Address me as';

		// Check required fields
		for (i=0;i<ContactForm.length;i++) {
			var FormField = ContactForm.elements[i];

		// Check generic required field
		if (Required[FormField.name] && FormField.value == '') {
			Warning = Required[FormField.name]+' is a required field!';
			alert(Warning);
			FormField.focus();
			return
		}

		// Check email address format
		else if (FormField.name  == 'contact_email' &&
				 FormField.value.match(/[\w.-]+@[\w-]+(\.[\w-]+){1,}/) == null) {
			Warning = 'Invalid E-Mail address format!';
			alert(Warning);
			FormField.focus();
			return
		}
	}
	ContactForm.submit()
}


    // Function to bookmark this page
    function AddBookmark () {
        bookmarkurl = "http://www.surgeryinformationcenter.com";
        bookmarktitle = "SurgeryInformationCenter.com";
        if (document.all) {
            window.external.AddFavorite(bookmarkurl,bookmarktitle);
        }
    }
