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();
}

/* preverjanje vnosnih polj */


function isSpusti(besedilo, msg)
{
	
	if (besedilo.value.length != 0)
  	{
		if(besedilo.value < 50)
		{
			alert(msg)
			besedilo.focus()
			return false
  		} 
 	 		return true
	}		
	return true			
}
function isVredu(besedilo1, besedilo2, besedilo3, msg)
{

	if(besedilo1.value == 1 && besedilo2.value == 1 && besedilo3.value == 1942)
	{
		alert(msg)
		besedilo.focus()
		return false
  	} 
  	return true
}


function isUpokojen(besedilo1, besedilo2, msg)
{
	if (( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 65 && document.frmIzracun.IzracunLeto.value ==1942) || ( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 64 && document.frmIzracun.IzracunLeto.value ==1943) || ( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 63 && document.frmIzracun.IzracunLeto.value ==1944) || ( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 62 && document.frmIzracun.IzracunLeto.value ==1945) || ( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 61 && document.frmIzracun.IzracunLeto.value ==1946) || ( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 60 && document.frmIzracun.IzracunLeto.value ==1947) || ( 58 <= document.frmIzracun.IzracunStarost.value && document.frmIzracun.IzracunStarost.value <= 59 && document.frmIzracun.IzracunLeto.value ==1948) || ( document.frmIzracun.IzracunStarost.value == 58 && document.frmIzracun.IzracunLeto.value ==1949))
	{
		alert(msg)
		besedilo.focus()
		return false
  	} 
  	return true
}
function isMozno(besedilo1, besedilo2, besedilo3, msg)
{	
	var spr1 = besedilo1.value
	var spr2 = besedilo2.value
	var spr3 = besedilo3.value
	var spr4
	spr4 = (parseInt(spr1) + parseInt(spr2)) - parseInt(spr3)
	
	if(spr4 < 2007)
	{
	alert(msg)
	besedilo.focus()
	return true
  } 
  return true
}

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 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 SearchCheck()
{
	if (isEmpty(document.iskalnik.Query, 'Vnesite iskalni niz!'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function SearchCheckEn()
{
	if (isEmpty(document.search.q, 'Enter search string!'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isNumber(besedilo, msg)
{
  if (isNaN(besedilo.value) || besedilo.value.length == 0)
  {
	alert(msg)
	besedilo.select()
	return false
  } 
  return true
}

/* preverjanje vnosnih polj */
function FormatCurrency(input)
{
	if (input.value != '')
	{
		var obj = input
		var num = new NumberFormat();
		num.setInputDecimal(',');
		num.setNumber(obj.value);
		num.setPlaces('2', false);
		num.setCurrencyValue('$');
		num.setCurrency(false);
		num.setCurrencyPosition(num.LEFT_OUTSIDE);
		num.setNegativeFormat(num.LEFT_DASH);
		num.setNegativeRed(false);
		num.setSeparators(true, '.', ',');
		obj.value = num.toFormatted();
	}
}


document.write("<SCR" + "IPT LANGUAGE='JavaScript' SRC='/library/javascript/numberformat.js' TYPE='text/javascript'><\/SCR" + "IPT>");





function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=580,height=700,left = 390,top = 162');");
}

function popup(url)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  wdth = 640
  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 popup = null;
  popup = window.open('/okvir-popup.asp?' + url, 'popupwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes');
  if (popup.blur) popup.focus();
}

function popupen(url)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  wdth = 640
  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 popup = null;
  popup = window.open('/en/frame-popup.asp?' + url, 'popupwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes');
  if (popup.blur) popup.focus();
}

function popupcms(url, width, height)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  wdth = width
  hght = height;
  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 popupcms = null;
  popupcms = window.open(url, 'popupcmswnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes');
  if (popupcms.blur) popupcms.focus();
}




//Pop Up meni na prvi strani
var H=0,v,t
function HideMenu(MeniId)
{
	clearTimeout(v);
	v = setTimeout("Hide('popUpMenu')",3000);
}
function Hide(MeniId)
{
document.getElementById('popUpMenu').style.display = 'none';
}
function drawMeni(MeniId)
{
if(document.getElementById('popUpMenu').style.display == 'none'){
	document.getElementById('popUpMenu').style.display = 'block';
	document.getElementById('popUpMenu').style.width = 10+'px';
	document.getElementById('popUpMenu').style.height = 10+'px';	
	var moz=(document.getElementById&&!document.all)?1:0;
	
	if (moz){document.getElementById('popUpMenu').style.left= 650+'px';
			document.getElementById('popUpMenu').style.top= 122+'px';
	}
	clearTimeout(t);
	timedCount(MeniId);
}
}
function timedCount(MeniId)
{
	var width = parseInt(document.getElementById('popUpMenu').style.width);
	var height = parseInt(document.getElementById('popUpMenu').style.height);

	if(width < 345)
	{
	width+=20
	document.getElementById('popUpMenu').style.width = width+'px';
	}
	else if(height<170) {
	height+=20
	document.getElementById('popUpMenu').style.height = height+'px';
	}	
	else stopCount();
	
	t = setTimeout("timedCount()",15)
}
	
function stopCount()
{
	clearTimeout(t);
}

/* 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';");
	}
}

/* preveranje polja za iskalnik */
function SearchCheck()
{
	if (isEmpty(document.iskalnik.q, 'Vnesite iskalni niz!'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function changeInputType(oldElm,iType,iValue,noFocus) {
  if(!oldElm || !oldElm.parentNode || (iType.length<4) || 
    !document.getElementById || !document.createElement) return;
  var newElm = document.createElement('input');
  newElm.type = iType;
  if(oldElm.name) newElm.name = oldElm.name;
  if(oldElm.id) newElm.id = oldElm.id;
  newElm.onfocus = function() {
    if(this.hasFocus) return;
    var newElm = changeInputType(this,'password',
      (this.value.toLowerCase()=='geslo')?'':this.value);
    if(newElm) newElm.hasFocus=true;
  }
  newElm.onblur = function() {
    if(this.hasFocus)
    if(this.value=='' || this.value.toLowerCase()=='geslo') {
      changeInputType(this,'text','Geslo',true);
    }
  }
 // hasFocus is to prevent a loop where onfocus is triggered over and over again
  newElm.hasFocus=false;
  oldElm.parentNode.replaceChild(newElm,oldElm);
  if(iValue) newElm.value = iValue;
  if(!noFocus || typeof(noFocus)=='undefined') {
    window.tempElm = newElm;
    setTimeout("tempElm.hasFocus=true;tempElm.focus();",1);
  }
  return newElm;
}
window.onload = function() {
  var ua = navigator.userAgent.toLowerCase();
  if(!((ua.indexOf('konqueror')!=-1) && (document.all || 
    (ua.indexOf('khtml/3.4')!=-1))) && !(((ua.indexOf('safari')!=-1) && 
    !window.print) || (document.defaultCharset && !window.print)))
      changeInputType(document.getElementById('UserPass'),'text','Geslo',true);
}