function disableSelection(element) {
    element.onselectstart = function() {
        return false;
    };
    element.unselectable = "on";
    element.style.MozUserSelect = "none";
    element.style.cursor = "default";
}
function onLoad() {
  disableSelection(document.getElementById("read_story"));
}
function popUp(URL, Height, Width, scrollbar) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+scrollbar+',location=0,status=1,menubar=0,resizable=0,width='+Width+',height='+Height+',left = 220,top = 80');");
}

function printStory(shortlink) {
	popUp('/print/'+shortlink+'.htm', 400, 500, 1)
}

	function sure(strVal) {
	return confirm(strVal)
}

switchFontSize=function(ckname,val){
	var bd = $E('BODY');
	switch (val) {
		case 'inc':
			if (CurrentFontSize+1 < 7) {
				bd.removeClass('fs'+CurrentFontSize);
				CurrentFontSize++;
				bd.addClass('fs'+CurrentFontSize);
			}		
		break;
		case 'dec':
			if (CurrentFontSize-1 > 0) {
				bd.removeClass('fs'+CurrentFontSize);
				CurrentFontSize--;
				bd.addClass('fs'+CurrentFontSize);
			}		
		break;
		default:
			bd.removeClass('fs'+CurrentFontSize);
			CurrentFontSize = val;
			bd.addClass('fs'+CurrentFontSize);		
	}
	Cookie.set(ckname, CurrentFontSize,{duration:365});
}

function loginEnter(){

if(window.event.keyCode == 13){
	document.frmlogin.submit();
}
}
function toFriend(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open('/sendstory/' + URL + '.htm', '" + id + "', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=0,width=400,height=250,left = 220,top = 80');");
}
