
//called on clicking the "print" icon from the article page
function printpage() {
	if (getQryValue("prt")) return; //url alr has "?prt=y"
	
	var url = window.location.href.split(".html")[0]+".html?prt=y";
	var printPopup = window.open(url, "printPopup", "height=600,width=600,innerHeight=600,innerWidth=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0");
}


//this function called on document.onload - checks if page should be converted to special format (eg. print format, t2s format)
function init() {
	checkprint();
	checkt2s();
}
function checkprint() {
	if (getQryValue("prt")=="y") {
		document.write('<link rel="stylesheet" type="text/css" href="/global/common/css/printpage.css" media="all" />');
		window.print();
	}
}
function checkt2s() {
	if (getQryValue("t2s")=="y") {
		document.write('<link rel="stylesheet" type="text/css" href="http://www.omy.sg/global/common/css/t2spage.css" media="all" />');
	}
}


function sharearticle(){
	var sharePopup = window.open("http://fun.omy.sg/custom/common/shared_article.php","sharePopup","location=0,status=1,scrollbars=0,width=400,height=400");
	sharePopup.focus();
}
function postcomment(qry){
	var url = "http://fun.omy.sg/custom/common/post_comment.php?threadid="+qry;
	var commentPopup = window.open(url,'commentPopup','location=0,status=1,scrollbars=0,width=400,height=400');
	commentPopup.focus();
}

//hides the current article from the package list
function hidePackage() {
	var url = window.location.href;
	var articleId = url.substring(url.lastIndexOf("/")+1, url.lastIndexOf("."));
	if (document.getElementById("plist_"+articleId)) document.getElementById("plist_"+articleId).style.display = 'none';
}
//hides the current article from the feature list
function hideFeature() {
	var url = window.location.href;
	var articleId = url.substring(url.lastIndexOf("/")+1, url.lastIndexOf("."));
	if (document.getElementById("flist_"+articleId)) document.getElementById("flist_"+articleId).style.display = 'none';
}



document.onload = init();
