
var getElementWithId;
if(document.getElementById){
	getElementWithId = function(id){
		return document.getElementById(id);
	}
}else if(document.all){
	getElementWithId = function(id){
		return document.all[id];
	}
}else{
	getElementWithId = function(id){
		return false;
	}
}


function getStyleObject(objectId) {
	return getElementWithId(objectId).style;
}


function changeObjectVisibility(objectId, newVisibility) {
	var styleObject = getStyleObject(objectId);
	if(styleObject) {
		if(newVisibility=='change'){
			var oldVisibility=styleObject.visibility;
			if(oldVisibility=='visible')newVisibility='hidden';
			else newVisibility='visible';
		}
		styleObject.visibility = newVisibility;
		return true;
	} else {
		return false;
	}
}


function changeObjectDisplay(objectId, newDisplay) {
	var styleObject = getStyleObject(objectId);
	if(styleObject) {
		if(newDisplay=='change'){
			var oldDisplay=styleObject.display;
			if(oldDisplay=='block')newDisplay='none';
			else newDisplay='block';
		}
		styleObject.display = newDisplay;
		return true;
	} else {
		return false;
	}
}


function vis_showObject(objectId) {
	changeObjectVisibility(objectId, 'visible')
}


function vis_hideObject(objectId) {
	changeObjectVisibility(objectId, 'hidden')
}

function vis_changeObject(objectId) {
	changeObjectVisibility(objectId, 'change')
}


function dis_showObject(objectId) {
	changeObjectDisplay(objectId, 'block')
}


function dis_hideObject(objectId) {
	changeObjectDisplay(objectId, 'none')
}


function dis_changeObject(objectId) {
	changeObjectDisplay(objectId, 'change')
}


function set_akce5a5(cislo) {
	document.forms['registrovat'].akce5a5.value = cislo;
	
}


function dis_showObject(objectId) {
	changeObjectDisplay(objectId, 'block')
}



function dis_hideObject(objectId) {
	changeObjectDisplay(objectId, 'none')
}



function dis_changeObject(objectId) {
	changeObjectDisplay(objectId, 'change')
}


var layer_hider_timeout=0;
var layer_hider_object="";
var layer_hider_timer=1;



function start_layer_hider(objekt){
	if(layer_hider_object==objekt){
		if(layer_hider_timeout)clearTimeout(layer_hider_timeout);
		layer_hider_timeout=setTimeout("finish_layer_hider('"+objekt+"')",layer_hider_timer);
	}
}


function stop_layer_hider(objekt){
	
	if(layer_hider_object!=objekt && layer_hider_object.length>0) {
		dis_hideObject(layer_hider_object);
	}
	if(layer_hider_timeout && layer_hider_object==objekt)clearTimeout(layer_hider_timeout);
	dis_showObject(objekt);
	layer_hider_object=objekt;
}


function click_layer_hider(objekt,container){
	
	dis_changeObject(objekt);
	if(layer_hider_timeout)clearTimeout(layer_hider_timeout);
	layer_hider_object=objekt;
}


function finish_layer_hider(objekt){
	dis_hideObject(objekt);
	if(layer_hider_timeout)clearTimeout(layer_hider_timeout);
}

function nahratObrazky(){
var d=document;if(d.images){if(!d.prel) d.prel=new Array();
var i,j=d.prel.length,args=nahratObrazky.arguments;for(i=0; i<args.length; i++) if (args[i].indexOf("#")!=0){
d.prel[j]=new Image;d.prel[j++].src=args[i];}}}


function update_html(objid,newtext) {
	var o = getElementWithId(objid);
	o.innerHTML = newtext;
}

function update_picture(objid,newsrc) {
	var o = getElementWithId(objid);
	if (newsrc) o.src = newsrc;
}


function ukoncitbanner() {
	var o = document.getElementById('overbanner');
	o.style.display = 'none';
}

function changeClass(objectId,classname) {
	var o = getElementWithId(objectId);
	if (classname) o.className = classname;
}


function getPageScrollY() {
    var global = this;
    var readScroll = {scrollLeft:NaN,scrollTop:NaN};
    var readScrollY = 'scrollTop';
    if(typeof global.pageXOffset == 'number'){
        readScroll = global;
        readScrollY = 'pageYOffset';
    }else{
        if((typeof document.compatMode == 'string')&&
           (document.compatMode.indexOf('CSS') >= 0)&&
           (document.documentElement)&&
           (typeof document.documentElement.scrollLeft=='number')){
            readScroll =  document.documentElement;
        }else if((document.body)&&
                 (typeof document.body.scrollLeft == 'number')){
            readScroll =  document.body;
        }
    }
    return readScroll[readScrollY];
};

function frposition(obj) {
	var o = document.getElementById(obj);
	var sc = getPageScrollY();
	sc += 50;
	var lf = document.body.clientWidth;
	lf = (lf - 800) /2;
	if (lf<10) lf = 10;
	o.style.top = sc+'px';
	o.style.left = lf+'px';
}


