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 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);
}
function popup(url,width,height,focusIfAlreadyExists,closeIfAlreadyExists) {
	
	if (!url) {
		alert("no url was set: '"+url+"'");
		return false;
	}
	else{
		width	= (width) 	? width	+= 20 : 150;  // 150px*150px is the default size
		height	= (height) 	? height+= 25 : 150;
		var args = 'width='+width+',height='+height+',resizable,scrollbars=yes';
		
		var makeNew = true;
		
		if(focusIfAlreadyExists)
			if(popfocus())
				makeNew=false;
	
		if(closeIfAlreadyExists)
			popdown();
		
		
		if( makeNew )
			POP_1233_W_LALA = window.open(url,'',args);
		
		
		return (POP_1233_W_LALA) ? false : true;
	}
}
function showHideContact(jezik)
	{
	
	if (jezik==1)
	{
		document.getElementById('SLO').style.display = 'block';
		document.getElementById('USA').style.display = 'none';
		document.getElementById('AUT').style.display = 'none';
	}
	else if (jezik==2)
	{
		document.getElementById('SLO').style.display = 'none';
		document.getElementById('USA').style.display = 'block';
		document.getElementById('AUT').style.display = 'none';
	}
	else if (jezik==3)
	{
		document.getElementById('SLO').style.display = 'none';
		document.getElementById('USA').style.display = 'none';
		document.getElementById('AUT').style.display = 'block';
	}
	
}
function activecatalogue(katalog)
	{
	
	if (katalog==1)
	{
		document.getElementById('catalogue1').style.display = 'block';
		
	}
	else if (katalog==2)
	{
		document.getElementById('catalogue2').style.display = 'block';
	}
	else if (katalog==3)
	{
		document.getElementById('catalogue3').style.display = 'block';
	}
	else if (katalog==4)
	{
		document.getElementById('catalogue4').style.display = 'block';
	}
	else if (katalog==5)
	{
		document.getElementById('catalogue5').style.display = 'block';
	}
	else if (katalog==6)
	{
		document.getElementById('catalogue6').style.display = 'block';
	}
	
}
	
