function fzi(){if (CUR_FONT<(FONT_NORM*1.5)) setSize(++CUR_FONT);}
function fzo(){if (CUR_FONT>(FONT_NORM/1.3)) setSize(--CUR_FONT);}
function fn(){CUR_FONT=FONT_NORM;setSize(FONT_NORM);}
function setSize(fsize){
	var paras=document.getElementsByTagName("P");
	for (var i=0; i<paras.length;i++){
		paras[i].style.fontSize=fsize+"pt";
	}
}
function getStory(){
	var str = "<html><head><title>"+TITLE+"</title><link rel='stylesheet' type='text/css' href='"+pcss+"' /></head><body>";
	str += "<table class='story'><tr class='hdr'><td colspan='4'>";
	str += document.getElementById('sec').innerHTML+"</td></tr>";
	str += "<tr><td class='col'>"+document.getElementById('p1').innerHTML+"</td><td>&nbsp;</td><td class='col'>"+document.getElementById('p2').innerHTML+"</td></tr></table></body></html>";
	return str;
}
function sprint(){
	var win=window.open('','','scrollbars=yes,menubar=no,height=520,width=780,resizable=no,toolbar=no,location=no,status=no');
	win.document.write(getStory());
	win.document.close();
	win.print();
}
function noPage(){
	alert("Sorry, PDF file does not exist");
}
function wtw(){
	if (chkForm(document.getElementById('wtw'))) {
		hideCom();
		x_ssd(STORY_ID, Base64.encode(document.getElementById('name').value), Base64.encode(document.getElementById('email').value), Base64.encode(document.getElementById('subj').value), Base64.encode(document.getElementById('msg').value), interactRes);
	}
	else showCom();
}
function interactRes(res){
	switch (res) {
		case 1:
			hideCom();
			alert("Mail sent successfully");
			break;
		case 0:
			showCom();
			alert("Failed to send mail");
			break;
		case -1:
			showCom();
			alert("Enter a correct email address");
			break;
		default:
			break;
	}
}
function mailTo(img){
	var url = 'link='+window.location+"&hd="+HDL;
	if (img!="") url = 'img='+img+"&hd="+HDL;
	var winMail=window.open('../bin/mailto.php?'+url,TITLE,'scrollbars=no,menubar=no,height=300,width=300,resizable=no,toolbar=no,location=no,status=no');
	winMail.document.close();
}
function hideCom(){
	document.getElementById('wtw').parentNode.style.display="none";
	window.scroll(0, 0);
}
function showCom(){
	if (document.getElementById('wtw')) {
		document.getElementById('wtw').parentNode.style.display="inline";
		window.scroll(0, document.getElementById('wtw').offsetTop);
	}
}
function chkForm(form){
	var bool = true;
	for (var i=0; i<form.elements.length; i++) {
		switch (form[i].type){
			case "text":
				form[i].parentNode.parentNode.childNodes[0].style.color="";
				if (form[i].value=="") {
					form[i].parentNode.parentNode.childNodes[0].style.color="#ff0000";
					bool=false;
				}
				break;
			case "textarea":
			form[i].parentNode.parentNode.childNodes[0].style.color="";
			if (form[i].value=="") {
					form[i].parentNode.parentNode.childNodes[0].style.color="#ff0000";
					bool=false;
				}
				break;
			default:
				break;
		}
	}
	return bool;
}