function openSendToFriendPopup(destination, pagetitle) {
	width = 1024;
  	height = 1768;
  	var left = (screen.width/2) - width/2;
  	var top = (screen.height/2) - height/2;
  	var title = document.title;
  	window.open(destination+"?"+pagetitle+"="+title, 'sendtofriend', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function openPrintPreviewPopup(printPreviewParam) {
	width = 1024;
  	height = 1768;
  	var left = (screen.width/2) - width/2;
  	var top = (screen.height/2) - height/2;
  	
  	var url = window.location.href;
  	var hash = window.location.hash;
  	if (hash != "") {
	  	var ind = url.indexOf(hash);
	  	if (ind != -1) {
	  		url = url.substring(0, ind);
	  	}
  	}
  	
  	if (url.indexOf("?") != -1) {
  		url = url + "&" + printPreviewParam + "=1" + hash;
  	} else {
  		url = url + "?" + printPreviewParam + "=1" + hash;
  	}
  	
  	window.open(url, 'printpreview', 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function openSiteOptionPopup(destination) {
	width = 1024;
  	height = 1768;
  	var left = (screen.width/2) - width/2;
  	var top = (screen.height/2) - height/2;
  	
  	if (destination != "") {
  		window.open(destination, 'siteoption', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  	}
}

function setActiveStyleSheet() {
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	     if(a.getAttribute("rel").indexOf("style") != -1) {
	    	 if (a.media && a.media == 'print') {
	    		 a.media = 'all';
	    	 }
	    	 
	    	 if (a.media && a.media != 'all') {
	    		 a.disabled = true;
	    	 }
	     }
	}
}
function displayPrintPreview() {
	jQuery('input[name^=enableReview]').attr("disabled", "");
}
function disablePrintPreview() {
	jQuery('input[name^=enableReview]').attr("disabled", "disabled");
}
