var rightDir = Array();rightDir[0]='bg-right-ll10-a.png';rightDir[1]='bg-right-ll10-b.png';rightDir[2]='bg-right-ll11-a.png';rightDir[3]='bg-right-ll12-a.png';rightDir[4]='bg-right-ll13-a.png';rightDir[5]='bg-right-ll15.png';rightDir[6]='bg-right-ll17.png';rightDir[7]='bg-right-ll7-a.png';rightDir[8]='bg-right-ll9-a.png';rightDir[9]='bg-right-ll9-b.png';rightDir[10]='bg-right-ll9-c.png';rightDir[11]='bg-right-ll9-d.png';var leftDir = Array();leftDir[0]='bg-left-ll10-a.png';leftDir[1]='bg-left-ll11-a.png';leftDir[2]='bg-left-ll12-a.png';leftDir[3]='bg-left-ll13-a.png';leftDir[4]='bg-left-ll15.png';leftDir[5]='bg-left-ll17.png';leftDir[6]='bg-left-ll8-a.png';leftDir[7]='bg-left-ll9-a.png';leftDir[8]='bg-left-ll9-b.png';leftDir[9]='bg-left-ll9-c.png';leftDir[10]='bg-left-ll9-d.png';leftDir[11]='bg-left-ll9-e.png';var ajaxURL = 'http://boxoffice.llamalan.co.uk/index.php?ajaxLoad=1&sid=' + sessionID;var ajaxBlogURL = 'llamalan.co.uk';(function($)
{
$.fn.serializelist = function(options)
{
/**
* jQuery Serialize List
* Copyright (c) 2009 Mike Botsko, Botsko.net LLC
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* Copyright notice and license must remain intact for legal use
* Version 1
*
* Serialize an unordered or ordered list item. Optional ability
* to determine which attributes are included. The serialization
* will be read by PHP as a multidimensional array which you may
* use for saving state.
*/
// Extend the configuration options with user-provided
var defaults = {
prepend: 'ul',
is_child: false,
attributes: ['id', 'class']
};
var opts = $.extend(defaults, options);
var serialStr = '';
if(!opts.is_child){ opts.prepend = '&'+opts.prepend; }
// Begin the core plugin
this.each(function() {
var ul_obj = this;
var li_count = 0;
$(this).children().each(function(){
for(att in opts.attributes){
serialStr += opts.prepend+'['+li_count+']['+opts.attributes[att]+']='+$(this).attr(opts.attributes[att]);
}
// append any children elements
var child_base = opts.prepend+'['+li_count+'][children]';
$(this).children().each(function(){
if(this.tagName == 'UL' || this.tagName == 'OL'){
serialStr += $(this).serializelist({'prepend': child_base, 'is_child': true});
}
});
li_count++;
});
});
return(serialStr);
};
})(jQuery); /**
* jQuery.timers - Timer abstractions for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/10/16
*
* @author Blair Mitchelmore
* @version 1.2
*
**/
jQuery.fn.extend({
everyTime: function(interval, label, fn, times) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, times);
});
},
oneTime: function(interval, label, fn) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, 1);
});
},
stopTime: function(label, fn) {
return this.each(function() {
jQuery.timer.remove(this, label, fn);
});
}
});
jQuery.extend({
timer: {
global: [],
guid: 1,
dataKey: "jQuery.timer",
regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
powers: {
// Yeah this is major overkill...
'ms': 1,
'cs': 10,
'ds': 100,
's': 1000,
'das': 10000,
'hs': 100000,
'ks': 1000000
},
timeParse: function(value) {
if (value == undefined || value == null)
return null;
var result = this.regex.exec(jQuery.trim(value.toString()));
if (result[2]) {
var num = parseFloat(result[1]);
var mult = this.powers[result[2]] || 1;
return num * mult;
} else {
return value;
}
},
add: function(element, interval, label, fn, times) {
var counter = 0;
if (jQuery.isFunction(label)) {
if (!times)
times = fn;
fn = label;
label = interval;
}
interval = jQuery.timer.timeParse(interval);
if (typeof interval != 'number' || isNaN(interval) || interval < 0)
return;
if (typeof times != 'number' || isNaN(times) || times < 0)
times = 0;
times = times || 0;
var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
if (!timers[label])
timers[label] = {};
fn.timerID = fn.timerID || this.guid++;
var handler = function() {
if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
jQuery.timer.remove(element, label, fn);
};
handler.timerID = fn.timerID;
if (!timers[label][fn.timerID])
timers[label][fn.timerID] = window.setInterval(handler,interval);
this.global.push( element );
},
remove: function(element, label, fn) {
var timers = jQuery.data(element, this.dataKey), ret;
if ( timers ) {
if (!label) {
for ( label in timers )
this.remove(element, label, fn);
} else if ( timers[label] ) {
if ( fn ) {
if ( fn.timerID ) {
window.clearInterval(timers[label][fn.timerID]);
delete timers[label][fn.timerID];
}
} else {
for ( var fn in timers[label] ) {
window.clearInterval(timers[label][fn]);
delete timers[label][fn];
}
}
for ( ret in timers[label] ) break;
if ( !ret ) {
ret = null;
delete timers[label];
}
}
for ( ret in timers ) break;
if ( !ret )
jQuery.removeData(element, this.dataKey);
}
}
}
});
jQuery(window).bind("unload", function() {
jQuery.each(jQuery.timer.global, function(index, item) {
jQuery.timer.remove(item);
});
});(function($){$.clock={version:"2.0.1",locale:{}};t=[];$.fn.clock=function(d){var c={it:{weekdays:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},en:{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},es:{weekdays:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],months:["Enero","Febrero","Marzo","Abril","May","junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},de:{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],months:["Januar","Februar","März","April","könnte","Juni","Juli","August","September","Oktober","November","Dezember"]},fr:{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],months:["Janvier","Février","Mars","Avril","May","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]},ru:{weekdays:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"]}};return this.each(function(){$.extend(c,$.clock.locale);d=d||{};d.timestamp=d.timestamp||"z";y=new Date().getTime();d.sysdiff=0;if(d.timestamp!="z"){d.sysdiff=d.timestamp-y}d.langSet=d.langSet||"en";d.format=d.format||((d.langSet!="en")?"24":"12");d.calendar=d.calendar||"true";if(!$(this).hasClass("jqclock")){$(this).addClass("jqclock")}var e=function(g){if(g<10){g="0"+g}return g},f=function(j,n){var r=$(j).attr("id");if(n=="destroy"){clearTimeout(t[r])}else{m=new Date(new Date().getTime()+n.sysdiff);var p=m.getHours(),l=m.getMinutes(),v=m.getSeconds(),u=m.getDay(),i=m.getDate(),k=m.getMonth(),q=m.getFullYear(),o="",z="",w=n.langSet;if(n.format=="12"){o=" AM";if(p>11){o=" PM"}if(p>12){p=p-12}if(p==0){p=12}}p=e(p);l=e(l);v=e(v);if(n.calendar!="false"){z=((w=="en")?""+c[w].weekdays[u]+", "+c[w].months[k]+" "+i+", "+q+"":""+c[w].weekdays[u]+", "+i+" "+c[w].months[k]+" "+q+"")}$(j).html(z+""+p+":"+l+":"+v+o+"");t[r]=setTimeout(function(){f($(j),n)},1000)}};f($(this),d)})};return this})(jQuery);(function($)
{
$.fn.countTo = function(options)
{
// merge the default plugin settings with the custom options
options = $.extend({}, $.fn.countTo.defaults, options || {});
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(options.speed / options.refreshInterval),increment = (options.to - parseInt(options.from,10)) / loops;
return $(this).each(function()
{
var _this = this,
loopCount = 0,
value = parseInt(options.from,10),
interval = setInterval(updateTimer, options.refreshInterval);
function updateTimer()
{
value += increment;
loopCount++;
if(options.padding > 0)
{
//we need to remove the padding from the div, apply the calculation then reapply the padding:
n = String(value.toFixed(options.decimals));
while (n.length < options.padding)
{
n = "0" + n;
}
$(_this).html(n);
}
else
{
$(_this).html(value.toFixed(options.decimals));
}
if (typeof(options.onUpdate) == 'function')
{
options.onUpdate.call(_this, value);
}
if (loopCount >= loops)
{
clearInterval(interval);
value = options.to;
if (typeof(options.onComplete) == 'function')
{
options.onComplete.call(_this, value);
}
}
}
});
};
$.fn.countTo.defaults =
{
from: 0, // the number the element should start at
to: 100, // the number the element should end at
speed: 1000, // how long it should take to count between the target numbers
refreshInterval: 100, // how often the element should be updated
decimals: 0, // the number of decimal places to show
onUpdate: null, // callback method for every time the element is updated,
onComplete: null, // callback method for when the element finishes updating
padding: 0 // number of zeros to pad the number with.
};
})(jQuery);
/*
* Marquee jQuery Plug-in
*
* Copyright 2009 Giva, Inc. (http://www.givainc.com/labs/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Date: 2009-05-20
* Rev: 1.0.01
*/
(function(A){A.marquee={version:"1.0.01"};A.fn.marquee=function(E){var F=typeof arguments[0]=="string"&&arguments[0];var D=F&&Array.prototype.slice.call(arguments,1)||arguments;var C=(this.length==0)?null:A.data(this[0],"marquee");if(C&&F&&this.length){if(F.toLowerCase()=="object"){return C}else{if(C[F]){var B;this.each(function(G){var H=A.data(this,"marquee")[F].apply(C,D);if(G==0&&H){if(!!H.jquery){B=A([]).add(H)}else{B=H;return false}}else{if(!!H&&!!H.jquery){B=B.add(H)}}});return B||this}else{return this}}}else{return this.each(function(){new A.Marquee(this,E)})}};A.Marquee=function(E,Q){Q=A.extend({},A.Marquee.defaults,Q);var O=this,M=A(E),F=M.find("> li"),H=-1,G=false,L=false,N=0;A.data(M[0],"marquee",O);this.pause=function(){G=true;P()};this.resume=function(){G=false;D()};this.update=function(){var R=F.length;F=M.find("> li");if(R<=1){D()}};function K(R){if(F.filter("."+Q.cssShowing).length>0){return false}var T=F.eq(R);if(A.isFunction(Q.beforeshow)){Q.beforeshow.apply(O,[M,T])}var S={top:(Q.yScroll=="top"?"-":"+")+T.outerHeight()+"px",left:0};M.data("marquee.showing",true);T.addClass(Q.cssShowing);T.css(S).animate({top:"0px"},Q.showSpeed,Q.fxEasingShow,function(){if(A.isFunction(Q.show)){Q.show.apply(O,[M,T])}M.data("marquee.showing",false);J(T)})}function J(S,R){if(L==true){return false}R=R||Q.pauseSpeed;if(C(S)){setTimeout(function(){if(L==true){return false}var V=S.outerWidth(),T=V*-1,U=parseInt(S.css("left"),10);S.animate({left:T+"px"},((V+U)*Q.scrollSpeed),Q.fxEasingScroll,function(){I(S)})},R)}else{if(F.length>1){setTimeout(function(){if(L==true){return false}S.animate({top:(Q.yScroll=="top"?"+":"-")+M.innerHeight()+"px"},Q.showSpeed,Q.fxEasingScroll);I(S)},R)}}}function I(R){if(A.isFunction(Q.aftershow)){Q.aftershow.apply(O,[M,R])}R.removeClass(Q.cssShowing);B()}function P(){L=true;if(M.data("marquee.showing")!=true){F.filter("."+Q.cssShowing).dequeue().stop()}}function D(){L=false;if(M.data("marquee.showing")!=true){J(F.filter("."+Q.cssShowing),1)}}if(Q.pauseOnHover){M.hover(function(){if(G){return false}P()},function(){if(G){return false}D()})}function C(R){return(R.outerWidth()>M.innerWidth())}function B(){H++;if(H>=F.length){if(!isNaN(Q.loop)&&Q.loop>0&&(++N>=Q.loop)){return false}H=0}K(H)}if(A.isFunction(Q.init)){Q.init.apply(O,[M,Q])}B()};A.Marquee.defaults={yScroll:"top",showSpeed:850,scrollSpeed:12,pauseSpeed:5000,pauseOnHover:true,loop:-1,fxEasingShow:"swing",fxEasingScroll:"linear",cssShowing:"marquee-showing",init:null,beforeshow:null,show:null,aftershow:null}})(jQuery);/* 2008 Matthew Ainge & LlamaLAN */
/* Countdown v2.0 build begun 04 February 2008 13:10 */
// Countdown
// The countdown duration is not calculated on the client. The server stores the difference from now till then and used by
// the countdown functions. We also cannot depend on the interval being exact if based on client time.
// This is so erroneous time or date settings on the client PC do not affect the actual countdown time.
// Client timestamps are only used to determine how much closer we are since the page loaded.
//
// To use this function, alter the
html tag to include the OnLoad attribute e.g.
/* Variables set by YOU! */
//
var usingLocalTimezone = false; // For now, this code assumes the PHP server is in the UK.
// If we want the countdown to hit 0 at midnight in the client's country, set this to true.
// If the event is specific to the UK, it's more accurate to set this to false.
var usingPlurals = false; // If true, taps an 's' on the end of the label for each time unit, if required (i.e. if not 1 left)
var updateFrequencyinMS = 200; // Number of milliseconds between updates. If every second, 1000.
// NOTE - because of how the numbers are rounded it would look better to use more frequent
// updates. Otherwise, the seconds seem to freeze and jump occasionally.
var showMilliseconds = false; // If you want a more dramatic flurry of milliseconds set to true.
var dayAnnounceText = "" // What appears when we have arrived at the event's date and time. If blank, time will just stay at 00.
// Strings used for each time unit. Do not make it plural.
// These could simply be colons (:) with the usingPlurals flag set to false to give it a digital style
// Use your imagination. Go wild.
var weekLabel = ":"; // Weeks
var dayLabel = ":"; // Days
var hourLabel = ":"; // Hours
var minuteLabel = ":"; // Minutes
var secondLabel = ""; // Seconds
/* Variables NOT set by YOU! */
//
var serverTimeAtLoad; // serverTimeAtLoad is the PHP timestamp (seconds since UNIX epoch) according to the server at the time of render.
var clientTimeAtLoad; // Collects the timestamp according to the client's PC, stored when the page runs once only
var clientTimeCurrently; // Gets the current timestamp according to the client PC every second.
var wp, dp, hp, mp, sp; // set up other necessary variables
var el = ""; // element we're interested in, changes during code.
var cdID = ""; // Passed in by template to target specific countdown
// Let us begin
if (usingPlurals)
{
// prepare the pluralisation!
var theLetterS = "s";
}
function commenceCountdown(cdID)
{
// Can pass a specific ID to match a collection of fields which are identified by a common string appended to each field name.
// This is in case we have multiple countdowns.
// If undefined, leave it blank.
if (cdID == null)
{
cdID = "";
}
// commenceCountdown kicks the whole thing off
if (usingLocalTimezone)
{
el = 'cdTZ'; // Highly unlikely we'll have multiple of these on the page, would be silly
if(document.getElementById(el) != null)
{
var visitortime = new Date(); // We can nab the client's local Timezone
if(visitortime)
{
var visTZ = visitortime.getTimezoneOffset()/60; // Get the offset in hours
if(visTZ != 0)
{
if(visTZ < 0)
{
visTZ = visTZ * -1;
}
document.getElementById(el).innerHTML = "(Adjusted for your timezone)";
}
}
}
}
// PHP code has written the server's NOW timestamp into countServerTime div
el = 'cdServerTime';
if(document.getElementById(el) != null)
{
serverTimeAtLoad = parseInt(document.getElementById(el).innerHTML);
// If using client timezone, add the offset to the NOW timestamp.
// e.g. in the UK, the event day is 2008-10-08 00:00:00, and the time on the server is 2008-10-07 22:00:00.
// in the UK, there are 2 hours to go. In Spain, there are 3 hours to go till the next day.
if (usingLocalTimezone)
{
serverTimeAtLoad += visTZ * 3600;
}
serverTimeAtLoad *= 1000; // Gets it to the same precision as JS (to milliseconds)
d=new Date();
clientTimeAtLoad = d.getTime(); // Assign the current client's javascript timestamp to clientTimeAtLoad.
// This is not changed until page refresh.
// Shift the check of day into the function.
// dont' forget to include clearInterval when the dayAnnounce string is displayed.
if(cdID.length == 0)
{
// Do an initial run immediately
cdUpdate();
// Run the update() function at the interval set by updateFrequencyInMS
cdIntervalID = window.setInterval("cdUpdate()", updateFrequencyinMS);
}
else
{
for (var i=0; i eventTime && dayAnnounceText.length>0)
{
el = 'theDay' + cdID;
document.getElementById(el).innerHTML = dayAnnounceText;
window.clearInterval(window['cdIntervalID' + cdID]); // Stop the regular update
}
else
{
// If there's no set message, make sure we hit 0 and then stop updates after the countdown reads zero.
if(serverTimeCurrently >= eventTime)
{
serverTimeCurrently = eventTime;
window.clearInterval(window['cdIntervalID' + cdID]); // Stop the regular update
}
// Otherwise, we continue to count down
// Time left is the server's event timestamp minus the time passed since page load.
// Exciting stuff.
millisecondsUntilEvent = eventTime - serverTimeCurrently;
// The next block works out how much time is left in each unit of measurement
weeks = Math.floor(millisecondsUntilEvent/604800000);
millisecondsUntilEvent -= weeks * 604800000;
days = Math.floor(millisecondsUntilEvent/86400000);
millisecondsUntilEvent -= days * 86400000;
hours = Math.floor(millisecondsUntilEvent/3600000);
millisecondsUntilEvent -= hours * 3600000;
minutes = Math.floor(millisecondsUntilEvent/60000);
millisecondsUntilEvent -= minutes * 60000;
seconds = millisecondsUntilEvent/1000;
// Want to kill off any pluralisation of these strings, in case the last update added an S.
sp = secondLabel;
mp = minuteLabel;
hp = hourLabel;
dp = dayLabel;
wp = weekLabel;
// If the update is less than a second, let's display the milliseconds
if(showMilliseconds)
{
seconds = seconds.toFixed(3);
}
else
{
seconds = Math.floor(seconds);
}
// If using plurals, lets add them if needed.
if(usingPlurals)
{
if (seconds != 1) sp += theLetterS;
if (minutes != 1) mp += theLetterS;
if (hours != 1) hp += theLetterS;
if (days != 1) dp += theLetterS;
if (weeks != 1) wp += theLetterS;
}
// If any measurement is less than 10, pad out the result to look nice.
if(seconds < 10) seconds = "0" + seconds;
if(minutes < 10) minutes = "0" + minutes;
if(hours < 10) hours = "0" + hours;
if(days < 10) days = "0" + days;
if(weeks < 10) weeks = "0" + weeks;
// Now place the formatted unit count strings into the proper elements in the countdown block.
if(document.getElementById('cdS' + cdID) != null)
{
document.getElementById('cdS' + cdID).innerHTML = seconds;
document.getElementById('cdM' + cdID).innerHTML = minutes;
document.getElementById('cdH' + cdID).innerHTML = hours;
document.getElementById('cdD' + cdID).innerHTML = days;
document.getElementById('cdW' + cdID).innerHTML = weeks;
// Now place the formatted labels into the proper elements
document.getElementById('cdSlabel' + cdID).innerHTML = sp;
document.getElementById('cdMlabel' + cdID).innerHTML = mp;
document.getElementById('cdHlabel' + cdID).innerHTML = hp;
document.getElementById('cdDlabel' + cdID).innerHTML = dp;
document.getElementById('cdWlabel' + cdID).innerHTML = wp;
if(document.getElementById('tz' + cdID) != null)
{
// Keep the timezone area cleared
document.getElementById('tz' + cdID).innerHTML = "";
}
}
}
}
}
}
/* 2008 Matthew Ainge & LlamaLAN */
// Toggle Shoutbox
// setup
var blShoutDisplayed = true;
function toggleShout()
{
var objBox = document.getElementById('shoutBox-Content');
if(!objBox)
{
return false;
}
if(blShoutDisplayed)
{
objBox.style.height = "1px";
objBox.blur();
blShoutDisplayed = false;
return true;
}
else
{
objBox.style.height = "auto";
objBox.blur();
blShoutDisplayed = true;
return true;
}
}// ColorBox v1.3.19 - jQuery lightbox plugin
// (c) 2011 Jack Moore - jacklmoore.com
// License: http://www.opensource.org/licenses/mit-license.php
(function(a,b,c){function Z(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function $(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function _(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function ba(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function bb(){var b;K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function bc(b,c){a.event.trigger(b),c&&c.call(P)}function bd(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(K.loop||y[Q+1])a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function be(b){U||(P=b,bb(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1)),S||(S=T=!0,r.show(),K.returnFocus&&a(P).blur().one(l,function(){a(this).focus()}),q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=_(K.initialWidth,"x"),K.h=_(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),bc(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()),W.load(!0))}function bf(){!r&&b.body&&(Y=!1,z=a(c),r=Z(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}).hide(),q=Z(X,"Overlay",o?"position:absolute":"").hide(),s=Z(X,"Wrapper"),t=Z(X,"Content").append(A=Z(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Z(X,"LoadingOverlay").add(Z(X,"LoadingGraphic")),D=Z(X,"Title"),E=Z(X,"Current"),G=Z(X,"Next"),H=Z(X,"Previous"),F=Z(X,"Slideshow").bind(h,bd),I=Z(X,"Close")),s.append(Z(X).append(Z(X,"TopLeft"),u=Z(X,"TopCenter"),Z(X,"TopRight")),Z(X,!1,"clear:left").append(v=Z(X,"MiddleLeft"),t,w=Z(X,"MiddleRight")),Z(X,!1,"clear:left").append(Z(X,"BottomLeft"),x=Z(X,"BottomCenter"),Z(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Z(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),J=G.add(H).add(E).add(F),a(b.body).append(q,r.append(s,B)))}function bg(){return r?(Y||(Y=!0,L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))}),a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),be(this))})),!0):!1}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=!a.support.opacity&&!a.support.style,o=n&&!c.XMLHttpRequest,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div",Y;if(a.colorbox)return;a(bf),W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},bf();if(bg()){if(!f[0]){if(f.selector)return f;f=a(""),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b))}).addClass(g),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&be(f[0])}return f},W.position=function(a,b){function i(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset(),g=z.scrollTop(),h=z.scrollLeft();z.unbind("resize."+f),r.css({top:-9e4,left:-9e4}),K.fixed&&!o?(e.top-=g,e.left-=h,r.css({position:"fixed"})):(c=g,d=h,r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-_(K.right,"x"),0):K.left!==!1?d+=_(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-_(K.bottom,"y"),0):K.top!==!1?c+=_(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){i(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",K.reposition&&setTimeout(function(){z.bind("resize."+f,W.position)},1),b&&b()},step:function(){i(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=_(a.width,"x")-O-M),a.innerWidth&&(K.w=_(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=_(a.height,"y")-N-L),a.innerHeight&&(K.h=_(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||QK.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(K.loop||y[Q+1])&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Z(X,"Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!T&&y[1]&&(K.loop||y[Q+1])&&(Q=$(1),W.load())},W.prev=function(){!T&&y[1]&&(K.loop||Q)&&(Q=$(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,bc(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),bc(m),A.remove(),setTimeout(function(){U=!1,bc(l,K.onClosed)},1)}))},W.remove=function(){a([]).add(r).add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g).die()},W.element=function(){return a(P)},W.settings=d})(jQuery,document,this);var serverList = new Array();
var currentListPosition = 0;
function serverstatus()
{
submitCommand("status");
}
function maplist()
{
submitCommand("maps *");
}
function changemap()
{
var iMapName = document.getElementById("MAPNAME");
submitCommand("map " + iMapName.value);
}
function restart()
{
submitCommand("restart");
}
function kickid()
{
var iKickID = document.getElementById("KICKID");
var iReason = document.getElementById("KICKREASON");
submitCommand("kickid " + iKickID.value + " " + "\"" + iReason.value + "\"");
}
function say()
{
var iSay = document.getElementById("SAY");
submitCommand("say " + "\"" + iSay.value + "\"");
}
function search()
{
var iSearch = document.getElementById("SEARCH");
submitCommand("cvarlist " + iSearch.value);
}
// Get the HTTP Object
function getHTTPObject()
{
if (window.ActiveXObject)
return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest)
return new XMLHttpRequest();
else
{
alert("Your browser does not support AJAX.");
return null;
}
}
// Change the value of the outputText field
function setOutput(serverid)
{
if(httpObject.readyState == 4)
{
var responseTxt = httpObject.responseText;
var updateTxt = "Unknown response(" + responseTxt + ")";
switch(responseTxt)
{
case "getstate() = on":
{
updateTxt = "Server powered up";
break;
}
case "getstate() = off":
{
updateTxt = "Server powered down";
break;
}
case "reset() = 1":
{
updateTxt = "Server restarting";
break;
}
case "stop() = 1":
{
updateTxt = "Server powering down";
break;
}
case "start() = 1":
{
updateTxt = "Server powering up";
break;
}
}
document.getElementById('outputText_'+serverid).innerHTML = updateTxt;
if(serverList.length > 0)
{
if(currentListPosition < serverList.length)
{
currentListPosition += 1;
doWork('getstate',serverList[currentListPosition]);
}
}
}
}
function doWork(option,serverid)
{
httpObject = getHTTPObject();
if (httpObject != null)
{
document.getElementById('outputText_'+serverid).innerHTML = "Running";
httpObject.open("GET", "vmcom.php?serverid="+serverid+"&option="
+option, true);
httpObject.send(null);
//httpObject.onreadystatechange = setOutput;
httpObject.onreadystatechange = function() { setOutput(serverid) };
}
}
function getAllStatus()
{
//this function will loop through the above array and (should) return ALL server status via javascript
doWork('getstate',serverList[currentListPosition]);
}
function find_username(url)
{
popup(url, 760, 570, '_usersearch');
return false;
}
function popup(url, width, height, name)
{
if (!name)
{
name = '_popup';
}
window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes, width=' + width);
return false;
}
function insert_user(user)
{
opener.document.forms['select_user'].username.value = ( opener.document.forms['select_user'].username.value.length && opener.document.forms['select_user'].username.type == "textarea" ) ? opener.document.forms['select_user'].username.value + "\n" + user : user;
}
function insert_marked(users)
{
if (typeof(users.length) == "undefined")
{
if (users.checked)
{
insert_user(users.value);
}
}
else if (users.length > 0)
{
for (i = 0; i < users.length; i++)
{
if (users[i].checked)
{
insert_user(users[i].value);
}
}
}
self.close();
}
function insert_single(user)
{
opener.document.forms['select_user'].username.value = user;
self.close();
}
function ajaxSort(tableName,orderField,listID)
{
var dataArray = 'tablename=' + tableName +'&orderfield=' + orderField + '&' + $('#' + listID).sortable('serialize');
$.ajax({
type: "POST",
url: "ajaxserver.php?functionname=sort",
data: dataArray,
success: function(msg)
{
$('#ajaxReturn').html(msg);
}
});
}var newBGColour = '#ffffff';
var openMenu = 0;
var blingFrequency = Math.floor(Math.random()*4000)+5000;
var flickerTimer = false;
var flickerStatus = true;
var manageFlickerTimer = false;
var gamesListIDs;
// This 'timeout' variable stores the timer for the Loading message.
// It always waits a second. If loadingmessage false is called before the timer completes,
// the timeout is cancelled and the message will not appear.
var loadingMsgTimeout = 0;
var loadingMsgDelay = 1000; // in milliseconds, 1000 = 1 sec;
var uiBounce = new Array();
uiBounce['shoutBox'] = -1;
uiBounce['activityBox'] = -1;
var debugVar = false;
$(document).ready(function()
{
hideDivs();
$('#hubtabs').tabs();
//setup counters
if(!$.browser.msie)
{
blingBling(blingFrequency);
flickerLED();
}
//create accordion
openMenu = getCookie('openMenu');
if(openMenu.length > 0)
{
$("div.accordian").accordion({active: '#' + openMenu, autoHeight: false,icons: false, collapsible: true, change: function(event, ui) {animateHeader(event, ui);}});
}
else
{
$("div.accordian").accordion({active: false, autoHeight: false,icons: false, collapsible: true, change: function(event, ui) {animateHeader(event, ui);}});
}
$("#serverAccorion").accordion({active: false, autoHeight: false,icons: false, collapsible: true});
$("div.eventAccordion").accordion({ autoHeight: false,icons: false});
$("div.tournamentAccordion").accordion({autoHeight: false,icons: false, collapsible: true});
$("div.matchAccordion").accordion({autoHeight: false,icons: false, collapsible: true});
//$("div.eventAccordion").accordion({autoHeight: false,icons: false});
//$("div.accordian").accordion({active: false, autoHeight: false,icons: false, collapsible: true, change: function(event, ui) {animateHeader(event, ui);}});
$("div.newsArchiveList").accordion({active: false, autoHeight: false,icons: false, collapsible: true});
$("div.yearList").accordion({active: false, autoHeight: false,icons: false, collapsible: true});
$("a.gallerythumblink").colorbox({transition:"none", width:"75%", height:"75%", photo:"true", rel:'GalleryImage'});
$("a.menucolorbox").colorbox();
/* Start countdowns */
commenceCountdown("LAN", "Cutoff", "Merchandise", "ContestsOpen");
selectBG(rightDir,'#bg-element-right','/forums/styles/corporate-llama/theme/images/bgimages/right/');
selectBG(leftDir,'#bg-element-left','/forums/styles/corporate-llama/theme/images/bgimages/left/');
newBGColour = getCookie('headerBGColour');
if(newBGColour.length == 0 || newBGColour == '')
{
newBGColour = '#ffffff';
}
applyGlow();
$("#SiteGamesList").sortable({connectWith: ".orderedGameList"}).disableSelection();
$("#UserGamesList").sortable(
{
connectWith: ".orderedGameList",
update: function(event, ui)
{
saveGameList(event,ui,'#UserGamesList');
}
}).disableSelection();
processAchievements();
$("form").submit(function(e)
{
// Trying to get this to work in more browsers!
var submitted =
e.originalEvent.explicitOriginalTarget ||
e.originalEvent.relatedTarget ||
e.originalEvent.currentTarget ||
document.activeElement;
// Look if it was a text node (IE bug surprise surprise)
// submitted = submitted.nodeType == 1 ? submitted : submitted.parentNode;
if(submitted)
{
//alert(submitted.id);
if (submitted.id == "shoutBoxUpdate" || submitted.id == "shoutBoxSubmit")
{
//we need to send the text via JS and then stop the form submit.
addShoutBox();
callShoutBox();
e.preventDefault();
return false;
}
}
});
});
function updateScore(targetDiv,newScore)
{
var oldScore = $(targetDiv).html();
if(oldScore != newScore)
{
$(targetDiv).countTo({from: oldScore,to: newScore, speed: 500, refreshInterval: 10, padding: 3});
}
}
function jsonScoreBoard()
{
$.getJSON('/scoreboard/?jsonLoad=1',function(data)
{
var items = [];
$.each(data,function(key,val)
{
switch(key)
{
case 'scores':
{
var scoreArray = Array(val);
/*$('#score-yellow').html(String("000" + scoreArray[0]['yellow']).slice(-3));
$('#score-red').html(String("000" + scoreArray[0]['red']).slice(-3));
$('#score-blue').html(String("000" + scoreArray[0]['blue']).slice(-3));
$('#score-green').html(String("000" + scoreArray[0]['green']).slice(-3));*/
updateScore('#score-yellow',scoreArray[0]['yellow']);
updateScore('#score-red',scoreArray[0]['red']);
updateScore('#score-blue',scoreArray[0]['blue']);
updateScore('#score-green',scoreArray[0]['green']);
break;
}
case 'adminrant':
{
$('#admin-message').html(val);
break;
}
}
});
});
callShoutBox();
}
function flickerLED()
{
$("#next-event-led").effect("pulsate", {}, 800,
function()
{
flickerLED();
});
}
function saveGameList(event,ui,listID)
{
//save the list in listID
arr = $(listID + ' li').map(function()
{
var strID = $(this).attr("ID");
strID = strID.substring(strID.indexOf("_") + 1);
return strID;
}).get();
$.post(ajaxURL + '&Section=usergames.inc.php',{"gameids":[arr]}); /*,function(data)
{
ajaxContentLoad(data,'#ajax-content','#ajax-container');
});*/
}
function stopAnimation(div)
{
$(div).stop(true, false);
$(div).removeAttr('style');
}
function toggleChatDiv(callingDiv,DivID)
{
toggleDiv('div.' + DivID,'down','drop');
$(callingDiv).toggleClass('icon-down',800);
uiBounce[DivID] = false;
stopAnimation(callingDiv);
}
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value + ";path=/; domain=llamalan.co.uk";
}
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
var returnString = '';
for (i=0;i 1)
{
var randomEntry = Math.floor(Math.random() * arDirList.length);
var newBG = dirLocation + arDirList[randomEntry];
$(divID).css('background-image','url(\'' + newBG + '\')');
}
}
function checkHide(divID,panelID)
{
if(getCookie(divID) == 'true' && divID != '#ui-profile-panel')
{
$(panelID).toggleClass('icon-down',800);
}
else
{
if(divID != '#ui-profile-panel')
{
$(divID).hide();
}
}
}
function hideDivs()
{
//Hide divs
$("div.menuTopSlider").hide();
$("div.menuLeftSlider").hide();
$("div.accordionItem").hide();
$("#ajax-container").hide();
$('#ui-loading-msg').hide();
$("div.tournamentData").hide();
$("#tournamentDetails").hide();
$(".eventAccordionImageColour").hide();
$("#newsContent").hide();
checkHide('#ui-countdowns-panel','#ui-countdowns-panel .ui-paneltoggle');
checkHide('#ui-profile-panel','#ui-myprofile .ui-paneltoggle');
checkHide('div.activityBox','#ui-activity');
checkHide('div.shoutBox','#ui-chatbar');
}
function blingBling(blingFrequency)
{
$("#bling").effect("pulsate", {}, blingFrequency,
function()
{
blingFrequency = Math.floor(Math.random()*4000)+5000;
blingBling(blingFrequency);
});
}
function closeAjax()
{
// $('#ajax-container').hide('fold',750);
$('#ajax-container').fadeOut('medium');
$('#cboxOverlay').css('display','none');
updateActionLink();
}
function loadingMessage(msgToggle)
{
sitePulsate();
var loadingDiv = '#ui-loading-msg';
if(msgToggle == 'off')
{
return;
$(loadingDiv).stop(true, false);
}
if(msgToggle==true)
{
if($(loadingDiv + ':visible').length == 0)
{
//$(loadingDiv).show('scale',500);
loadingMsgTimeout = setTimeout('$(\'' + loadingDiv + '\').show(\'scale\',500)', loadingMsgDelay);
document.body.style.cursor='wait';
//debugMessage('Loading Message set to appear in 1 sec...');
}
}
if(msgToggle==false)
{
if($(loadingDiv + ':visible').length > 0)
{
$(loadingDiv).hide('scale',500);
document.body.style.cursor='auto';
//debugMessage('Loading Message was whisked away.');
}
else
{
if (loadingMsgTimeout > 0)
{
clearTimeout(loadingMsgTimeout);
$(loadingDiv).stop(true, false);
document.body.style.cursor='auto';
//debugMessage('Loading Message cancelled!');
}
}
}
}
function debugMessage(message)
{
if(message.length > 0)
{
document.getElementById('adblock').innerHTML = message;
}
}
//function showMessage()
// {
// $(loadingDiv).show('scale',500);
// }
function processAchievements()
{
ajaxLoad('achievements',0,'#ajax-content','#ajax-container');
}
function ajaxLoad(section,id,ajaxcontent,ajaxcontainer,loadMessage,jqueryEffect)
{
if(loadMessage == null)
{
loadMessage = true;
}
if(jqueryEffect == null)
{
jqueryEffect = '';
}
loadingMessage(loadMessage);
if(section == 'achievements')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=processachievements.inc.php',
contentType: "application/json; charset=utf-8",
success: function(data)
{
if(data.length > 0)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}
}});
}
if(section == 'matchresult')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=matchresults.inc.php&matchid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentShow(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'activity')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=activity.inc.php',
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentShow(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'shoutbox')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=shoutbox.inc.php',
contentType: "application/json; charset=utf-8",
success: function(data)
{
updateShoutBox(data);
//ajaxContentShow(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'blog')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=viewblog.inc.php&blogid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer,jqueryEffect);
}});
}
if(section == 'news')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=news.inc.php&newsid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer,jqueryEffect);
}});
}
if(section == 'article')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=articles.inc.php&ArticleID='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventSignup')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=eventsignup.inc.php&eventid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventSignupAdd')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=eventsignup.inc.php&eventid='+id+'&adduser=1',
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventSignupAddSpec')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=eventsignup.inc.php&eventid='+id+'&adduser=1&spec=1',
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventSignupUseTicket')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=eventsignup.inc.php&eventid='+id+'&useticket=1',
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventSignupPay')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=paymentoptions.inc.php&eventid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventCancel')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=eventsignup.inc.php&cancel=1&eventid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'eventCancelConfirm')
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=eventsignup.inc.php&cancel=1&confirmcancel=1&eventid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'event')
{
if(id == 0)
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=event.inc.php',
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
else
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=event.inc.php&EventID=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
}
if(section == 'eventfloorplan')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=floorplan.inc.php&FloorPlanEvent=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'tournament')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=tournaments.inc.php&tournamentid=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
setCookie('tournamentsection',section);
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'tournamentrules')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=tournaments.inc.php&mode=showrules&tournamentid=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
setCookie('tournamentsection',section);
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'tournamenttree')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=tournaments.inc.php&mode=showtree&tournamentid=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
setCookie('tournamentsection',section);
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'tournamenttable')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=tournaments.inc.php&mode=showtable&tournamentid=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
setCookie('tournamentsection',section);
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
if(section == 'tournamentlist')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=tournaments.inc.php&EventID=' + id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
},
error: function(jqXHR, textStatus, errorThrown)
{
alert(errorThrown);
}
});
}
if(section == 'newquote')
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=newquote.inc.php&userid='+id,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}});
}
//and finally, update the actionlink to reflect any changes made...
updateActionLink();
}
function updateActionLink()
{
$.ajax({type: 'get',
url: ajaxURL + '&Section=actionlink.inc.php',
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,'div.actionLink','');
}});
}
function ajaxContentLoad(data,ajaxcontent,ajaxcontainer,jqueryEffect)
{
if(jqueryEffect == null)
{
//jqueryEffect = '';
jqueryEffect = 'fade';
}
if($(ajaxcontainer + ':visible').length > 0 && ajaxcontainer.length > 0)
{
if(jqueryEffect.length > 0)
{
//stick the colour box here...
if(jqueryEffect == 'fade')
{
$(ajaxcontainer).fadeOut('fast',function () {ajaxContentShow(data,ajaxcontent,ajaxcontainer,jqueryEffect);});
}
else
{
$(ajaxcontainer).hide(jqueryEffect,function () {ajaxContentShow(data,ajaxcontent,ajaxcontainer,jqueryEffect);});
}
}
else
{
// $(ajaxcontainer).hide('fold',function () {ajaxContentShow(data,ajaxcontent,ajaxcontainer,jqueryEffect);});
$(ajaxcontainer).hide('fade',function () {ajaxContentShow(data,ajaxcontent,ajaxcontainer,jqueryEffect);});
}
}
else
{
ajaxContentShow(data,ajaxcontent,ajaxcontainer,jqueryEffect);
}
}
function ajaxContentShow(data,ajaxcontent,ajaxcontainer,jqueryEffect)
{
if(jqueryEffect == null)
{
jqueryEffect = '';
}
/*$('#ajax-content').html(data);
loadingMessage(false);
$("#ajax-container").show('fold',1000);*/
$(ajaxcontent).html(data);
if(ajaxcontent.substr(0,15) == '#TournamentList')
{
$("div.tournamentData").hide();
var tournamentID = getCookie('tournamentid');
if(tournamentID > 0)
{
showTournamentData(tournamentID);
}
var currentTournament = getCookie('LL_CURRENT_TOURNAMENT');
if(currentTournament > 0)
{
showTournamentData(currentTournament);
}
}
loadingMessage(false);
if(ajaxcontainer == '#ajax-container')
{
$("#cboxOverlay").css("display","block");
}
if(ajaxcontainer.length > 0)
{
if(jqueryEffect.length > 0)
{
if(jqueryEffect == 'fade')
{
$(ajaxcontainer).fadeIn('normal');
}
else
{
$(ajaxcontainer).show(jqueryEffect,1000);
}
}
else
{
$(ajaxcontainer).fadeIn('normal');
}
}
}
function ajaxSeatSelect(eventid,seatid)
{
$.ajax({type: 'get',
url:ajaxURL + '&Section=floorplan.inc.php&FloorPlanEvent='+eventid + '&SelectedSeat='+seatid,
contentType: "application/json; charset=utf-8",
success: function(data)
{
ajaxContentLoad(data,'#ajax-content','#ajax-container');
ajaxLoad('eventfloorplan',eventid,'#eventDetails','#eventDetails',false);
}});
}
function addNewQuote(id)
{
ajaxLoad('newquote',id,'#ajax-content','#ajax-container',false)
}
function ajaxFormSubmit(url,dataString,ajaxcontent,ajaxcontainer)
{
$.ajax({type: 'post',
url:ajaxURL + url,
data: dataString,
success: function(data)
{
ajaxContentLoad(data,ajaxcontent,ajaxcontainer);
}
});
}
/*function toggleBottomDiv(divName)
{
$(divName).toggle('slide', {direction: "down"}, 1000);
}*/
function toggleDiv(divName, cmdDirection, cmdEffect)
{
if(cmdDirection==null || cmdDirection.length==0)
{
cmdDirection="down";
}
if(cmdEffect==null || cmdEffect.length==0)
{
cmdEffect="slide";
}
//cos Golem is a PITA, we are going to store this DATA in the cookie
//$(divName).toggle(function() {setCookie(divName,$(divName).is(":visible"),1);});
$(divName).toggle(cmdEffect, {direction: cmdDirection}, 1000,function() {setCookie(divName,$(divName).is(":visible"),1);});
}
function animateHeader(event,ui)
{
if($(ui.newHeader).css('background-color') != undefined)
{
newBGColour = $(ui.newHeader).css('background-color');
}
if(newBGColour == '')
{
newBGColour = '000000';
}
applyGlow();
setCookie('headerBGColour',newBGColour,1);
setCookie('openMenu',$(ui.newHeader).attr('id'));
}
function loadEvent(event,ui)
{
var index = $(ui.newHeader).attr('id');
//ajaxLoad('event',index,'#ajaxData'+index,'#ajaxData'+index);
ajaxLoad('tournamentlist',index,'#TournamentList'+index,'');
//now we need to do an ajax load into our ajax container..
}
function getAttention(divName)
{
stopAnimation(divName); // this is to prevent queueing in the background, something Chrome does when you aint looking...
$(divName).effect("bounce", { times:3,mode:"effect" });
}
function applyGlow()
{
$("#ui-toplight").animate({ backgroundColor: newBGColour }, 400);
$("#ui-footlight").animate({ backgroundColor: newBGColour }, 400);
}
function sitePulsate()
{
$("#ui-toplight").stop(true, false);
$("#ui-footlight").stop(true, false);
$("#ui-toplight").animate({backgroundColor: "#fff"}, 50, function()
{
$("#ui-toplight").animate({backgroundColor: newBGColour}, 50);
}
);
$("#ui-footlight").animate({backgroundColor: "#fff"}, 50, function()
{
$("#ui-footlight").animate({backgroundColor: newBGColour}, 50);
}
);
}
function closeContent(contentDiv)
{
$(contentDiv).hide('fold',1000);
}
function showContent(contenDiv)
{
if($('div.accordionItem:visible').length > 0)
{
$('div.accordionItem:visible').hide('fold',1000,function() {$(contenDiv).toggle('fold',1000);});
}
else
{
$(contenDiv).toggle('fold',1000);
}
$('div.accordian').accordion("activate",false);
}
function callShoutBox()
{
$.post("/ajaxserver.php", { "function": "populateShoutbox"},function(data){updateShoutBox(data);});
}
function updateShoutBox(data)
{
//function to re-populate the shoutbox (can be setup on a timed event to reload...
var currentShoutBox = $("#shoutBox-Lines").html(); // Nab the current contents
$("#shoutBox-Lines").html(data); // Update contents
if($('div.shoutBox').is(":visible") == false)
{
data = data.replace(/"/g, "\"");
if(currentShoutBox != data)
{
// The previous contents do not match the update
// set the flag on to make the chat box bounce if the box is closed
if(uiBounce['shoutBox'] == -1)
{
uiBounce['shoutBox'] = false;
// this is a check - the very first update on page refresh is always different
// so this stops the box bouncing every time the page reloads.
}
else
{
// If this is a genuine update (after the first) then set the flag to bounce
uiBounce['shoutBox'] = true;
}
}
}
else
{
// If the box is open, stop the bouncing. This stops it bouncing even if the content
// was refreshed without the box being visible.
uiBounce['shoutBox'] = false;
}
if(uiBounce['shoutBox'] == true)
{
// If the flag is on, bounce the bar. This will happen every update until it's open.
getAttention('#ui-chatbar');
}
else
{
// if false, make sure we stop the current animation and kill the queue
// so we don't have a major spasm!
stopAnimation('#ui-chatbar');
}
}
function addShoutBox()
{
//function to send new shoutbox entries via JS
var sMessage = $('#newShout').val();
$.post("/index.php?ajaxLoad=1&Section=ajaxserver.inc.php&sid=" + sessionID, { "function": "userAddShoutbox", xmlData: sMessage},function(data){updateShoutBox(data);});
$('#newShout').val('');
}
function submitCommand(sCommand)
{
var iCommand = document.getElementById('COMMAND');
var iSubmit = document.getElementById('CUSTOMCOMMAND');
if(iCommand != null)
{
iCommand.value = sCommand;
if(iSubmit != null)
{
iSubmit.submit();
}
else
{
alert("no form :'(");
}
}
else
{
alert("No command field");
}
}
function serverstatus()
{
submitCommand("status");
}
function maplist()
{
submitCommand("maps *");
}
function changemap()
{
var iMapName = document.getElementById("MAPNAME");
submitCommand("map " + iMapName.value);
}
function restart()
{
submitCommand("restart");
}
function kickid()
{
var iKickID = document.getElementById("KICKID");
var iReason = document.getElementById("KICKREASON");
submitCommand("kickid " + iKickID.value + " " + "\"" + iReason.value + "\"");
}
function say()
{
var iSay = document.getElementById("SAY");
submitCommand("say " + "\"" + iSay.value + "\"");
}
function search()
{
var iSearch = document.getElementById("SEARCH");
submitCommand("cvarlist " + iSearch.value);
}
function getHTTPObject()
{
if (window.ActiveXObject)
return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest)
return new XMLHttpRequest();
else
{
alert("Your browser does not support AJAX.");
return null;
}
}
function doWork(option,serverid)
{
httpObject = getHTTPObject();
if (httpObject != null)
{
document.getElementById('outputText_'+serverid).innerHTML = "Running";
httpObject.open("GET", "vmcom.php?serverid="+serverid+"&option="
+option, true);
httpObject.send(null);
//httpObject.onreadystatechange = setOutput;
httpObject.onreadystatechange = function() { setOutput(serverid) };
}
}
function getAllStatus()
{
//this function will loop through the above array and (should) return ALL server status via javascript
doWork('getstate',serverList[currentListPosition]);
}
function find_username(url)
{
popup(url, 760, 570, '_usersearch');
return false;
}
function popup(url, width, height, name)
{
if (!name)
{
name = '_popup';
}
window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes, width=' + width);
return false;
}
function insert_user(user)
{
opener.document.forms['select_user'].username.value = ( opener.document.forms['select_user'].username.value.length && opener.document.forms['select_user'].username.type == "textarea" ) ? opener.document.forms['select_user'].username.value + "\n" + user : user;
}
function insert_marked(users)
{
if (typeof(users.length) == "undefined")
{
if (users.checked)
{
insert_user(users.value);
}
}
else if (users.length > 0)
{
for (i = 0; i < users.length; i++)
{
if (users[i].checked)
{
insert_user(users[i].value);
}
}
}
self.close();
}
function insert_single(user)
{
opener.document.forms['select_user'].username.value = user;
self.close();
}