// <!--
// 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=214;
var h=310;
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);}

// 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=0,location=0,toolbar=0,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t);}

function hra(file) {
var w=360;
var h=445;
var l=(screen.width-w-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);}


// 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);
}


//forum

function pop_forum_form(file) {
var w=320;
var h=360;
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);}

//dona

var pole;
	    function dona(pole)
	   {
                             newwindow=window.open('','name','height=505,width=505,resizable=1,scrollbars=1');
                             newwindow.document.write('<HTML><HEAD><TITLE>Aby pse byl pes</TITLE><link rel="stylesheet" href="/default/default/style.css" type="text/css"/><link rel="stylesheet" href="/psi/default/local.css" type="text/css"/></HEAD><body text="#000000" bgColor="white" leftMargin="0" topMargin="0" MARGINHEIGHT="0" MARGINWIDTH="0">');
                             newwindow.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="2"');
                             newwindow.document.write('<tr><td>');
                             newwindow.document.write('<img src=/psi/html/');
                             newwindow.document.write(pole[0]);
                             newwindow.document.write(' border=0>');
                             newwindow.document.write('</td></tr>');
                             newwindow.document.write('<tr><td class="text">');
                             newwindow.document.write(pole[1]);
                             newwindow.document.write('</td></tr>');
                             newwindow.document.write('</table>');
                             newwindow.document.write('</body></HTML>');
                             newwindow.document.close();
                     }

// 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=1";
newwindow=window.open('','name',titlebody);
newwindow.document.write('<HTML><HEAD><TITLE>Galerie</TITLE></HEAD><body text="#000000" bgColor="white" leftMargin="0" topMargin="0" MARGINHEIGHT="0 " MARGINWIDTH="0">');
newwindow.document.write('<div  align="center">');
newwindow.document.write('<img title="po kliknutí se popop okno zavøe" border=0 src=http://www.rozhlas.cz/_obrazek/');
newwindow.document.write(pole[3]);
newwindow.document.write('>');
newwindow.document.write('</div>');
newwindow.document.write('</body></HTML>');
newwindow.document.close();
}

// -->
