var win_popups = new Array();


function swf_nawi(){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="290" id="nawi_home" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="nawi_home.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="nawi_home.swf" quality="high" bgcolor="#ffffff" width="800" height="290" name="nawi_home" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>');
	document.write('</object>');
}

function swf_nawi_3(tekst){
	document.write('<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="230" height="28" id="titolo_menu" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="images/titolo_menu.swf?titolo='+tekst+'" />');
	document.write('<param name="quality" value="best" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('</object>');
}

function swf_nawi_2(tekst){
	document.write('<OBJECT id="titolo_sezione" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="63" width="760" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">');
	document.write('<PARAM NAME="allowScriptAccess" VALUE="sameDomain">');
	
	document.write('<PARAM NAME="movie" VALUE="images/titolo_sezione.swf?titolo='+tekst+'">');
	document.write('<PARAM NAME="quality" VALUE="best"><PARAM NAME="wmode" VALUE="transparent">');
	document.write('<PARAM NAME="bgcolor" VALUE="#ffffff">');
/*	document.write('<embed src="titolo_sezione.swf?titolo=WSPOLNOTA&sottotitolo=Doskonala Kawa" wmode="transparent" quality="best" bgcolor="#ffffff" 
            width="760" height="63" name="titolo_sezione" align="middle" 
            allowScriptAccess="sameDomain" type="application/x-shockwave-flash" 
            pluginspage="http://www.macromedia.com/go/getflashplayer" />');*/
	document.write('</object>');
}

function swf_top_po(){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="760" height="123">');
	document.write('<param name="movie" value="Pliki/Flash/top.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="" />');
	document.write('<embed src="Pliki/Flash/top.swf" wmode="" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="760" height="123"></embed>');
	document.write('</object>');
}


function window_open(adres, nazwa, par) {
	if(nazwa in win_popups && !win_popups[nazwa].closed) {
		win_popups[nazwa].focus();
	} else {
		var win=window.open(adres, nazwa, par);
		win_popups[nazwa] = new Object(win);
	}
}


function load_data_ifarea(id) {
	document.getElementById(id+'_area').contentWindow.document.body.innerHTML=document.getElementById(id).value;
}


function delete_tresc(id) {
	if(confirm("Czy napewno usun±ć ?")) {
		document.location.href="index.php?d="+id;
	}
}

function file_open(img) {
	window_open("popup/plik.php?img="+img, "zt", "width=200,height=90,left=10,top=10");
}

function rollover_ini() {
	rollovers = new Array();
	var img=document.body.getElementsByTagName('img');
	for(var i=0; i<img.length; i++) {
		if(img[i].className=='rollover') {
			img[i].src.match(/(.*)\.([a-z0-9]+)$/i);
			var src_act=RegExp.$1+'_act.'+RegExp.$2;
			rollovers[i]=document.createElement('img');
			rollovers[i].src=src_act;
			img[i].alt=src_act;
			img[i].onmouseover = function () {
				var buff= new String(this.src);
				this.src=this.alt;
				this.alt=buff; 	
			}
			
			img[i].onmouseout = function () {
				var buff= new String(this.src);
				this.src=this.alt; 
				this.alt=buff;	
			}
			
			
		}
	}
}

function Init() {
	rollover_ini();
}

function drukuj(id) {
	var id_el=document.getElementById(id);
	if(id_el == undefined ) {
		alert("Opcje nie dostępna");
	} else {
		window_open("popup/popup.php?id=drukuj;"+id.toString(), 'drukowanie', 'width=600,height=500,scrollbars=yes,menubar=yes,status=yes,toolbar=no');
	}
}

function sklep_licz_koszt(obj) {
	var towar=document.getElementById('suma_all');
	if(typeof towar !== "object") {
		return false;
	}
	
	var koszt=document.getElementById("koszt_"+obj.value);
	if(!koszt) return false;
	
	var kwota=document.getElementById("kwota_cala");
	if(!kwota) return false;	
	
	var koszt_all=parseFloat(koszt.value) + parseFloat(towar.value);
	koszt_all=koszt_all.toFixed(2);
	
	var koszt_node=document.createTextNode(koszt_all.toString());
	
	if(kwota.firstChild == null) {
		kwota.appendChild(koszt_node);
	} else {
		kwota.replaceChild(koszt_node, kwota.firstChild);
	}	
}


function Chmurka(T,t){
 T.title=''
 T.parentNode.lastChild.style.display=t?'block':'none'
}



function zmien_avatar(obj){
	plik = obj.options[obj.selectedIndex].value;
	logon.imgavatar.src = 'images/avatar/'+plik;
}

function foto(){

		url = document.rotater.linki.value
		document.images.photoslider.src=url
}

function fotoi(url){

		//url = document.rotater.linki.value
		document.post.tresc.value = "sasasas"
		document.images.photoslider.src=url
}	

