// #### obecne funkce ####

//	 DHTML library from Prague
//   Copyright (C) 2001 skater@internet.cz

//Otevreni popup okna s obrazkem
var popWin=null;
function WinOpen(ParObr,w,h,cesta,title,ext,bgcolor,scroll) //w - sirka,h - vyska obrazku,cesta - kde sou obr,
{
	if (cesta == null) cesta = "_images";		//def hodnoty
	if (!title) title = "Náhled";
	if (!bgcolor) bgcolor = "white";
	if (!ext) ext = "jpg";
	if (!scroll) scroll = "no"

	WinTit = title;
	 w+=2; h+=2;
	 if (popWin && !popWin.closed) popWin.close();
	var WinOpenZdr1 = "<html><head><title>"
	var WinOpenBody = "marginheight='0' marginwidth='0' leftmargin='0' topmargin='0'"
	var WinOpenZdr2 = "</title></head><body bgcolor='"+bgcolor+"' "+WinOpenBody+" onload='focus()'>"+
						"<a title='Kliknutím zavřete' href='javascript:self.close()'><img src='"+cesta+"/" +ParObr+"."+ext+"' border='0'></a></body></html>"
	winFeatures="width="+w+",height="+h+",toolbar=no,location=no,"+
	             "directories=no,status=no,menubar=no,resizable=yes,scrollbars="+scroll;
	 popWin = window.open('', "ImageWindow", winFeatures);
	 popWin.document.write(WinOpenZdr1 + WinTit + WinOpenZdr2);
	 popWin.document.close();
	 if (!popWin.opener) popWin.opener = self;
}

function Mapka(ParObr,title)
{
	cesta = "_images/mapy";		//def hodnoty
	if (!title) title = "Náhled";
	WinTit = title;
	// w+=2; h+=2;
	if (popWin && !popWin.closed) popWin.close();
	var WinOpenZdr1 = "<html><head><title>"
	var WinOpenBody = "marginheight='0' marginwidth='0' leftmargin='0' topmargin='0'"
	var WinOpenZdr2 = "</title></head><body bgcolor='white' "+WinOpenBody+" onload='focus()'>"+
						"<a title='Kliknutím zavřete' href='javascript:self.close()'><img src='"+cesta+"/" +ParObr+".gif' border='0'></a></body></html>"
	winFeatures="width=425,height=250,toolbar=no,location=no,"+
	             "directories=no,status=no,menubar=no,resizable=yes,scrollbars=no";
	 popWin = window.open('', "ImageWindow", winFeatures);
	 popWin.document.write(WinOpenZdr1 + WinTit + WinOpenZdr2);
	 popWin.document.close();
	 if (!popWin.opener) popWin.opener = self;
}


function WinOpenS(ParObr,w,h,cesta,title,ext,bgcolor) {
	if (cesta == null) cesta = "_images";		//def hodnoty
	if (!title) title = "Náhled";
	if (!bgcolor) bgcolor = "white";
	if (!ext) ext = "jpg";
	WinTit = title;
	 w+=2; h+=2;
	 if (popWin && !popWin.closed) popWin.close();
	var WinOpenZdr1 = "<html><head><title>"
	var WinOpenBody = "marginheight='0' marginwidth='0' leftmargin='0' topmargin='0'"
	var WinOpenZdr2 = "</title></head><body bgcolor='"+bgcolor+"' "+WinOpenBody+" onload='focus()'>"+
						"<a title='Kliknutím zavřete' href='javascript:self.close()'><img src='"+cesta +ParObr+"."+ext+"' border='0'></a></body></html>"
	winFeatures="width="+w+",height="+h+",toolbar=no,location=no,"+
	             "directories=no,status=no,menubar=no,resizable=yes,scrollbars=no";
	 popWin = window.open('', "ImageWindow", winFeatures);
	 popWin.document.write(WinOpenZdr1 + WinTit + WinOpenZdr2);
	 popWin.document.close();
	 if (!popWin.opener) popWin.opener = self;
}

// Otevreni pop up okna - dokument
var docWin=null;
function DocOpen(DocName,w,h,idw) //DocName - jmeno souboru,w - sirka,h - vyska,idw - identifikator okna
{
	if (!idw) cesta = "Gambrinus";		//def hodnota
	 w+=2; h+=2;
	winFeatures="width="+w+",height="+h+",toolbar=no,location=no,"+
	"directories=no,status=no,menubar=no,resizable=no,scrollbars=no";
	docWin = "";
	docWin = window.open(DocName, idw, winFeatures);
	window.open(DocName, idw, winFeatures);
}

// #### proprietari funkce ###

