


KAFEL.Fp.jsLoaded = function(){

if(document.getElementById('todaytabs')){
var todayTabs = new KAFEL.Fp.tabs("todaytabs");
todayTabs.bChangeTab=0;
todayTabs.sCurrentTab = 'featured1';
todayTabs.changeAction(KAFEL.Fp.loadPanel,{"type":"tab","module":"today","load":"story,footer"});
todayTabs.setupTabs();
KAFEL.Fp.setupStoriesTabs("footer1",todayTabs,"featured1ct");
}


KAFEL.Fp.selectTab = function(sTab,oObj){
sTab = KAFEL.cookie.getsub("FPM",sTab);
if(sTab!=""){
setTimeout( function(){
oObj.tabAction(0,oObj,document.getElementById(sTab));
}, 10);
}
}


if(KAFEL.cookie.get("FPM").indexOf('=')>0){
KAFEL.Fp.selectTab("news",newsTabs);
KAFEL.Fp.selectTab("today",todayTabs);
}
KAFEL.Fp.onJsLoaded.fire();
};















(function(){
	var Y=KAFEL.util,getStyle,setStyle,id_counter=0,propertyCache={};
	var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);
	var patterns={HYPHEN:/(-[a-z])/i};
	var toCamel=function(property)
	{
		if(!patterns.HYPHEN.test(property)){return property;}
		if(propertyCache[property]){return propertyCache[property];}
		
		while(patterns.HYPHEN.exec(property))
			{property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}

		propertyCache[property]=property;
		return property;
	};
		
	if(document.defaultView&&document.defaultView.getComputedStyle)
		{
			getStyle=function(el,property)
				{
					var value=null;
					var computed=document.defaultView.getComputedStyle(el,'');
					if(computed){value=computed[toCamel(property)];}
					return el.style[property]||value;
				};
		}
	else if(document.documentElement.currentStyle&&isIE)
		{
			getStyle=function(el,property)
			{
				switch(toCamel(property))
					{
						case'opacity':
							var val=100;
							try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}
							catch(e)
								{
									try {val=el.filters('alpha').opacity;}
									catch(e){}
								}
							return val/100;
							break;
						default:
							var value=el.currentStyle?el.currentStyle[property]:null;
							return(el.style[property]||value);}
			};
		}
	else{getStyle=function(el,property){return el.style[property];};}

	if(isIE)
	{
		setStyle=function(el,property,val)
					{
						switch(property)
						{
							case'opacity':
								if(typeof el.style.filter=='string')
								{
									el.style.filter='alpha(opacity='+val*100+')';
									if(!el.currentStyle||!el.currentStyle.hasLayout)
									{
										el.style.zoom=1;
									}
								}
								break;
							default:
								el.style[property]=val;
						}
					};
	}
	else
	{
		setStyle=function(el,property,val)
					{
						el.style[property]=val;
					};
	}

	KAFEL.util.Dom=
	{
		get:function(el)
			{
				if(!el)
				{
					return null;
				}
				
				if(typeof el!='string'&&!(el instanceof Array))
				{
					return el;
				}
				
				if(typeof el=='string')
				{
					return document.getElementById(el);
				}
				
				else
				{
					var collection=[];
					for(var i=0,len=el.length;i<len;++i)
					{
						collection[collection.length]=Y.Dom.get(el[i]);
					}
					return collection;
				}
				
				return null;
			},
		
		getStyle:function(el,property)
			{
				property=toCamel(property);
				var f=function(element)
						{
							return getStyle(element,property);
						};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		setStyle:function(el,property,val)
			{
				property=toCamel(property);
				var f=function(element)
						{
							setStyle(element,property,val);
						};
				Y.Dom.batch(el,f,Y.Dom,true);
			},
			
		getXY:function(el)
			{
				var f=function(el)
						{
							if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')
							{
								return false;
							}
							var parentNode=null;
							var pos=[];
							var box;
							
							if(el.getBoundingClientRect)
							{
								box=el.getBoundingClientRect();
								var doc=document;
								if(!this.inDocument(el)&&parent.document!=document)
								{
									doc=parent.document;
									if(!this.isAncestor(doc.documentElement,el))
									{
										return false;
									}
								}
								var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);
								var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);
								return[box.left+scrollLeft,box.top+scrollTop];
							}
							else
							{
								pos=[el.offsetLeft,el.offsetTop];
								parentNode=el.offsetParent;
								if(parentNode!=el)
								{
									while(parentNode)
									{
										pos[0]+=parentNode.offsetLeft;
										pos[1]+=parentNode.offsetTop;
										parentNode=parentNode.offsetParent;
									}
								}

								if(isSafari&&this.getStyle(el,'position')=='absolute')
								{
									pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;
								}
							}

							if(el.parentNode)
							{
								parentNode=el.parentNode;
							}
							else
							{
								parentNode=null;
							}
							
							while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML')
							{
								if(Y.Dom.getStyle(parentNode,'display')!='inline')
								{
									pos[0]-=parentNode.scrollLeft;
									pos[1]-=parentNode.scrollTop;
								}
						
								if(parentNode.parentNode)
								{
									parentNode=parentNode.parentNode;
								}
								else
								{
									parentNode=null;
								}
							}

							return pos;
						};
						return Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		getX:function(el)
			{
				var f=function(el)
						{
							return Y.Dom.getXY(el)[0];
						};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		getY:function(el)
			{
				var f=function(el)
						{
							return Y.Dom.getXY(el)[1];
						};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
			
		setXY:function(el,pos,noRetry)
			{
				var f=function(el)
						{
							var style_pos=this.getStyle(el,'position');
							
							if(style_pos=='static')
							{
								this.setStyle(el,'position','relative');style_pos='relative';
							}
							var pageXY=this.getXY(el);
							
							if(pageXY===false)
							{
								return false;
							}

							var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];
							
							if(isNaN(delta[0]))
							{
								delta[0]=(style_pos=='relative')?0:el.offsetLeft;
							}

							if(isNaN(delta[1]))
							{
								delta[1]=(style_pos=='relative')?0:el.offsetTop;
							}

							if(pos[0]!==null)
							{
								el.style.left=pos[0]-pageXY[0]+delta[0]+'px';
							}

							if(pos[1]!==null)
							{
								el.style.top=pos[1]-pageXY[1]+delta[1]+'px';
							}

							if(!noRetry)
							{
								var newXY=this.getXY(el);
								if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1]))
								{
									this.setXY(el,pos,true);
								}
							}
						};
						
						Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		setX:function(el,x)
			{
				Y.Dom.setXY(el,[x,null]);
			},
			
		setY:function(el,y)
			{
				Y.Dom.setXY(el,[null,y]);
			},
			
		getRegion:function(el)
			{
				var f=function(el)
						{
							var region=new Y.Region.getRegion(el);
							return region;
						};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
			
		getClientWidth:function()
			{
				return Y.Dom.getViewportWidth();
			},
			
		getClientHeight:function()
			{
				return Y.Dom.getViewportHeight();
			},
			
		getElementsByClassName:function(className,tag,root)
			{
				var method=function(el)
						{
							return Y.Dom.hasClass(el,className);
						};
				return Y.Dom.getElementsBy(method,tag,root);
			},
			
		hasClass:function(el,className)
			{
				var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');
				var f=function(el)
						{
							return re.test(el['className']);
						};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
			
		addClass:function(el,className)
			{
				var f=function(el)
						{
							if(this.hasClass(el,className))
								{
									return;
								}
							el['className']=[el['className'],className].join(' ');
						};
						Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		removeClass:function(el,className)
			{
				var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');
				var f=function(el)
						{
							if(!this.hasClass(el,className))
							{
								return;
							}
							var c=el['className'];el['className']=c.replace(re,' ');
				
							if(this.hasClass(el,className))
							{
								this.removeClass(el,className);
							}
						};
				Y.Dom.batch(el,f,Y.Dom,true);
			},
					
		replaceClass:function(el,oldClassName,newClassName)
			{
				if(oldClassName===newClassName)
				{
					return false;
				}
				var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');
				var f=function(el)
							{
								if(!this.hasClass(el,oldClassName))
								{
									this.addClass(el,newClassName);
									return;
								}
								
								el['className']=el['className'].replace(re,' '+newClassName+' ');
								
								if(this.hasClass(el,oldClassName))
								{
									this.replaceClass(el,oldClassName,newClassName);
								}
							};
							
							Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		generateId:function(el,prefix)
			{
				prefix=prefix||'yui-gen';el=el||{};
				var f=function(el)
							{
								if(el)
								{
									el=Y.Dom.get(el);
								}
								else
								{
									el={};
								}

								if(!el.id)
								{
									el.id=prefix+id_counter++;
								}

								return el.id;
							};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		isAncestor:function(haystack,needle)
			{
				haystack=Y.Dom.get(haystack);
				
				if(!haystack||!needle)
				{
					return false;
				}
			
				var f=function(needle)
							{
								if(haystack.contains&&!isSafari)
								{
									return haystack.contains(needle);
								}
								else if(haystack.compareDocumentPosition)
								{
									return!!(haystack.compareDocumentPosition(needle)&16);
								}
								else
								{
									var parent=needle.parentNode;
									
									while(parent)
									{
										if(parent==haystack)
										{
											return true;
										}
										else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML')
										{
											return false;
										}
										
										parent=parent.parentNode;}

										return false;
								}
							};
				return Y.Dom.batch(needle,f,Y.Dom,true);
			},
		
		inDocument:function(el)
			{
				var f=function(el)
							{
								return this.isAncestor(document.documentElement,el);
							};
				return Y.Dom.batch(el,f,Y.Dom,true);
			},
		
		getElementsBy:function(method,tag,root)
			{
				tag=tag||'*';
				var nodes=[];
				
				if(root)
				{
					root=Y.Dom.get(root);
					
					if(!root)
					{
						return nodes;
					}
				}
				else
				{
					root=document;
				}
				
				var elements=root.getElementsByTagName(tag);
				
				if(!elements.length&&(tag=='*'&&root.all))
				{
					elements=root.all;
				}

				for(var i=0,len=elements.length;i<len;++i)
				{
					if(method(elements[i]))
					{
					nodes[nodes.length]=elements[i];
					}
				}
				
				return nodes;
			},

		batch:function(el,method,o,override)
			{
				var id=el;el=Y.Dom.get(el);
				var scope=(override)?o:window;
				if(!el||el.tagName||!el.length)
				{
					if(!el)
					{
						return false;
					}
					return method.call(scope,el,o);
				}
				
				var collection=[];
				
				for(var i=0,len=el.length;i<len;++i)
				{
					if(!el[i])
					{
						id=el[i];
					}
					collection[collection.length]=method.call(scope,el[i],o);
				}

				return collection;
			},

		getDocumentHeight:function()
			{
				var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;
				var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());
				return h;
			},
		
		getDocumentWidth:function()
			{
				var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;
				var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());
				return w;
			},
		
		getViewportHeight:function()
			{
				var height=self.innerHeight;
				var mode=document.compatMode;
				
				if((mode||isIE)&&!isOpera)
				{
					height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;
				}
				
				return height;
			},

		getViewportWidth:function()
			{
				var width=self.innerWidth;
				var mode=document.compatMode;
				
				if(mode||isIE)
				{
					width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;
				}
				
				return width;
			}

	};

}
)
();


