function popup(url, name, features) {
    window.open(url, name, features);
}

function popupCustomerService(url, name) {
    popup(url, name, 'toolbars=no,resizable=no,overflow-x=hidden,overflow-y=auto,left=50,top=50,width=400,height=500');
}

function popupGlossary(url, name) {
    popup(url, name, 'toolbars=no,resizable=no,overflow-x=hidden,overflow-y=auto,left=50,top=50,width=447,height=524');
}

function email_a_friend(url) {
    popup(url, '', 'toolbars=no,status=1,resizable=0,overflow-x=hidden,overflow-y=hidden,left=50,top=50,width=427,height=520');
}

function popupPaymentSchedule(url, name) {
    popup(url, name, 'toolbars=no,resizable=yes,overflow-x=hidden,overflow-y=auto,left=50,top=50,width=600,height=525');
}

function setActionSubmitForm(formName, action, useSSL) {
	var form = document.forms[formName];
	var prefix = "https://";
	if(useSSL != null && useSSL == "false") {
		prefix = "http://";
	}
	var pHost = document.location.host;
	var inx = pHost.indexOf(":");
	if(inx > -1 && prefix == "https://") {
		//This is a just for local environments not prod.
		pHost = pHost.substring(0,inx) + ":8" + pHost.substring(inx+2);
	}
	
	if(form != null) {
		var fullAction = prefix + pHost + action;
		form.action = fullAction;
		return true;
	}
	return false;
}