//pred vstupem do skriptu musi byt definovano: menuid, submenuid

//definice pro moznost tahat mysi objekty http://www.webreference.com/programming/javascript/mk/column2/index.html
var Demos       = [];
var nDemos      = 8;

// Demo variables
// iMouseDown represents the current mouse button state: up or down
/*
lMouseState represents the previous mouse button state so that we can
check for button clicks and button releases:

if(iMouseDown && !lMouseState) // button just clicked!
if(!iMouseDown && lMouseState) // button just released!
*/
var mouseOffset = null;
var iMouseDown  = false;
var lMouseState = false;
var dragObject  = null;

// Demo 0 variables
var DragDrops   = [];
var curTarget   = null;
var lastTarget  = null;
var dragHelper  = null;
var tempDiv     = null;
var rootParent  = null;
var rootSibling = null;
var nImg        = new Image();

nImg.src        = 'images/drag_drop_poof.gif';

// Demo1 variables
var D1Target    = null;

Number.prototype.NaN0=function(){return isNaN(this)?0:this;}

function CreateDragContainer(){
	/*
	Create a new "Container Instance" so that items from one "Set" can not
	be dragged into items from another "Set"
	*/
	var cDrag        = DragDrops.length;
	DragDrops[cDrag] = [];

	/*
	Each item passed to this function should be a "container".  Store each
	of these items in our current container
	*/
	for(var i=0; i<arguments.length; i++){
		var cObj = arguments[i];
		DragDrops[cDrag].push(cObj);
		cObj.setAttribute('DropObj', cDrag);

		/*
		Every top level item in these containers should be draggable.  Do this
		by setting the DragObj attribute on each item and then later checking
		this attribute in the mouseMove function
		*/
		for(var j=0; j<cObj.childNodes.length; j++){

			// Firefox puts in lots of #text nodes...skip these
			if(cObj.childNodes[j].nodeName=='#text') continue;

			cObj.childNodes[j].setAttribute('DragObj', cDrag);
		}
	}
}

function getPosition(e){
	var left = 0;
	var top  = 0;
	while (e.offsetParent){
		left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
		top  += e.offsetTop  + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
		e     = e.offsetParent;
	}


	left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
	top  += e.offsetTop  + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);

	return {x:left, y:top};

}

function mouseCoords(ev){
	if(ev.pageX || ev.pageY){
		return {x:ev.pageX, y:ev.pageY};
	}
	return {
		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
		y:ev.clientY + document.body.scrollTop  - document.body.clientTop
	};
}

function writeHistory(object, message){
	if(!object || !object.parentNode || !object.parentNode.getAttribute) return;
	var historyDiv = object.parentNode.getAttribute('history');
	if(historyDiv){
		historyDiv = document.getElementById(historyDiv);
		historyDiv.appendChild(document.createTextNode(object.id+': '+message));
		historyDiv.appendChild(document.createElement('BR'));

		historyDiv.scrollTop += 50;
	}
}

function getMouseOffset(target, ev){
	ev = ev || window.event;

	var docPos    = getPosition(target);
	var mousePos  = mouseCoords(ev);
	return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}

