function formInputClear(forma,formel,tekst){
	if(document.getElementById(forma).elements[formel].value==tekst){
		document.getElementById(forma).elements[formel].value="";
	}
}
function formInputFill(forma,formel,tekst){
	if(document.getElementById(forma).elements[formel].value==""){
		document.getElementById(forma).elements[formel].value=tekst;
	}
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
function setHakt(){
	gumb = document.getElementById('hmeniAkt');
	if(gumb){
		gumbx = findPosX(gumb);
		document.getElementById('hakt').style.left=gumbx+11+"px";
	}
}
var aktPmeni;
function pMeni(obj,pmeni_id,ivent){
	xpos = findPosX(obj);
	if(ivent==1){
		document.getElementById(pmeni_id).style.display="block";
		document.getElementById(pmeni_id).style.left=xpos+"px";
		//pokaziPMeni(pmeni_id);
		if(aktPmeni && aktPmeni!=pmeni_id){
			sakrijPMeni(aktPmeni);
		}
		if(window.stid){
			clearTimeout(stid);	
		}
		aktPmeni = pmeni_id;
		tid = window.setTimeout("pokaziPMeni('"+pmeni_id+"')",10);
	}else if(ivent==2){
		stid = window.setTimeout("sakrijPMeni('"+pmeni_id+"')",1000);
		//document.getElementById(pmeni_id).style.display="none";
	}
}
function pMeni2(pmeni_id,ivent){
	if(ivent==1){
		if(window.stid){
			clearTimeout(stid);	
		}
	}else if(ivent==2){
		stid = window.setTimeout("sakrijPMeni('"+pmeni_id+"')",500);
	}
}
function pokaziPMeni(pmeni_id){
	palfa = document.getElementById(pmeni_id).style.opacity*100;
	if(!palfa){
		palfa = 0;
		//palfa = document.getElementById(pmeni_id).style.filter;
	}
	novialfa = palfa + 5;

	if(palfa<100){
		//document.getElementById(pmeni_id).style.opacity=novialfa/100;
		//document.getElementById(pmeni_id).style.filter = "alpha(opacity:"+novialfa+")";
		tid = window.setTimeout("pokaziPMeni('"+pmeni_id+"')",10);
	}else{
		if ( window.tid ) {	
			clearTimeout(tid);
		}
	}
}
function sakrijPMeni(pmeni_id){
	//document.getElementById(pmeni_id).style.opacity=0;
	//document.getElementById(pmeni_id).style.filter = "alpha(opacity:0)";	
	document.getElementById(pmeni_id).style.display="none";
	aktPmeni = "";
}

function produziPmeni(pmeni_id){
	if ( window.stid ) {		
		clearTimeout(stid);
	}
	stid = window.setTimeout("sakrijPMeni('"+pmeni_id+"')",1000);
}

function IEhover(){
	if(document.getElementsByTagName) {
	  (function() {
		var className = 'ieHover',
			pattern   = new RegExp('(^|\\s+)' + className + '(\\s+|$)'),
			rows      = document.getElementsByTagName('tr');	
		for(var i = 0, n = rows.length; i < n; ++i) {
		  rows[i].onmouseover = function() {
			this.className += ' ' + className;
		  };
		  rows[i].onmouseout = function() {
			this.className = this.className.replace(pattern, ' ');
		  };
		}
		rows = null;
	  })();
	}
}

//http://www.avto.info/common/flashDetection.js
function detectingFLASH() { 
  var browser = navigator.userAgent.toLowerCase(); 
  flashVersion = 0;     
    // NS3+, Opera3+, IE5+ Mac 
    if ( navigator.plugins != null && navigator.plugins.length > 0 ) { 
        var flashPlugin = navigator.plugins['Shockwave Flash']; 
        if ( typeof flashPlugin == 'object' ) {
            if ( flashPlugin.description.indexOf('10.') != -1 ) flashVersion = 10; 
	     else if ( flashPlugin.description.indexOf('9.') != -1 ) flashVersion = 9;
	     else if ( flashPlugin.description.indexOf('8.') != -1 ) flashVersion = 8;
	     else if ( flashPlugin.description.indexOf('7.') != -1 ) flashVersion = 7;
            else if ( flashPlugin.description.indexOf('6.') != -1 ) flashVersion = 6; 
            else if ( flashPlugin.description.indexOf('5.') != -1 ) flashVersion = 5; 
            else if ( flashPlugin.description.indexOf('4.') != -1 ) flashVersion = 4; 
            else if ( flashPlugin.description.indexOf('3.') != -1 ) flashVersion = 3; 
        } 
    } // IE4+ Win32 (VBscript) 
    else if ( browser.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && browser.indexOf("win")!= -1 && browser.indexOf("16bit")== -1 ) { 
      document.write('<scr' + 'ipt language="VBScript"\> \n'); 
        document.write('on error resume next \n'); 
        document.write('DIM obFlash \n'); 
        document.write('SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.10") \n'); 
        document.write('IF IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 10 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.9") END IF \n'); 
        document.write('IF flashVersion < 10 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 9 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.8") END IF \n'); 
        document.write('IF flashVersion < 9 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 8 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") END IF \n'); 
        document.write('IF flashVersion < 8 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 7 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") END IF \n'); 
        document.write('IF flashVersion < 7 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 6 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") END IF \n'); 
        document.write('IF flashVersion < 6 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 5 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") END IF \n'); 
        document.write('IF flashVersion < 5 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 4 \n'); 
        document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") END IF \n'); 
        document.write('IF flashVersion < 4 and IsObject(obFlash) THEN \n'); 
        document.write('flashVersion = 3 \n'); 
        document.write('END IF'); 
      document.write('</scr' + 'ipt\> \n'); 
  } // no Flash 
  else { 
    flashVersion = -1; 
  } 
return flashVersion; 
} 

/*
if (detectingFLASH() < 6)
	document.location.href= 'http://www.si21.info/noflash/';
*/

/**/
window.onload = function() {
	setHakt();
	IEhover();
}