// jQuery things
$(document).ready(function(){
		$("a[rel='overlay']").colorbox();
		$('img.size-thumbnail, img.size-medium, img.attachment-thumbnail').each(function(i) {
			if ($(this).parent('a').attr("href").indexOf(".pdf") < 0) {
				$(this).parent('a').colorbox();
			}
		});
});



// simple form validation to get going

function showError() {
	document.getElementById('formError').style.display = 'block';
}

function validate_required(field) {
	with (field){
	  if ( value == null || value == "" ) {
		showError();
		return false;
	  }
	  else{
	  	return true;
	  }
	}
}


function validate_user(thisform){
	with (thisform){
		if (validate_required(comment)==false){
			showError();
			return false;
		}
	}
}

function validate_guest(thisform){
	with (thisform){
		if (validate_required(author)==false){
			showError();
			return false;
		}
		
		if (validate_required(email)==false){
			showError();
			return false;
		}
		
		if (validate_required(comment)==false){
			showError();
			return false;
		}
		
	}
}
