function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//	document.oncontextmenu = function(){return false;}
	
var nosise="Copyright by MULTILINK d.o.o." 
  
function click(doc) { //3.0 
        if (document.all) { 
                if (event.button == 2 || event.button == 3 || event.button == 6 || event.button == 7) { 
                        alert(nosise); 
                        return false; 
                        } 
        } 
        if (document.layers) { 
                if (doc.which == 3) { 
                        alert(nosise); 
                        return false; 
                        } 
        } 
} 
function parseHRdec(instring,scale){ 
/* instring = input string, 
   scale = broj decimala (optional - default=2), 
   return value = numeric(rounded) or NaN 
*/ 
        var x=NaN; 
        var sc=100; 
        var re = /^\s*-?(\d{1,3})*(\.?\d{3})*(,\d+)?\s*$/; 
        if (arguments.length > 1) sc = Math.pow(10,scale); 
        if (re.test(instring)){ 
                x=instring.replace(/\./g,""); 
                x=x.replace(",","."); 
                x=parseFloat(x); 
                x=Math.round(x*sc)/sc 
        } 
        return x 
} 
function formatHRdec(infloat,scale){ 
/* infloat = input numeric string, 
   scale = broj decimala (optional - default=2), 
   return value = string(formatted - 0,00 ako nije numerik) 
*/ 
        if (arguments.length > 1) 
         sc = Math.pow(10,scale) 
        else { 
         sc = 100; 
         scale=2; 
        } 
        nn=Math.round(infloat*sc)/sc 
        cijelo=Math.floor(nn); 
        decimale=Math.round((nn-cijelo)*sc); 
// formatiranje cijelog dijela na grupe po tri 
        nn=cijelo.toString().length; 
        ss=cijelo.toString(); 
        for(i=nn,xx="";i>0;i-=3){ 
                if(ss.substring(i-3,i) != "-") 
                        xx=ss.substring(i-3,i)+((i==nn)?"":".")+xx 
                else 
                        xx=ss.substring(i-3,i)+xx 
        } 
// formatiranje decimala 
        xx+=","; 
        ss=decimale+sc; 
        ss=ss.toString(); 
        xx=xx+ss.substring(1,scale+1);  
        return xx 
} 

var tecaj = [1.0,40.3399,340.750,6.55957,1936.27,2.20371,200.482,1.95583,166.386,0.787564,40.3399,13.7603,5.94573]; 
var euro = 0; 
var iznos = 0; 
function toeuro(x,t) { 
        iznos = parseHRdec(x.value,2); 
        euro = iznos/tecaj[t];
		return refreshtxt();
}
function refreshtxt () { 
        document.form1.txt0.value=formatHRdec(euro*tecaj[0],2); 
        document.form1.txt1.value=formatHRdec(euro*tecaj[1],2); 
        document.form1.txt2.value=formatHRdec(euro*tecaj[2],2);
		document.form1.txt3.value=formatHRdec(euro*tecaj[3],2); 
		document.form1.txt4.value=formatHRdec(euro*tecaj[4],2); 
		document.form1.txt5.value=formatHRdec(euro*tecaj[5],2); 
		document.form1.txt6.value=formatHRdec(euro*tecaj[6],2); 
		document.form1.txt7.value=formatHRdec(euro*tecaj[7],2); 
		document.form1.txt8.value=formatHRdec(euro*tecaj[8],2); 
		document.form1.txt9.value=formatHRdec(euro*tecaj[9],2); 
		document.form1.txt10.value=formatHRdec(euro*tecaj[10],2); 
		document.form1.txt11.value=formatHRdec(euro*tecaj[11],2);
		document.form1.txt12.value=formatHRdec(euro*tecaj[12],2);
        return true 
} 

var prozor = "temp_prozor";
function otvori_prozor(ID,sirina,visina)
{
		if( prozor != "temp_prozor" ) 
			prozor.close();
		prozor = window.open(ID,"Pomocni","scrollbars=auto,resizable=false,width=" + sirina + ",height=" + visina + ",dependent");

		prozor.focus();
}

// POP UP 

var prozor2 = null; 

function popUpProzor(jpg, sirina, visina, marg){
         if (prozor2 != null){
                   prozor2 = temp.close();
         }
         if (marg == null) { marg = 0 };
         sirina_prozora = sirina + marg*2
         visina_prozora = visina + marg*2
         temp = window.open('popup.asp?jpg=' + jpg + '&marg=' + marg, 'prozor','width=' + sirina_prozora + ',height=' + visina_prozora + ',status=no');
         prozor2 = temp.document;

}

function newPopup(URL, WIDTH, HEIGHT) {
properties = "left=50,top=50,width=" + (WIDTH) + ",height=" + (HEIGHT);

text = "<html><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><a href='javascript:window.close();'><img src='" + URL + "' border='0'></a></body></html>";

preview = window.open("", "preview", properties);
preview.document.open();
preview.document.write(text);
}


// REBRAND
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < words.length; ++i) {
		if (isNaN(parseInt(words[i])))
			continue;
		var MM_PluginVersion = words[i];
	}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('<\/SCR' + 'IPT\> \n');
}
