//************************************************************
//popup funkcija (nima zveze z menujem)
var okno = null;
var okno2 = null;
function popup(doc, w, h)
{
  	if (w == null) w = 576;
  	if (h == null) h = 600;
	if (okno==null || okno.closed) {
		okno=window.open(doc,"popup",'toolbar=no,width='+ w +',height='+ h +',resizable=yes,scrollbars=yes,directories=no,status=no,menubar=no,location=no');
		okno.creator = self;      
	}
	else {
		okno.location = doc;
		okno.focus();
	}
	
}

//popup brez scrollbarjev
function popup2(doc, w, h)
{
  	if (w == null) w = 576;
  	if (h == null) h = 600;
	if (okno2==null || okno2.closed) {
		okno2=window.open(doc,"popup2",'toolbar=no,width='+ w +',height='+ h +',resizable=no,scrollbars=no,directories=no,status=no,menubar=no,location=no');
		okno2.creator = self;      
	}
	else {
		okno2.location = doc;
		okno2.focus();
	}
	
}

//popup brez scrollbarjev - galerija
function popup4(doc, w, h)
{
  	if (w == null) w = 576;
  	if (h == null) h = 600;
	if (okno2==null || okno2.closed) {
		okno2=window.open(doc,"popup4",'toolbar=no,width='+ w +',height='+ h +',resizable=no,scrollbars=no,directories=no,status=no,menubar=no,location=no');
		okno2.creator = self;      
	}
	else {
		okno2.location = doc;
		okno2.focus();
	}
	
}

//popup funkcija (FAQ)
var okno = null;
var okno2 = null;
function popup3(doc, w, h)
{
  	if (w == null) w = 576;
  	if (h == null) h = 600;
	if (okno==null || okno.closed) {
		okno=window.open(doc,"popup3",'toolbar=no,width='+ w +',height='+ h +',resizable=yes,scrollbars=yes,directories=no,status=no,menubar=no,location=no');
		okno.creator = self;      
	}
	else {
		okno.location = doc;
		okno.focus();
	}
	
}

//fullscreen popup
function openfull(doc)
{
	if (okno==null || okno.closed) {
		okno=window.open(doc,"full",'fullscreen=yes,scrollbars=no');
		okno.creator = self;      
	}
	else {
		okno.location = doc;
		okno.focus();
	}
	
}


// popup z detekcijo flash playerja

///////////////////////////////////////////////////////////////////////////////////////////
// Inicializacija za IE
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;   
	
	var flash2Installed = false;
	var flash3Installed = false;
	var flash4Installed = false;
	var flash5Installed = false;
	var flash6Installed = false;
	var actualVersion = 0;
	
	
	if(isIE){
	  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	  document.write('on error resume next \n');
	  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
	  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
	  document.write('</SCR' + 'IPT\> \n'); 
	}
//////////////////////////////////////////////////////////////////////////////////////////

function detectFlash(requiredVersion) {  
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
	  flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion >= 6;
    }
  }
  

  for (var i = 2; i <= 6; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  if (actualVersion < requiredVersion) {
  	 return false;
  }else{
  	 return true;
  }
}

////////////////////////////////////////

function FormatCurrency(val){
   var num = parseFloat(val);
   var positive = (num >= 0)? true : false;
   var t = Math.abs(num);
   var tt = Math.floor(t);
   var dec = t - tt;
   var out = "";
   var aa = tt;
   var b,i;
   i=0;
   
   b = Math.round(dec*100);
   if (b == 100 ) {
   		dec=0;
   		aa++;
   }
   
   if (aa > 0){
	   while (aa > 0){
		   b = aa % 10;
		   aa = Math.floor(aa / 10);
					  if (i>0 && i % 3 == 0 ) out    = "." + out;
		   out    = b + "" + out;
				  i++;           }
   }else{
		out = "0";
   }
	
	if (dec > 0){
	   b = Math.round(dec*100);
	   out    += (b<10)? ",0"+b :","+b;
   	}else{
	   out    += ",00"
   	}
	  if (!positive)    out    = "-" + out;
	  return out;
}

function unformatCurrency(val)
{
	ret="";
	deci=false;
	for (f = val.length-1 ; f>=0 ; f--){
		c=val.substr(f,1);
		if((c==",")||(c==".")) {
			if(!deci) ret="."+ret;
			deci=true;
		} else ret=c+ret;
	}
	return ret;
}


function isNumber(a){
	var valid = '0123456789,.'; 
	for (j = 0 ; j<a.length ; j++){
		if (valid.indexOf(a.substr(j,1)) < 0) return false;
	}
	return true;
}


k=239.640;	//$euro$;

function selectsit()
{
	document.forms.calc.sit.select();
}
function selecteur()
{
	document.forms.calc.eur.select();
}


function eur2sit()
{	
	a=unformatCurrency(document.forms.calc.eur.value);
	b="";
	if(isNumber(a)) b=FormatCurrency(a*k);
	document.forms.calc.sit.value=b;
}

function sit2eur()
{
	a=unformatCurrency(document.forms.calc.sit.value);
	b="";
	if(isNumber(a)) b=FormatCurrency(a/k);
	document.forms.calc.eur.value=b;
}

// funkcija za preklop tabel (sit, eur)
function prikaziTabelo(id) {
	if (id=='sit') {
		document.getElementById('vepSit').style.display='block';
		document.getElementById('vepEur').style.display='none';
	} 
	if (id=='eur') {
		document.getElementById('vepSit').style.display='none';
		document.getElementById('vepEur').style.display='block';
	}
	if (id=='sit2') {
		document.getElementById('mairSit').style.display='block';
		document.getElementById('mairEur').style.display='none';
	} 
	if (id=='eur2') {
		document.getElementById('mairSit').style.display='none';
		document.getElementById('mairEur').style.display='block';
	}
	if (id=='sit3') {
		document.getElementById('mairKnjSit').style.display='block';
		document.getElementById('mairKnjEur').style.display='none';
	} 
	if (id=='eur3') {
		document.getElementById('mairKnjSit').style.display='none';
		document.getElementById('mairKnjEur').style.display='block';
	}
}


// -->