function mouseMove(ev){
	ev         = ev || window.event;

	/*
	We are setting target to whatever item the mouse is currently on

	Firefox uses event.target here, MSIE uses event.srcElement
	*/
	var target   = ev.target || ev.srcElement;
	var mousePos = mouseCoords(ev);

	if(Demos[0] || Demos[4]){
		// mouseOut event - fires if the item the mouse is on has changed
		if(lastTarget && (target!==lastTarget)){
			writeHistory(lastTarget, 'Mouse Out Fired');

			// reset the classname for the target element
			var origClass = lastTarget.getAttribute('origClass');
			if(origClass) lastTarget.className = origClass;
		}

		/*
		dragObj is the grouping our item is in (set from the createDragContainer function).
		if the item is not in a grouping we ignore it since it can't be dragged with this
		script.
		*/
		var dragObj = target.getAttribute('DragObj');

		 // if the mouse was moved over an element that is draggable
		if(dragObj!=null){

			// mouseOver event - Change the item's class if necessary
			if(target!=lastTarget){
				writeHistory(target, 'Mouse Over Fired');

				var oClass = target.getAttribute('overClass');
				if(oClass){
					target.setAttribute('origClass', target.className);
					target.className = oClass;
				}
			}

			// if the user is just starting to drag the element
			if(iMouseDown && !lMouseState){
				writeHistory(target, 'Start Dragging');

				// mouseDown target
				curTarget     = target;

				// Record the mouse x and y offset for the element
				rootParent    = curTarget.parentNode;
				rootSibling   = curTarget.nextSibling;

				mouseOffset   = getMouseOffset(target, ev);

				// We remove anything that is in our dragHelper DIV so we can put a new item in it.
				for(var i=0; i<dragHelper.childNodes.length; i++) dragHelper.removeChild(dragHelper.childNodes[i]);

				// Make a copy of the current item and put it in our drag helper.
				dragHelper.appendChild(curTarget.cloneNode(true));
				dragHelper.style.display = 'block';

				// set the class on our helper DIV if necessary
				var dragClass = curTarget.getAttribute('dragClass');
				if(dragClass){
					dragHelper.firstChild.className = dragClass;
				}

				// disable dragging from our helper DIV (it's already being dragged)
				dragHelper.firstChild.removeAttribute('DragObj');

				/*
				Record the current position of all drag/drop targets related
				to the element.  We do this here so that we do not have to do
				it on the general mouse move event which fires when the mouse
				moves even 1 pixel.  If we don't do this here the script
				would run much slower.
				*/
				var dragConts = DragDrops[dragObj];

				/*
				first record the width/height of our drag item.  Then hide it since
				it is going to (potentially) be moved out of its parent.
				*/
				curTarget.setAttribute('startWidth',  parseInt(curTarget.offsetWidth));
				curTarget.setAttribute('startHeight', parseInt(curTarget.offsetHeight));
				curTarget.style.display  = 'none';

				// loop through each possible drop container
				for(var i=0; i<dragConts.length; i++){
					with(dragConts[i]){
						var pos = getPosition(dragConts[i]);

						/*
						save the width, height and position of each container.

						Even though we are saving the width and height of each
						container back to the container this is much faster because
						we are saving the number and do not have to run through
						any calculations again.  Also, offsetHeight and offsetWidth
						are both fairly slow.  You would never normally notice any
						performance hit from these two functions but our code is
						going to be running hundreds of times each second so every
						little bit helps!

						Note that the biggest performance gain here, by far, comes
						from not having to run through the getPosition function
						hundreds of times.
						*/
						setAttribute('startWidth',  parseInt(offsetWidth));
						setAttribute('startHeight', parseInt(offsetHeight));
						setAttribute('startLeft',   pos.x);
						setAttribute('startTop',    pos.y);
					}

					// loop through each child element of each container
					for(var j=0; j<dragConts[i].childNodes.length; j++){
						with(dragConts[i].childNodes[j]){
							if((nodeName=='#text') || (dragConts[i].childNodes[j]==curTarget)) continue;

							var pos = getPosition(dragConts[i].childNodes[j]);

							// save the width, height and position of each element
							setAttribute('startWidth',  parseInt(offsetWidth));
							setAttribute('startHeight', parseInt(offsetHeight));
							setAttribute('startLeft',   pos.x);
							setAttribute('startTop',    pos.y);
						}
					}
				}
			}
		}

		// If we get in here we are dragging something
		if(curTarget){
			// move our helper div to wherever the mouse is (adjusted by mouseOffset)
			dragHelper.style.top  = mousePos.y - mouseOffset.y;
			dragHelper.style.left = mousePos.x - mouseOffset.x;

			var dragConts  = DragDrops[curTarget.getAttribute('DragObj')];
			var activeCont = null;

			var xPos = mousePos.x - mouseOffset.x + (parseInt(curTarget.getAttribute('startWidth')) /2);
			var yPos = mousePos.y - mouseOffset.y + (parseInt(curTarget.getAttribute('startHeight'))/2);

			// check each drop container to see if our target object is "inside" the container
			for(var i=0; i<dragConts.length; i++){
				with(dragConts[i]){
					if((parseInt(getAttribute('startLeft'))                                           < xPos) &&
						(parseInt(getAttribute('startTop'))                                            < yPos) &&
						((parseInt(getAttribute('startLeft')) + parseInt(getAttribute('startWidth')))  > xPos) &&
						((parseInt(getAttribute('startTop'))  + parseInt(getAttribute('startHeight'))) > yPos)){

							/*
							our target is inside of our container so save the container into
							the activeCont variable and then exit the loop since we no longer
							need to check the rest of the containers
							*/
							activeCont = dragConts[i];

							// exit the for loop
							break;
					}
				}
			}

			// Our target object is in one of our containers.  Check to see where our div belongs
			if(activeCont){
				if(activeCont!=curTarget.parentNode){
					writeHistory(curTarget, 'Moved into '+activeCont.id);
				}

				// beforeNode will hold the first node AFTER where our div belongs
				var beforeNode = null;

				// loop through each child node (skipping text nodes).
				for(var i=activeCont.childNodes.length-1; i>=0; i--){
					with(activeCont.childNodes[i]){
						if(nodeName=='#text') continue;

						// if the current item is "After" the item being dragged
						if(curTarget != activeCont.childNodes[i]                                                  &&
							((parseInt(getAttribute('startLeft')) + parseInt(getAttribute('startWidth')))  > xPos) &&
							((parseInt(getAttribute('startTop'))  + parseInt(getAttribute('startHeight'))) > yPos)){
								beforeNode = activeCont.childNodes[i];
						}
					}
				}

				// the item being dragged belongs before another item
				if(beforeNode){
					if(beforeNode!=curTarget.nextSibling){
						writeHistory(curTarget, 'Inserted Before '+beforeNode.id);

						activeCont.insertBefore(curTarget, beforeNode);
					}

				// the item being dragged belongs at the end of the current container
				} else {
					if((curTarget.nextSibling) || (curTarget.parentNode!=activeCont)){
						writeHistory(curTarget, 'Inserted at end of '+activeCont.id);

						activeCont.appendChild(curTarget);
					}
				}

				// the timeout is here because the container doesn't "immediately" resize
				setTimeout(function(){
				var contPos = getPosition(activeCont);
				activeCont.setAttribute('startWidth',  parseInt(activeCont.offsetWidth));
				activeCont.setAttribute('startHeight', parseInt(activeCont.offsetHeight));
				activeCont.setAttribute('startLeft',   contPos.x);
				activeCont.setAttribute('startTop',    contPos.y);}, 5);

				// make our drag item visible
				if(curTarget.style.display!=''){
					writeHistory(curTarget, 'Made Visible');
					curTarget.style.display    = '';
					curTarget.style.visibility = 'hidden';
				}
			} else {

				// our drag item is not in a container, so hide it.
				if(curTarget.style.display!='none'){
					writeHistory(curTarget, 'Hidden');
					curTarget.style.display  = 'none';
				}
			}
		}

		// track the current mouse state so we can compare against it next time
		lMouseState = iMouseDown;

		// mouseMove target
		lastTarget  = target;
	}
	if(Demos[2]){
		document.getElementById('MouseXPosition').value = mousePos.x;
		document.getElementById('MouseYPosition').value = mousePos.y;
	}

	if(dragObject){
		dragObject.style.position = 'absolute';
		dragObject.style.top      = mousePos.y - mouseOffset.y;
		dragObject.style.left     = mousePos.x - mouseOffset.x;      
    	dragObject.alt  =dragObject.style.pixelLeft + ", " + dragObject.style.pixelTop + ": " + dragObject.style.zIndex; //toto jsem si pridal pro explorer   curTarget		
    	//dragObject.title=dragObject.style.left + ", " + dragObject.style.top + ": " + dragObject.style.zIndex; //toto jsem si pridal pro Firefox 2.0 (pixelLeft a pixelTop zde neni)
    	dragObject.title=eval(mousePos.x - mouseOffset.x) + ", " + eval(mousePos.y - mouseOffset.y) + ": " + dragObject.style.zIndex; //toto jsem si pridal pro Firefox
	}

	// track the current mouse state so we can compare against it next time
	lMouseState = iMouseDown;

	// this prevents items on the page from being highlighted while dragging
	if(curTarget || dragObject) return false;
}

