//<!--
var glA = document.all ? true:false;
if (!glA) var glGE = document.getElementById ? true:false; else var glGE = false;
var glW = 0;
var glH = 0;
var img_loaded = false;

// document.oncontextmenu=new Function("alert('OOPS\\n Tato funkce je zakázána na těchto stránkách.\\n This functionality is restricted on this pages.'); return false;");

// vypina a zapina div pomoci idcka
function showHide(x_id)
{
	if (glA) { el=document.all(x_id).style; } else { el=document.getElementById(x_id).style; }
	el.display=(el.display == 'block')?'none':'block';
}

// colorize background
function colorize( x_id )
{
	// alert(x_id.style.backgroundColor);
	if (glA) { x_id.style.backgroundColor=(x_id.style.backgroundColor == '#cacaca')?'transparent':'#cacaca'; }
		else { x_id.style.backgroundColor=(x_id.style.backgroundColor == 'rgb(202, 202, 202)')?'transparent':'rgb(202, 202, 202)'; }
}

// colorize background
function colPic( x_id )
{
	// alert(x_id.style.backgroundColor);
	if (glA) { x_id.style.backgroundColor=(x_id.style.backgroundColor == '#000000')?'#EEEEEE':'#000000'; }
		else { x_id.style.backgroundColor=(x_id.style.backgroundColor == 'rgb(0, 0, 0)')?'#EEEEEE':'rgb(0, 0, 0)'; }
}


// preloaduje obrazkyu do document.images
function im_preload( img_obj, img_src )
{
	if ( document.images ) {
		eval( img_obj + ' = new Image()' );
		eval( img_obj + '.src = "' + img_src + '"' );
	}
}


// meni obrazky v hladine LAYER a jejim <IMG> s Id nebo Name IMG_NAME za obrazek ulozeni v objektu IMG_OBJ z kontejneru document.images
function im_change( layer, img_name, img_obj ) {
	if (img_loaded) {
		// alert( layer + '   ' + img_name + '    ' + img_obj);
		if ( document.images ) {
			if ( document.layers && layer != null ) eval( 'document.layers["' + layer + '"].document.images["' + img_name + '"].src = ' + img_obj + '.src');
			else document.images[ img_name ].src = eval( img_obj + ".src" );
			}
		}
	}

	
// - - - object JS changer for pics
function image_changer ( xImgId, xImgObjOver, xImgObjOut )
{
	this.imgId = xImgId;
	this.imgObjOver = xImgObjOver;
	this.imgObjOut = xImgObjOut;
}


image_changer.prototype.onOver = function()
{
	im_change( null, this.imgId, this.imgObjOver );
}


image_changer.prototype.onOut = function()
{
	im_change( null, this.imgId, this.imgObjOut );
}


// nacte rozliseni browseru do globalnich promennych glW a glH
function get_scr_res() {
	if ( glGE ) {
		glW = window.innerWidth;
		glH = window.innerHeight;
		}
	else if ( glA ) {
		glW = document.body.offsetWidth;
		glH = document.body.offsetHeight;
		}
	}


var pop_pic_params = 'directories=no,location=no,menubars=no,menubar=no,resizable=no,scrollbars=no,statusbars=no,status=no,titlebar=no,toolbar=no,fullscreen=no'; 

// popne picture
function popPhpPicGal(URL, comment, lang) {
	var s=160;
	var v=120;	
	var corMw = 8;
	var corMh = 28;
	if (document.GetElementById) { s += corMw; v += corMh; }
	s += 10;
	v += 25;
	
	if (parseInt(navigator.appVersion) >= 4) { winl = 100, wint = 100; }
	var winl = (screen.width - s) / 2;
	var wint = (screen.height - v) / 2;
	
	day = new Date();
	id = day.getTime();
	popPhpPic_URL = 'tp_pic_gal.php?urlpic=' + URL + '&' + lang + '&title=' + encodeURIComponent(comment);
	popPhpPic_id = 'PHPpicture';
	popPhpPic_params = pop_pic_params +',width='+s+",height="+v+",left="+winl+",top="+wint;
	window.open( popPhpPic_URL, popPhpPic_id, popPhpPic_params);
}
