function submitForm(){
    document.forms[0].submit();
}

function emailSubmit(emailAddress){
    window.location="mailto://" + emailAddress;
}

function changeLocation(url){
    window.location=url;
}

// Base function which gets the elements of passed in code.
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

function popupPage(pageName,url,height,width,scrollbars,toolbar,resizable){

//temp
if (url.indexOf("/inquire") > -1){
	scrollbars = "yes";
	resizable = "yes";
	width = parseInt(width) + 17;
}

    if(pageName==''){
        pageName = 'PopupPage';
    }
    if(scrollbars=='' || scrollbars=='no'){
        scrollbars='0';
    }else if(scrollbars=='yes'){
        scrollbars='1';
    }
    if(toolbar=='' || toolbar=='no'){
        toolbar='0';
    }else if(toolbar=='yes'){
        toolbar='1';
    }
    if(resizable=='' || resizable=='no'){
        resizable='0';
    }else if(resizable=='yes'){
        resizable='1';
    }

	var param = "width=" + width + ", height=" + height + ", scrollbars=" + scrollbars + ", toolbar=" + toolbar + ", resizable=" + resizable;
    
   var popupWindow = window.open(url,pageName,param);
	popupWindow.focus();
}

function popupVewHoursPage(){
    popupPage('','/inc/ViewHours.htm',215,400,0,0);
}
