function printablePage() { var strURL = document.location.href + ((document.location.search.length == 0) ? "?" : "&") + "media=print"; document.location = strURL; }