﻿function addEvent(obj, type, fn) {
			if (obj.addEventListener) {
					obj.addEventListener(type, fn, false);
			} 
			else if (obj.attachEvent) {
				obj["e"+type+fn] = fn;
				obj[type+fn] = function() {obj["e"+type+fn](window.event); 
			}
				obj.attachEvent("on"+type, obj[type+fn]);
			}
}
		
function funkcja_inicjujaca() {

			tworzenie_loga ();
			//tworzenie_banera ();
		}
		
addEvent(window, "load", funkcja_inicjujaca);
		
///////////////////////////////////////////////////////////////////////////////
function tworzenie_loga () {	
	//tworzenie przyciskow powiekszenia czcionki
	var diva = document.createElement('div');
	 diva.setAttribute("id", "logo_swf");
	 //wlozenie przycisku;
	 if (document.getElementById('en') ) {
	 document.getElementById('en').appendChild(diva);
	 wstawianie_logo ();
	 zaladowano_logo ();
	 }
	
	
};

function wstawianie_logo () {
var so = new SWFObject("/flash/logo_en.swf", "logo_plik", "360", "60", "8", "#000000");
		so.addParam("wmode", "transparent");
		so.write("logo_swf");
		//if(so.write("pojemnik_flasha") {
		//document.getElementById('menu').style.background-image='none';
		//}
}

function zaladowano_logo() {
	document.getElementById('en').firstChild.firstChild.style.background='none';
	document.getElementById('en').firstChild.firstChild.style.background='transparent url(/images/blank.gif) top left repeat';
	document.getElementById('en').firstChild.style.textIndent='-5000px';
	
}

function tworzenie_banera () {	

	//tworzenie przyciskow powiekszenia czcionki
	var diva2 = document.createElement('div');
	 diva2.setAttribute("id", "baner_swf");
	 //wlozenie przycisku;
	 if (document.getElementById('baner_strony_1') ) {
	 document.getElementById('baner_strony_1').appendChild(diva2);
	 wstawianie_baner (1);
	 //zaladowano_baner ();
	 }
	 
	 if (document.getElementById('baner_strony_2') ) {
	 document.getElementById('baner_strony_2').appendChild(diva2);
	 wstawianie_baner (2);
	 //zaladowano_baner ();
	 }
	 
	 if (document.getElementById('baner_strony_3') ) {
	 document.getElementById('baner_strony_3').appendChild(diva2);
	 wstawianie_baner (3);
	 //baner ();
	 }
	
	
};

function wstawianie_baner (zmienna) {
var so2 = new SWFObject("/flash/baner.swf", "tlo_flash", "720", "226", "8", "#000000");
so2.addParam("wmode", "opaque");
so2.write("baner_swf");	
}

function baner () {
	
	document.getElementById('baner_swf').className='zaladowany';
	//alert('zaladowano');
}
