// nova verzija 4.8.2006
// potrebuje prototype javascript knjižico v 1.4.0 ali novejšo
//  [] http://prototype.conio.net [] //

function custom_sirina(val){
	var sirina= new Array(3); 
	return sirina[val];
}

function showMenu(what,level) { 
		var div = $('menu' + what);
		if (!div) return;
		var sir = 0;
		if(level == 0){
			div.style.top = (get_pos_x('navanchor' + what)+0) + 'px';
			div.style.left = (get_pos_y('navanchor' + what)+0) + 'px';
			div.style.width = get_width('navanchor' + what) + 'px';
			div.style.width = div.offsetWidth + 'px';
		} else {
			div.style.top = (get_pos_x_sub('item' + what)+2) + 'px';
			div.style.left = (get_pos_y_sub('item' + what)-2) + 'px';
			div.style.width = div.offsetWidth + 'px';
		}
   	    div.style.visibility = "visible";
}

function hideMenu(what) { 
 	/* delay pri odpiranju oken v milisekundah */
	//pausecomp(0)
	try{		
			var div = $('menu' + what);
    		div.style.visibility = 'hidden';
			;
	}
	catch(e){}
}

function get_pos_x(val){
	var top = 0, left = 0, pos_x = 0;
 	height = document.getElementById(val).offsetHeight;
	myTarget = document.getElementById(val);
	
	while(myTarget != document.body) {
		 top += myTarget.offsetTop;
		 myTarget = myTarget.offsetParent;
 	}
	pos_x = (top + height);
	return pos_x;
}


function get_pos_y(val){
	var top = 0, left = 0, pos_x = 0;
	myTarget = document.getElementById(val);
	
	while(myTarget != document.body) {
		 left += myTarget.offsetLeft;
		 myTarget = myTarget.offsetParent;
 	}
	return left;
}

function get_pos_x_sub(val){
	var top = 0, left = 0, pos_x = 0;
	myTarget = document.getElementById(val);
	
	while(myTarget != document.body) {
		 top += myTarget.offsetTop;
		 myTarget = myTarget.offsetParent;
 	}
	pos_x = (top );
	return pos_x;
	
}
function get_pos_y_sub(val){
	var top = 0, left = 0, pos_x = 0, width = 0;
	myTarget = document.getElementById(val);
	width = myTarget.offsetWidth;
	while(myTarget != document.body) {
		left += myTarget.offsetLeft;
		myTarget = myTarget.offsetParent;
		myTarget == 'ff';
 	}
	return (left + width);
}

function get_width(val){
	myTarget = document.getElementById(val);
	width = myTarget.offsetWidth;
	return width;
}

function pausecomp(Amount)
{
	d = new Date() //today's date
	while (1)
	{
		mill=new Date() // Date Now
		diff = mill-d //difference in milliseconds
		if( diff > Amount ) {break;}
	}
}

function showframe(){
	var browserName=navigator.appName; 
		if(browserName == 'Netscape'){
			ccframe = document.getElementById('ciframe');
			ccframe.style.width = '100%';
		}
}
