// main HK
function setCookie(name, value, expire) {
		   document.cookie = name + "=" + escape(value)  + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}

function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) 
		 end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
     } 
  }
} 

var doc_toky = null;
var doc_pruvodce = null;
var doc_hp = null;

// rollover object
function rollOver ( path, name, first, last )	{
	// properties
	this.path = path;
	this.name = name;
	this.extension = "gif";
	this.first = first;
	this.last = last;
	this.active = first-1;
	// methods
	this.preloadImages = preloadImages;
	this.preload = preload;
	this.roll = roll;
	this.set = set;
	this.dis = dis;
}
// rollover public method
function preloadImages( ext ) {
	var nameOver = (null!=ext)?'_'+ext:'';
	for (num=this.first; num<=this.last; num++) {
		this.preload( this.name + '_' + num + nameOver );
	}
}
function preload(imgSrc) {
	if (document.images) {
		eval(imgSrc+' = new Image()');
		eval(imgSrc+'.src = "' +this.path + '/' + imgSrc + '.' + this.extension + '"');
	}
}
// rollover public method - set active item
function set (num,over,pic) {
	this.prev = this.active;
	this.active = num+1;
	this.roll(num,over,pic);
	this.active = num;
	if (this.prev != 0) 
		this.roll(this.prev);
}
// rollover public method - disable item
function dis (num,over,pic) {
	this.active = num;
}
// rollover public method - roll item
function roll(num,over,pic) {
	pic = (null != pic)?pic:num;
	over = (null != over)?over:'';
	if (num == this.active)	{
		return false;
	}
	if (document.images) {
		var imgObj;
		if (over != '') {
			imgObj = this.name + '_' + num + '_' + over;
		}
		else {
			imgObj = this.name + '_' + num;
		}
		var imgName = this.name + '_' + pic;
		document.images[imgName].src = eval(imgObj+".src");
	}
}
// window status function
function ws(txt) {
	window.status = txt;
	return true;
}
function openWin ( path, w, h, alt ) {
	 var sc_w = screen.width;
	 var sc_h = screen.height;
	 if (sc_w <= (parseInt(w) + 50)) { width = parseInt(sc_w) - 100;}
	 else { width = parseInt(w) +36;}
	 if (sc_h <= (parseInt(h) + 200)) { height = parseInt(sc_h)- 200;}
	 else { height = parseInt(h) + 30;}
		new_win=window.open('','nove'+width+height,'scrollbars=yes,resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width) );
		new_win.focus();
		new_win.document.writeln('<html>');
		new_win.document.writeln('<head>');
		new_win.document.writeln('<title>' + alt + '</title>');
		new_win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');
		new_win.document.writeln('</head>');
		new_win.document.writeln('<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">');
		new_win.document.writeln('<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="center"><img src="' + path + '" width="' + w + '" height="' + h + '" border="0" alt="' + alt + '" vspace="10"></td></tr></table>');
		new_win.document.writeln('</body></html>');
	}
function openHardWin( path, w, h, alt, okraj ) {
		if ( !okraj ) { n = 30; }
		else { n = 0;}
		width = parseInt(w)+ parseInt(n);
		height = parseInt(h)+ parseInt(n);
		pic_win=window.open('','pic'+width+height,'scrollbars=no,resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width) );
		pic_win.focus();
		pic_win.document.writeln('<html>');
		pic_win.document.writeln('<head>');
		pic_win.document.writeln('<title>' + alt + '</title>');
		pic_win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');
		pic_win.document.writeln('</head>');
		pic_win.document.writeln('<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">');
		pic_win.document.writeln('<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="center"><img src="' + path + '" width="' + w + '" height="' + h + '" border="0" alt="' + alt + '"></td></tr></table>');
		pic_win.document.writeln('</body><br></html>');
	}
function openHardDoc ( path, w, h, alt, tool ) {
	if ( tool != "yes") {tool = "no";}
	var dat = new Date();
	doc_win=window.open('','nove'+dat.getSeconds(),'toolbar='+tool+',scrollbars=yes,resizable=yes,resize=no,width='+w+',height='+h+',screenX='+getCenterW(w)+',screenY='+getCenterH(h)+',top='+getCenterH(h)+',left='+getCenterW(w) );
	doc_win.focus();
	doc_win.document.location = path;
	}
function openToky ( path, w, h ) {
	if (( doc_toky == null) || (doc_toky.closed)){
		doc_toky=window.open('','toky','toolbar=yes,scrollbars=yes,resizable=yes,resize=no,width='+w+',height='+h+',screenX='+getCenterW(w)+',screenY='+getCenterH(h)+',top='+getCenterH(h)+',left='+getCenterW(w) );
		doc_toky.focus();
		doc_toky.document.location = path;
	} else {
		doc_toky.focus();
		doc_toky.window.location.href = path;
	}
}
function openHp ( path, w, h ) {
	if (( doc_hp == null) || (doc_hp.closed)){
		doc_hp=window.open('','hp','toolbar=yes,scrollbars=yes,resizable=yes,resize=no,width='+w+',height='+h+',screenX='+getCenterW(w)+',screenY='+getCenterH(h)+',top='+getCenterH(h)+',left='+getCenterW(w) );
		doc_hp.focus();
		doc_hp.document.location = path;
	} else {
		doc_hp.focus();
		doc_hp.window.location.href = path;
	}
}
function openPruvodce ( path, w, h ) {
		doc_pruvodce=window.open('','toky','toolbar=yes,scrollbars=yes,resizable=yes,resize=no,width='+w+',height='+h+',screenX='+getCenterW(w)+',screenY='+getCenterH(h)+',top='+getCenterH(h)+',left='+getCenterW(w) );
		doc_pruvodce.focus();
		doc_pruvodce.document.location = path;
}					
function getCenterW(width) {
	return parseInt( eval( (screen.width-parseInt(width))/2 ) );
}
function getCenterH(height) {
	return parseInt( eval( (screen.height-parseInt(height))/2 ) );
}
function wr_row(cislo,popis)
{document.write("<tr valign='top'><td align='right'>" + cislo+ ".&nbsp;</td><td><a href='navody/" + cislo + ".shtml'>" + popis + "</a></td></tr>")
}
function setMenu( path ) {
		var URL = path;
		parent.idx.location.href= URL;
}
function openPic( path, w, h, alt, t, l ) {
		width = parseInt(w);
		height = parseInt(h);
		pic_win= window.open('','pic','scrollbars=no,resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width));
		pic_win.focus();
		pic_win.document.open();
		pic_win.document.writeln('<html>');
		pic_win.document.writeln('<head>');
		pic_win.document.writeln('<title>' + alt + '</title>');
		pic_win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');
		pic_win.document.writeln('</head>');
		pic_win.document.writeln('<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" >');
		pic_win.document.writeln('<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="center"><a href="#" title="(kliknutím zavøi)" onClick="javascript:window.close()"><img src="' + path + '" width="' + w + '" height="' + h + '" border="0" alt="(kliknutím zavøi)"></a></td></tr></table>');
		pic_win.document.writeln('</body><br></html>');
		//pic_win.document.close();
	}
	
function openF( p, w, h, alt, c_foto, e ) {
		width = parseInt(w) + 20;
		height = parseInt(h)+ 120;
		if (!e){ext = ".jpg";}
		else { ext = e;}
		path= p + c_foto + ext;
		foto_win= window.open('','foto','scrollbars=auto,resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width));
		foto_win.focus();
		foto_win.document.open();
		foto_win.document.writeln('<html>');
		foto_win.document.writeln('<head>');
		foto_win.document.writeln('<title>' + alt + '</title>');
		foto_win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');
		foto_win.document.writeln('<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/foto.css\">');
		foto_win.document.writeln('</head>');
		foto_win.document.writeln('<body bgcolor=\"#FFFFFF\">');
		foto_win.document.writeln('<h2 align=\"center\">' + alt +' - foto ' + c_foto+'</h2>');
		foto_win.document.writeln('<p align="center"><img src="' + path + '" width="' + w + '" height="' + h + '" border="0" alt="'+ alt + ' - foto ' + c_foto+ '">');
		foto_win.document.writeln('<p align="center"><a href="#" title="(kliknutím zavøi)" onClick="javascript:window.close()"><b>zavøít okno</b></a></p>');
		
		foto_win.document.writeln('</body></html>');
		//foto_win.document.close();
	}	
function openWin ( path, w, h, alt ) {
	 var sc_w = screen.width;
	 var sc_h = screen.height;
	 if (sc_w <= (parseInt(w) + 50)) { width = parseInt(sc_w) - 100;}
	 else { width = parseInt(w) +36;}
	 if (sc_h <= (parseInt(h) + 200)) { height = parseInt(sc_h)- 200;}
	 else { height = parseInt(h) + 30;}
		new_win=window.open('','nove'+width+height,'scrollbars=yes,resizable=no,resize=no,width='+width+',height='+height+',screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width) );
		new_win.focus();
		new_win.document.writeln('<html>');
		new_win.document.writeln('<head>');
		new_win.document.writeln('<title>' + alt + '</title>');
		new_win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');
		new_win.document.writeln('</head>');
		new_win.document.writeln('<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">');
		new_win.document.writeln('<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="center"><img src="' + path + '" width="' + w + '" height="' + h + '" border="0" alt="' + alt + '" vspace="10"></td></tr></table>');
		new_win.document.writeln('</body></html>');
	}
function getCenterW(width) {
	return parseInt( eval( (screen.width-parseInt(width))/2 ) );
}
function getCenterH(height) {
	return parseInt( eval( (screen.height-parseInt(height))/2 ) );
}
