	var click_dis = false;

	function roll(item) {
		var pom;
		if (item.classNameRoll) {
			pom = item.classNameRoll;
			item.classNameRoll = item.className;
			item.className = pom;
		} else {
			item.classNameRoll = item.className;
			item.className = 'activ';
		}
	}

	function clickme(item) {
		var pom;
		if (click_dis)
		{
			click_dis = false;
			return;
		}
		if (item.className == item.classNameRoll) {
			item.classNameRoll = item.classNameClick;
			item.className = 'activ';
		} else {
			item.classNameClick = item.classNameRoll
			item.className = 'click';
			item.classNameRoll = 'click';
		}
	}

	function openPage(url, target, width, height) {
		lefti = (window.screen.width / 2) - (width / 2);
		topi = (window.screen.height / 2) - (height / 2);

		options = 'margin=5,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		win = window.open(url, target, options);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

		return (typeof(win) != 'object');
	}

function open_page(url, target,width,height) {
	left = (window.screen.width / 2) - (width / 2);
	topi = (window.screen.height / 2) - (height / 2);
	
	options = 'margin=5,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + left + ',width=' + width + ',height=' + height:'');
	win = window.open(url, target, options);    
	win.focus();
	return ('object' == typeof(win)) ? false : true;
}

	
	function changeStav(item)
	{
		alert(item);
	}

	
function open_pic(url, target, width, height) {
	lefti = (window.screen.width / 2) - (width / 2);
	topi = (window.screen.height / 2) - (height / 2);

	options = 'margin=0,scrollbars=no,toolbar=0,resizable=yes,top=' + topi + ',left=' + lefti + ',menubar=0,width=' + width + ',height=' + height;
	win = window.open(url, target, options);    
	win.focus();
	return ('object' == typeof(win)) ? false : true;
}
function onLoadImage()
{
	width = this.width + 6;
	height = this.height + 6;

	lefti = (window.screen.width / 2) - (width / 2);
	topi = (window.screen.height / 2) - (height / 2);

	options = 'margin=0,scrollbars=no,toolbar=0,resizable=yes,top=' + topi + ',left=' + lefti + ',menubar=0,width=' + width + ',height=' + height;
	win = window.open('', '', options);
	win.document.write('<html><body style="margin:0;padding:4px;background:#4093BA;"><header><title>VP Servis :: '+this.src+'</title></header><a href="#" title="Zavøít okno" onclick="window.close();"><img src="'+this.src+'" style="border: none;"></a></body></html>');
	win.focus();
	return ('object' == typeof(win)) ? false : true;

}


function openImage(url) {
	var imag = new Image();
	imag.onload = onLoadImage;
	imag.src = url;
	
	return false;
}
