String.prototype.trim = function() {
   return this.replace(/^\s+|\s+$/g,"");
}

function showBlogType(type) {
	var title = "";
	var image = "";
	if(type == 1) {
		title = "General Blog";
		image = "general.png";
	}
	if(type == 2) {
		title = "Rant";
		image = "rant.png";
	}
	if(type == 3) {
		title = "Ask Ryan";
		image = "askryan.png";
	}
	if(type == 4) {
		title = "Question of the Month";
		image = "qom.png";
	}
	if(type == 5) {
		title = "Olivia Update";
		image = "olivia.png";
	}
	if(type == 6) {
		title = "Geek";
		image = "geek.png";
	}
	if(type == 7) {
		title = "News";
		image = "news.png";
	}
	
	$('typetitle').innerHTML = title;
	$('typeimage').src = "/images/" + image;
}

function showShameType(type) {
	title = "";
	image = "";

	if(type == 1) {
		title = "Visitors Looking for Ryan Sheckler";
		image = "sheckler.png";
	}
	if(type == 2) {
		title = "Celebs Doing Dumb Things";
		image = "celebs.png";
	}
	if(type == 3) {
		title = "We All do Dumb Things.  (Ordinary Joes)";
		image = "ordinaryjoes.png";
	}
	$('typetitle').innerHTML = title;
	$('typeimage').src = "/images/" + image;
}

function showGalleryType(desc) {
	$('gallerydescription').innerHTML = desc;
}

function showImage(path, cap) {
	var image = $('galleryimage');
	var caption = $('imagecaption');
	image.src = path;
	caption.innerHTML = cap;
}

function askmeValidator() {
	var email = $('email').value;
	var name = $('name').value;
	var message = $('message').value;
	if(email == null || email.trim() == "") {
		alert('I said ALL field are required.  Enter an email.');
		return false;
	} else if(name == null || name.trim() == "") {
		alert('I said ALL field are required.  Enter a name.');
		return false;
	} else if(message == null || message.trim() == "") {
		alert('Watsa matter? Cat got yer tongue?  Enter a message.');
		return false;
	} else {
		return true;
	}
}

