function prikazi_Element(id)
{
      if(document.getElementById(id)==null)
			return;
	elem=document.getElementById(id);
	if(elem.className=="skrit")
	{


		elem.className="prikazan";
		for(i=0;elem.children[i]!=null;i++)
			elem.children[i].className="prikazan";
	}
	else
	{
		elem.className="skrit";
        for(i=0;elem.children[i]!=null;i++)
			elem.children[i].className="skrit";

				
	}
	position_corecture();
	
	
}


function openWin(page,name)
{

	window.open(page, name,"toolbar=No,menubar=No,location=No,scrollbars=No,resizable=Yes,status=No,width=700,height=500,left=150,top=150,border=0");
}


function go_to_url(url)
{
	if(url=="")
		location="index.php";
	else
		location=url;

}

function position_corecture()
{
	if(document.getElementById('position_corecture')==null)
		return;
		elem=document.getElementById('position_corecture');

	elem.style.height="13px";
	elem.style.height="2px";
}

/////////////////////////kukiji

function setCookie(ime,vrednost,rok,pot, domena, varno)
{
   var datum = new Date()
   rok=datum.setTime(datum.getTime() + rok * 86400000)

/*
   document.cookie =
	  ime + "=" + encodeURIComponent(vrednost) +
	  ((rok) ? "; expires=" + rok.toUTCString() : "") +
	  ((pot) ? "; path=" + pot : "") +
	  ((domena) ? "; domain=" + domena : "") +
	  ((varno) ? "; secure" : "")
*/

   document.cookie =
	  ime + "=" + vrednost +
	  ((rok) ? "; expires=" + rok.toUTCString() : "") +
	  ((pot) ? "; path=" + pot : "") +
	  ((domena) ? "; domain=" + domena : "") +
	  ((varno) ? "; secure" : "");


}

function deleteCookie(ime, pot, domena)
{
   document.cookie =
	  ime + "=" +
	  "; expires=Thu, 01-Jan-70 00:00:01 GMT" +
	  ((pot) ? "; path=" + pot : "") +
	  ((domena) ? "; domain=" + domena : "")
}

function getCookie(ime)
{
   ime+="="
   var dc = document.cookie
   var start = dc.indexOf("; " + ime)
   if (start >= 0) start += 2
   else {
	  start = dc.indexOf(ime)
	  if (start != 0) return null
   }
   start += ime.length
   var konec = dc.indexOf(";", start)
   if (konec == -1) konec = dc.length
   return decodeURIComponent(dc.substring(start, konec))
}

function afterSomeDays(dnevi)
{
   var datum = new Date()
   datum.setTime(datum.getTime() + dnevi * 86400000)
   return datum;
}


function potrdi_geslo()
{

	var val1 = document.getElementById('preveri_geslo1').value;
	var val2 = document.getElementById('preveri_geslo2').value;

	if(val1 == val2)
	{
		document.podatki_uporabnika.submit();
	}
	else
	{
		alert("Gesli sta različni!");
	}

}


function printaj()
{
	var elements = document.getElementsByTagName("span");
	var content = "";

	if(!elements)
		return;

	for(i = 0 ; i< elements.length ; i++)
	{
		element = elements[i];

		if(element.name == "print")
		{
			content = content + "<br><br>"+ element.innerHTML;
		}
	}

	if(content != "")
		odpri_zapisi(content);

/*

	var oPopup = window.createPopup();


      oPopup.document.body.style.backgroundColor = "lightyellow";
	    oPopup.document.body.innerHTML=content;
    oPopup.show(50, 50, 500, 500, document.body);

*/


	//window.print('index.php');
	//window.open("print.php", "PRINT","toolbar=No,menubar=No,location=No,scrollbars=No,resizable=Yes,status=No,width=200,height=100,left=150,top=150,border=0");
}

function vprasaj(vprasanje,param)
{
	if (confirm(vprasanje))
		location=param;
}



function spremeniKlas(klas,id)
{
        id_div="div_"+id;
        //alert(document.getElementById(id));
        if(document.getElementById(id_div)==null)
        return
          //alert(document.getElementById(id));

        document.getElementById(id_div).className=klas;



        menjaj_sliko(id);

	//position_corecture();
}

function spremeniKlasId(klas,id)
{

         id_div="div_"+id;
        //alert(document.getElementById(id));
        if(document.getElementById(id_div)==null)
        return
          //alert(document.getElementById(id));

        document.getElementById(id_div).className=klas;
        //position_corecture();
}

function menjaj_sliko(id)
{
        id_slika="slika"+id;
        //alert(document.getElementById(id));
        if(document.getElementById(id_slika)==null)
        return
          //alert(document.getElementById(id));
         if(document.getElementById(id_slika).name==1)
         {
                document.getElementById(id_slika).src="www/default/img/gumb-aktiv.gif";
                document.getElementById(id_slika).name=0;
         }
         else
         {
                document.getElementById(id_slika).src="www/default/img/gumb-pasiv.gif";
                document.getElementById(id_slika).name=1;
         }


}

function prikazi_opis(str)
{
	window.status = str;
	position_corecture();
}
var _editor_url;
function remote()
{

	_editor_url = "edit/";                     // URL to htmlarea files
	var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
	if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }

	if (win_ie_ver >= 5.5) {
	  document.write('<scr' + 'ipt src="www/default/script/editor.js"');
	  document.write(' language="Javascript1.2"></scr' + 'ipt>');
	} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

}
function resiz()
{
	elem1=parseInt(document.getElementById("rozca").currentStyle.left);
	elem2=document.getElementById("rozca_pozicija").offsetWidth;
	document.getElementById("rozca").style.left=(elem1+elem2-25)+"px";
	
}

function narocilo()
{

	window.open("narocilnica.php", "ZivaCenter","toolbar=No,menubar=No,location=No,scrollbars=No,resizable=Yes,status=No,width=775,height=600,left=0,top=0,border=0");
}
