
function ShowYouTube(text,flag){
  /*var params = { allowScriptAccess: "always" };
	var atts = { id: "myytplayer" };
	swfobject.embedSWF("http://www.youtube.com/v/"+text+"&enablejsapi=1&playerapiid=ytplayer",
       "youtube_{$smarty.foreach.yt.iteration}", "190", "130", "8", null, null, params, atts);*/

	var tlo = Tlo();
	var srodek = document.createElement('div');
	srodek.id = "gr";
	document.body.appendChild(srodek);
	document.getElementById("gr").innerHTML = "<div id=\"ob\"></div>";
	srodek.style.position = "absolute";
	srodek.style.zIndex = 100;
	srodek.style.left = Math.round((tlo.offsetWidth-769)/2)+"px";
	srodek.style.width = '769px';
	if (flag) {
		var so = new SWFObject("http://www.youtube.com/v/"+text+"&enablejsapi=1&playerapiid=ytplayer&fs=1", "mymovie", "769", "622", "8", "#fff");
	}else{
		var so = new SWFObject("/public/default/flvPlayer.swf?videoPath="+text+"", "mymovie", "769", "622", "8", "#fff");
	}
	so.addParam("allowFullScreen", "true");
	so.write("ob");

	var MSIE = false;
	if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0)MSIE=true;
	var arVersion = navigator.appVersion.split("MSIE");
	var version = parseFloat(arVersion[1]);

	if (!MSIE || version>6) {
		srodek.style.position = "fixed";
		srodek.style.top = '80px';
	}else{
		var coordinates = $('body').cumulativeScrollOffset();
		srodek.style.top = 50+coordinates[1]+'px';
	}

}
function Tlo2(){
	var tlo = document.createElement('div');
	tlo.className = "tlo";
	tlo.id = 'bg';
	tlo.style.height = wysokosc()[0]+'px';
	if (window.opera) {
		tlo.style.height = $('srodek').offsetHeight+350+'px';
	}
	tlo.onclick = function(){
	document.body.removeChild(document.getElementById('gr'));
	document.body.removeChild(this);
	//teraz2.mydrag.destroy();
	}
	document.body.appendChild(tlo);
	var arVersion = navigator.appVersion.split("MSIE");
	var version = parseFloat(arVersion[1]);
	/*if(version <= 6){
		var ifr = document.createElement('IFRAME');
		ifr.src = 'blank.html';
		tlo.appendChild(ifr);
	}*/
	return tlo;
}
function wysokosc(){
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;

//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

//	console.log("xScroll " + xScroll)
//	console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = xScroll;
	} else {
		pageWidth = windowWidth;
	}
	//	console.log("pageWidth " + pageWidth)
	al = new Array(pageHeight,yScroll,windowHeight)
 	return al;
}