KAFEL.util.CustomEvent=function(type,oScope,silent,signature)
	{
		this.type=type;
		this.scope=oScope||window;
		this.silent=silent;
		this.signature=signature||KAFEL.util.CustomEvent.LIST;
		this.subscribers=[];
		if(!this.silent){}
		var onsubscribeType="_YUICEOnSubscribe";
		
		if(type!==onsubscribeType)
		{
			this.subscribeEvent=new KAFEL.util.CustomEvent(onsubscribeType,this,true);
		}
	};


KAFEL.util.CustomEvent.prototype=
	{
		subscribe:function(fn,obj,override)
				{
					if(this.subscribeEvent)
					{
						this.subscribeEvent.fire(fn,obj,override);
					}

					this.subscribers.push(new KAFEL.util.Subscriber(fn,obj,override));
				},
				
		unsubscribe:function(fn,obj)
				{
					var found=false;
					
					for(var i=0,len=this.subscribers.length;i<len;++i)
					{
						var s=this.subscribers[i];
						
						if(s&&s.contains(fn,obj))
						{
							this._delete(i);
							found=true;
						}
					}
					
					return found;
				},
		fire:function()
				{
					var len=this.subscribers.length;
					
					if(!len&&this.silent)
					{
						return true;
					}
					
					var args=[],ret=true,i;
					
					for(i=0;i<arguments.length;++i)
					{
						args.push(arguments[i]);
					}

					var argslength=args.length;
					
					if(!this.silent){}
					
					for(i=0;i<len;++i)
					{
						var s=this.subscribers[i];
						
						if(s)
						{
							if(!this.silent){}
							var scope=s.getScope(this.scope);
							
							if(this.signature==KAFEL.util.CustomEvent.FLAT)
							{
								var param=null;
								
								if(args.length>0)
								{
									param=args[0];
								}

								ret=s.fn.call(scope,param,s.obj);
							}
							else
							{
								ret=s.fn.call(scope,this.type,args,s.obj);
							}

							if(false===ret)
							{
								if(!this.silent){}
								return false;}
							}
					}

					return true;
				},
		
		unsubscribeAll:function()
				{
					for(var i=0,len=this.subscribers.length;i<len;++i)
					{
						this._delete(len-1-i);
					}
				},
		
		_delete:function(index)
				{
					var s=this.subscribers[index];
					
					if(s)
					{
						delete s.fn;
						delete s.obj;
					}
					
					this.subscribers.splice(index,1);
				},
		
		toString:function()
				{
					return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;
				}
	};

