function popup(url, height, width) {

	if (height == undefined) {
		height = 375;
	}
	
	if (width == undefined) {
		width = 480;
	}
	
  popupWinAll(url, 'MedAmerica', 0, 1, 0, height, width);
}

function popupSales(url, height, width) {

	if (height == undefined) {
		height = 325;
	}
	
	if (width == undefined) {
		width = 650;
	}
	
  popupWinAll(url, 'MedAmerica', 0, 1, 0, height, width);
}

function openPDF(pdfURL) {
//added menubar and toolbar b/c a lot of apps need to saved as and printed log request #9
//major edits to ensure this will work in secure environment (must use http://, not https://) -- JML
  var envir = document.URL;
  envir = envir.replace(/https/, "http");
  popupServer = envir.substr(0,7);
  temp = envir.substr(7);
  popupServer += temp.substr(0, temp.indexOf("/"));
  if (pdfURL.indexOf("/") != 0) { pdfURL = "/" + pdfURL; }
  thisWindow = window.open(popupServer + pdfURL,"MedAmericaPDF","width=640, height=550, toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes")
  //thisWindow.moveTo(120,260);
  //if (window.focus)
  //{
  //  thisWindow.focus();
  //}
}

function openPopUp(url) {
  openPDF(url);
}

function openApp(url) {
  openPDF(url);
}

function popupWinAll(url, title, menubar, resizable, scrollbars, height, width) {

	var params = "menubar="+menubar;
	params += ",resizable="+resizable;
	params += ",scrollbars="+scrollbars;
	params += ",height="+height;
	params += ",width="+width;

	newWindow = window.open(url, title, params);
  //newWindow.moveTo(120,318);
  //if (window.focus)
  //{
  //  newWindow.focus();
  //}

}
function redirect()
{
	if (document.location.href == "http://www.ltcmedamerica.com/welcome"||document.location.href == "https://www.ltcmedamerica.com/welcome"||document.location.href == "http://ltcmedamerica.com/welcome"||document.location.href == "https://ltcmedamerica.com/welcome")
	{
	window.location = "http://www.ltcmedamerica.com/groups/consumer/";
	}
}




