/* popup za predogled tiskanja */

var strQueryString;
strQueryString = '';

function printpreview(language)
{
  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;
  prn = window.open(language + '/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 printframe()
{
  parent.frame_print_bottom.focus();
  parent.frame_print_bottom.print();
}

/* popup za predogled tiskanja */

/* popup O avtorjih */

function aboutAuthors(url)
{
	var scrnwdth = 0;
	var scrnhght = 0;
	var wdth = 480;
	var hght = 360;
	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 authors = null;
	authors = window.open(url, 'authorswnd', '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 (authors.blur) authors.focus();

}

/* preverjanje vnosnih polj */

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 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
  }
}

/* prikazovanje in skrivanje divov */

function ShowHide(divId)
{
	var id = document.getElementById(divId);
	if (id.style.display == "none")
	{
		eval("id.style.display = 'block';");
	}
	else
	{
		eval("id.style.display = 'none';");
	}
}


var t = 0

function popupImage(url)
{
	var tmpImage = new Image()
	var tWidth = 0;
	tUrl = url
	tmpImage.src = url;
	
	if (tmpImage.complete )
	{
		strHeight = tmpImage.height+ 30;
		tWidth = tmpImage.width;
		//alert(tWidth)
		photo = window.open('', 'imagewnd','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no, width='+tWidth+', height='+strHeight+'');
		photo.document.writeln('<html>'
		+'<head><style>table {margin:0px; padding:0px;}</style>'
		+'</head><body style="text-align:center; margin:0px; padding:0px; height:'+tmpImage.height+'px; width:'+tWidth+'px; border:none;">'
		+'<table cellspacing="0" style="line-height:30px; width:'+tWidth+'px;" cellpadding="0"><tr><td align="center" valign="middle"><img src="'+url+'"></td></tr></table></body></html>');
		
			
		
		if (photo.blur) 
		{
			photo.focus();
			photo.resize()
			clearTimeout(t)
		}
	}
	else
	{
		t=setTimeout("popupImage(tUrl)",100);
	}
	

}