function mouseUp(ev){
	if(Demos[0] || Demos[4]){
		if(curTarget){
			writeHistory(curTarget, 'Mouse Up Fired');

			dragHelper.style.display = 'none';
			if(curTarget.style.display == 'none'){
				if(rootSibling){
					rootParent.insertBefore(curTarget, rootSibling);
				} else {
					rootParent.appendChild(curTarget);
				}
			}
			curTarget.style.display    = '';
			curTarget.style.visibility = 'visible';
		}
		curTarget  = null;
	}
	if(Demos[6] && dragObject){
		ev           = ev || window.event;
		var mousePos = mouseCoords(ev);

		var dT = dragObject.getAttribute('droptarget');
		if(dT){
			var targObj = document.getElementById(dT);
			var objPos  = getPosition(targObj);
			if((mousePos.x > objPos.x) && (mousePos.y > objPos.y) && (mousePos.x<(objPos.x+parseInt(targObj.offsetWidth))) && (mousePos.y<(objPos.y+parseInt(targObj.offsetHeight)))){
				var nSrc = targObj.getAttribute('newSrc');
				if(nSrc){
					dragObject.src = nSrc;
					setTimeout(function(){
						if(!dragObject || !dragObject.parentNode) return;
						dragObject.parentNode.removeChild(dragObject);
						dragObject = null;
					}, parseInt(targObj.getAttribute('timeout')));
				} else {
					dragObject.parentNode.removeChild(dragObject);
				}
			}
		}
	}
	
	dragObject = null;
    
	iMouseDown = false;
}

