var sendCoppermineComment = function(msg_author,pid,msg_body,filename)
{
//	alert('t1: autor: ' + msg_author + '; body: '+msg_body);
	if (msg_author!=='' && msg_body!=='') {
	
	    new Ajax.Request("wp-content/plugins/coppermine/coppermine-details.php?mode=addcomment&msg_author="+msg_author+"&pid="+pid+"&msg_body="+msg_body,
	                        {
	                    onSuccess: function(t)
	                            {
	//                            	alert('t1: ' + "wp-content/plugins/coppermine/coppermine-details.php?pic="+$('lightboxImage'));
	//                            	alert('t1: ' + "wp-content/plugins/coppermine/coppermine-details.php?pic="+filename+"&filename="+filename);
	                                //$('imageCoppermineDetails').innerHTML = t.responseText;
	//                                new Ajax.Request("wp-content/plugins/coppermine/coppermine-details.php?pic="+$('lightboxImage').src,
	                                new Ajax.Request("wp-content/plugins/coppermine/coppermine-details.php?pic="+filename+"&filename="+filename+"".src,
	
						{
							onSuccess: function(t)
							{
	//							alert('t2');
								$('imageCoppermineDetails').innerHTML = t.responseText;
							},
							onFailure: function(r)
							{
	//							alert("error");
								$('imageCoppermineDetails').innerHTML = '';
							}
						}
					 );
	                            },
	                            onFailure: function(r)
	                            {
	//                              alert('t3');  
	                            }
	                        }
	                     );
	}
}

var sendCoppermineRating = function(pid,value,filename)
{
//	alert('t1: filename: ' + filename);
    new Ajax.Request("wp-content/plugins/coppermine/coppermine-details.php?mode=rating&pid="+pid+"&rating="+value,
                        {
                    onSuccess: function(t)
                            {
//                            	alert('t1');
                                //$('imageCoppermineDetails').innerHTML = t.responseText;
//                                new Ajax.Request("wp-content/plugins/coppermine/coppermine-details.php?pic="+$('lightboxImage').src,
                                new Ajax.Request("wp-content/plugins/coppermine/coppermine-details.php?pic="+filename+"&filename="+filename+"".src,
					{
						onSuccess: function(t)
						{
//							alert('t2');
							$('imageCoppermineDetails').innerHTML = t.responseText;
						},
						onFailure: function(r)
						{
							//alert("error");
							$('imageCoppermineDetails').innerHTML = '';
						}
					}
				 );
                            },
                            onFailure: function(r)
                            {
//                                alert('fail');
                            }
                        }
                     );
}