function zoom(URL,winName,features,popis) // G-city
{
  if (!popis) popis = '';
	okno=window.open('',winName,features);
	okno.document.write('<HTML><TITLE>'+popis+' - Gambrinus</TITLE><BODY style="margin:0; padding:0; font-family: Arial, Helvetica, sans-serif; color: white;">');
	okno.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" style="font-size: 75%;">');
	okno.document.write('<a href="javascript:window.close()"><IMG SRC="'+URL+'" border="0" alt=":: zavřít okno ::" style="border: 4px solid #FFFFFF;"></a><br>'+popis);
	okno.document.write('<td><tr></table></BODY></HTML>');
	okno.document.close();
	okno.focus();
	okno.document.bgColor="BD0014";

}

function Okno(det){ //otvira v hospodach hodnotici formular
			window.open(det,null,'width=510,height=500,noresize');
		}
function hodnot(co) //Hospody - hodnotici formular
    	    {
        		document.forms[0].hodnoceni[co].checked = true;
	        }

function posun(dir, poc){ //reklama_slide
	var pos;
	pos = obj.x;
	pos = ((dir=='left')&&(obj.x > -(poc*173-173))) ? obj.x-173 : pos;
	pos = ((dir=='right')&&(obj.x < 0)) ? obj.x+173 : pos;
	obj.slideIt(pos,0,10,10);
	listaobj.writeIt(popisky[Math.round(-((pos-173)/173)-1)]);
}

function libinit(){
	page=new lib_doc_size()
	obj3=new lib_obj('divTest3')
	obj2=new lib_obj('divTest2','divTest3')
	obj=new lib_obj('divTest','divTest3.document.divTest2')
	listaobj=new lib_obj('lista','divTest3')

	if (!bw.ns4) obj2.css.overflow = "hidden";
	if (bw.ns6) obj2.css.position = "absolute";
	obj2.css.width = 173+px;
	obj2.clipTo(0,173,143,0)
	obj2.css.visibility = "visible";
}

function libinit_loga(){
	page=new lib_doc_size()
	telefobj=new lib_obj('telef')
	logoobj=new lib_obj('logo','telef')

	if (!bw.ns4) logoobj.css.overflow = "hidden";
	if (bw.ns6) logoobj.css.position = "absolute";
	logoobj.css.width = 132+px;
	logoobj.clipTo(0,132,352,0)
	logoobj.css.visibility = "visible";
}

function newWin(URL) {
	okno=window.open(URL,'blank');
	//okno.document.close();
	okno.focus();
}

function vanoce2002() { //soutez vanoce tip 2002
	DocOpen(abspath+"soutez/vanoce2002/start.php?cid=3",674,420,"vanoce2002");
}
//DocOpen(DocName,w,h,idw) //DocName - jmeno souboru,w - sirka,h - vyska,idw - identifikator okna

function puzzlemania() {  // otevira puzzlemanii
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/me2004-maxim-puzzle/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}
function puzzlemania2() {  // otevira puzzlemanii
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/puzzlemania/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}
function fotbalek() {
	if (!arguments[0]) return false;
	cid =  arguments[0];
	window.open(abspath+"soutez/ncp-2005/fotbalek.php?cid="+cid,"xxx","width=800,height=500,resizezable=yes,scrolling=no");
  if (!arguments[1]) return false;
}
function kalendar() {
	if (!arguments[0]) return false;
	cid =  arguments[0];
	window.open(abspath+"soutez/ncp-2005/kalendar.php?cid="+cid,"xxx","width=495,height=600,resizezable=no,scrolling=no");
  return false
}
function Player() {  // otevira okno s mp3 playerem
		switch (arguments.length) {
		   case 0: urladd = ''; break;
		   case 1: urladd = '?album='+arguments[0];break;
		   case 2: urladd = '?album='+arguments[0]+'&track='+arguments[1];break;
		}
		window.open(abspath+"rock/player.php"+urladd,"MP3Player","width=300,height=250");
	}