function mouseDown(ev){
	ev         = ev || window.event;
	var target = ev.target || ev.srcElement;

	iMouseDown = true;
	if(Demos[0] || Demos[4]){
		if(lastTarget){
			writeHistory(lastTarget, 'Mouse Down Fired');
		}
	}
	if(target.onmousedown || target.getAttribute('DragObj')){
		return false;
	}
}

function chzindex(ClickedItem){ //pridano kvuli moznosti meni DblClickem Z-Index :)
//return 5; //provadeni funkce umozni menit z-index obrazku
if (!ClickedItem.style.zIndex) {ClickedItem.style.zIndex=0}
if (eval(ClickedItem.style.zIndex)>3) {ClickedItem.style.zIndex=0;} //eval pridano kvuli Firefox :)
else {ClickedItem.style.zIndex=eval(ClickedItem.style.zIndex)+1;}
//ClickedItem.alt=ClickedItem.style.pixelLeft + ", " + ClickedItem.style.pixelTop + ": " + ClickedItem.style.zIndex;
ClickedItem.title=ClickedItem.style.left + ", " + ClickedItem.style.top + ": " + ClickedItem.style.zIndex;
}


function makeDraggable(item){
	//return;
	if(!item) return;
	item.onmousedown = function(ev){
		dragObject  = this;
		mouseOffset = getMouseOffset(this, ev);
		return false;
	}
	item.ondblclick = function(ev){
   		chzindex(item);
		return false;
	}
	//emod = (e) ? (e.eventPhase) ? "W3C" : "NN4" : (window.event) ? "IE4+" : "unknown";
    //if (emod == "NN4") { item.captureEvents(Event.KEYDOWN); }
    //item.onkeydown = onKeyDownH;
}

