function checkLogin(){
	var d=document,dl=d.loginForm;
	if(dl.email.value==""){
		alert("Please input your email.");
		dl.email.focus();
		return false;
	}
	if(dl.passwd.value==""){
		alert("Please input Password.");
		dl.passwd.focus();
		return false;
	}
}
function openPrint(){
	printView = window.open("?view=print", 'viewStory', 'width=670,height=600,scrollbars=yes,resizable=yes,left=0,top=0'); printView.focus();
}

function largeFont(){
	var d=document,dg=d.getElementById("main_story"),b;
	if(dg.style.fontSize==""){
		dg.style.fontSize="13px";
		b=13;
	} else {
		b=parseInt(dg.style.fontSize);
		if(b<=18){
			b=b+1;
			dg.style.fontSize=b+"px";
			if(b>=15){
				dg.style.lineHeight=Math.floor(b*1.6)+"px";
			} else if(b>=13){
				dg.style.lineHeight=Math.floor(b*1.5)+"px";
			} else {
				dg.style.lineHeight=Math.floor(b*1.4)+"px";
			}
		} else {
			b=19;
		}
	}
	var p=60*60;
	setCookie("fsize",b,p)
}
function smallFont(){
	var d=document,dg=d.getElementById("main_story"),b;
	if(dg.style.fontSize==""){
		dg.style.fontSize="11px";
		b=11;
	} else {
		b=parseInt(dg.style.fontSize);
		if(b>=11){
			b=b-1;
			dg.style.fontSize=b+"px";
			if(b>=15){
				dg.style.lineHeight=Math.floor(b*1.6)+"px";
			} else if(b>=13){
				dg.style.lineHeight=Math.floor(b*1.5)+"px";
			} else {
				dg.style.lineHeight=Math.floor(b*1.4)+"px";
			}
		} else {
			b=10;
		}
	}
	var p=60*60;
	setCookie("fsize",b,p)
}

function checkComment(){
	var d=document,da=d.addC,c=da.comment.value;
	if(c==""){
		alert("Please input your Comments.");
		da.comment.focus();
		return false;
	}

	var b,f,k;
	k=String.fromCharCode(10);
	f=c.split(" ");
	b=f.length;

	//var k=c.length;
	if(b>=202){
		b=String(b);
		alert("Your comment is too long ("+b+" words). \nOnly 200 words can be accepted. Please edit your comment.");
		da.comment.focus();
		return false;
	}
}
function showComments(){
	location.href="#comment";
	if(document.addC){
		document.addC.comment.focus();
	}
}
