// check browser
function checkBrowser() {
  	//if(navigator.appName == 'Netscape') this.b = 'ns';	else this.b = 'ie'
		this.b = 'ie'
  	this.v = parseInt(navigator.appVersion)
  	this.ns = (this.b == 'ns' && this.v >= 4)
  	this.ns4 = (this.b == 'ns' && this.v == 4)
  	this.ns5 = (this.b == 'ns' && this.v == 5)
  	this.ie = (this.b == 'ie' && this.v >= 4)
  	this.ie4 = (navigator.userAgent.indexOf('MSIE 4') > 0)
  	this.ie5 = (navigator.userAgent.indexOf('MSIE 5') > 0)
  	return this
}
is=new checkBrowser()  

// datum
var dnes = new Date();
var den = dnes.getDate();
var mes = dnes.getMonth();
var rok = dnes.getFullYear();
datum = den + '.' + mes + '.' + rok;

// preload images
function preload(imgObj,imgSrc) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
}
        
// change images
function changeImage(nest,layer,imgName,imgObj) {
    if (nest!='') nest = 'document.'+nest+'.'
    if (layer!='') layer = 'document.'+layer+'.' 
		if (document.layers) eval(nest+layer+'document.images["'+imgName+'"].src = '+imgObj+'.src')
		else document.images[imgName].src = eval(imgObj+".src")
}

function imgOn(imgName) {
    document[imgName].src = eval(imgName + "On.src");
}
function imgOff(imgName) {
    document[imgName].src = eval(imgName + "Off.src");
}

// change HTML kod
function changeHTML(id,msg,nest) {
    if(is.ns) {
        nest=(!nest)? '' : 'document.'+nest+'.';
        objMsg = eval(nest + 'document' + '[id]' + '.document');
        objMsg.open();
        objMsg.write(msg);
        objMsg.close(); 
    } 
    else  if(is.ie) {
        objMsg = eval('document.all' + '[id]');
        objMsg.innerHTML = msg;
    }
}

// change pages (in frames)
function changeThree(firstURL,secondURL)  {
    parent.navigace.location.href=firstURL
    parent.main.location.href=secondURL
    }   

// open new window
function openWindow(name,w,h,l,t,scroll) { 
    window.open("",name,'toolbar=0,location=0,scrollbars=' + scroll + ',resizable=1,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t); 
}

