try { document.execCommand('BackgroundImageCache', false, true); } catch (e) {}

//DODAJ DO ULUBIONYCH
function addToBookmarks( sTitle, sHref ) 
	{
	//Wersja skryptu 1.0
	//Modyfikacji dokonał: Krzysztof Samełko
	//Data: 2008-05-12
	
	if( window.sidebar && window.sidebar.addPanel ) 
		{
		//Gecko (Netscape 6 etc.) - add to Sidebar
		window.sidebar.addPanel( sTitle, sHref, '' );
		} 
	else if( window.external && ( navigator.platform == 'Win32' || ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) ) 
		{
		//IE Win32 or iCab - checking for AddFavorite produces errors for no
		//good reason, so I use a platform and browser detect.
		//adds the current page page as a favourite; if this is unwanted,
		//simply write the desired page in here instead of 'location.href'
		window.external.AddFavorite( window.location.href, document.title );
		} 
	else if( window.opera && window.print ) 
		{
		
		window.open('js/opera_dodaj_do_ulubionych.php','','width=150,height=50');
		//Opera 6+ - add as sidebar panel to Hotlist
		return true;
		} 
	else if( document.layers ) 
		{
		//NS4 & Escape - tell them how to add a bookmark quickly (adds current page,
		//not target page)
		window.alert( 'Proszę kilknąć OK a pu&#65533;niej Ctrl+D aby dodać strone do ulubionych' );
		} 
	else 
		{
		//other browsers - tell them to add a bookmark (adds current page, not target page)
		window.alert( 'Proszę użyć menu przeglądarki by utworzyć dodać strone do ulubionych' );
		}
	return false;
	}
//DODAJ DO ULUBIONYCH

//PODMIANA RAMKI W DZIALE SAMOCHODY UZYWANE
function PodmienRamke(stan,id)
	{
	if (stan == 1)
		{
		document.getElementById(id).style.background = "url(images/ramka_foto_male.gif)"; 
		}
	else if (stan == 0)
		{
		document.getElementById(id).style.background = "url(images/ramka_foto_male1.gif)";
		}
	}

//PODMIANA RAMKI W DZIALE SAMOCHODY OSOBOWE W GALERII
function PodmienRamkeOsoboweGaleria(stan,id)
	{
	if (stan == 1)
		{
		document.getElementById(id).style.background = "url(images/ramka_galeria_osobowe.jpg)"; 
		}
	else if (stan == 0)
		{
		document.getElementById(id).style.background = "url(images/ramka_galeria_osobowe1.jpg)";
		}
	}
	
//PODMIANA RAMKI W DZIALE SAMOCHODY OSOBOWE
function PodmienRamkeOsobowe(stan,id)
	{
	if (stan == 1)
		{
		document.getElementById(id).style.background = "url(images/ramka_foto_osobowe.gif)"; 
		}
	else if (stan == 0)
		{
		document.getElementById(id).style.background = "url(images/ramka_foto_osobowe1.gif)";
		}
	}
	
//PODMIANA ZDJECIA W DZIALE SAMOCHODY UZYWANE	
function PodmienZdjecie(name,folder_numer)
	{
	document.images.zdjecie_glowne.src="oferta/prod"+folder_numer+"/"+name;
	document.getElementById("ramka_glowna").innerHTML = "<a href='oferta/prod"+folder_numer+"/orig/"+name+"' rel='lightbox'><img name='zdjecie_glowne' src='oferta/prod"+folder_numer+"/"+name+"' alt='' title='' /></a>";
	}
	
//PODMIANA KOLORU KOMORKI W DZIALE SAMOCHODY UZYWANE
function PodmienKolorTabelki(wartosc,kolor)
	{
	document.getElementById("td1_"+wartosc).style.backgroundColor = kolor;
	document.getElementById("td2_"+wartosc).style.backgroundColor = kolor;
	document.getElementById("td3_"+wartosc).style.backgroundColor = kolor;
	}
	
function IdzDo(link)
	{
	document.location.href = link;
	}
	
function PokazFormularzSamochodyOsobowe(pokaz,schowaj)
	{
	document.getElementById(pokaz).style.display = "block";
	document.getElementById(schowaj).style.display = "none";
	}
	
	
	
//POPUPY
/***********************************************
* Floating Top Bar script- Š Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
//(szerokosc przegladarki - szerokoscdiva) / 2 

var startX = 350//30 //set x offset of bar in pixels
var startY = 120//5 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function rozwin_wiersz(id){	
	//alert("#wiersz_"+id);
	var height = $("wiersz_"+id).getHeight();	
	//alert(document.getElementById("#wiersz_"+$id).height);	
	if (height != 55){	
		$("wiersz_"+id).setStyle({
		  height: '55px'		  
		});			
		$("wiersz_naglowek_"+id).removeClassName('on');
	}	
	else{	
		$("wiersz_"+id).setStyle({
		  height: 'auto'		  
		});	
		$("wiersz_naglowek_"+id).addClassName('on');
		
		//document.getElementById("wiecej_szczegolow_"+$id).innerHTML='zwiń';
		//$(".wiersz_historii_rozwiniety").css("background", "#eeeeee");
	}

}









function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

function staticbar(){
//alert($('topbar').getWidth());
var topbarwidth = $('topbar').getWidth();

//*** obliczanie sze4rokosci okna
		var windowWidth, windowHeight;
		
		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;
		}
//***
startX = (windowWidth - topbarwidth) / 2 ;

	barheight=document.getElementById("topbar").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("topbar");
	stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
	