function RockInvaders(cid)
{
        window.open(abspath+"soutez/rockinvaders/main.php?cid="+cid,"RI","width=610,height=550,scrollbars=no,resize=no");
}
function rockfest()
{
        if (!arguments[0]) return;
        cid = arguments[0];
	window.open(abspath+"soutez/festivaly/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}
function pivris()
{
    return;
        if (!arguments[0]) return;
        cid = arguments[0];
	window.open(abspath+"soutez/pivris/main.php?cid="+cid,"xxx","width=500,height=400,resizezable=no,scrolling=no");
}

function RockInvadersII(cid) { if (cid) window.open(abspath+"soutez/RockInvadersII/main.php?cid="+cid,"RI2","width=610,height=550,scrollbars=no,resize=no"); }

function rockinvaders2005(cid) { if (cid) window.open(abspath+"soutez/rock-invaders-2005/main.php?cid="+cid,"RI05","width=610,height=550,scrollbars=no,resize=no"); }

function festivaly2004(cid)
{
        if (!arguments[0]) return;
        cid = arguments[0];
	window.open(abspath+"soutez/festivaly2004/main.php?cid="+cid,"festivaly2004","width=777,height=439,resizezable=no,scrolling=no");
}
function festivaly2005(cid)
{
        if (!arguments[0]) return;
        cid = arguments[0];
	window.open(abspath+"soutez/festivaly2005/main.php?cid="+cid,"festivaly2005","width=777,height=439,resizezable=no,scrolling=no");
}

function permice2004()
{
  if (!arguments[0]) return;
  cid = arguments[0];
  window.open(abspath+"soutez/permanentky-GA-liga-podzim-2004/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}
function permice2005()
{
  if (!arguments[0]) return;
  cid = arguments[0];
  window.open(abspath+"soutez/permanentky-GA-liga-2005/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}

function tris()
{
  if (!arguments[0]) return;
  cid = arguments[0];
  window.open(abspath+"soutez/poprask/tris.php?cid="+cid,"tris","width=500,height=400,resizezable=no,scrolling=no");
}

function playGambBalls2005(){ //GambBalls 2005
  if (!arguments[0]) cid = 111;
  else cid = arguments[0];
  DocOpen(abspath+"zabava/_swf/main.php?cid="+cid,520,500,"GambBalls");
}
function puzzlems2005() {  // otevira puzzlemanii
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/puzzle-ms2005/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}

function GJack()
{
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/g-jack/main.php?cid="+cid,'GJack',"width=640,height=480,resizezable=no,scrolling=no");
    return false;
}

function kviz()
{
	if (!arguments[0]) return false;
	cid =  arguments[0];
	window.open(abspath+"gambrinus-tym-v-novem/main.php?cid="+cid,'kviz',"width=623,height=425,resizezable=no,scrolling=no");
    //return false;
}

function puzzle_mmig2006_divokej_bill() {  // otevira puzzlemanii
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/puzzle-mmig2006-divokej-bill/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}
function puzzle_mmig2006_benatska_noc() {  // otevira puzzlemanii
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/puzzle-mmig2006-benatska-noc/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}
function puzzle_mmig2006_tri_sestry() {  // otevira puzzlemanii
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open(abspath+"soutez/puzzle-mmig2006-tri-sestry/main.php?cid="+cid,"xxx","width=777,height=439,resizezable=no,scrolling=no");
}

function permice_2006() {  // otevira matchball
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open("http://www.gambrinus.cz/soutez/permice-2006/main.php?cid="+cid,"xxx","width=600,height=450,resizezable=no,scrolling=no");
}
function matchball_10_2006() {  // otevira matchball
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open("http://www.gambrinus.cz/soutez/matchball_10_2006/main.php?cid="+cid,"xxx","width=600,height=450,resizezable=no,scrolling=no");
}

function fotbalek_nevyherni() {     // otevira fotbalek nevyherni
	if (!arguments[0]) return false;
	cid =  arguments[0];
	window.open(abspath+"soutez/fotbalek-nevyherni/fotbalek.php?cid="+cid,"xxx","width=800,height=500,resizezable=yes,scrolling=no");
}

function brankari_09_2006() {  // otevira hru Brankari
	if (!arguments[0]) return;
	cid =  arguments[0];
	window.open("http://www.gambrinus.cz/soutez/fotbalove-hry/brankari/main.php?cid="+cid,"xxx","width=770,height=500,resizezable=no,scrolling=no");
}

// intro NCP 2007
function closeDiv(name) {
    var div = document.getElementById(name);
    div.setAttribute("style", "display: none");
    div.style.display = "none";
}
function closeBanner(URL) {
    closeDiv("intro");
//	window.location=URL;
}
function intro() {
	var shockmode = false;
	var mimetype = 'application/x-shockwave-flash';

	if (navigator.mimeTypes) {
		if (navigator.mimeTypes[mimetype] != null) {
			if (navigator.mimeTypes[mimetype].enabledPlugin != null) {
				shockmode = true;
		      }
		}
	}

	if (!shockmode && navigator.appVersion.indexOf('MSIE') !=-1) {
		shockmode = true;
	}
	if (shockmode) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write(' codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0"');
		document.write(' ID=banner WIDTH=815 HEIGHT=800 >');
		document.write(' <PARAM NAME=movie VALUE="http://www.gambrinus.cz/_swf/intro-ncp-2007.swf"> ');
		document.write(' <PARAM NAME=quality VALUE=autohigh> ');
		document.write(' <PARAM NAME=wmode VALUE=transparent> ');
		document.write('<EMBED SRC="/_swf/intro-ncp-2007.swf"');
		document.write(' swLiveConnect=FALSE WIDTH=815 HEIGHT=800');
		document.write(' QUALITY=autohigh WMODE=transparent');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
		document.write('</EMBED>');
		document.write('</OBJECT>');
	}
	else {
		document.write('Nemáte Adobe Flash Player');
	}
}

// EOF

