

/*ta funlkcija se uporablja za izpsis podrobnosti o dogodkih v koledarju*/
function openWinKoledar(page)
{
        //alert(page);
        wind=window.open("koledar.php?dogodek="+page+"", "Koledar","toolbar=No,menubar=No,location=No,scrollbars=yes,resizable=Yes,status=No,width=450,height=300,left=100,top=150,border=0");
        wind.focus();
}
function fok()
{
	
	oce=window.open("index.php?path=home", "oce");
	oce.focus();
	
}
function favorites() { 
   if (window.external) { 
      window.external.AddFavorite(document.URL, document.title); 
   } else if (window.sidebar) { 
      window.sidebar.addPanel(document.title, document.URL, ''); 
   } 
}

function menjajklas(klas)
{
 event.srcElement.className=klas; 
  
    
}
function spremeni()
{
	
	if(prenos==0)
	return;
	
	if("_"+prenos==this.event.srcElement.id)
	return;
	
	if(this.event.srcElement.nameProp=="struktura_zaporedje_p.jpg")
		this.event.srcElement.src="www/default/matrice/katalog/struktura_zaporedje.jpg";
	else
		this.event.srcElement.src="www/default/matrice/katalog/struktura_zaporedje_p.jpg";
 	//alert(this.href);
	
}
function spremeni_prenos()
{
	
	if(prenos!=0)
	return;
	
	if(this.event.srcElement.nameProp=="struktura_z_h.jpg")
		this.event.srcElement.src="www/default/matrice/katalog/struktura_z_p.jpg";
	else
		this.event.srcElement.src="www/default/matrice/katalog/struktura_z_h.jpg";
	
}
var prenos=0;
function set(id)
{
	
	if(prenos==0)
	return;
	
	if("_"+prenos==this.event.srcElement.id)
	return;
	document.getElementById(prenos).src="www/default/matrice/katalog/struktura_z_p.jpg";
	
	location=id+"&id_old="+prenos;
}
var set_id;
var set_prenos_id;
function set_prenos(id)
{
	
	
	if(prenos!=0)
	document.getElementById(prenos).src="www/default/matrice/katalog/struktura_z_p.jpg";
	
	if(prenos==id)
	{
		
		prenos=0;
		return;
	}
	prenos=id;
	this.event.srcElement.src="www/default/matrice/katalog/struktura_z_a.jpg";
	
}
function set_height()
{
	
	
	if(this.event.srcElement.height=="90%")
	this.event.srcElement.height="50";
	else
	this.event.srcElement.height="90%";
	
	
	
}
function openWin(page)
{
    if(window.name=="CtrlWindow") 
    {
    	document.location= page;
    	
    }  
	
	var width= document.all ?  screen.availWidth : screen.availWidth;
  	var height= document.all ?  screen.availHeight : screen.availHeight;
 OpenWin = window.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,scrollbars=Yes,width="+width+",height="+height+",resizable=Yes,status=No,left=0,top=0,border=1");
  	OpenWin.focus();
}
function openWin_prikaz(page)
{
    
	
	
 OpenWin = window.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,scrollbars=Yes,width=600,height=300,resizable=Yes,status=No,left=100,top=100,border=1");
  	OpenWin.focus();
}
function openWinOglas(page)
{
   

   
   
    var width= (document.all ?  screen.availWidth : screen.availWidth)-100;
  	var height= (document.all ?  screen.availHeight : screen.availHeight)-100;
 OpenWin = window.open(page, "CtrlWindowOglas","toolbar=No,menubar=No,location=No,scrollbars=Yes,width="+width+",height="+height+",resizable=Yes,status=No,left=50,top=50,border=1");
  	OpenWin.focus();
}
function skrijPrikazi(id)
{
    
	el=document.getElementById(id);
	el1=document.getElementById(id+"_prikaz");
	if((el==null)||(el1==null))
	return;
	if( el.style.display=="none")
	{
		el.style.display="block";
		el1.innerHTML="--";
	}
	else
	{
		el.style.display="none";
		el1.innerHTML="+";
	}
}

function find_elements(tagname, prefix, do_something_with) {
	var all_elements = document.getElementsByTagName(tagname);
	for (var i = 0; i < all_elements.length; i++) {
		if (all_elements[i].id.substr(0, prefix.length) == prefix) {
			element = all_elements[i];
			do_something_with(element);
		}
	}
}

function fillHtml(element) {
	var vsebina = element.innerHTML;
	if (vsebina == '') {
		filename = element.id.substr(2);
		filepath = 'www/default/cpv/en/' + filename + '.html';
		ajaxFunction(filename, element);
	}
}

function ajaxFunction(filename, element) {
	var xmlHttp;
	try {
		xmlHttp = new XMLHttpRequest();
	}
	catch (e) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 1) {
			document.getElementsByTagName("body").item(0).style.cursor = "wait";
		}
		if (xmlHttp.readyState == 4) {
			document.getElementsByTagName("body").item(0).style.cursor = "auto";
			element.innerHTML = xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET", filepath, true);
	xmlHttp.send(null);
}
function napolni_vrednost(coda)
{
	
	document.location="index.php?path=admin&action=edit_company&coda="+coda+"&id=true";
	
	
}
function napolni_vrednost1(coda)
{
	
	document.location="index.php?path=admin&action=edit_company&coda="+coda+"&id=4";
	
	
}