<!--
agent = navigator.userAgent
browser = 0
selected = ''
if (agent.indexOf("a/3",1) == 6 || agent.indexOf("a/4",1) == 6) {browser = 1} else {browser = 0}
if (browser == 1) {

link1_n = new Image(50,48);
link1_n.src = "images/home.gif";
link1_h = new Image(50,48);
link1_h.src = "images/home1.gif";
}
function nt4(img) {
if (agent.indexOf("WinNT") == -1) {
                return;
        } 
                else {
                document.images[img].src = eval(img + "_c.src")
        }
}
function pass(prima,tipo) {

if (browser == 1) {

if (tipo == 's') {
                if (selected) {
                        nt4(prima)
                        document.images[selected].src = eval(selected + "_n.src")
                }
                nt4(prima)
                document.images[prima].src = eval(prima + "_s.src")
                selected=prima
                }

if (tipo == 'h') {
                if (prima != selected) {
                nt4(prima)
                document.images[prima].src = eval(prima + "_h.src")
                        }
                }

if (tipo == 'n') {
                if (prima != selected) {
                        nt4(prima)
                        document.images[prima].src = eval(prima + "_n.src")
                        }
                }

        }
}

ns4 = (document.layers) ? true : false
ie4 = (document.all) ? true : false

function openNew()
{
windowHandle = window.open('letak.html','newwindow','height=600,width=820,dependent=0,directories=0,fullscreen=yes,hotkeys=0,location=0,menubar=0,resizable=yes,scrollbars=yes,status=0,titlebar=0,toolbar=0,z-lock=0,top=1,left=1,screenX=1,screenY=1,resizable=0,copyhistory=0')
}

function openTecaj(url)
{
window.open(url,'newwindow','top=235,left=203,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=0,copyhistory=0,width=220,height=155')
}

function openSlika(url)
{
window.open(url,'newwindow','top=100,left=200,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=1,scrollbars=1, copyhistory=0,width=330,height=500')
}

function openServis(url)
{
window.open(url,'newwindow','top=100,left=200,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=0,scrollbars=1,copyhistory=0,width=400,height=300')
}

function gokategorija(parts)
{
  broj=parts.options[parts.selectedIndex].value;
  if (broj>0)
  { 
    URL='products.php?kategorija_id='+broj;
    location.href =URL;
  }
}

function goproizvodjac(parts)
{
  broj=parts.options[parts.selectedIndex].value;
  if (broj>0)
  { 
    URL='search.php?proizvodjac_id='+broj;
    location.href =URL;
  }
}

function getradiovalue(o)
{
	for (j=0;j<o.length;j++)
	{
		if (o[j].checked)
			return o[j].value;
	}
	return 0;
}

function checknaruci(parts)
{
	return true;
   var isok = true;
   var nplacanje = getradiovalue(document.forma.placanje);
//   var nplacanje = nplacanje=document.forma.placanje.checked.value;
// var nplacanje = document.forma.placanje.value);

   if (nplacanje==0) isok = false;
   if ((nplacanje==2)&&(document.forma.kredit.value=='')) isok = false;
   if (document.forma.dostava.value==0) isok=false;

//   alert(nplacanje);


//alert('dostava='+document.forma.dostava.value+',placanje='+nplacanje+',kredit='+document.forma.kredit.value);

   document.forma.gumb.disabled=!isok;

//   if ((document.myForm.dostava.value=='')||(document.myForm.placanje.value==''))
//      document.myForm.mySubmit.disabled=true;
//   else
//      document.myForm.mySubmit.disabled=false;
}

	function fncCalculateCurrency(objSelect,intPrice) {
	
		if(intPrice == 0) intPrice = document.forms['fmExchange'].fmERPriceFrom.value;

		intNumber = objSelect[objSelect.selectedIndex].value;
		strFinal = (intPrice / intNumber + 0.000000001).toString();
		if (strFinal.indexOf(".") > -1) 
		{ 
			strFinal = strFinal.substring(0,strFinal.indexOf(".")+3); 
		}

		intLZ = 7-strFinal.length;
		if (intLZ > 0) { strFinal = ' ' + strFinal; }
		for (intA=0;intA<intLZ;intA++) {
			strFinal = ' ' + strFinal;
		}

		document.forms['fmExchange'].fmERPrice.value = strFinal;
	}
//-->

