function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

function formCheck() 
{
        if (document.comment_form.name.value == "") 
        {
        	alert("Please include your name.");
       		return false;
        }
		else if(document.comment_form.email.value != "" && document.comment_form.email.value.indexOf("@") == -1)
        	{
        		alert("Please include a proper email address, if including an e-mail address.");
        		return false;
        	}
			else if (document.comment_form.email.value != "" && document.comment_form.email.value.indexOf(".") == -1)
			{
        		alert("Please include a proper email address, if including an e-mail address.");
        		return false;
        	}
		
		else if (document.comment_form.comment.value == "") 
        {
        	alert("Please include your comment.");
       		return false;
        }
		else
		{
			return true;
		}
       
}

function openwin(img)
{
	img1="comments.php?rantid=" + img;
	window.open(img1, "Comments", "height=485,width=500,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=1,status=0");
}