/**
*
*  URL encode / decode
*  http://www.webtoolkit.info/
*
**/
var Url = {
 
	// public method for url encoding
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},
 
	// public method for url decoding
	decode : function (string) {
		return this._utf8_decode(unescape(string));
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
 
}

function newwin(filename,xwidth,yheight,room){
var wp = navigator.appName;
var room1 = Url.decode(room);
var zleva = (screen.availWidth-xwidth)/2;
var zhora = ((screen.availHeight-yheight)-60)/2;
var a = window.open("","_blank","left="+zleva+",top="+zhora+",width="+xwidth+",height="+yheight);
a.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
a.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">');
a.document.writeln('<head><title>Přehrání videa</title>');
a.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />');
a.document.writeln('<meta name="robots" content="index,follow" />');
a.document.writeln('<meta name="keywords" content="6.zš, 6.zs, 6zs, 6., zš, zs, mb, 6.zs mb, 6zs mb, 6.zš mb, základní škola, škola, základní, mateřská, mateřská škola, mateřská škola mb, Mladá Boleslav, Mladá, Boleslav, Jilemnického, Jilemnickeho, 1152" />');
a.document.writeln('<meta name="description" content="6.základní škola Mladá Boleslav" />');
a.document.writeln('<meta name="rating" content="general" />');
a.document.writeln('<meta name="author" content="td" />');
a.document.writeln('<meta name="copyright" content="© 2010 6.základní škola" />');
a.document.writeln('<meta name="generator" content="XOOPS" /></head>');
a.document.writeln('<body><center>');
if (wp=="Microsoft Internet Explorer") {
a.document.writeln('<h3><b>'+room1+'</b></h3>');}
else {a.document.writeln('<h3><b>'+room+'</b></h3>');}
a.document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240" id="player1" align="middle">');
a.document.writeln('<param name="movie" value="'+filename+'" />');
a.document.writeln('<param name="menu" value="false" />');
a.document.writeln('<param name="quality" value="high" />');
a.document.writeln('<param name="bgcolor" value="#FFFFFF" />');
a.document.writeln('<noscript>');
a.document.writeln('Váš prohlížeč nepodporuje flash animace.</noscript>');
a.document.writeln('<embed src="'+filename+'" menu="false" quality="high" bgcolor="#FFFFFF" width="320" height="240" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
a.document.writeln('</object>');
a.document.writeln('</center></body>');
a.document.writeln('</html>');
a.document.close();
};