function makeClickable(item){
	if(!item) return;
	item.onmousedown = function(ev){
		document.getElementById('ClickImage').value = this.name;
	}
}

function addDropTarget(item, target){
	item.setAttribute('droptarget', target);
}

document.onmousemove = mouseMove;
document.onmousedown = mouseDown;
document.onmouseup   = mouseUp;

//------------------------------------------------------------------------------------------------------------

var obrazky_top=69;   obrazky_left=840; obrazky_n=1;
function obrazky_add(adrm, adr) {
//  document.write('<a href="'+adr+'" target="_blank">\n');
  document.write('<a href="'+adr+'" target="_self">\n');
  document.write('<img src="'+adrm+'" alt="" name="" id="f03" width="55" height="41" border="0" style="position:absolute; left:'+obrazky_left+'px; top:'+obrazky_top+'px; filter: Alpha(Opacity=75); opacity:0.75;" onMouseOver="roztahniobrazek(this,4,\''+adr+'\',2);" onMouseOut="smrstiobrazek(this);">\n');
  document.write('</a>');
  obrazky_left=obrazky_left-60;
  obrazky_n=obrazky_n+1;
}


var roztahniobrazekw=0; var roztahniobrazekh=0; var roztahniobrazekt=0; var roztahniobrazekl=0; var roztahniobrazeksrc='';
function roztahniobrazek(obrazek,k,zdroj,jak) {
  window.document.roztahniobrazekw=obrazek.width;
  window.document.roztahniobrazekh=obrazek.height;
  window.document.roztahniobrazekt=obrazek.style.top;
  window.document.roztahniobrazekl=obrazek.style.left;
  window.document.roztahniobrazeksrc=obrazek.style.src;
  var dy=parseInt(obrazek.height)*k;  var dyt=dy/2;  var dx=parseInt(obrazek.width)*k;  var dxl=dx/2; 
  if (jak==1) { dyt=0; dxl=0; } //neposunout nahoru a doleva, protoze je to skript pro stránku 
  if (jak==2) { dyt=-10; dxl=100; } //posunout dolu o neco  a doleva
  obrazek.style.top=Math.floor(parseInt(obrazek.style.top)-dyt)+'px'; //!! pozor, lze pouzit na obrazek, ktery ma definovano stylem left a top, jinak tyto dv hodnoty nejsou k dispozici
  obrazek.style.left=Math.floor(parseInt(obrazek.style.left)-dxl)+'px'; 
  obrazek.height+=Math.floor(dy);
  obrazek.width+=Math.floor(dx);
  if (zdroj!="") { obrazek.src=zdroj; }
  obrazek.style.zIndex=3;  
  try{    obrazek.style.filter = 'alpha(opacity=100)';  }catch(e){  }
  try{    obrazek.style.opacity=1;  }catch(e){  }
}
function smrstiobrazek(obrazek) {		
  obrazek.width=window.document.roztahniobrazekw;
  obrazek.height=window.document.roztahniobrazekh;
  obrazek.style.top=window.document.roztahniobrazekt;
  obrazek.style.left=window.document.roztahniobrazekl;
  obrazek.style.src=window.document.roztahniobrazeksrc;
  obrazek.style.zIndex=1;
  try{    obrazek.style.filter = 'alpha(opacity=75)';  }catch(e){  }
  try{    obrazek.style.opacity="0.75";  }catch(e){  }
}

