// <!--
// Browser identification
var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ns    = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') ==-1));
var is_ns4up = (is_ns && (is_major >= 4));
var is_ie    = (agt.indexOf("msie") != -1);
var is_ie4up = (is_ie  && (is_major >= 4));
var is_docom = (document.getElementById);
var is_nn6   = (!document.all && document.getElementById);
if (is_ie) {
        is_docom = 0;
}
if (is_docom) {
        is_ns    = 0;   
        is_ns4up = 0;   
}

// PopUp Menus...
var LAYER = 0;
var lastMenu = false;
var timeOut = 1000;   
var timeoutId = false;

//NS4 = (document.layers) ? 1 : 0;
//IE = (document.all) ? 1 : 0;
NS = (is_ns4up) ? 1 : 0;
IE = (is_ie4up) ? 1 : 0;
DC = (is_docom) ? 1 : 0;
NN6 = (is_nn6)  ? 1 : 0;
LAYER = (NS || IE || DC || NN6) ? 1 : 0;

if (IE || NN6) {
  SHOW = "visible";
  HIDE = "hidden";
} else if (NS || DC) {
  SHOW = "show";
  HIDE = "hide";
}


// Floating menu
function createLayers(menuName,topPos) {
        if (LAYER) {
         	if (NS) {
 			screenWidth = window.innerWidth;
        		document.layers[menuName].left = 165;
                        document.layers[menuName].top  = topPos;
                } else if (DC || NN6) {
                        screenWidth = window.innerWidth;
                        document.getElementById(menuName).style.left = 165;
 			document.getElementById(menuName).style.top  = topPos;
        	} else if (IE) {
          		//topPos = topPos + 15;
                       	screenWidth = document.body.clientWidth + 18;
          		document.all[menuName].style.pixelLeft = 165;
          		document.all[menuName].style.pixelTop  = topPos;
           	}
        }
}



function kick(menuName,status,topPos) {
        if (LAYER) {
                if (status) {
                        createLayers(menuName,topPos);
                        if (NS) {
                                document.layers[menuName].visibility = SHOW;
                	} else if (DC || NN6) {
                   		document.getElementById(menuName).style.visibility = SHOW;
                  	} else if (IE) {
                      		document.all[menuName].style.visibility = SHOW;
                	}
                } else {
 			if (NS) {
                                document.layers[menuName].visibility = HIDE;
			} else if (DC || NN6) {
                		document.getElementById(menuName).style.visibility = HIDE;
                        } else if (IE) {
                    		document.all[menuName].style.visibility = HIDE;
         	        }
 		}
        }
}





function popUp(menuName,show,topPos) {
	if (LAYER) {
		if (lastMenu) {
			kick(lastMenu,false,topPos);
		}
		if (show) {
			kick(menuName,true,topPos);
		}
	lastMenu = menuName;
	clearTimeout(timeoutId);
	}
}

function hide(menuName,topPos) {
	toFunc = "popUp('" + menuName + "',false,'" + topPos + "')";
	timeoutId = setTimeout (toFunc,timeOut);
}

// Live...
function eradio(file) {
var w=260;
var h=300;
var l=(40);
var t=(20);

        window.open (file,'_blank','scrollbars=0,status=0,menubar=0,resizable=0,location=0,toolbar=0,width=' + w + 
',height=' + h + ',left=' + l + ',top=' + t);}

// forum
function pop_forum_form(file) {
var w=330;
var h=360;
var l=(40);
var t=(20);

window.name="_target";
        window.open (file,'_blank','scrollbars=0,status=0,menubar=0,resizable=0,location=0,toolbar=0,width=' + w + 
',height=' + h + ',left=' + l + ',top=' + t);}


// Livex.
function xradio(file) {
var w=300;
var h=500;
var l=(screen.width-w-40);
var t=(20);

        window.open (file,'_blank','scrollbars=1,status=0,menubar=0,resizable=1,location=0,toolbar=0,width=' + w + 
',height=' + h + ',left=' + l + ',top=' + t);}

// Contact
function kontakt(file) {
var w=300;
var h=405;
var l=(screen.width-w-40);
var t=(20);

        window.open (file,'_blank','scrollbars=0,status=0,menubar=0,resizable=1,location=0,toolbar=0,width=' + w + 
',height=' + h + ',left=' + l + ',top=' + t);}

// Print
/*
function print(id) {
var w=214;
var h=310;
var l=(screen.width-w-40);
var t=(20);

        window.open ('/_print/' + id,'_blank');
}
*/

// Send Email
function mailem(id) {
var w=300;
var h=500;
var l=(screen.width-w-40);
var t=(20);

        window.open ('/_mailem/' +
id,'_blank','scrollbars=0,status=0,menubar=0,resizable=0,location=0,toolbar=0,width=' + w + ',height=' + h +
',left=' + l + ',top=' + t);
}

// popup okno - obecne
var info;
function okno(info) {
window.open(info[0],'_blank',"scrollbars=1,status=0,menubar=0,resizable=1,location=0,toolbar=0,left="+info[2]+",top="+info[3]+",width="+info[4]+",height="+info[5]);
}

//window popup - GALERIE
var pole;
            function galerie(pole)
           {
var titlebody = "height="+pole[1]+",width="+pole[0]+",resizable=1,scrollbars=0";
newwindow=window.open('','name',titlebody);
newwindow.document.write('<HTML><HEAD><TITLE>Galerie</TITLE></HEAD><body text="#000000" bgColor="white" style="margin:0px">');
newwindow.document.write('<div  align="center">');
newwindow.document.write('<img title="po kliknutí se popup okno zavøe"  onclick="window.close()"  border=0 src=http://media.rozhlas.cz/_obrazek/');
newwindow.document.write(pole[3]);
newwindow.document.write('>');
newwindow.document.write('</div>');
newwindow.document.write('</body></HTML>');
newwindow.document.close();
}


//automaticke popup okenko
function okenko(sir,vys,adr){
 //okenko se statusem
 var xsirka=window.screen.width; var xvyska=window.screen.height;
 var xleft=Math.round((xsirka-sir)/2)

 var modif = 12;
 if (parseInt(vys)+150 > xvyska) modif = 42;
 var xtop=Math.round((xvyska-vys)/2)-modif

 if (adr.indexOf("/") > 0) {
  var cc = adr.lastIndexOf("/")+1;
  var jmn = adr.substr(cc, 4);
 }
 else {
  var jmn = adr.substr(0, adr.indexOf("."));
 }

 var parametry = "left="+xleft+",top="+xtop+",width="+sir+",height="+vys+",toolbar=0,directories=0,menubar=0,scrollbars=yes,location=0,status=1,resizable=1"
 var okenko=open(adr,jmn,parametry);
 return okenko;
}

function panorama(ciss){
 var cest = "http://www.rozhlas.cz/odysea/panorama/"+ciss+"/index.html";
  //alert(cest);
   window.open(cest,"P1","width=425,height=340,menubar=0,scrollbars=0,resizable=0");
   }


// -->

