function updateChanged(request) {
	    //alert(request.responseText);
		var resp_arr = request.responseText.split("||");
		if (resp_arr[0] == 'ERR') {
			alert(resp_arr[1]);
		}

}

function popplayeropen(url,type) {
	window.open(url, type, 'height=534,width=750,resizable=no,status=0,scrollbars=no,location=no,menubar=no,toolbar=no');
}

function popvidopen(url,type) {
	window.open(url, type, 'height=534,width=750,resizable=no,status=0,scrollbars=no,location=no,menubar=no,toolbar=no');
}

function addView(id,c,d) {
		new ajax('/plugins/VideoComment/mt-video-comment.cgi', {postBody: '__mode=addview&obj_id='+id+'&count='+c+'&display='+d, onComplete: updateChanged});
}

var didsubmit=0;
function validateVCFields(f)
{
	 var missing = "";
	 if ( f.author_name.value == "")
		 missing += "\n Name";
	 if ( f.author_email.value == "" || f.author_email.value.indexOf("@") == -1)
		 missing += "\n Email Address";
	 if (missing != "") {
		 alert( "Anonymous Video Comments will not be published. The following must be supplied: " + missing);
		 return false;
	}
	if( !didsubmit ) {
		didsubmit=1;
		f.submit();
	}
}