function OknoGalerii(url, width, height) {
	        var Win = window.open('/'+url,"OknoGalerii",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
	}
	
	function displayWindow(url, width, height) {
	        var Win = window.open('/'+url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no' );
	}
	
function zmienFilm(TRID,TRF)
{
	TRF = TRF || 0; 

	//myFlash.changeMovie('http://gry.gery.pl/film.php?T='+TRID+'&TRF='+TRF);
	myFlash.changeMovie({file:'http://gry.gery.pl/film.php?T='+TRID+'&TRF='+TRF,autoplay:true});
}
	function ujmij(id)
	{
		attach_file('/ujmij.php?IDe='+id)
		document.getElementById('ulubione').innerHTML = '<a href="javascript:dodaj('+id+')">Dodaj do ulubionych gier</a>';
	}
	function dodaj(id)
	{
		attach_file('/dodaj.php?IDe='+id)
		document.getElementById('ulubione').innerHTML = '<a href="javascript:ujmij('+id+')">Usuń z ulubionych</a>';
	}
	                 
	function attach_file( p_script_url ) {
		script = document.createElement( 'script' );
		script.src = p_script_url;
		document.getElementsByTagName( 'head' )[0].appendChild( script );
	 }
	 
	function vote(){
	
	}
	
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}

function showPod (o) {

  if (o.className=='podobneButtonClose') {
    return hidePod();
  } else {
    o.className = 'podobneButtonClose';
  }

  var el = document.getElementById('pbg');  
  var pos = findPos(o);  
  var vtop = parseInt(parseInt(pos[1]) + 19) + "px";
  
  el.style.display = 'block';  
  el.style.top = vtop;
  
  pos = findPos(document.getElementById('topWrapper'));
  var vleft = parseInt(pos[0] + 18) + "px";
  
  el.style.left = vleft; 
  
  o = document.getElementById('pbgt');
  //o.style.width = el.offsetWidth + "px";
  o.style.height = (el.offsetHeight-20) + "px";
  o.style.top = vtop;
  o.style.left = vleft;
  o.style.display = 'block';
  
}

function hidePod() {
  document.getElementById('pbgt').style.display = document.getElementById('pbg').style.display = 'none';
  document.getElementById('pb').className = 'podobneButton';
}
