function iClient(count) {
	document.iClientIndex=-1;
	document.iClientCount=count;
	for(var i=0;i<count;i++) {
		var img=document.getElementById('client-'+i);
		img.style.display='none';
	}
	iClientShow();
	window.setInterval('iClientShow()',2000);
}

function iClientShow() {
	var img=document.getElementById('client-'+document.iClientIndex);
	if (img)
		img.style.display='none';
	document.iClientIndex++;
	if (document.iClientIndex>=document.iClientCount)
		document.iClientIndex=0;
	var img=document.getElementById('client-'+document.iClientIndex);
	img.style.display='inline';
}

function iTabs(prefix) {
	for(var i=1;i<=3;i++) {
		var td=document.getElementById(prefix+'-tab-'+i);
		td.iTabPrefix=prefix;
		td.iTabIndex=i;
		td.onmousedown=iTabShow;
		var div=document.getElementById(prefix+'-body-'+i);
		div.style.display=(i==1?'block':'none');
	}
}

function iTabShow() {
	for(var i=1;i<=3;i++) {
		var div=document.getElementById(this.iTabPrefix+'-body-'+i);
		div.style.display=(i==this.iTabIndex?'block':'none');
	}
}

// --- iFlash ---

function iFlashHtml(src,width,height,id,bgcolor,flashvars) {	
	var html='';
	if (id) {
		html+='<SCRIPT LANGUAGE=VBScript\> \n';
		html+='on error resume next \n';
		html+='Sub '+id+'_FSCommand(ByVal command, ByVal args)\n';
		html+='  call '+id+'_DoFSCommand(command, args)\n';
		html+='end sub\n';
		html+='</SCRIPT\> \n';
	}
	html+='<object type="application/x-shockwave-flash"';
	html+='   width="'+width+'px"';
	html+='   height="'+height+'px"';
	if (id) {
		html+='   id="'+id+'"';
		html+='   name="'+id+'"';
	}
	html+='   data="'+src+'">';
	html+='<param name=movie value="'+src+'">';
	html+='<param name=flashvars value="'+flashvars+'">';
	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>';
	//alert(html);
	return(html);
}

function iFlashGenerate(src,width,height,id,bgcolor,flashvars,install) {
	var html='';
	if ((!install)||(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);
	}
}