var dbg; function zliczEraSkin() { _gde_wmjrfupixs = new Image(1,1); _gde_wmjrfupixs.src='http://gazeta.hit.gemius.pl/_'+(new Date()).getTime()+'/redot.gif?id=.cngGy_bf1ubAApfLTLN_qQsrodG0INA6O9sSmaA0V7.m7/stparam=wmjrfupixs'; } function zliczEraOverlayer() { _gde_npoeqlnghh = new Image(1,1); _gde_npoeqlnghh.src='http://gazeta.hit.gemius.pl/_'+(new Date()).getTime()+'/redot.gif?id=.cngGy_bf1ubAApfLTLN_qQsrodG0INA6O9sSmaA0V7.m7/stparam=npoeqlnghh'; } /* reklama player video */ document.write('<\/script>'); if(typeof banContent == 'undefined') var banContent = {}; /* * jQuery UI 1.7.2 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Draggable 1.7.2 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Draggables * * Depends: * ui.core.js */ (function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);; function trace(obj) { if (console.log) console.log(obj); } function isIE6() { return ($.browser.msie && $.browser.version == 6)} gazeta_pl.empty_string = function() { var str = arguments[0]; var rep = arguments.length == 2 ? arguments[1] : ''; return str ? str : rep; } gazeta_pl.format_time = function(time) { if (time == '') return ''; var d = time.split(/ /).shift(); var h = time.split(/ /).pop(); h = h.substr(0, 5); return ''+d+''+h+''; } gazeta_pl.short_text = function(str, len) { str = str.split(/ /); var res = ''; var i = 0; while (i < str.length && (res+str[i]).length < len) { res += str[i++]+' '; } res = $.trim(res); if (i < str.length) res += '...'; return res; } gazeta_pl.set_hash = function(elem, hash) { elem.attr('href', '#'+hash); } gazeta_pl.plejtv = { pagetype: null, config: { servlet_uri: { 'polecane': '/telewizor/RecommendedServletNowy', 'najnowsze': '/telewizor/NajServletNowy', 'najpopularniejsze': '/telewizor/NajServletNowy', 'moja_lista': '/telewizor/PlaylistServletNowy', 'szukaj': '/telewizor/FastSearchServletNowy' }, servlet_param: { 'najnowsze': 'newest', 'najpopularniejsze': 'popular', 'tytul': 'title', 'data': 'date' }, search_uri: '/plej/0,100924.html', index_uri: '/plej/0,100942.html', player_uri: '/plej/0,100864.html', channels: {}, defaults: {}, autoplay: true, init: function() { var me = gazeta_pl.plejtv.config; var fhtm = gazeta_pl.plejtv_vars; me.channels = fhtm.channels; me.defaults = fhtm.defaults; me.autoplay = fhtm.autoplay; } }, template: { get: function(name, rep) { var me = gazeta_pl.plejtv.template; var res = me[name]; for (var r in rep) { var reg = new RegExp('', 'g'); res = res.replace(reg, rep[r]); } return res; }, player: '
' + '

' + '
' + '
Wideo niedostępne
' + '

' + '

' + '
', pl_search_head: '
' + '' + 'Odtwarzaj wszystkie' + '
', pl_search_body: '', pl_user_head: '', pl_user_body: '
' + '
' + '

' // + 'Zrób widget i pokaż innym co oglądasz' + '

' + '
', pl_rows_head: '
' + '' + 'RSS' + '
', pl_rows_body: '
' + '
' + '

' + '+ więcej »' + '

' + '
', pl_grid_head: '
' + '' + '
', pl_grid_body: '
' + '
' + '

' + '
', pl_e_common: '
' + '

Nie znaleziono filmów spełniających podane kryteria.

' + '
', pl_e_user: '
' + '

Brak wideo na Twojej liście.

' + '

Dodaj wideo i zrób
własną ramówkę.

' + '
', pl_i_start: '
    ', pl_i_start_user: '
      ', pl_i_end: '
    ', pl_elem: '
  • ' + '
    <!title!>
    ' + '' + '
    ' + '

    ' + '

    ' + '
    ' + '
    ' + '' + '' + '
    ' + '
    ' + '
    odtwarzam
    ' + '
  • ', widget: '' + '' }, hash: { values: {}, current: [], has_focus: true, force: false, page_set: {}, init: function() { var me = gazeta_pl.plejtv.hash; var def = gazeta_pl.plejtv.config.defaults; for (var i in def) me.values[i] = def[i]; me.read(true); me.add_event_trigger(); }, set_page_number: function() { var me = gazeta_pl.plejtv.hash; if (me.values['strona']) { me.page_set = { 'kanal': me.values['kanal'], 'typ': me.values['typ'], 'slowo': me.values['slowo'] } } }, check_page_number: function() { var me = gazeta_pl.plejtv.hash; return (me.values['kanal'] == me.page_set['kanal'] && me.values['typ'] == me.page_set['typ']); }, read_page_number: function() { var me = gazeta_pl.plejtv.hash; return me.check_page_number() ? parseInt(me.values['strona']) : 1; }, read: function(first) { var me = gazeta_pl.plejtv.hash; var cfg = gazeta_pl.plejtv.config; var plr = gazeta_pl.plejtv.player; me.current = window.location.hash; var v = me.current.replace(/#/, '').split(/,/); for (var i = 0; i < v.length; i++) { var name = v[i].split(/=/).shift(); var value = v[i].split(/=/).pop(); var ok = false; switch (name) { case 'kanal': if (typeof cfg.channels[value] != 'undefined') ok = true; break; case 'typ': if (typeof cfg.servlet_uri[value] != 'undefined') ok = true; break; case 'film': if (value.match(/^[0-9]+_[0-9]+$/)) ok = true; break; case 'slowo': ok = true; break; case 'strona': if (value.match(/^[0-9]+$/)) ok = true; break; case 'sortuj': ok = (value == 'data' || value == 'tytul'); break; } if (ok) me.values[name] = value; } if (first) me.set_page_number(); plr.set(); }, add_event_trigger: function() { var me = gazeta_pl.plejtv.hash; $(document).focus(function() { me.has_focus = true; }); $(document).blur(function() { me.has_focus = false; }); (function () { window.setInterval(function() { if (me.has_focus && (me.force || me.current != window.location.hash)) { me.force = false; me.read(); } }, 100); })(); } }, user_list: { list: [], init: function() { var me = gazeta_pl.plejtv.user_list; me.list = $.cookie('plejtv_user_playlist') ? $.cookie('plejtv_user_playlist').replace(/,/g, '_').split(/;/) : []; me.set_nav(); $('#nav_user .nav_userlist a').click(function(e) { if (me.list.length == 0) e.preventDefault(); }); }, set_nav: function() { var me = gazeta_pl.plejtv.user_list; var elem = $('#nav_user .nav_userlist').parent(); if (me.list.length > 0) { if (!elem.hasClass('enabled')) elem.addClass('enabled'); elem.find('a').html('Moja lista ('+me.list.length+')') } else { if (elem.hasClass('enabled')) elem.removeClass('enabled'); elem.find('a').html('Moja lista'); } if (elem.find('.glow').length > 0) elem.find('.glow').width(elem.width() - 8); }, check: function(id) { var me = gazeta_pl.plejtv.user_list; return me.list.indexOf(id.split(/_/).pop()) > -1; }, add: function(id) { var me = gazeta_pl.plejtv.user_list; if (!me.check(id)) { me.list.push(id); me.save(); } }, empty: function() { var me = gazeta_pl.plejtv.user_list; return me.list.length == 0; }, del: function(id) { var me = gazeta_pl.plejtv.user_list; if (me.check(id)) { me.list.splice(me.list.indexOf(id), 1); me.save(); if (me.empty()) $('#playlist_empty_list').show(); } }, get: function(ajax) { var me = gazeta_pl.plejtv.user_list; var sep = ajax ? ',' : ';'; return me.list.join(sep); }, save: function() { var me = gazeta_pl.plejtv.user_list; $.cookie('plejtv_user_playlist', me.get(false), { expires: 365 }); me.set_nav(); }, on_list_btn_click: function(elem) { var me = gazeta_pl.plejtv.user_list; var id = elem.attr('hash').match(/list=([0-9]+)/).pop(); if (elem.hasClass('add_list_btn')) { if(me.list.length >= 21) return; elem.html('na liście'); elem.removeClass('add_list_btn'); elem.addClass('on_list_btn'); me.add(id); return; } if (elem.hasClass('del_list_btn')) { elem.parents().filter('li').eq(0).remove(); me.del(id); return; } if (elem.hasClass('on_list_btn')) { if (gazeta_pl.plejtv.pagetype == 'search_result') { window.location.href = gazeta_pl.plejtv.config.player_uri + '#typ=moja_lista'; } else { window.location.hash = 'typ=moja_lista'; } return; } }, on_remove_all_click: function() { var me = gazeta_pl.plejtv.user_list; if (me.empty()) return; if (confirm('Na pewno usunąć wszystkie elementy z listy?')) { $('#playlist_inner li').remove(); me.list = []; if (me.empty()) $('#playlist_empty_list').show(); me.save(); } }, on_sort_update: function() { var me = gazeta_pl.plejtv.user_list; me.list = []; $('#playlist_inner .user_playlist li').each(function() { me.list.push($(this).attr('id').split(/_/).pop()); }); me.save(); } }, navigation: { init: function() { var me = gazeta_pl.plejtv.navigation; var plr = gazeta_pl.plejtv.player; $('#navH a').click(function(e) { if (!$(this).parent().hasClass('dropdown')) { plr.auto = false; // to jest zlo: if ($(this).attr('href').match(/kanal=nazywo/)) { e.preventDefault(); document.location.href = 'http://gazeta.pl'; return; }; if ($(this).attr('href').match(/typ=szukaj/)) { if (!$(this).parent().parent().hasClass('enabled')) { e.preventDefault(); } }; } }); me.rewrite(); }, init_dropdown: function() { $('#navH .dropdown').hover( function() { $(this).addClass('dropdown_hover'); }, function() { $(this).removeClass('dropdown_hover'); } ); }, rewrite: function() { var me = gazeta_pl.plejtv.navigation; var hash = gazeta_pl.plejtv.hash; var cfg = gazeta_pl.plejtv.config; $('#navH .active').removeClass('active'); $('#navH .glow').remove(); var channel_mode = (hash.values['typ'] != 'moja_lista' && hash.values['typ'] != 'szukaj'); $('#nav_channels li a').each(function() { var par = $(this).parent(); if (!par.hasClass('dropdown')) { var channel = $(this).attr('hash').match(/kanal=([a-zA-Z0-9 _\.-]+)/).pop(); var type; if (channel_mode) { type = hash.values['typ']; } else { if (type = $(this).attr('hash').match(/typ=([a-zA-Z0-9_.-]+)/)) { type = type.pop(); } else { type = cfg.defaults['typ']; } } gazeta_pl.set_hash($(this), 'kanal='+channel+',typ='+type); if (channel_mode && channel == hash.values['kanal']) { if ($(this).parents().filter('.dropdown').length == 0) { par.addClass('active'); var cln = 'glow'; if (isIE6()) cln += ' glowie'; par.append(''); par.find('.glow').width(par.width() - 8); } } } }); if (!channel_mode) { var par; switch (hash.values['typ']) { case 'moja_lista': par = $('#nav_user .nav_userlist').parent(); break; case 'szukaj': par = $('#nav_user .nav_search').parent(); break; } par.addClass('active'); var cln = 'glow'; if (isIE6()) cln += ' glowie'; par.append(''); par.find('.glow').width(par.width() - 8); } } }, playlist: { channel: null, type: null, page: null, order: null, keyword: null, init: function() { var me = gazeta_pl.plejtv.playlist; var upl = gazeta_pl.plejtv.user_list; var plr = gazeta_pl.plejtv.player; $('#playlist_inner .list_action a').live('click', function(e) { e.preventDefault(); upl.on_list_btn_click($(this)); }); $('#playlist_play_all').live('click', function(e) { e.preventDefault(); me.on_all_click(); }); $('#playlist_remove_all').live('click', function(e) { e.preventDefault(); upl.on_remove_all_click(); }); $('#playlist_head li a,#playlist_inner .play_movie_btn').live('click', function() { plr.auto = false; }); }, rewrite: function() { var me = gazeta_pl.plejtv.playlist; var hash = gazeta_pl.plejtv.hash; var tpl = gazeta_pl.plejtv.template; var cfg = gazeta_pl.plejtv.config; if (me.channel == hash.values['kanal'] && me.type == hash.values['typ']) return false; me.channel = hash.values['kanal']; me.type = hash.values['typ']; var tpl_name; var rep_h = {}; var rep_b = {}; switch (me.type) { case 'szukaj': rep_h.keyword = hash.values['slowo']; rep_b.more_uri = cfg.search_uri + '?PageNumber='+hash.values['strona']+'&slowo='+hash.values['slowo']+'&sortuj='+hash.values['sortuj']+'&kanal='+hash.values['kanal']; tpl_name = 'search'; break; case 'moja_lista': rep_h.channel = hash.values['kanal']; tpl_name = 'user'; break; case 'najnowsze': case 'najpopularniejsze': rep_h.channel = hash.values['kanal']; rep_h.active_new = me.type == 'najnowsze' ? ' class="active"' : ''; rep_h.active_rec = me.type == 'najpopularniejsze' ? ' class="active"' : ''; rep_h.rss_uri = gazeta_pl.plejtv_vars.rss[me.type] + '?channel=' + gazeta_pl.plejtv_vars.channels[me.channel]; rep_b.channel = hash.values['kanal']; rep_b.more_uri = cfg.index_uri + '?kanal='+hash.values['kanal']+'&typ='+hash.values['typ']; tpl_name = 'rows'; break; case 'polecane': rep_h.channel = hash.values['kanal']; rep_b.channel = hash.values['kanal']; tpl_name = 'grid'; break; } var htm_h = tpl.get('pl_'+tpl_name+'_head', rep_h); var htm_b = tpl.get('pl_'+tpl_name+'_body', rep_b); $('#playlist').html(htm_h+htm_b); me.load(); return true; }, load: function() { var me = gazeta_pl.plejtv.playlist; var hash = gazeta_pl.plejtv.hash; var cfg = gazeta_pl.plejtv.config; var upl = gazeta_pl.plejtv.user_list; var ajax = {}; ajax.url = cfg.servlet_uri[hash.values['typ']]; ajax.data = []; switch (hash.values['typ']) { case 'polecane': ajax.data.push('ch=' + cfg.channels[hash.values['kanal']]); break; case 'najnowsze': case 'najpopularniejsze': ajax.data.push('key=' + cfg.servlet_param[hash.values['typ']]); ajax.data.push('quantity=21'); ajax.data.push('channel=' + cfg.channels[hash.values['kanal']]); ajax.data.push('pos=' + (1 + 21 * (hash.read_page_number() - 1))); break; case 'moja_lista': ajax.data.push('videos=' + upl.get(true)); break; case 'szukaj': ajax.data.push('text=' + hash.values['slowo']); ajax.data.push('channel=' + (cfg.channels[hash.values['kanal']] - 1)); ajax.data.push('sort=' + cfg.servlet_param[hash.values['sortuj']]); ajax.data.push('page=' + hash.values['strona']); ajax.data.push('perPage=21'); break; } ajax.data = ajax.data.join('&'); ajax.success = function(msg) { me.on_load_success(msg); } $.ajax(ajax); }, on_load_success: function(msg) { var me = gazeta_pl.plejtv.playlist; var hash = gazeta_pl.plejtv.hash; var tpl = gazeta_pl.plejtv.template; var upl = gazeta_pl.plejtv.user_list; var spl = gazeta_pl.plejtv.search_list; var plr = gazeta_pl.plejtv.player; var es = gazeta_pl.empty_string; var json = (msg == 'ERROR' ? [] : typeof msg == 'object' ? msg : JSON.parse(msg)); var htm = tpl.pl_e_common; var userlist = ''; var pl_start = 'pl_i_start'; var sortable = false; var searchq = ''; if (hash.values['typ'] == 'moja_lista') { htm = tpl.pl_e_user; userlist = hash.values['typ'] == 'moja_lista' ? '' : ''; pl_start = 'pl_i_start_user'; sortable = true; } if (hash.values['typ'] == 'szukaj') { searchq = ',' + [ 'slowo='+hash.values['slowo'], 'strona='+hash.values['strona'], 'sortuj='+hash.values['sortuj'] ].join(','); } if (json.length > 0) { htm += tpl[pl_start]; var iter = 0 for (var i = 0; i < json.length; i++) { var entry = json[i]; if (!entry.url) continue; entry.url = entry.url.replace(/^([0-9]+),([0-9]+).*$/, '$1_$2'); var rep = { 'id': entry.url, 'list_id': entry.url.split(/_/).pop(), 'description': es(entry.description), 'thumb': es(entry.thumb_url), 'time': es(entry.time), 'title': es(entry.title), 'channel': hash.values['kanal'], 'type': hash.values['typ'], 'iter': iter % 3, 'userlist': userlist, 'list_action_class': 'del', 'list_action_caption': 'usuń z listy', 'playing': plr.movie == entry.url ? ' currently_playing' : '', 'searchq': searchq } if (hash.values['typ'] != 'moja_lista') { if (upl.check(entry.url)) { rep.list_action_class = 'on'; rep.list_action_caption = 'na liście'; } else { rep.list_action_class = 'add'; rep.list_action_caption = 'dodaj do listy'; } if (entry.url == '0_0') { continue; //rep.list_action_class = 'hidden'; //rep.list_action_caption = ''; } } htm += tpl.get('pl_elem', rep); iter++; } htm += tpl.pl_i_end; } $('#playlist_loading').replaceWith(htm); $('.playing_hover_bg').css({ opacity: 0.5 }); if (json.length == 0) { $('#playlist_empty_list').show(); } else if (sortable) { $('#playlist_inner .user_playlist').sortable({ handle: '.dnd', update: upl.on_sort_update, axis: 'y' }); } if (hash.values['typ'] == 'szukaj') spl.init({ num: json.length, hash: window.location.hash }); plr.rewrite(); }, get_movie_data: function(id) { var elem = $('#pe_'+id); if (elem.length == 0) return null; var data = { title: elem.find('.title a').html(), description: elem.find('.data .description').html(), time: elem.find('.data .time').html() }; return data; }, set_movie: function(id) { $('#playlist_inner .currently_playing').removeClass('currently_playing'); $('#pe_'+id).addClass('currently_playing'); }, empty: function() { return $('#playlist_inner li').length == 0; }, get_next_movie: function(movie) { var me = gazeta_pl.plejtv.playlist; var elem = $('#pe_'+movie); if (elem.length == 0) return; elem = elem.next('li'); if (elem.length == 0) return; window.location.hash = elem.find('.play_movie_btn:first').attr('hash'); }, on_all_click: function() { var me = gazeta_pl.plejtv.playlist; var plr = gazeta_pl.plejtv.player; var hash = gazeta_pl.plejtv.hash; if (me.empty()) return; plr.auto = true; hash.force = true; window.location.hash = $('#playlist_inner .play_movie_btn:first').attr('hash'); } }, search_list: { init: function(data) { var me = gazeta_pl.plejtv.search_list; if (data.num > 0) { var elem = $('#nav_user .nav_search').parent(); elem.addClass('enabled'); gazeta_pl.set_hash(elem.find('a'), data.hash.replace(/#/, '')); elem.find('a').html('Wyniki szukania ('+data.num+')'); if (elem.find('.glow').length > 0) elem.find('.glow').width(elem.width() - 8); } } }, player: { built: false, started: false, movie: null, auto: false, init: function() { gazeta_pl.plejtv.user_list.init(); gazeta_pl.plejtv.playlist.init(); gazeta_pl.plejtv.hash.init(); gazeta_pl.plejtv.navigation.init(); }, set: function() { var me = gazeta_pl.plejtv.player; var nav = gazeta_pl.plejtv.navigation; var pl = gazeta_pl.plejtv.playlist; if (!me.built) { $('#player').html(gazeta_pl.plejtv.template.player); me.built = true; } nav.rewrite(); if (!pl.rewrite()) me.rewrite(); }, rewrite: function() { var me = gazeta_pl.plejtv.player; var hash = gazeta_pl.plejtv.hash; var pl = gazeta_pl.plejtv.playlist; var cfg = gazeta_pl.plejtv.config; if (me.movie == hash.values['film'] && !me.auto) return; me.movie = hash.values['film']; me.hide_blank(); if (me.movie == '') { if ($('#playlist_inner .play_movie_btn').length == 0) { me.show_blank(); return; } else { me.movie = $('#playlist_inner .play_movie_btn:first').attr('hash').match(/film=([0-9_]+)/).pop(); hash.values['film'] = me.movie; } } var xx = me.movie.split(/_/).pop(); var xxd = me.movie.split(/_/).shift(); if (xx == '0' && xxd == '0') { me.show_blank(); return; } var data = pl.get_movie_data(me.movie); if (!data) { var uri = cfg.servlet_uri['moja_lista']; var data = 'videos='+xx; $.ajax({ url: uri, data: data, success: function(msg) { var json = (msg == 'ERROR' ? [] : typeof msg == 'object' ? msg : JSON.parse(msg)); if (json.length == 0) return; json = json.pop(); $('#player_movie_title').html(gazeta_pl.short_text(json.title, 70)); $('#player_movie_description').html(json.description); $('#player_movie_info').html(gazeta_pl.format_time(json.time)); } }); } else { pl.set_movie(me.movie); $('#player_movie_title').html(gazeta_pl.short_text(data.title, 70)); $('#player_movie_description').html(data.description); $('#player_movie_info').html(gazeta_pl.format_time(data.time)); } if (!me.started) { me.auto = ( cfg.autoplay && (hash.values['typ'] == 'polecane' || hash.values['typ'] == 'najnowsze') && hash.values['typ'] == cfg.defaults['typ'] ); //var url = 'http://bi.gazeta.pl/im/player/PlayerArt.swf'; // stary player var url = 'http://bi.gazeta.pl/im/Player.swf'; var vars = 't=1&a='+(me.auto?1:0)+'&ad=1&m=http://serwisy.gazeta.pl/getDaneWideo?xx='+xx+'%26xxd='+xxd+'&f=http://bi.gazeta.pl/im/&pid=player_movie_flash&e=2&adDef='+encodeURIComponent(JSON.stringify(banContent)); var params = { wmode: 'opaque', allowScriptAccess: 'always', allowFullScreen: 'true', flashvars: vars }; swfobject.embedSWF(url, 'player_movie_flash', 480, 393, '9.0.0', '/info/expressInstall.swf', {}, params); me.started = true; } else { $('#player_movie_flash')[0]._fpLoad('http://serwisy.gazeta.pl/getDaneWideo?xx='+xx+'&xxd='+xxd); } }, show_blank: function() { $('#player_movie_blank').show(); $('#player_movie_flash').hide(); }, hide_blank: function() { $('#player_movie_blank').hide(); $('#player_movie_flash').show(); }, on_finished_movie: function() { var me = gazeta_pl.plejtv.player; var pl = gazeta_pl.plejtv.playlist; if (me.auto) pl.get_next_movie(me.movie); } }, search_result: { uri: null, init: function() { var me = gazeta_pl.plejtv.search_result; var upl = gazeta_pl.plejtv.user_list; upl.init(); me.uri = gazeta_pl.parse_uri(); if (me.uri.kanal) $('#i_channels').val(me.uri.kanal); if (me.uri.sortuj) $('#i_sort').val(me.uri.sortuj); $('#mod_search_result .body li .desc').before('
    '); $('#mod_search_result .body li .desc_bg').css({ opacity: 0.5 }); $('#mod_search_result .body li .desc, #mod_search_result .body li .desc_bg').click(function() { var uri = $(this).parents().filter('li').find('a').eq(0).attr('href'); window.location.href = uri; }); $('#mod_search_result .body li').hover( function() { if ($(this).find('a').length == 0) return; $(this).find('.desc').show(); $(this).find('.desc_bg').show(); }, function() { if ($(this).find('a').length == 0) return; $(this).find('.desc').hide(); $(this).find('.desc_bg').hide(); } ); $('#mod_search_result .list_action a').click(function(e) { e.preventDefault(); upl.on_list_btn_click($(this)); }); if($('#mod_search_result .body').length > 0){ if (me.uri.slowo) { var par = $('#nav_user .nav_search').parent(); par.addClass('enabled'); var cln = 'glow'; if (isIE6()) cln += ' glowie'; par.append(''); par.find('.glow').width(par.width() - 8); } }else{ $('#nav_user .nav_search a').click(function(e){ e.preventDefault(); }); } $('#i_channels').change(function() { me.uri.kanal = $(this).val(); me.uri.PageNumber = 1; window.location.href = gazeta_pl.make_uri(me.uri); }); $('#i_sort').change(function() { me.uri.sortuj = $(this).val(); me.uri.PageNumber = 1; window.location.href = gazeta_pl.make_uri(me.uri); }); $('#navH li:not(.active) .nav_search a').click(function(e) { e.preventDefault(); }); } }, widget: { data: {}, colors: ['black', 'red', 'green', 'blue', 'gray'], reload: function() { var me = gazeta_pl.plejtv.widget; var cookie_str = []; var src = $('#frame_tvwidget').attr('src'); for (var i in this.data) { cookie_str.push(i+'='+this.data[i]); var t = null; var u = ''; switch (i) { case 'color': t = new RegExp('&ws=[a-z]+'); u = '&ws='; break; case 'autoplay': t = new RegExp('&ap=[01]'); u = '&ap='; break; case 'autoplay_all': t = new RegExp('&pa=[01]'); u = '&pa='; break; case 'caption': t = new RegExp('&wq=[^&]*'); u = '&wq='; break; case 'width': t = new RegExp('&ww=[0-9]+'); u = '&ww='; break; } if (t) { src = src.replace(t, u+this.data[i]); } } cookie_str = cookie_str.join(';'); $.cookie('widget_tmp_cookie', cookie_str); me.write_code(); if (src != $('#frame_tvwidget').attr('src')) { $('#frame_tvwidget').attr('src', src); } //window.location.reload(); }, write_code: function() { var rep = { width: this.data.width, scheme: this.data.color, autoplay: this.data.autoplay, autoplayall: this.data.autoplay_all, ids: this.data.ids, caption: this.data.caption }; var c = gazeta_pl.plejtv.template.get('widget', rep); $('#i_widget_html').val(c); }, init: function() { var me = gazeta_pl.plejtv.widget; me.data = embedWidget.data; me.data.scheme = me.colors.indexOf(me.data.color); me.select_scheme(); me.write_code(); $('#i_widget_color li').click(function() { me.data.scheme = parseInt($(this).attr('className').match(/scheme([0-9])/).pop()); if (me.select_scheme()) { me.reload(); } }); $('#i_widget_width').blur(function() { var w = parseInt($(this).val()); if (isNaN(w)) return; if (w == me.data.width) return; me.data.width = w; me.reload(); }); $('#i_widget_theme').blur(function() { var t = $(this).val(); if (t == me.data.caption) return; me.data.caption = t; me.reload(); }); $('#i_widget_autoplay').click(function() { var a = $(this).attr('checked') ? 1 : 0; if (a == me.data.autoplay) return; me.data.autoplay = a; me.reload(); }); $('#i_widget_playall').click(function() { var a = $(this).attr('checked') ? 1 : 0; if (a == me.data.autoplay_all) return; me.data.autoplay_all = a; me.reload(); }); $('#btn_widget_select').click(function() { $('#i_widget_html').select(); }); }, select_scheme: function() { var me = gazeta_pl.plejtv.widget; var cur = $('#i_widget_color .active'); if (cur.length > 0) { var n = parseInt(cur.attr('className').match(/scheme([0-9])/).pop()); if (n == me.data.scheme) return false; cur.attr('className', 'scheme'+n); } cur = $('#i_widget_color .scheme'+me.data.scheme); cur.addClass('active'); cur.addClass('ascheme'+me.data.scheme); me.data.color = me.colors[me.data.scheme]; return true; } }, init: function() { var t = $('#searchH input[type=image]').eq(0) if (isIE6()) t.attr('src', t.attr('src').replace('png', 'gif')); t.css({ visibility: 'visible' }); var me = gazeta_pl.plejtv; me.config.init(); me.pagetype = $('#page_main div:first').attr('id').replace(/^mod_/, ''); me[me.pagetype].init(); gazeta_pl.plejtv.navigation.init_dropdown(); } } function _fpEnd() { gazeta_pl.plejtv.player.on_finished_movie(); } $(document).ready(function() { gazeta_pl.plejtv.init(); });