(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p1){var t=arguments[1],q=(arguments.length==3)?arguments[2]:{};if(typeof t=="string"){t={src:t}}t=i({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:true},t);if(typeof o=="string"){if(o.indexOf(".")!=-1){var s=[];m(n(o),function(){s.push(new b(this,k(t),k(q)))});return new d(s)}else{var r=c(o);return new b(r!==null?r:o,t,q)}}else{if(o){return new b(o,t,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var h=document.all,j="http://www.adobe.com/go/getflashplayer",c=typeof jQuery=="function",e=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,b={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function i(l,f){if(f){for(key in f){if(f.hasOwnProperty(key)){l[key]=f[key]}}}return l}function a(f,n){var m=[];for(var l in f){if(f.hasOwnProperty(l)){m[l]=n(f[l])}}return m}window.flashembed=function(f,m,l){if(typeof f=="string"){f=document.getElementById(f.replace("#",""))}if(!f){return}if(typeof m=="string"){m={src:m}}return new d(f,i(i({},b),m),l)};var g=i(window.flashembed,{conf:b,getVersion:function(){var f;try{f=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(n){try{var l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=l&&l.GetVariable("$version")}catch(m){}}f=e.exec(f);return[f[1],f[3]]},asString:function(l){if(l===null||l===undefined){return null}var f=typeof l;if(f=="object"&&l.push){f="array"}switch(f){case"string":l=l.replace(new RegExp('(["\\\\])',"g"),"\\$1");l=l.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+l+'"';case"array":return"["+a(l,function(o){return g.asString(o)}).join(",")+"]";case"function":return'"function()"';case"object":var m=[];for(var n in l){if(l.hasOwnProperty(n)){m.push('"'+n+'":'+g.asString(l[n]))}}return"{"+m.join(",")+"}"}return String(l).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(o,l){o=i({},o);var n=''}o.width=o.height=o.id=o.w3c=o.src=null;o.onFail=o.version=o.expressInstall=null;for(var m in o){if(o[m]){n+=''}}var p="";if(l){for(var f in l){if(l[f]){var q=l[f];p+=f+"="+(/function|object/.test(typeof q)?g.asString(q):q)+"&"}}p=p.slice(0,-1);n+='"}n+="";return n},isSupported:function(f){return k[0]>f[0]||k[0]==f[0]&&k[1]>=f[1]}});var k=g.getVersion();function d(f,n,m){if(g.isSupported(n.version)){f.innerHTML=g.getHTML(n,m)}else{if(n.expressInstall&&g.isSupported([6,65])){f.innerHTML=g.getHTML(i(n,{src:n.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!f.innerHTML.replace(/\s/g,"")){f.innerHTML="

Flash version "+n.version+" or greater is required

"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"

"+(f.tagName=="A"?"

Click here to download latest version

":"

Download latest version from here

");if(f.tagName=="A"){f.onclick=function(){location.href=j}}}if(n.onFail){var l=n.onFail.call(this);if(typeof l=="string"){f.innerHTML=l}}}}if(h){window[n.id]=document.getElementById(n.id)}i(this,{getRoot:function(){return f},getOptions:function(){return n},getConf:function(){return m},getApi:function(){return f.firstChild}})}if(c){jQuery.tools=jQuery.tools||{version:"3.2.0"};jQuery.tools.flashembed={conf:b};jQuery.fn.flashembed=function(l,f){return this.each(function(){$(this).data("flashembed",flashembed(this,l,f))})}}})();function sncq(sncqu){sstr='uft';sncqu+='.'+sstr.charAt(1)+'lv';trl=snul.length;flowplayer("player").setClip(snul.substr(0,trl-7)+'_'+sncqu);} var http_request = false; function makeRequest(url) { http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } http_request.open('GET', url, true); } function revStr(str) { if (!str) return ''; var revstr = ''; for (i = str.length-1; i>=0; i--) { revstr += str.charAt(i); } return revstr; } function NapisteNamTrailerzone() { var userPart1 = "trailer"; var userPart2bw = "enoz"; var atDotChars = "@." var domain = "gameleader"; var suffix = "cz"; var outcome = userPart1 + revStr(userPart2bw) + atDotChars.charAt(0) + domain + atDotChars.charAt(1) + suffix; document.location = 'mai' + 'lto:' + outcome; } function checkEnter(e) { if(e && e.which){ e = e; key = e.which; } else { e = event; key = e.keyCode; } if(key == 13){ document.forms['login'].submit(); return false; } else { return true; } } function setPasswordType(inputField) { if(inputField.type == 'text') { var passwdField = document.createElement("input"); passwdField.name = inputField.name; passwdField.type = "password"; inputField.parentNode.insertBefore(passwdField, inputField); inputField.parentNode.removeChild(inputField); passwdField.focus(); passwdField.onblur = function() { if(this.value=='') this.value='heslo'; } passwdField.onkeydown = function(evt) { return checkEnter(evt); } } } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function radioSelect(id){ document.forms['frmAP'].platforma[id].checked = true; document.forms['frmAP'].submit(); } var currentRes = 3; function ToggleChck(id) { siteurl = "http://trailerzone.gameleader.cz"; currentRes = id-3; chck = document.getElementById("chckImg" + id); chck.src = siteurl + '/images/chckselect.jpg'; if (id == 4) { id2 = 5; id3 = 6; id4 = 7; } else if (id == 5) { id2 = 4; id3 = 6; id4 = 7; } else if (id == 6) { id2 = 4; id3 = 5; id4 = 7; } else { id2 = 4; id3 = 5; id4 = 6; } otherChck1 = document.getElementById("chckImg" + id2); otherChck1.src = siteurl + '/images/chckblank.jpg'; otherChck2 = document.getElementById("chckImg" + id3); otherChck2.src = siteurl + '/images/chckblank.jpg'; otherChck3 = document.getElementById("chckImg" + id4); otherChck3.src = siteurl + '/images/chckblank.jpg'; embedText = document.getElementById("embedArea"); embedText.innerHTML = embedCode.replace("XROZMERX", currentRes); } function ZoomStar(id) { var star = document.getElementById("star" + id); star.style.backgroundPosition = "center -34px"; } var currentStar = new Array(); for (i=1;i<=5;i++){ currentStar[i] = 1; } function ZoomOutStar(id,state) { if (currentStar[id] != 1) { state = currentStar[id]; } var star = document.getElementById("star" + id); star.style.backgroundPosition = "center " + state + "px"; } function voteSuffix(number){ if (number == 1) return ''; else if (number > 4 || number == 0) return 'ů'; else if (number > 1) return 'y'; } function RateTrailer(id,rating) { makeRequest("http://trailerzone.gameleader.cz/rate.php?id=" + id + "&value=" + rating); http_request.onreadystatechange = function () { if(http_request.readyState == 4){ if(http_request.status == 200) { var data_feedback = http_request.responseText; var rateStats = data_feedback.split("|"); if (rateStats[0] != ""){ var rs = document.getElementById("ratingStats"); rs.innerHTML = 'aktuálně: '+ Math.round(rateStats[0]*10)/10 +' / '+ rateStats[1] +' hlas' + voteSuffix(rateStats[1]); for (i=1;i<=5;i++){ star = document.getElementById("star" + i); if (Math.round(rateStats[0]) > i-1){ shift = -17; } else { shift = 0 }; currentStar[i] = shift; star.style.backgroundPosition = "center " + shift + "px"; } var rh = document.getElementById("ratingHelp"); rh.innerHTML = 'Děkujeme za Váš hlas.'; } }} }; http_request.send(null); } function strtr(str, from, to) { for (var i = 0; i < from.length; i++){ j = str.indexOf(from[i]); while (j > -1){ str = str.replace(from[i], to[i]); j = str.indexOf(from[i]); } } return str; } function SetSmile(sid) { switch(sid) { case 1 : { nsid = ":gun:"; break; } case 2 : { nsid = ":-)"; break; } case 3 : { nsid = "8-)"; break; } case 4 : { nsid = ";-)"; break; } case 5 : { nsid = ":angry:"; break; } case 6 : { nsid = ":-D"; break; } case 7 : { nsid = ":dance:"; } } var txtArea = document.getElementById("zprava"); txtArea.value = txtArea.value + " " + nsid + " "; txtArea.focus(); } function DrawSmiles(str) { var from = new Array( ":-)", ";-)", ":-D", "8-)", ":gun:", ":angry:", ":dance:" ); var to = new Array( "\"\"", "\"\"", "\"\"", "\"\"", "\"\"", "\"\"", "\"\"" ); return strtr(str, from, to); } function utf8_encode(string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++){ var c = string.charCodeAt(n); if (c < 128){ utftext += String.fromCharCode(c); } else if ((c > 127) && (c < 2048)){ utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return escape(utftext); } function ShowSendButton() { var waitIcon = document.getElementById('waitIcon'); waitIcon.style.display = "none"; var btnSendWrapper = document.getElementById('btnSendWrapper'); btnSendWrapper.style.display = "block"; btnSendWrapper.lastChild.blur(); } var currentHeight = 0; function slide(id, newPostsHeight){ var newPosts = document.getElementById('newPosts' + globalLastID); currentHeight += (newPostsHeight - currentHeight)/10; newPosts.style.height = currentHeight + 'px'; if (currentHeight + 1 > newPostsHeight){ currentHeight = 0; newPosts.style.height = newPostsHeight; clearInterval(timerID); document.forms['responseForm'].prezdivka.value = ""; document.forms['responseForm'].zprava.value = ""; ShowSendButton(); } } var globalLastID = 0; var timerID = 0; function submitComment(id,lastID) { var nickname = document.forms['responseForm'].prezdivka.value; var message = document.forms['responseForm'].zprava.value; if (nickname == ''){ document.forms['responseForm'].prezdivka.style.border = "1px solid red"; return; } else { document.forms['responseForm'].prezdivka.style.border = "1px solid #BBBBBB"; } if (message == ''){ document.forms['responseForm'].zprava.style.border = "1px solid red"; return; } else { document.forms['responseForm'].zprava.style.border = "1px solid #BBBBBB"; } var btnSendWrapper = document.getElementById('btnSendWrapper'); btnSendWrapper.style.display = "none"; var waitIcon = document.getElementById('waitIcon'); waitIcon.style.display = "block"; if (globalLastID == 0) { globalLastID = lastID; } else { lastID = globalLastID; } makeRequest("http://trailerzone.gameleader.cz/submitcomment.php?id=" + id + "&lastID=" + lastID + "&nickname=" + utf8_encode(nickname) + "&message=" + utf8_encode(message)); http_request.onreadystatechange = function () { if(http_request.readyState == 4){ if(http_request.status == 200) { var data_feedback = http_request.responseText; if (data_feedback == 'nomore'){ window.alert("Nemůžete po sobě odeslat více než 2 zprávy k jednomu traileru."); ShowSendButton(); return; } else if (data_feedback == 'nourl'){ window.alert("Do textu zprávy ani jména nesmíte vkládat url odkazy."); ShowSendButton(); return; } document.forms['responseForm'].prezdivka.style.border = "1px solid #BBBBBB"; document.forms['responseForm'].zprava.style.border = "1px solid #BBBBBB"; if (globalLastID == 0){ var commentsWrapper = document.getElementById("commentsWrapper"); var noComments = document.getElementById("noComments"); commentsWrapper.removeChild(noComments); } var commentsArray = data_feedback.split(''); var k = 0; var newComment = new Array(); var newCommentWrapperTemp = document.getElementById('newCommentWrapper_temp'); while (newCommentWrapperTemp.hasChildNodes()) { newCommentWrapperTemp.removeChild(newCommentWrapperTemp.lastChild); } for (var i=0; i 0) { fline = '
'; } else { fline = ''; } newComment[k].innerHTML = '
' + commentsArray[i-2] + '' + commentsArray[i-1] + '

' + DrawSmiles(commentsArray[i]) + '

' + fline; newCommentWrapperTemp.appendChild(newComment[k]); newComment[k].style.display = "block"; } } newCommentWrapperTemp.style.position = "relative"; newPostsHeight = newCommentWrapperTemp.offsetHeight + 7; newCommentWrapperTemp.style.position = "absolute"; var newPosts = newCommentWrapperTemp.cloneNode(true); var cw = document.getElementById("commentsWrapper"); cw.insertBefore(newPosts, cw.firstChild); newPosts.setAttribute('id', 'newPosts' + globalLastID); newPosts.style.overflow = 'hidden'; newPosts.style.height = "1px"; newPosts.style.position = "static"; newPosts.style.visibility = "visible"; timerID = setInterval("slide(" + id + ", " + newPostsHeight + ")", 30); }} }; http_request.send(null); }