//potrzebne
KAFEL.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};
//

if(!KAFEL.util.Event)
{
	KAFEL.util.Event=function()
		{
			var loadComplete=false;
			var listeners=[];
			var unloadListeners=[];
			var legacyEvents=[];
			var legacyHandlers=[];
			var retryCount=0;
			var onAvailStack=[];
			var legacyMap=[];
			var counter=0;
			return {
				POLL_RETRYS:200,
				POLL_INTERVAL:20,
				EL:0,
				TYPE:1,
				FN:2,
				WFN:3,
				OBJ:3,
				ADJ_SCOPE:4,
				isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),
				isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),
				_interval:null,
				startInterval:function()
						{
							if(!this._interval)
							{
								var self=this;
								var callback=function()
									{
										self._tryPreloadAttach();
									};
								this._interval=setInterval(callback,this.POLL_INTERVAL);
							}
						},
				onAvailable:function(p_id,p_fn,p_obj,p_override)
						{
							onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});
							retryCount=this.POLL_RETRYS;
							this.startInterval();
						},
				onContentReady:function(p_id,p_fn,p_obj,p_override)
						{
							onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});
							retryCount=this.POLL_RETRYS;this.startInterval();
						},
				
				addListener:function(el,sType,fn,obj,override)
						{
							if(!fn||!fn.call)
							{
								return false;
							}
							if(this._isValidCollection(el))
							{
								var ok=true;
								
								for(var i=0,len=el.length;i<len;++i)
								{
									ok=this.on(el[i],sType,fn,obj,override)&&ok;
								}
								
								return ok;
							}
							else if(typeof el=="string")
							{
								var oEl=this.getEl(el);
								if(oEl)
								{
									el=oEl;
								}
								else
								{
									this.onAvailable(el,function(){KAFEL.util.Event.on(el,sType,fn,obj,override);});
									return true;
								}
							}
							
							if(!el)
							{
								return false;
							}

							if("unload"==sType&&obj!==this)
							{
								unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];
								return true;
							}

							var scope=el;
							
							if(override)
							{
								if(override===true)
								{
									scope=obj;
								}
								else
								{
									scope=override;
								}
							}

							var wrappedFn=function(e)
								{
									return fn.call(scope,KAFEL.util.Event.getEvent(e),obj);
								};
							
							var li=[el,sType,fn,wrappedFn,scope];
							var index=listeners.length;listeners[index]=li;
							if(this.useLegacyEvent(el,sType))
							{
								var legacyIndex=this.getLegacyIndex(el,sType);
								
								if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0])
								{
									legacyIndex=legacyEvents.length;
									legacyMap[el.id+sType]=legacyIndex;
									legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];
									legacyHandlers[legacyIndex]=[];
									el["on"+sType]=function(e)
										{
											KAFEL.util.Event.fireLegacyEvent(KAFEL.util.Event.getEvent(e),legacyIndex);
										};
								}

								legacyHandlers[legacyIndex].push(li);
							}
							else
							{
								try
								{
									this._simpleAdd(el,sType,wrappedFn,false);
								}
								catch(e)
								{
									this.removeListener(el,sType,fn);
									return false;
								}
							}
							
							return true;
						},
					

				fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}
