function printSelect(webroot, shortName, itemId) {
	var printT = document.getElementById('print');
	
	// If the page is a dynamic one with a content ID, send a special url.
	if(shortName == 'team' || shortName == 'portfolio' || shortName == 'news-detail' || shortName == 'archive-detail') {
		var printURL = webroot + 'print/dynamic/' + itemId + '/' + shortName + '-printable.php';
	} else {
		var printURL = webroot + 'print/' + shortName + '-printable.php';
	}

	printT.className = 'printSelect noPrint';
	printT.innerHTML = '<a href="javascript:;" onclick="printOption(\'current\');">Print This Page</a> | ';
	printT.innerHTML += '<a href="javascript:;" onclick="printOption(\'all\', \''+webroot+'\');">Print All Pages</a>';
	
	return false;
}

var noticeExists = 0;

function printOption(mode, webroot) {
	if(mode == 'current') {
		document.getElementById('centerContentPrint').className = 'printOnly noPrint';
		document.getElementById('centerContentScreen').className = 'center_content';
		if(noticeExists == 1) document.getElementById('printNotice').style.display = 'none';
		
		window.print();
	} else {
		$("#centerContentPrintContent").load(webroot+'print/all.php', { }, function() {
			if(noticeExists == 1) {
				document.getElementById('printNotice').style.display = '';
			} else {
				var contentHTML = $("#centerContentScreen").html();
				contentHTML = '<div id="printNotice" class="printNotice noPrint">You have selected <strong>print all pages</strong> which may take a few seconds. To print only this page, please select the <strong>Print This Page</strong> link above.</div>'+contentHTML;
				$("#centerContentScreen").html(contentHTML);
				noticeExists = 1;
			}
			
			document.getElementById('centerContentPrint').className = 'printOnly';
			document.getElementById('centerContentScreen').className = 'center_content noPrint';
			window.print();
		});
	}
}