var menul=80; menut=100;
function tiskmenu (pol,title,href) {
	//document.write('<div class="transOFF" style="position:absolute; left:'+eval(menul)+'px; top:'+eval(menut)+'px;" onMouseOver="this.className=\'transON\'" onMouseOut="this.className=\'transOFF\'">');
	//document.write('<div class="trans75" onMouseOver="this.className=\'trans50\' onMouseOut="this.className=\'trans75\'">');
	//document.write('<img src="img/tlacitko.gif" alt="" width="300" height="42" border="0" style="Position:absolute; left:'+eval(menul+10)+'px; top:'+eval(menut+5)+'px;">');
	document.write('<img src="img/tlacitko.jpg" alt="" width="200" height="32" border="0" style="Position:absolute; left:'+eval(menul+10)+'px; top:'+eval(menut+5)+'px;  filter: Alpha(Opacity=40); opacity:0.4; -moz-opacity: 0.4">');
	document.write('<a href="'+href+'" class="nabidka" style="Position:absolute; left:'+eval(menul+20)+'px; top:'+eval(menut+11)+'px; " title="'+title+'" >'+pol+'</a>');
	//document.write('</div>');
	menut=menut+40;
}

function languagesadd(href,pol) { //0cerveny,    >0bily
	var s=window.document.getElementById("divlang").innerHTML+'&nbsp; ';
	//s=s+'<img src="web_obrazky/sipka-horniodkaz-cervena.gif" alt="" width="9" height="8" border="0">';
	s=s+'<a href="'+href+'">';
	s=s+pol+'</a>';
	window.document.getElementById("divlang").innerHTML=s;
}


