
ERROR_BLUR_EMPTY[ "name_val" ] = true;

window.onload = function()
{
	form_events( "frm-comment-rate" );
}


function updateInfo(){};
function updateDrop(){};


function rate_top( num )
{
	document.getElementById( "current_stars" ).style.width = num*22 + "px";

	setValue( "rating_val", num );
	document.forms[ "frm-comment-rate" ].submit();
}

function rate_bottom( num )
{
	document.getElementById( "my_rating" ).innerHTML = "<b>" + num + " Stars!</b>";
	document.getElementById( "my_stars" ).style.width = num*22 + "px";

	setValue( "rating_val", num );
}

function myspace_copy()
{
	if ( JS_GETELEMENTBYID )
	{
		_this = document.getElementById( "myspace_val" )

		_this.focus();
		_this.select();
	}
}

function form_validate()
{
	var bValidForm = true;

	// regular expressions / error checking
	for ( var i=0; i<document.forms[ "frm-comment-rate" ].elements.length; i++ )
	{
		if ( document.forms[ "frm-comment-rate" ].elements[i].type == "text" || document.forms[ "frm-comment-rate" ].elements[i].type == "textarea" )
		{
			var _this = document.forms[ "frm-comment-rate" ].elements[i];
			if ( !ERROR_KEYUP_test( _this ) || !ERROR_BLUR_test( _this ) )
				bValidForm = false;
		}
	}

	if ( bValidForm && getValue( "comment_val" ) == "" && getValue( "rating_val" ) == "" )
	{
		alert( "A comment and/or a rating must be supplied." );
		bValidForm = false;
	}

	if ( !bValidForm )
		window.location.hash = "status_box";

	else
	{
		document.forms[ "frm-comment-rate" ].submit();
	}
}