/* Tiskanje */
var strQueryString;
strQueryString = '';

function printpreview()
{
  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('/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 printpreviewen()
{
  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('/en/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();
}

/* Tiskanje */

/* Odpre div z poljem Drugo pri kontaktu */

function openOther(obj, div)
{
	if(obj.value == 'Drugo')
	{
		var layer = document.getElementById(div);
		layer.style.display = "block";
	}
	else
	{
		var layer = document.getElementById(div);
		layer.style.display = "none";	
	}
}

/* Odpre div z poljem Drugo pri kontaktu */

	image01=new Image();
	image01.src="/library/images/menu_iconLevel2.gif";
	image02=new Image();
	image02.src="/library/images/menu_iconLevel2off.gif";

function replaceId(obj, src ) {
 objTemp = obj.parentNode.parentNode; 
 obj.parentNode.parentNode.childNodes[0].firstChild.src = src
}



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 verifyRadio(btn,msg) {
	var cnt = -1;
	for (var i=btn.length-1; i > -1; i--) {	
	   if (btn[i].checked) {cnt= btn[i].value;}
	   }

	if (cnt == -1)  {
		 alert(msg);
		 btn[1].focus();
		 return false;
	}
	else return cnt;
	
}

function isChecked(checkbox, msg)
{
  if (checkbox.checked)
  {
	return true
  } 
  alert(msg);
  return false
}

function isLessThanMin(besedilo, minval, msg)
{
	if (besedilo.value < minval)
	{
		alert(msg + ' ' +  minval + '!')
		besedilo.select()
		return false
	} 
	return true
}

function VerifyMaxLength(besedilo, znakov, msg)
{
  if (besedilo.value.length > znakov)
  {
  alert(msg + ' ' + znakov + ' znakov!')
  besedilo.focus()
  return false
  }
  return true
}

function verifyPassword(geslo, potrditev, msg)
{
	if (geslo.value != potrditev.value)
	{
		alert(msg)
		potrditev.select()
		return false
	} 
	return true
}

function isNumber(besedilo, msg)
{
	vrednost  = new String(besedilo.value);
	vrednost = vrednost.replace(/,/ , ".");
  if (isNaN(vrednost))
  {
	alert(msg)
	besedilo.select()
	return false
  } 
  return true
}

function isMobitel(besedilo, msg)
{
  if (isNaN(besedilo.value))
  {
	alert(msg)
	besedilo.select()
	return false
  } 
  return true
}

/* print map */
function printframe()
{
	parent.frame_print_bottom.focus();
	parent.frame_print_bottom.print();
}
/* najboljsi popup - dhtml */
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}




function popup(strUrl)

{

  var scrnwdth = 0;
  var scrnhght = 0;
  var wdth = 707;
  var hght = 581;
  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(strUrl, 'prnwnd', '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 (prn.blur) prn.focus();

}


function openWindow(url, width, height)
{
  var scrnwdth = 0;
  var scrnhght = 0;
  var wdth = width;
  var 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 openwnd = null;
  openwnd = window.open(url, 'openwnd', 'width=' + wdth + ',height=' + hght + ',left=' + lft + ',top=' + tp + ',screenX=' + lft + ',screenY=' + tp + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes');
  if (openwnd.blur) openwnd.focus();
}

