function isEmpty(besedilo, msg)
{
	if (besedilo.value.length == 0)
	{
		alert(msg)
		besedilo.focus()
		return false
	} 
	return true
}

function isEmail(besedilo, msg)
{
	if (besedilo.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
	{
		alert(msg);
		besedilo.focus();
		return false;
	}
}

function showPicture(id, total)
{
  for (i=total;i>0;i--)
  {
    if (i!=id) {hide(i);};
  };
  show(id);
}

function show(id)
{
  if (document.getElementById)
  {
    var obj = id;
    document.getElementById(obj).style.visibility = 'visible';
    }
  else if (document.layers && document.layers[object] != null)
  {
    document.layers[object].visibility = 'visible';
  }
  else if (document.all)
  {
    document.all[object].style.visibility = 'visible';
  }
}

function hide(id) {
  if (document.getElementById)
  {
    var obj = id;
    document.getElementById(obj).style.visibility = 'hidden';
  }
  else if (document.layers && document.layers[object] != null)
  {
    document.layers[object].visibility = 'hidden';
  }
  else if (document.all)
  {
    document.all[object].style.visibility = 'hidden';
  }
}

function openWindow(link)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  var wdth = 640;
  var hght = 480;
  var lft;
  var tp;
  if((window.screen) && (screen.width) && (screen.height)) {scrnwdth = screen.width; scrnhght = screen.height;}
  if(scrnwdth != 0) lft = (scrnwdth - wdth)/2;
  if(scrnhght != 0) tp = (scrnhght - hght)/2;
  var wnd = null;
  wnd = window.open('windowopen.asp?Link=' + link, 'wnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no');  
  if (wnd.blur) wnd.focus();
}
