function iImages() {
	var c,f,e,n,d=document.getElementsByTagName('IMG'),html='';

	for(i=0;i<d.length;i++) {
		c=d[i].className;
		if (c.substr(c.length-8)=='rollover') {

			f=d[i].src;
			e=f.substr(f.lastIndexOf('.'));
			f=f.substr(0,f.lastIndexOf('.'));
			f=f.substr(0,f.length-2);
			d[i].iImageSrc1=d[i].src;
			d[i].iImageSrc2=f+'_2'+e;
			html+='<img src="'+d[i].iImageSrc2+'">';
			html+='<img src="'+d[i].iImageSrc1+'">';
			if (d[i].addEventListener) {
				d[i].addEventListener("mouseover",iImageOver, false);
				d[i].addEventListener("mouseout",iImageOut, false);
			} else {
				d[i].onmouseover=iImageOver;
				d[i].onmouseout=iImageOut;
			}
		}
	}
	if (html!='')
		document.write('<div style="position:absolute;left:0px;top:0px;visibility:hidden">'+html+'</div>');
}
function iImageOver() {
	this.src=this.iImageSrc2;
}
function iImageOut() {
	this.src=this.iImageSrc1;
}
function iSubmit(form) {
  document.forms[form].submit();
}

// --- iFlash ---

var iFlashFSCommands=false;//(navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1);
if (iFlashFSCommands) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub flash_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call flash_command(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

function iFlashEscape(text) {
  /*var chars=['ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ź','Ż','±','¶','Ľ','ˇ','¦','¬'];
  text=escape(text);
  for(var i=0;i<chars.length;i++)
    text=text.replace(new RegExp(escape(chars[i]),"g"),chars[i]);*/
  //text=text.replace(/\&/g,escape('&'));
  //text=text.replace(/\?/g,escape('?'));
  return(text);
}

function iFlashHtml(src,width,height,id,bgcolor,flashvars) {
  var vars=[];
  for(e in flashvars) {
    vars.push(e+'='+iFlashEscape(flashvars[e]));
  }
  vars=vars.join('&');
	//if ((bgcolor=='')||(!bgcolor)) bgcolor='#000000';
	var html='';
	html+='<object type="application/x-shockwave-flash"';
	//html+='   classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"';
 	html+='   width="'+width+'px"';
 	html+='   height="'+height+'px"';
 	if (id)
 	  html+='   id='+id;
 	html+='   data="'+src+'">';
	html+='<param name=movie value="'+src+'">';
	html+='<param name=flashvars value="'+vars+'">';
	html+='<param name=quality value=high>';
	html+='<param name=menu value=false>';
	if (bgcolor=='transparent')
	  html+='<param name=wmode value=transparent>';
	else if (bgcolor)
	  html+='<param name=bgcolor value='+bgcolor+'>';
	html+='</object>';
	return(html);
}

function iFlashGenerate(src,width,height,id,bgcolor,flashvars,install) {
	var html='';
	if (iFlashVersion()>=6) {
		html+=iFlashHtml(src,width,height,id,bgcolor,flashvars);
	} else if (install) {
	  html+='<p>Do prawidłowego działania serwisu wymagany jest plugin Macromedia Flash 6 lub nowszy.</p><p>';
	  html+=iFlashHtml('layout/flash.swf',70,70,'href=index.php');
    html+='</p><p>Nie widzisz animacji? Zainstaluj plugin:</p><p>';
    html+='<a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" target=_blank><img src="layout/flash.gif" width=75 height=75></a>';
    html+='</p>';
	}
	document.write(html);
}

function iFlashVersion() {
	var i,v=0;
	if (navigator.plugins.length) {
	  var p=navigator.plugins;
    if ((p)&&(p.length>0)&&(p['Shockwave Flash']))	{
	    var w=p['Shockwave Flash'].description.split(' ');
		  for(i=0;i<w.length;i++) {
		    var j=parseInt(w[i]);
		    if (!isNaN(j))
		      v=Math.max(v,j);
		  }
    }
    return(v);
  } else {
	  for(v=10;v>0;v--) {
      var x=null;
      try {
        x=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+v);
      } catch(e) {}
      if (x) return(v);
    }
    return(0);
	}
}

function iFlashCommand(command,text) {
  //alert(command+' - '+text);
}

