function showmenu(id) {
	for (i=0; i<999; i++) {
		if (document.getElementById('submenu'+i)) {
			document.getElementById('submenu'+i).className = 'sublowheader_hide';
		}
	}
	div = document.getElementById(id);
	if (div.className != 'sublowheader_show') {
		new_class = 'sublowheader_show';
	}
	else {
		new_class = 'sublowheader_hide';
	}
	div.className = new_class;
}
function showcomment() {
	div = document.getElementById('comment_box');
	if (div.className != 'hide') {
		div.className = 'hide';
	}
	else {
		div.className = 'show';
	}
}
function checkcomment() {
	err = '';
	correct = true;
	if (document.getElementById('c_name').value.length < 2) {
		err += '\nYou have not entered a name';
		correct = false;
	}
	if (document.getElementById('c_email').value.length < 6) {
		err += '\nYou have not entered an email';
		correct = false;
	}
	if (document.getElementById('c_comment').value.length < 6) {
		err += '\nYou have not entered a comment';
		correct = false;
	}
	
	if (!correct) {
		err = 'Error' + err;
		alert(err);
	}
	else {
		document.getElementById('myform').submit();
	}
}
function redirectStory(link) {
	location.href = link;
}
function newTopStory(src, the_title, the_short, the_link) {
	document.getElementById('topStory_img_src').src = src;
	document.getElementById('topStory_title_link').innerHTML = stripslashes(the_title);
	document.getElementById('topStory_short').innerHTML = stripslashes(the_short);
	document.getElementById('topStory_link').href = the_link;
	document.getElementById('topStory_title_link').href = the_link;
}

function sendPage() {
	mail_str = "mailto:?";
	mail_str += "body=" + "You have been sent a link from LastTackle.com %0D%0A%0D%0A" + location.href + "%0D%0A%0D%0ARegards%0D%0A%0D%0ALast Tackle";
	location.href = mail_str;
}
function printPage() {
	window.print();
}

function addslashes(str) {
str=str.replace(/\\/g,'\\\\');
str=str.replace(/\'/g,'\\\'');
str=str.replace(/\"/g,'\\"');
str=str.replace(/\0/g,'\\0');
return str;
}
function stripslashes(str) {
str=str.replace(/\\'/g,'\'');
str=str.replace(/\\"/g,'"');
str=str.replace(/\\0/g,'\0');
str=str.replace(/\\\\/g,'\\');
return str;
}