<!--
/* CSS handeling function */
function set_class(placeholder) {
	if(document.all && document.getElementsByTagName){
		navRoot = document.getElementById(placeholder)
		list_items = navRoot.getElementsByTagName("LI");
		for(i=0; i<list_items.length; i++ ){
			node = list_items[i];
			//if(node.parentNode.parentNode.id != 'toolbox'){
				if(node.className != "li_second") {
					node.onmouseover=function() { if (!event.toElement || event.toElement.className != "a_second") this.className+=" over"; } 
					node.onmouseout=function() { if (!event.toElement || event.toElement.className != "a_second") this.className=this.className.replace(" over", ""); } 
				}
			//}
		}
	}
}

/* Poll voting + results on remote server */
function remote_vote(poll_vote){
	var service_url = "http://www.spletna.net/grabs/logistika/voting/index.php";
	if(poll_vote != false ){
		service_url += "?POLL_VOTE=" + poll_vote;
	}
		p_width	= 400;	p_height = 300;
		p_left	= (screen.width/2) - p_width/2;
		p_top	= (screen.height/2) - p_height/2 - 30;
	var w_config = 'toolbar=0,location=0,top='+p_top+',left='+p_left+',directories=0,status=0,'+'menubar=0,scrollbars=autoe,resizable=0,width='+p_width+',height='+p_height;
	
	hwnd = window.open(service_url, 'poll', w_config);
}

/* open gallery popup window */
function gallery_zoom(url,name,width,height){
  	var l = (screen.width - width) / 2;
  	if(screen.width <= width){
  		width=screen.width;
  	}
  	if(screen.height <= height){
  		height=screen.height;
 	 	var t = 0;
  		var scroll = 1;
  	}else{
  		var t = (screen.height - height) / 2;
  		var scroll = 1;
  	}
	mewin=window.open(url,name,'toolbar=0,location=0,top='+t+',left='+l+',directories=0,status=0,'+'menubar=0,scrollbars='+scroll+',resizable=1,width='+width+',height='+height);
}

/* rezise window to optimal width/height */
function setClientSize(W, H){
    window.resizeTo(W, H);


    var cp = document.createElement("div");
    cp.style.position = "absolute";
    cp.style.width = "0px";
    cp.style.height = "0px";
    cp.style.right = "0px";
    cp.style.bottom = "0px";

    document.body.appendChild(cp);

    var current_width = cp.offsetLeft;
    var current_height = cp.offsetTop;

    var dw = W - current_width;
    var dh = H - current_height;

    window.resizeBy(dw, dh);
	window.moveTo(((screen.width/2)-((W + dw)/2)),(((screen.height/2)-((H+dh)/2)-30)));

    document.body.removeChild(cp);

    return { missed_width: dw, missed_height: dh };
}

function text(type){
	obj = document.getElementsByTagName("body")[0];
	switch(type){
		case 0: obj.style.fontSize = '9px'; break;
		case 1: obj.style.fontSize = '11px';break;
		case 2: obj.style.fontSize = '13px';break;
		default: break;
	}
}
/* Open gallery popup window */
function open_gallery_window(myuri, window_width, window_height) {
	position = get_top_left(window_width, window_height);
	opts = 'toolbar=0,location=0,top='+position[0]+',left='+position[1]+',directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+window_width+',height='+window_height;
	var wnd = window.open(myuri, 'gw', opts);
	return false;
}

function open_nav_window_with_head(myuri, window_width, window_height) {
	position = get_top_left(window_width, window_height);
	opts = 'toolbar=0,location=0,top='+position[0]+',left='+position[1]+',directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+window_width+',height='+window_height;
	var wnd = window.open('popup.with_head.php?uri='+myuri, 'gw', opts);
	return false;
}

function set_popup(parent_element) {
	var elements = getElementsByClassName(document.getElementById(parent_element), "a", "popup");
	for (i=0; i<elements.length; i++) {
		elements[i].onclick = function() {
			return open_nav_window_with_head(this.href, 660, 500);
		}
	}
}

function init_text_properties() {
	current_text_size = getCookie('text_size');
	current_line_height = getCookie('line_height');
	
	if (current_text_size) {
		document.getElementById('body_main').style.fontSize = text_sizes[current_text_size] + "px";
	}	
	if (current_line_height) {
		document.getElementById('body_main').style.lineHeight = line_heights[current_line_height] + "em";
	}
	
}

var myWindow;


function OpenIt(filename){
	Wwidth = 580;
	Wheight = 400;
	leftX = (screen.width/2) - (Wwidth/2);
	topY = (screen.height/2) - (Wheight/2);
	mywin = window.open(filename,"Search","width="+Wwidth+", height="+Wheight+", left="+leftX+", top="+topY);
	mywin.focus();
}



// get screen center
function get_top_left(width, height){
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
	  		winW = window.innerWidth;
	  		winH = window.innerHeight;
	 		winL = window.screenX;
	 		winT = window.screenY;
	 	}else{
	 	//if (navigator.appName.indexOf("Microsoft")!=-1) {
	  		winW = document.body.offsetWidth;
	  		winH = document.body.offsetHeight;
	  		winL = window.screenLeft;
	  		winT = window.screenTop;
	 	}
	}
	
	var scroll = 0;
	var l = winL + winW/2 - width/2;
	var t = winT + winH/2 - height/2;
	
	
  	if(screen.width <= width){
  		width=screen.width;
  	}
  	if(screen.height <= height){
  		height=screen.height;
 	 	var t = 0;
  		var scroll = 1;
  	}
	return Array(t,l);
}

//
-->
