function sleepbrowser(localURL) {
   if (window.linkWindow && !window.linkWindow.closed) {
      window.linkWindow.close();
   }
   
   if (localURL.indexOf(".pdf")>0) {
      linkWindow = window.open("", "linkWindow", "toolbar=no,resizable=yes,scrollbars=yes,location=no,menubar=no,width=740,height=500");
   } else {
      linkWindow = window.open("", "linkWindow", "toolbar=yes,resizable=yes,scrollbars=yes,location=no,menubar=no,width=740,height=500");
   }
   
   linkWindow.document.write('<html><head><title>Sleep Solutions</title></head>');
   linkWindow.document.write('<frameset rows="60,*" cols="*" border="0" framespacing="0" frameborder="NO">');
   linkWindow.document.write('<frame src="../sleep_browser_top.htm" marginwidth="0" marginheight="0" noresize scrolling="NO" frameborder="NO">');
   linkWindow.document.write('<frame src=\"' + localURL + '\" frameborder="NO">');
   linkWindow.document.write('</frameset>');
   linkWindow.document.write('<noframes>');
   linkWindow.document.write('</noframes>');
   linkWindow.document.write('</body></html>');
   linkWindow.document.close();
   linkWindow.opener = self.parent;
   linkWindow.focus();
   
}

function sleepbrowser2(URL) {
      if (window.linkWindow2 && !window.linkWindow2.closed) {
      window.linkWindow2.close();
   }
   linkWindow2 = window.open(URL, "docsWindow", "toolbar=yes,resizable=yes,menubar=no,scrollbars=yes,location=no,width=700,height=480");
   linkWindow2.focus();
}

function sleepbrowser3(localURL) {
   if (window.linkWindow && !window.linkWindow.closed) {
      window.linkWindow.close();
   }
   
   if (localURL.indexOf(".pdf")>0) {
      linkWindow = window.open("", "linkWindow", "toolbar=no,resizable=yes,scrollbars=yes,location=no,menubar=no,width=650,height=650");
   } else {
      linkWindow = window.open("", "linkWindow", "toolbar=yes,resizable=yes,scrollbars=yes,location=no,menubar=no,width=650,height=650");
   }
   
   linkWindow.document.write('<html><head><title>Sleep Solutions</title></head>');
   linkWindow.document.write('<frameset rows="60,*" cols="*" border="0" framespacing="0" frameborder="NO">');
   linkWindow.document.write('<frame src="../sleep_browser_top.htm" marginwidth="0" marginheight="0" noresize scrolling="NO" frameborder="NO">');
   linkWindow.document.write('<frame src=\"' + localURL + '\" frameborder="NO">');
   linkWindow.document.write('</frameset>');
   linkWindow.document.write('<noframes>');
   linkWindow.document.write('</noframes>');
   linkWindow.document.write('</body></html>');
   linkWindow.document.close();
   linkWindow.opener = self.parent;
   linkWindow.focus();
   
}

function docsBrowser(URL) {
   if (URL.indexOf(".pdf")>0) {
      docsWindow = window.open(URL, "docsWindow", "toolbar=no,resizable=yes,menubar=no,scrollbars=yes,location=no,width=850,height=500");
   } else {
      docsWindow = window.open(URL, "docsWindow", "toolbar=yes,resizable=yes,menubar=yes,scrollbars=yes,location=no,width=850,height=500");
   }

docsWindow.focus();
}

function docsBrowser2(URL) {
   if (URL.indexOf(".pdf")>0) {
      docsWindow = window.open(URL, "docsWindow", "toolbar=no,resizable=yes,menubar=no,scrollbars=yes,location=no,width=645,height=500");
   } else {
      docsWindow = window.open(URL, "docsWindow", "toolbar=yes,resizable=yes,menubar=yes,scrollbars=yes,location=no,width=645,height=500");
   }

docsWindow.focus();
}

function homeBrowser(URL) {
homeWindow = window.open(URL, "homeWindow", "toolbar=yes,resizable=yes,menubar=yes,scrollbars=yes,location=yes,width=920,height=550");
homeWindow.focus();
}

function imgBrowser(loc) {
  loc = "/image_popup.htm?" + loc;
  imgWindow = window.open(loc, "imgWin", "toolbar=no,resizable=yes,menubar=no,scrollbars=no,location=no,width=100,height=100");
  if (imgWindow.opener == null) imgWindow.opener = self;
    //imgWindow.focus();
}