// varmistetaan, että käyttäjä todella haluaa poistaa kommentin
function kommentti_prompt(text,imgid,comid) 
{
  if (confirm(text)) 
  {
    window.location = 'img.php?action=delcomment&imgid='+imgid+'&comid='+comid;
  }
}

// check that only limited numbers of checkboxes are checked

function KeepCount(fmobj) 
{
var count=0;
var checks = document.getElementsByName('cat[]');
var boxLength = checks.length;

for (var i=0;i<boxLength;i++) 
{
  if ( checks[i].checked == true ) 
  {
    count=count+1;
  }
}
if (count > 3)
{
  alert('You can pick no more than three categories!');
  document.fmobj; return false;
}
}

function verify()
{
var themessage = "You are required to complete the following fields: ";

if (document.gallery.message.value=="")
{ themessage = themessage + "\n- Text for the..."; }

if (themessage == "You are required to complete the following fields: ")
{ return true; }
else
{
alert(themessage);
return (false);
}
}

	function OpenWin (url, win, width, height, options) {
        var leftPos = (screen.availWidth - width) / 2;
        var topPos = (screen.availHeight - height) / 2;
        options += 'width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos;
        return window.open(url, win, options);
}

