function PhotoBlogValidate() { }

PhotoBlogValidate.prototype.validate = validatePBform;
PhotoBlogValidate.prototype.showError = showPBerror;
PhotoBlogValidate.prototype.hideError = hidePBerror;

function validatePBform() {
       var error = "";

       if ( document.photobloguploadform.fname.value == "" )
         error += "<br/>&bull; Missing Firstname information.";

       if ( document.photobloguploadform.lname.value == "" )
         error += "<br/>&bull; Missing Lastname information.";

       if ( document.photobloguploadform.email.value == "" )
         error += "<br/>&bull; Missing Email information.";

       if ( document.photobloguploadform.fileupload1.value == "" )
         error += "<br/>&bull; Please provide an image to upload.";

       if ( document.photobloguploadform.phototitle.value == "" )
         error += "<br/>&bull; Missing Photo Title information.";

       if ( document.photobloguploadform.photodescription.value == "" )
         error += "<br/>&bull; Missing Photo Caption information.";

       if ( !document.photobloguploadform.accept_terms.checked )
         error += "<br/>&bull; You must agree to the Terms of Use.";

       if ( error != '' )
       {
          // Change the error string to a one liner to save vertical space...
                    error = "<br />You must fill out all fields and agree to the terms of use";
                    showPBerror(error);
                    return false;
       }

       return true;
}

function hidePBerror() {
	var d = document.getElementById("photoblogerror");
	d.innerHTML = "&nbsp;";
}

function showPBerror(str) {
	   document.getElementById("photoblogmessage").innerHTML = "";
	   var d = document.getElementById("photoblogerror");
	   d.innerHTML = str;
	   setTimeout("hidePBerror()",4000);
}

function PhotoBlogBox() { }

PhotoBlogBox.prototype.getNextPhoto = getNextPhoto;
PhotoBlogBox.prototype.getPrevPhoto = getPrevPhoto;

function getNextPhoto() {
	$("#randomphotohere").load("/photoblogajax.php?command=getnextphoto");
}
function getPrevPhoto() {
        $("#randomphotohere").load("/photoblogajax.php?command=getprevphoto");
}

