var strQueryString;
strQueryString = '';

function printframe()
{
  parent.frame_print_bottom.focus();
  parent.frame_print_bottom.print();
}

function printpreview(href)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  var wdth = 640;
  var hght = 450;
  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 prn = null;
  if (href) {
	  prn = window.open('/frameset_print.asp?' + location.protocol + '//' + location.host + href + '?blnPrint=true' + strQueryString, 'prnwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes');
  } else {
	  prn = window.open('/frameset_print.asp?' + location.protocol + '//' + location.host + location.pathname + '?blnPrint=true' + strQueryString, 'prnwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes');
  }
  if (prn.blur) prn.focus();
}

function picturepreview(slika, id)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  var wdth = 640;
  var hght = 489;
  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 popup = null;
  if (slika == 1)
    {
    popup = window.open('/frameset_picture.asp?link=/mediji/slika_prva.asp' + '&SeznamID=' + id, 'popupwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes');
    }
    else
	{
    popup = window.open('/frameset_picture.asp?link=/mediji/slika_druga.asp' + '&SeznamID=' + id, 'popupwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes');
    }
  if (popup.blur) popup.focus();
}

function isEmpty(besedilo, msg)
{
  if (besedilo.value.length == 0)
  {
	alert(msg)
	besedilo.focus()
	return false
  } 
  return true
}

function isSelected(radio, msg)
{
  blnOK = false
  for (var intIndex = 0; intIndex < radio.length; intIndex++)
  {
    if (radio[intIndex].checked)
    {
      blnOK = true
    }
  }
  if (blnOK)
  {
    return true
  }
  else
  {
    alert(msg)
    return false
  }
}

function isChecked(checkbox, msg)
{
  if (checkbox.checked)
  {
	return true
  } 
  	if (msg!= null){
  	alert(msg)
  	}	
	return false
}

function isMoreThanMax(besedilo, maxval, msg)
{
  if (besedilo.value.length > maxval)
  {
    alert(msg + ' ' +  maxval + ' znakov. Prosimo, ponovite vnos!')
    besedilo.select()
    return false
  } 
  return true
}

function isEmail(besedilo)
{
	if (besedilo.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
	{
		alert("Vnesite veljaven e-poštni naslov!");
		besedilo.focus();
		return false;
	}
}

function LetnoPorocilo(page)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  wdth = 950;
  hght = 670;
  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 porocilo = null;
  porocilo = window.open(page, 'porocilownd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no');
  if (porocilo.blur) porocilo.focus();
}

function LetnoPorocilo2006(page)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  wdth = 950;
  hght = 699;
  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 porocilo = null;
  porocilo = window.open(page, 'porocilownd2006', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no');
  if (porocilo.blur) porocilo.focus();
}