
/*
########################################################################
# Pop-up window                                                        #
########################################################################
*/
function popWin(winURL,winName,winOptions,winSize) {
  // Get screen dimensions
  var scrW = 600, scrH = 400; // default sizes
  if (document.all || document.layers) {
    scrW = screen.availWidth;
    scrH = screen.availHeight;
  } // End if

  // Set popup size
  var popW = 600, popH = 400; // default sizes
  if (window.screen) {
    popW = window.screen.availWidth * winSize / 100;
    popH = window.screen.availHeight * winSize / 100;
  } // End if
  var leftPos = (scrW-popW)/2, topPos = (scrH-popH)/3;

  // Build window options
  winOptions += ",width=" + popW + ",height=" + popH + ",top=" + topPos + ",left=" + leftPos;

  // Generate window
  window.open(winURL,winName,winOptions);
} // End function


/*
########################################################################
# Printer friendly                                                     #
########################################################################
*/

/*
function printMe(currentPath) {
  var pageHref = currentPath;
  var pageHrefParam = '?print=1';
  var printHref = pageHref + pageHrefParam;
  if (checkRedDot()) {
    alert("Print friendly functionality is disabled while working in RedDot");
  } else {
    popWin(printHref,'printWin','resizable,scrollbars,menubar,toolbar,status','70');
  }

} // End function
*/

function printMe(divID,cssPath) {
  var divContent = document.getElementById(divID).innerHTML;
  var printWinHTML = '< html >';
  printWinHTML += '< head ><title>Print Window</title></ head >';
  printWinHTML += '<link rel="stylesheet" href="' + cssPath + '" type="text/css">';
  printWinHTML += '<script language="JavaScript" type="text/javascript">self.focus();this.print();</script>';
  printWinHTML += '< body >';
  printWinHTML += '<div align="right"><a href="javascript: window.close();"><br>close window</a></div>';
  printWinHTML += divContent;
  printWinHTML += '</ body >';
  printWinHTML += '</ html >';
  
  var printWin = window.open('','NULL','resizable,scrollbars,menubar,toolbar,status','70');
  printWin.document.open();
  printWin.document.write(printWinHTML);
  printWin.document.close();
} // End function


/*
########################################################################
# Change page URL                                                      #
########################################################################
*/
function changeURL(goToURL) {
  document.location.href = goToURL;
} // End function


/*
########################################################################
# Check for RedDot environment                                         #
########################################################################
*/
function checkRedDot() {
  if (document.location.href.indexOf("ioRD.asp") >= 0) {
    return true;
  } else {
    return false;
  }
} // End function



 