return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
return false;}
var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}
delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
return id;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){loadComplete=true;var EU=KAFEL.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}
if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}
return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=KAFEL.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
j=j-1;}
l=null;EU.clearCache();}
for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};
		
		}();
		
		(function(){var EU=KAFEL.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}
EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}








//niepotrzebne, ale ciekawe :P
KAFEL.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d/2)==2){return b+c;}
if(!p){p=d*(.3*1.5);}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-KAFEL.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return KAFEL.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
return KAFEL.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};
// koniec niepotrzebnego ale ciekawego :P
	


//wymagane
KAFEL.Fp.onJsLoaded=new KAFEL.util.CustomEvent('onJsLoaded');






//otwieranie kolejnych kart
KAFEL.Fp.tabs=function(sModuleName){this.sModuleName=sModuleName;this.dCurTab="";this.dCurTabNum=1;this.aTabs=[];this.sTrigger="click";this.fAction=null;this.oActionVars=null;this.sTabTag="li";this.sClickTag="a";this.sOnName="on";this.sOffName="off";this.sHiLiteName="sparkle";this.nActionDelay=0;this.bRoundCorners=0;this.bIsOver=[];this.bChangeTab=1;this.aDataProcessed=[];this.oChildren={};this.sCurrentTab=null;};

KAFEL.Fp.tabs.prototype.changeAction=function(action,vars){this.fAction=action;this.oActionVars=vars;};

