// --- Functions relating to the Printer Friendly page ----
function go_back() {
// Due to issues with history.go(-1) and certain browsers not recognizing the 
// '?print=on' argument as a different page, this code simulates the 'back'
// functionality.
  var test=String(document.location).substring(0,String(document.location).indexOf("print=on"))
  if (test.charAt(test.length-1)=='?') {test=test.substring(0,test.length-1);}
  document.location=test;
}

function printer() {
  document.location=document.location+"?print=on";
}

//function printMode(sitePath) {
//  if (String(document.location).match("print=on")) {
 //   document.write('<link rel="stylesheet" href=\"'+sitePath+'/css/print.css\"/>');
//  }
//}
function printMode() {
  if (String(document.location).match("print=on")) {
    $('head').append('<link rel="stylesheet" href="/css/print.css" />');
  }
}

function printURL()
{
    window.open(document.location+"?print=on");
}
//function emailpopup(pageLocation) {
//  myWindow = window.open("/company/email_a_friend.asp?pageid=" + pageLocation, "email_friend", 'width=300,height=300');
//}
function emailpopup(pageLocation) {
  myWindow = window.open("/company/email_a_friend.asp?pageid=" + document.location.href, "email_friend", 'width=300,height=300');
}
function emailpopupCMS(pageLocation) {
//alert(document.location.href);
myWindow = window.open("http://www.quest.com/company/email_a_friend.asp?pageid=" + document.location.href, "email_friend", 'width=300,height=300');
}
function printThis(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}