		function otevriCenik(url) {
			mywindow = window.open (url,"cenik","location=0,status=0,scrollbars=1,width=750,height=700");
  			mywindow.moveTo(100,100);
		}

		function otevriObjednavku(url) {
			mywindow = window.open (url,"objednat","location=0,status=0,scrollbars=1,width=750,height=700");
  			mywindow.moveTo(100,100);
		}
		

		function otevriSkimapu(url) {
			mywindow = window.open (url,"skimapa","location=0,status=0,scrollbars=1,width=650,height=490");
  			mywindow.moveTo(100,100);
		}

default_toggle_hidden = true;
function toggle(showHideDiv, switchTextDiv) {

	var ele = getElement(showHideDiv);
	if (switchTextDiv != undefined )	var text = getElement(switchTextDiv);
	/*if(ele.style.display == "block") {
    		ele.style.display = "none";
		if (text != undefined ) text.innerHTML = "show";
  	}
	else {
		ele.style.display = "block";
		if (text != undefined ) text.innerHTML = "hide";
	}*/
	
	if (ele.hidden == undefined) ele.hidden = default_toggle_hidden;
	if (ele.hidden == false)
	{
		//ele.display = 'none';
		ele.style.position = 'absolute';
		ele.style.top     = '-99999px';
		ele.hidden = true;
	}
	else
	{
		//ele.display = 'block';
		ele.style.position = 'relative';
		ele.style.top     = '0px';
		ele.hidden = false;
	}
} 
function getElement(e,f){
	if(document.layers){
		f=(f)?f:self;
		if(f.document.layers[e]) {
			return f.document.layers[e];
		}
		for(W=0;i<f.document.layers.length;W++) {
			return(getElement(e,fdocument.layers[W]));
		}
	}
	if(document.all) {
		return document.all[e];
	}
	return document.getElementById(e);
}

function insertAfter(parent, node, referenceNode) {
	parent.insertBefore(node, referenceNode.nextSibling);
}

function autofitIframe(id){
	if (!window.opera && !document.mimeType && document.all && document.getElementById){
		parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px";
	}
	else if(document.getElementById) {
		parent.document.getElementById(id).style.height=this.document.body.scrollHeight+"px"
	}
 } 


// function iFrameHeight(elem) {
// 
// // 	h = getElement(id).contentDocument.body.scrollHeight;
// // 	getElement(id).style.height = h + 100;
// 
//  	h = 100;
// 	if (elem.contentDocument.body.scrollHeight)
// 	{
// 		h = elem.contentDocument.body.scrollHeight;
// 	}
// 	else if (elem.contentDocument.offsetHeight)
// 	{
// 		h = elem.contentDocument.offsetHeight;
// 	}
//  	elem.style.height = h + 100 + "px";
// 
// 	/*if(document.getElementById && !(document.all)) {
// 	
// 		h = document.getElementById('main').contentDocument.body.scrollHeight;
// 	
// 		document.getElementById('main').style.height = h + 100;
// 	
// 	}
// 	
// 	else if(document.all) {
// 	
// 		h = document.frames('main').document.body.scrollHeight;
// 	
// 		document.all.main.style.height = h + 100;
// 	
// 	}*/
// 
// }

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["zajezdy"];

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 3 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
	var dyniframe=new Array()
	
	for (i=0; i<iframeids.length; i++){
		var iframeid = iframeids[i];
	//	if (document.getElementById)
			resizeIframe(iframeid)
		//reveal iframe for lower end browsers? (see var above):
		if ((document.all || document.getElementById) && iframehide=="no"){
			var tempobj=document.all? document.all[iframeid] : document.getElementById(iframeid)
			tempobj.style.display="block"
		}
	} 
}

function resizeIframe(frameid){
	var currentfr=getElement(frameid);
	if (currentfr && !window.opera){
		currentfr.style.display="block"
		if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
			currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
		else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
			currentfr.height = currentfr.Document.body.scrollHeight;
		if (currentfr.addEventListener)
			currentfr.addEventListener("load", readjustIframe, false)
		else if (currentfr.attachEvent){
			currentfr.detachEvent("onload", readjustIframe) // Bug fix line
			currentfr.attachEvent("onload", readjustIframe)
		}
	}
}

function readjustIframe(loadevt) {
	var crossevt=(window.event)? event : loadevt
	var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
	if (iframeroot)
		resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

// function resizeIframe(iframeID) {
// 	if(self==parent) return false; /* Checks that page is in iframe. */
// 	else if(document.getElementById&&document.all) /* Sniffs for IE5+.*/
// 	
// 	var FramePageHeight = framePage.scrollHeight + 10; /* framePage
// 	is the ID of the framed page's BODY tag. The added 10 pixels prevent an
// 	unnecessary scrollbar. */
// 	parent.document.getElementById(iframeID).style.height=FramePageHeight;
// 	/* "iframeID" is the ID of the inline frame in the parent page. */
// } 

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

function setIframeHeight(iframeName) {
		  //var iframeWin = window.frames[iframeName];
		  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
		  if (iframeEl) {
		  iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
		  //var docHt = getDocHeight(iframeWin.document);
		  // need to add to height to be sure it will all show
		  var h = alertSize();
		  var new_h = (h+450);
		  iframeEl.style.height = new_h + "px";
		  }
		}

		function alertSize() {
		  var myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myHeight = document.body.clientHeight;
		  }
		  //window.alert( 'Height = ' + myHeight );
		  return myHeight;
		}