KAFEL.Fp.tabs.prototype.setupTabs=function(){var dTab=document.getElementById(this.sModuleName).getElementsByTagName(this.sTabTag);var nTabLength=dTab.length,i,j;for(i=0;i<nTabLength;i++){if(KAFEL.util.Dom.hasClass(dTab[i],this.sOnName)){this.dCurTab=dTab[i];}
var dClickTag=dTab[i].getElementsByTagName(this.sClickTag)||0;var nClickTagLength=dClickTag.length;for(j=0;j<nClickTagLength;j++){if(dClickTag[j].href.indexOf('schedule.cgi')<0){dClickTag[j].order=(i+1);this.aTabs[(i+1)]=dClickTag[j];var oSelf=this;var fAction=function(e){if(e){KAFEL.util.Event.stopEvent(e);}
oSelf.bIsOver[j]=1;var dNode=KAFEL.Fp._ie?window.event.srcElement:e.target;setTimeout(function(){if(oSelf.bIsOver[j]==1){oSelf.tabAction(e,oSelf,dNode);}},oSelf.nActionDelay);return false;}
if(dClickTag[j].id!='vsearchmore'){KAFEL.util.Event.addListener(dClickTag[j],this.sTrigger,fAction);}
if(this.sTrigger=="mouseover"){KAFEL.util.Event.addListener(dClickTag[j],"mouseout",function(){oSelf.bIsOver[j]=0;});}else if(this.sTrigger=="mousedown"){KAFEL.util.Event.addListener(dClickTag[j],"click",function(e){if(e){KAFEL.util.Event.stopEvent(e);}return false;});}}}}};


