function fav_add(url, title){
	if (document.all) {
		window.external.AddFavorite(url, title);
	} else if (window.sidebar) {
		window.sidebar.addPanel(title, url, "")
	}
}

function aktcas() {
  var hod, min, sec;
  var hodiny, minuty, sekundy;
  var datum;
  var vypiscas;
  vypiscas = document.getElementById("vypiscas");
  datum = new Date();
  hodiny = datum.getHours();
  minuty = datum.getMinutes();
  sekundy = datum.getSeconds();
  if (hodiny < 10) {
     hod = "0"+hodiny+":";
  } else {
     hod = hodiny+":";
  }
  if (minuty < 10) {
     min = "0"+minuty+":";
  } else {
     min = minuty+":";
  }
  if (sekundy < 10) {
     sec = "0"+sekundy+" ";
  } else {
     sec = sekundy+" ";
  }
  timeString = hod+min+sec;
  vypiscas.innerHTML = timeString;
  window.setTimeout("aktcas();", 100);
}



/* ------------ protoHover ------------- */
// a simple hover implementation for prototype.js
// Sasha Sklar and David Still

(function() {
	// copied from jquery
	var withinElement = function(evt, el) {
		// Check if mouse(over|out) are still within the same parent element
		var parent = evt.relatedTarget;

		// Traverse up the tree
		while (parent && parent != el) {
			try {
				parent = parent.parentNode;
			} catch (error) {
				parent = el;
			}
		}
		// Return true if we actually just moused on to a sub-element
		return parent == el;
	};

	// Extend event with mouseEnter and mouseLeave
	Object.extend(Event, {
		mouseEnter: function(element, f, options) {
			element = $(element);

			// curry the delay into f
			var fc = (options && options.enterDelay)?(function(){window.setTimeout(f, options.enterDelay);}):(f);

			if (Prototype.Browser.IE) {
				element.observe('mouseenter', fc);
			} else {
				element.hovered = false;

				element.observe('mouseover', function(evt) {
					// conditions to fire the mouseover
					// mouseover is simple, the only change to default behavior is we don't want hover fireing multiple times on one element
					if (!element.hovered) {
						// set hovered to true
						element.hovered = true;

						// fire the mouseover function
						fc(evt);
					}
				});
			}
		},
		mouseLeave: function(element, f, options) {
			element = $(element);

			// curry the delay into f
			var fc = (options && options.leaveDelay)?(function(){window.setTimeout(f, options.leaveDelay);}):(f);

			if (Prototype.Browser.IE) {
				element.observe('mouseleave', fc);
			} else {
				element.observe('mouseout', function(evt) {
					// get the element that fired the event
					// use the old syntax to maintain compatibility w/ prototype 1.5x
					var target = Event.element(evt);

					// conditions to fire the mouseout
					// if we leave the element we're observing
					if (!withinElement(evt, element)) {
						// fire the mouseover function
						fc(evt);

						// set hovered to false
						element.hovered = false;
					}
				});
			}
		}
	});


	// add method to Prototype extended element
	Element.addMethods({
		'hover': function(element, mouseEnterFunc, mouseLeaveFunc, options) {
			options = Object.extend({}, options) || {};
			Event.mouseEnter(element, mouseEnterFunc, options);
			Event.mouseLeave(element, mouseLeaveFunc, options);
		}
	});
})();

// var dimensionsObject = getWindowDimensions();
// alert('Height: ' + dimensionsObject.Height + ' Width: ' + dimensionsObject.Width);
function getWindowDimensions()
	{
	var heightValue = 0;
	widthValue = 0;

	if ( window.innerHeight )
	{
	heightValue = window.innerHeight;
	widthValue = window.innerWidth;
	}
	else if ( (document.documentElement) && (document.documentElement.clientHeight) )
	{
	heightValue = document.documentElement.clientHeight;
	widthValue = document.documentElement.clientWidth;
	}
	else if ( (document.body) && (document.body.clientHeight) )
	{
	heightValue = document.body.clientHeight;
	widthValue = document.body.clientWidth;
	}

	return { Height: parseInt(heightValue, 10), Width: parseInt(widthValue, 10) };
}
// -->

function resize_iframe()
{

	var height = getWindowDimensions().Height;
	//alert(height.Height);

	//resize the iframe according to the size of the
	//window (all these should be on the same line)
	document.getElementById("body_iframe").style.height=parseInt(height-document.getElementById("body_iframe").offsetTop-10)+"px";
}

// this will resize the iframe every
// time you change the size of the window.
window.onresize=resize_iframe;