/*
//if (navigator.appName == "Microsoft Internet Explorer") {  //defaultne nadefinujeme pro explorer

var platnol=0; var platnot=0; //pozice plachty
var platnow=900; var platnoh=500;
var logol=platnol+105; var logot=platnot+23; //pozice loga
var menul=platnol+0; var menut=platnot+77; //pozice menu
var horniodkazyl=platnol+530; var horniodkazyt=platnot+60; //pozice menu

var menuw=+1+20+1+170+1; //sirka menu

//var fotkal=213; var fotkat=77; //doporucene umisteni, pokud je 1 fotka na strance //na hlavni strance
//var logotuvl=72; var logotuvt=524;
//document.write('<img src="web_obrazky/vystrazne-znacky-hlavni.gif" alt="" width="222" height="33" border="0" style="position:absolute; left:'+eval(vystrazne_sedel)+'px; top:'+eval(vystrazne_sedet)+'px;" onMouseDown="Move(this);" onMouseUp="MoveEnd(this);">');

if ((menuid<=0)||(menuid==1)) {  //pokud je vybrano domu
var cervenypruhl=menuw;
var cervenypruht=menut;
var cervenypruhw=1000-192;
var cervenypruhh=190;
} else {
var cervenypruhl=menuw;
var cervenypruht=0;
var cervenypruhw=1000-192;
var cervenypruhh=77;
}

var bilepruhyl=1000-228+1;
var bilepruhyt=0;

var menulinkal=192; menulinkat=77; //jednobodova seda linka horizontalni vpravo vedle menu polozek
var menu_spodnit=612; //spodni okraj designu stranky
if (window.menuspodek!=undefined) { 
menu_spodnit=menuspodek; 
}


if (navigator.appName == "Netscape") {
//var cervenypruhhlavniw=1000-192; //napr. pokud je potreba pro jiny prohlizec dat jine pozice /netscape / opera
}
if (navigator.appName == "Opera") {
//var cervenypruhhlavniw=1000-192; //napr. pokud je potreba pro jiny prohlizec dat jine pozice /netscape / opera
}

document.write('<img src="domu/w.jpg" alt="" name="podklad" id="podklad" width="1158" height="748" border="0" style="position:absolute; left:0px; top:0px;">');
document.getElementById('podklad').style.left=platnol;
document.getElementById('podklad').style.top=platnot;
document.getElementById('podklad').style.width=platnow;
document.getElementById('podklad').style.height=platnoh;

document.write('<img src="domu/logo.gif" alt="" name="logo" id="logo" width="400" height="50" border="0" style="position:absolute; left:'+logol+'px; top:'+logot+'px; z-index:1;">');
makeDraggable(document.getElementById('logo'));


document.write('<div class="horniodkazy_cervene" id="divhorniodkazy">');
document.write('</div>');
makeDraggable(document.getElementById('divhorniodkazy'));
document.getElementById('divhorniodkazy').style.left=horniodkazyl;
document.getElementById('divhorniodkazy').style.top=horniodkazyt;
function vlozhorniodkaz(pol,href) { //0cerveny,    >0bily
var s=window.document.getElementById("divhorniodkazy").innerHTML+'&nbsp; &nbsp; ';
//s=s+'<img src="web_obrazky/sipka-horniodkaz-cervena.gif" alt="" width="9" height="8" border="0">';
s=s+'<a href="'+href+'" class="horniodkazy_cervene">';
s=s+pol+'</a>';
window.document.getElementById("divhorniodkazy").innerHTML=s;
}
vlozhorniodkaz('Kontakt','kontakt.html');
vlozhorniodkaz('O firmě','ofirme.html');
vlozhorniodkaz('Partnerské CK','partnerskeck.html');

var menu_t=menut;
var menu_pomid=1; var menu_pomsubid=1;

function menu_tisk(pol,href){
	if (href=='') {href='domu.php'} 
	//filter: Alpha(Opacity=50); je pro MSIE
	//opacity:0.5; 	je pro FireFox a Operu
	document.write('<img src="domu/menu190x22l.gif" alt="" width="190" height="22" border="0" style="position:absolute; left:'+eval(menul)+'px; top:'+eval(menu_t)+'px; filter: Alpha(Opacity=40); opacity:0.4; ">');
	//if (menuid==menu_pomid) {
	//document.title='projektypo.cz-'+pol;
	if (menuid==menu_pomid) {
		if (submenuid==0) { //zajisti sedou sipku
			document.write('<img src="domu/sipka14x16z.gif" alt="" width="14" height="16" border="0" style="position:absolute; left:'+eval(menul+3)+'px; top:'+eval(menu_t+3)+'px;">');
		} else {
			document.write('<img src="domu/sipka14x16z.gif" alt="" width="14" height="16" border="0" style="position:absolute; left:'+eval(menul+20)+'px; top:'+eval(menu_t+3)+'px;">');
		}
		document.write('<div class="menu" style="position:absolute; left:'+eval(menul+1+20+1+6)+'px; top:'+eval(menu_t+4)+'px;">');
		document.write(pol);
		document.write('</div>');
		//vlozohorniodkaz(submenuid,pol,href);
		//vlozhornipopis(menuid-1,pol,href);
	} else {
		//document.write('<img src="web_obrazky/menu_ctverec.gif" alt="" width="20" height="20" border="0" style="position:absolute; left:'+eval(menul+1)+'px; top:'+eval(menu_t+1)+'px;">');
		document.write('<a href="'+href+'" class="menu" style="position:absolute; left:'+eval(menul+1+20+1+6)+'px; top:'+eval(menu_t+4)+'px;">');
		document.write(pol);
		document.write('</a>');
	}
	menu_t=menu_t+21;
	menu_pomid=menu_pomid+1;
	menu_pomsubid=1; //resetuj cislovani pripadneho submenu
	document.write('<br>');
}

document.write('<div id="divmenuleft" style="position:absolute; width:190px;">');
menu_tisk('Letní nabídka','leto.html'); //menuid=1
menu_tisk('Zimní nabídka','zima.html'); //menuid=2 //vstup hend do prvniho submenu
document.write('</div>');
makeDraggable(document.getElementById('divmenuleft'));


*/