KAFEL.Fp.tabs.prototype.changeTab=function(oSelf,dNode){if(dNode&&dNode.id){if(oSelf.sCurrentTab!=null){KAFEL.util.Dom.removeClass(oSelf.oActionVars.module,oSelf.sCurrentTab);}
oSelf.sCurrentTab=dNode.id;KAFEL.util.Dom.addClass(oSelf.oActionVars.module,oSelf.sCurrentTab);}
if((oSelf.dCurTabNum-1)>0){KAFEL.util.Dom.removeClass(oSelf.aTabs[(oSelf.dCurTabNum-1)].parentNode.parentNode,oSelf.sOffName);}
KAFEL.util.Dom.removeClass(oSelf.dCurTab,oSelf.sOnName);oSelf.dCurTab=(oSelf.oActionVars.type=='tab'?dNode.parentNode.parentNode:dNode.parentNode);KAFEL.util.Dom.removeClass(oSelf.dCurTab,oSelf.sHiLiteName);oSelf.dCurTabNum=dNode.order;KAFEL.util.Dom.addClass(oSelf.dCurTab,oSelf.sOnName);if((oSelf.dCurTabNum-1)>0){KAFEL.util.Dom.addClass(oSelf.aTabs[(oSelf.dCurTabNum-1)].parentNode.parentNode,oSelf.sOffName);}};



KAFEL.Fp.tabs.prototype.tabAction=function(e,oSelf,dNode){if(dNode.tagName=='IMG'){dNode=dNode.parentNode;}
if(oSelf.bChangeTab)oSelf.changeTab(oSelf,dNode);if(oSelf.fAction)oSelf.fAction(oSelf.oActionVars,dNode,this);return false;};
//koniec otwierania
	
	
//wazne!!!	
KAFEL.Fp.loadPanel=function(args,self,obj)
	{
		KAFEL.Fp.currentTab=obj;
		var sSelfId=(args.type=="story"?self.parentNode.id:self.id);
		
		if(sSelfId.indexOf("|")>0)
		{
			var aSelfId=sSelfId.split("|");
			sSelfId=aSelfId[0];
			var sCheckSum=aSelfId[1];
		}
		
		var oStory=document.getElementById(sSelfId+"ct"),oPanel=document.getElementById(args.module+"bd");
		
		if(args.type=="tab")
		{
			var sCookie=sSelfId;
			var tDate=new Date();
			var tExpires=new Date(tDate.getTime()+(60000*30));
			KAFEL.cookie.setsub("FPM",args.module,sCookie,tExpires);
		}

		var temp=oStory.innerHTML.replace(/( |\n|\r)/g,"");
		
		if(temp!=''||(typeof(obj.aDataProcessed[oStory.id])!='undefined'&&obj.aDataProcessed[oStory.id]==1))
		{
			obj.changeTab(obj,self);
			KAFEL.Fp.showCurrentPanel(oStory.id);
			
			if(args.module=='today'&&args.type=='tab')
			{
				KAFEL.Fp.showCurrentPanel('footer'+self.order);
				KAFEL.Fp.setupStoriesTabs('footer'+self.order,obj,oStory.id);
				//var sChildId=obj.oChildren[sSelfId+'ct'].dCurTab.id;    chyba niepotrzebne ;P
				
				if(sChildId)
				{
					sChildId=sChildId.indexOf('|')>1?sChildId.split('|')[0]:sChildId;KAFEL.Fp.showCurrentPanel(sChildId+'ct');
				}
			}
		}
		else
		{
			var sKfTemp=(KAFEL.Fp.Kf)?KAFEL.Fp.Kf:'';
			url=KAFEL.Fp.prepareUrl(url,1,1);
			var oCallback=
						{
							success:KAFEL.Fp.panelCallBack,
							failure:function()
								{
									KAFEL.Fp.handleAjaxError(self.href);
								},
							argument:{
								args:args,
								self:self,
								oStory:oStory,
								obj:obj
									}
						};
			
			if(KAFEL.Fp.currentTabArgs&&KAFEL.Fp.currentTabArgs[args.module]&&KAFEL.Fp.currentTabArgs[args.module].timeout)
			{
				clearTimeout(KAFEL.Fp.currentTabArgs[args.module].timeout);
			}

			var timeout=setTimeout(function(){KAFEL.Fp.handleAjaxError(self.href);},KAFEL.Fp.dynamicScriptNodes.timeout);
			
			KAFEL.Fp.currentTabArgs[args.module]={'args':args,'self':self,'oStory':oStory,'obj':obj,'timeout':timeout};
			var oYLC=[{key:'p',value:sSelfId.substring(0,1)+sSelfId.substring(sSelfId.length-1)},{key:'c',value:'i'}];
			KAFEL.Fd.updateYLC(oYLC);KAFEL.Fp.dynamicScriptNodes.load(url,'');
		}
	};



