/* Copyright (C) Portu media & communications. All rights reserved. */
/*
 * The rest of this file is:
 * Copyright (C) Portu media & communications
 */
function pagerChange(b){var a=new String(window.location);if(/page=/.test(a)){a=a.replace(/page=\d*/,"page="+b)}else{if(!/\?/.test(a)){a=a+"?"}else{a=a+"&"}a=a+"page="+b}window.location=a}function toggleVisibility(a){$("#"+a).slideToggle()}function lzlog(b){try{if(console&&console.log){var a=new Date();console.log("["+a.toString()+"] Lixuz Live: "+b);return true}else{lzlog=$.noop}}catch(c){}return false}function $L(a){return $("#"+a)[0]}(function(h){var l=false,e=[],f="3.1.5",g=[];function b(){try{var m=h("[name=lixuz_video]");if(m.length){h.getScript("/swf/flowplayer/flowplayer-"+f+".min.js",function(){m.each(function(){k(h(this).attr("id"))})})}}catch(n){}}function j(q){try{var o=h("#"+q);var n=i(q);if(n!=null){o.attr("href",n)}if(o.attr("href")==null){return}var m=c(q,{clip:{autoPlay:false,autoBuffering:true}});return m}catch(p){lzlog("lixuz_playVideo("+q+") error: "+p.message)}}function d(s,q,n){var r=[];var p=false;if(q){r.push({url:q,seekableOnBegin:false,controls:{playlist:false,scrubber:false}});p=true}var o=i(s);if(o==null){return}r.push({url:o,autoPlay:p});if(n){r.push({url:n,seekableOnBegin:false,controls:{playlist:false,scrubber:false},autoPlay:true})}var m=c(s,{clip:{autoPlay:false,autoBuffering:true},playlist:r,plugins:{controls:{playlist:false}}});m.__lixuzInfo={fired:0,mainVidURL:o};m.onFinish(function(){var t=m.getPlaylist();if(t.length==1){return}this.__lixuzInfo.fired++;if(t.length==this.__lixuzInfo.fired){this.setPlaylist([{autoPlay:false,autoBuffering:true,url:this.__lixuzInfo.mainVidURL,seekableOnBegin:true}])}});return m}function k(o){var m=null;try{m=lixuz_VideoPlayerOverride}catch(n){m=null}if(m!=null&&m!=undefined){return m(o,{play:j,playWithAds:d,getURL:i})}else{return j(o)}}function i(r){try{if(typeof(r)!="object"){r="#"+r}var n=h(r);if(!n.length){lzlog("lixuz_getFLVURL("+r+"): failed to retrieve element DOM object");return null}var m=n.attr("href");if(!m){var p=n.attr("uid");if(p==null){var o;try{o=n.find("img").attr("src").replace(/^\D+/,"").replace(/\?flvp.+$/,"")}catch(q){}if(o!=null&&o.match(/^\d+$/)){p=o}else{lzlog("uid missing from lixuz_video element that had no href");return}}m="/files/get/"+p+"?flv=1"}else{m=element.attr("href")}return m}catch(q){lzlog("Failed to retrieve FLV URL from "+r+": "+q.message);return null}}function a(o,n){lzlog("Initializing flowPlayer on element "+o);var m=flowplayer(o,"/swf/flowplayer/flowplayer-"+f+".swf",n);if(l==false){l=true;return a(o,n)}return m}function c(q,o){try{var n=h("#"+q);if(!n.length){lzlog("lixuz_playVideo(): Failed to locate the player $element: "+q);return null}else{if(n.html().length>200){lzlog("lixuz_playVideo(): The html() of "+q+" exceeded 200 characters (it has "+n.html().length+"). Suspecting an unclosed div. Refusing to initialize video.");return null}else{if((n.html().length>100)&&(!n.html().match(/</))){lzlog("lixuz_playVideo(): The html() of "+q+" exceeded 100 characters (it has "+n.html().length+") AND it has NO HTML tags inside it. Suspecting an unclosed div. Refusing to initialize video.");return null}}var m=a(q,o);return m}}catch(p){lzlog("Failure in lixuz_safePlayer when attempting to start player on "+q+": "+p.message)}return null}h(function(){try{b()}catch(m){}})})(jQuery);