//wyswietlanie w kazdej karcie czegos innego
KAFEL.Fp.showCurrentPanel=function(sCurrentNodeId)
	{
		var a=arguments;
		var sTagName=(a.length>1&&a[1]!='')?a[1]:'span';
		var sClassName=(a.length>2&&a[2]!='')?a[2]:'current';
		var aNodes=document.getElementById(sCurrentNodeId).parentNode.getElementsByTagName(sTagName);
		var nNodesLength=aNodes.length,i;
		
		for(i=0;i<nNodesLength;i++)
		{
			if(KAFEL.util.Dom.hasClass(aNodes[i],sClassName))
			{
				KAFEL.util.Dom.removeClass(aNodes[i],sClassName);
			}
		}
	
		KAFEL.util.Dom.addClass(document.getElementById(sCurrentNodeId),sClassName);
	};




KAFEL.Fp.Logout={};

KAFEL.Fp.Logout.close=function(e){if(e)KAFEL.util.Event.stopEvent(e);var el=document.getElementById('logout');el.style.height=KAFEL.util.Dom.getStyle(el,'height');el.style.width=KAFEL.util.Dom.getStyle(el,'width');var eChild=el.getElementsByTagName('div')[0];var myAnim=new KAFEL.util.Anim(eChild,{opacity:{to:0}},.2);myAnim.onComplete.subscribe(function(){eChild.parentNode.removeChild(eChild);});myAnim.animate();var myAnim2=new KAFEL.util.Anim(el,{height:{to:0},opacity:{to:0}},.3,KAFEL.util.Easing.easeIn);myAnim2.onComplete.subscribe(function(){el.style.display='none';});myAnim2.animate();return false;};

KAFEL.Fp.Logout.cookie=function(){var sPhCookie=KAFEL.cookie.get('PH');var iCookieExp=1;if(sPhCookie){if(sPhCookie.indexOf('logout')>-1){var aPhCookie=sPhCookie.split('&');var aTempCookie=[];for(var i=0,keyValue;keyValue=aPhCookie[i];i++){keyValue=keyValue.split('=');if(keyValue[0]!='logout'){aTempCookie[aTempCookie.length]=[keyValue[0],'=',keyValue[1]].join('');}}
iCookieExp=(aTempCookie.length==0)?iCookieExp:400*3600000;KAFEL.cookie.set('PH',aTempCookie.join('&'),iCookieExp,'','.infolinia.org');}}
else{KAFEL.cookie.set('PH','',iCookieExp,'','.infolinia.org');}}();

KAFEL.Fp.Logout.init=function(){if(document.getElementById('logout')){KAFEL.util.Event.addListener('lo_close','click',KAFEL.Fp.Logout.close);}};

KAFEL.Fp.onJsLoaded.subscribe(KAFEL.Fp.Logout.init);

if(typeof(KAFEL.Fp.jsLoaded)=='function'){KAFEL.Fp.jsLoaded();}




