var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;var isSafari=((navigator.userAgent.toLowerCase().indexOf("safari")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("mac")!=-1))?true:false;function curvyCorners(){if(typeof(arguments[0])!="object"){throw newCurvyError("First parameter of curvyCorners() must be an object.")}if(typeof(arguments[1])!="object"&&typeof(arguments[1])!="string"){throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name.")}if(typeof(arguments[1])=="string"){var e=0;var a=getElementsByClass(arguments[1])}else{var e=1;var a=arguments}var d=new Array();for(var c=e,b=a.length;c<b;c++){if(a[c].tagName.toLowerCase()=="div"){d[d.length]=new curvyObject(arguments[0],a[c])}}this.objects=d;this.applyCornersToAll=function(){for(var f=0,g=this.objects.length;f<g;f++){this.objects[f].applyCorners()}}}function curvyObject(){this.box=arguments[1];this.settings=arguments[0];this.topContainer=null;this.bottomContainer=null;this.masterCorners=new Array();this.contentDIV=null;var g=get_style(this.box,"height","height");var d=get_style(this.box,"width","width");var a=get_style(this.box,"borderTopWidth","border-top-width");var h=get_style(this.box,"borderTopColor","border-top-color");var c=get_style(this.box,"backgroundColor","background-color");var e=get_style(this.box,"backgroundImage","background-image");var b=get_style(this.box,"position","position");var f=get_style(this.box,"paddingTop","padding-top");this.boxHeight=parseInt(((g!=""&&g!="auto"&&g.indexOf("%")==-1)?g.substring(0,g.indexOf("px")):this.box.scrollHeight));this.boxWidth=parseInt(((d!=""&&d!="auto"&&d.indexOf("%")==-1)?d.substring(0,d.indexOf("px")):this.box.scrollWidth));this.borderWidth=parseInt(((a!=""&&a.indexOf("px")!==-1)?a.slice(0,a.indexOf("px")):0));this.boxColour=format_colour(c);this.boxPadding=parseInt(((f!=""&&f.indexOf("px")!==-1)?f.slice(0,f.indexOf("px")):0));this.borderColour=format_colour(h);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.backgroundImage=((e!="none")?e:"");this.boxContent=this.box.innerHTML;if(b!="absolute"){this.box.style.position="relative"}this.box.style.padding="0px";if(isIE&&d=="auto"&&g=="auto"){this.box.style.width="100%"}if(this.settings.autoPad==true&&this.boxPadding>0){this.box.innerHTML=""}this.applyCorners=function(){for(var E=0;E<2;E++){switch(E){case 0:if(this.settings.tl||this.settings.tr){var B=document.createElement("DIV");B.style.width="100%";B.style.fontSize="1px";B.style.overflow="hidden";B.style.position="absolute";B.style.paddingLeft=this.borderWidth+"px";B.style.paddingRight=this.borderWidth+"px";var v=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);B.style.height=v+"px";B.style.top=0-v+"px";B.style.left=0-this.borderWidth+"px";this.topContainer=this.box.appendChild(B)}break;case 1:if(this.settings.bl||this.settings.br){var B=document.createElement("DIV");B.style.width="100%";B.style.fontSize="1px";B.style.overflow="hidden";B.style.position="absolute";B.style.paddingLeft=this.borderWidth+"px";B.style.paddingRight=this.borderWidth+"px";var C=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);B.style.height=C+"px";B.style.bottom=0-C+"px";B.style.left=0-this.borderWidth+"px";this.bottomContainer=this.box.appendChild(B)}break}}if(this.topContainer){this.box.style.borderTopWidth="0px"}if(this.bottomContainer){this.box.style.borderBottomWidth="0px"}var I=["tr","tl","br","bl"];for(var M in I){var H=I[M];if(!this.settings[H]){if(((H=="tr"||H=="tl")&&this.topContainer!=null)||((H=="br"||H=="bl")&&this.bottomContainer!=null)){var A=document.createElement("DIV");A.style.position="relative";A.style.fontSize="1px";A.style.overflow="hidden";if(this.backgroundImage==""){A.style.backgroundColor=this.boxColour}else{A.style.backgroundImage=this.backgroundImage}switch(H){case"tl":A.style.height=v-this.borderWidth+"px";A.style.marginRight=this.settings.tr.radius-(this.borderWidth*2)+"px";A.style.borderLeft=this.borderString;A.style.borderTop=this.borderString;A.style.left=-this.borderWidth+"px";break;case"tr":A.style.height=v-this.borderWidth+"px";A.style.marginLeft=this.settings.tl.radius-(this.borderWidth*2)+"px";A.style.borderRight=this.borderString;A.style.borderTop=this.borderString;A.style.backgroundPosition="-"+(v+this.borderWidth)+"px 0px";A.style.left=this.borderWidth+"px";break;case"bl":A.style.height=C-this.borderWidth+"px";A.style.marginRight=this.settings.br.radius-(this.borderWidth*2)+"px";A.style.borderLeft=this.borderString;A.style.borderBottom=this.borderString;A.style.left=-this.borderWidth+"px";A.style.backgroundPosition="-"+(this.borderWidth)+"px -"+(this.boxHeight+(C+this.borderWidth))+"px";break;case"br":A.style.height=C-this.borderWidth+"px";A.style.marginLeft=this.settings.bl.radius-(this.borderWidth*2)+"px";A.style.borderRight=this.borderString;A.style.borderBottom=this.borderString;A.style.left=this.borderWidth+"px";A.style.backgroundPosition="-"+(C+this.borderWidth)+"px -"+(this.boxHeight+(C+this.borderWidth))+"px";break}}}else{if(this.masterCorners[this.settings[H].radius]){var A=this.masterCorners[this.settings[H].radius].cloneNode(true)}else{var A=document.createElement("DIV");A.style.height=this.settings[H].radius+"px";A.style.width=this.settings[H].radius+"px";A.style.position="absolute";A.style.fontSize="1px";A.style.overflow="hidden";var p=parseInt(this.settings[H].radius-this.borderWidth);for(var x=0,L=this.settings[H].radius;x<L;x++){if((x+1)>=p){var r=-1}else{var r=(Math.floor(Math.sqrt(Math.pow(p,2)-Math.pow((x+1),2)))-1)}if(p!=L){if((x)>=p){var o=-1}else{var o=Math.ceil(Math.sqrt(Math.pow(p,2)-Math.pow(x,2)))}if((x+1)>=L){var m=-1}else{var m=(Math.floor(Math.sqrt(Math.pow(L,2)-Math.pow((x+1),2)))-1)}}if((x)>=L){var l=-1}else{var l=Math.ceil(Math.sqrt(Math.pow(L,2)-Math.pow(x,2)))}if(r>-1){this.drawPixel(x,0,this.boxColour,100,(r+1),A,-1,this.settings[H].radius)}if(p!=L){for(var w=(r+1);w<o;w++){if(this.settings.antiAlias){if(this.backgroundImage!=""){var n=(pixelFraction(x,w,p)*100);if(n<30){this.drawPixel(x,w,this.borderColour,100,1,A,0,this.settings[H].radius)}else{this.drawPixel(x,w,this.borderColour,100,1,A,-1,this.settings[H].radius)}}else{var G=BlendColour(this.boxColour,this.borderColour,pixelFraction(x,w,p));this.drawPixel(x,w,G,100,1,A,0,this.settings[H].radius,H)}}}if(this.settings.antiAlias){if(m>=o){if(o==-1){o=0}this.drawPixel(x,o,this.borderColour,100,(m-o+1),A,0,0)}}else{if(m>=r){this.drawPixel(x,(r+1),this.borderColour,100,(m-r),A,0,0)}}var u=this.borderColour}else{var u=this.boxColour;var m=r}if(this.settings.antiAlias){for(var w=(m+1);w<l;w++){this.drawPixel(x,w,u,(pixelFraction(x,w,L)*100),1,A,((this.borderWidth>0)?0:-1),this.settings[H].radius)}}}this.masterCorners[this.settings[H].radius]=A.cloneNode(true)}if(H!="br"){for(var E=0,K=A.childNodes.length;E<K;E++){var y=A.childNodes[E];var J=parseInt(y.style.top.substring(0,y.style.top.indexOf("px")));var O=parseInt(y.style.left.substring(0,y.style.left.indexOf("px")));var Q=parseInt(y.style.height.substring(0,y.style.height.indexOf("px")));if(H=="tl"||H=="bl"){y.style.left=this.settings[H].radius-O-1+"px"}if(H=="tr"||H=="tl"){y.style.top=this.settings[H].radius-Q-J+"px"}switch(H){case"tr":y.style.backgroundPosition="-"+Math.abs((this.boxWidth-this.settings[H].radius+this.borderWidth)+O)+"px -"+Math.abs(this.settings[H].radius-Q-J-this.borderWidth)+"px";break;case"tl":y.style.backgroundPosition="-"+Math.abs((this.settings[H].radius-O-1)-this.borderWidth)+"px -"+Math.abs(this.settings[H].radius-Q-J-this.borderWidth)+"px";break;case"bl":y.style.backgroundPosition="-"+Math.abs((this.settings[H].radius-O-1)-this.borderWidth)+"px -"+Math.abs((this.boxHeight+this.settings[H].radius+J)-this.borderWidth)+"px";break}}}}if(A){switch(H){case"tl":if(A.style.position=="absolute"){A.style.top="0px"}if(A.style.position=="absolute"){A.style.left="0px"}if(this.topContainer){this.topContainer.appendChild(A)}break;case"tr":if(A.style.position=="absolute"){A.style.top="0px"}if(A.style.position=="absolute"){A.style.right="0px"}if(this.topContainer){this.topContainer.appendChild(A)}break;case"bl":if(A.style.position=="absolute"){A.style.bottom="0px"}if(A.style.position=="absolute"){A.style.left="0px"}if(this.bottomContainer){this.bottomContainer.appendChild(A)}break;case"br":if(A.style.position=="absolute"){A.style.bottom="0px"}if(A.style.position=="absolute"){A.style.right="0px"}if(this.bottomContainer){this.bottomContainer.appendChild(A)}break}}}var D=new Array();D.t=Math.abs(this.settings.tl.radius-this.settings.tr.radius);D.b=Math.abs(this.settings.bl.radius-this.settings.br.radius);for(z in D){if(D[z]){var N=((this.settings[z+"l"].radius<this.settings[z+"r"].radius)?z+"l":z+"r");var q=document.createElement("DIV");q.style.height=D[z]+"px";q.style.width=this.settings[N].radius+"px";q.style.position="absolute";q.style.fontSize="1px";q.style.overflow="hidden";q.style.backgroundColor=this.boxColour;switch(N){case"tl":q.style.bottom="0px";q.style.left="0px";q.style.borderLeft=this.borderString;this.topContainer.appendChild(q);break;case"tr":q.style.bottom="0px";q.style.right="0px";q.style.borderRight=this.borderString;this.topContainer.appendChild(q);break;case"bl":q.style.top="0px";q.style.left="0px";q.style.borderLeft=this.borderString;this.bottomContainer.appendChild(q);break;case"br":q.style.top="0px";q.style.right="0px";q.style.borderRight=this.borderString;this.bottomContainer.appendChild(q);break}}var s=document.createElement("DIV");s.style.position="relative";s.style.fontSize="1px";s.style.overflow="hidden";s.style.backgroundColor=this.boxColour;s.style.backgroundImage=this.backgroundImage;switch(z){case"t":if(this.topContainer){if(this.settings.tl.radius&&this.settings.tr.radius){s.style.height=v-this.borderWidth+"px";s.style.marginLeft=this.settings.tl.radius-this.borderWidth+"px";s.style.marginRight=this.settings.tr.radius-this.borderWidth+"px";s.style.borderTop=this.borderString;if(this.backgroundImage!=""){s.style.backgroundPosition="-"+(v+this.borderWidth)+"px 0px"}this.topContainer.appendChild(s)}this.box.style.backgroundPosition="0px -"+(v-this.borderWidth)+"px"}break;case"b":if(this.bottomContainer){if(this.settings.bl.radius&&this.settings.br.radius){s.style.height=C-this.borderWidth+"px";s.style.marginLeft=this.settings.bl.radius-this.borderWidth+"px";s.style.marginRight=this.settings.br.radius-this.borderWidth+"px";s.style.borderBottom=this.borderString;if(this.backgroundImage!=""){s.style.backgroundPosition="-"+(C+this.borderWidth)+"px -"+(this.boxHeight+(v+this.borderWidth))+"px"}this.bottomContainer.appendChild(s)}}break}}if(this.settings.autoPad==true&&this.boxPadding>0){var F=document.createElement("DIV");F.style.position="relative";F.innerHTML=this.boxContent;F.className="autoPadDiv";var P=Math.abs(v-this.boxPadding);var R=Math.abs(C-this.boxPadding);if(v<this.boxPadding){F.style.paddingTop=P+"px"}if(C<this.boxPadding){F.style.paddingBottom=C+"px"}F.style.paddingLeft=this.boxPadding+"px";F.style.paddingRight=this.boxPadding+"px";this.contentDIV=this.box.appendChild(F)}};this.drawPixel=function(t,q,k,p,r,s,m,o){var l=document.createElement("DIV");l.style.height=r+"px";l.style.width="1px";l.style.position="absolute";l.style.fontSize="1px";l.style.overflow="hidden";var n=Math.max(this.settings.tr.radius,this.settings.tl.radius);if(m==-1&&this.backgroundImage!=""){l.style.backgroundImage=this.backgroundImage;l.style.backgroundPosition="-"+(this.boxWidth-(o-t)+this.borderWidth)+"px -"+((this.boxHeight+n+q)-this.borderWidth)+"px"}else{l.style.backgroundColor=k}if(p!=100){setOpacity(l,p)}l.style.top=q+"px";l.style.left=t+"px";s.appendChild(l)}}function insertAfter(b,c,a){b.insertBefore(c,a.nextSibling)}function BlendColour(n,l,g){var d=parseInt(n.substr(1,2),16);var m=parseInt(n.substr(3,2),16);var f=parseInt(n.substr(5,2),16);var c=parseInt(l.substr(1,2),16);var k=parseInt(l.substr(3,2),16);var e=parseInt(l.substr(5,2),16);if(g>1||g<0){g=1}var h=Math.round((d*g)+(c*(1-g)));if(h>255){h=255}if(h<0){h=0}var b=Math.round((m*g)+(k*(1-g)));if(b>255){b=255}if(b<0){b=0}var a=Math.round((f*g)+(e*(1-g)));if(a>255){a=255}if(a<0){a=0}return"#"+IntToHex(h)+IntToHex(b)+IntToHex(a)}function IntToHex(a){base=a/16;rem=a%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+""+remS}function MakeHex(a){if((a>=0)&&(a<=9)){return a}else{switch(a){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}}function pixelFraction(h,g,a){var c=0;var b=new Array(1);var f=new Array(1);var k=0;var d="";var e=Math.sqrt((Math.pow(a,2)-Math.pow(h,2)));if((e>=g)&&(e<(g+1))){d="Left";b[k]=0;f[k]=e-g;k=k+1}var e=Math.sqrt((Math.pow(a,2)-Math.pow(g+1,2)));if((e>=h)&&(e<(h+1))){d=d+"Top";b[k]=e-h;f[k]=1;k=k+1}var e=Math.sqrt((Math.pow(a,2)-Math.pow(h+1,2)));if((e>=g)&&(e<(g+1))){d=d+"Right";b[k]=1;f[k]=e-g;k=k+1}var e=Math.sqrt((Math.pow(a,2)-Math.pow(g,2)));if((e>=h)&&(e<(h+1))){d=d+"Bottom";b[k]=e-h;f[k]=0}switch(d){case"LeftRight":c=Math.min(f[0],f[1])+((Math.max(f[0],f[1])-Math.min(f[0],f[1]))/2);break;case"TopRight":c=1-(((1-b[0])*(1-f[1]))/2);break;case"TopBottom":c=Math.min(b[0],b[1])+((Math.max(b[0],b[1])-Math.min(b[0],b[1]))/2);break;case"LeftBottom":c=(f[0]*b[1])/2;break;default:c=1}return c}function rgb2Hex(b){try{var c=rgb2Array(b);var h=parseInt(c[0]);var f=parseInt(c[1]);var a=parseInt(c[2]);var d="#"+IntToHex(h)+IntToHex(f)+IntToHex(a)}catch(g){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")}return d}function rgb2Array(a){var c=a.substring(4,a.indexOf(")"));var b=c.split(", ");return b}function setOpacity(f,c){c=(c==100)?99.999:c;if(isSafari&&f.tagName!="IFRAME"){var b=rgb2Array(f.style.backgroundColor);var e=parseInt(b[0]);var d=parseInt(b[1]);var a=parseInt(b[2]);f.style.backgroundColor="rgba("+e+", "+d+", "+a+", "+c/100+")"}else{if(typeof(f.style.opacity)!="undefined"){f.style.opacity=c/100}else{if(typeof(f.style.MozOpacity)!="undefined"){f.style.MozOpacity=c/100}else{if(typeof(f.style.filter)!="undefined"){f.style.filter="alpha(opacity:"+c+")"}else{if(typeof(f.style.KHTMLOpacity)!="undefined"){f.style.KHTMLOpacity=c/100}}}}}}function inArray(c,b){for(var a=0;a<c.length;a++){if(c[a]===b){return a}}return false}function inArrayKey(b,a){for(key in b){if(key===a){return true}}return false}function addEvent(e,d,b,a){if(e.addEventListener){e.addEventListener(d,b,a);return true}else{if(e.attachEvent){var c=e.attachEvent("on"+d,b);return c}else{e["on"+d]=b}}}function removeEvent(e,d,b,a){if(e.removeEventListener){e.removeEventListener(d,b,a);return true}else{if(e.detachEvent){var c=e.detachEvent("on"+d,b);return c}else{alert("Handler could not be removed")}}}function format_colour(b){var a="#ffffff";if(b!=""&&b!="transparent"){if(b.substr(0,3)=="rgb"){a=rgb2Hex(b)}else{if(b.length==4){a="#"+b.substring(1,2)+b.substring(1,2)+b.substring(2,3)+b.substring(2,3)+b.substring(3,4)+b.substring(3,4)}else{a=b}}}return a}function get_style(obj,property,propertyNS){try{if(obj.currentStyle){var returnVal=eval("obj.currentStyle."+property)}else{if(isSafari&&obj.style.display=="none"){obj.style.display="";var wasHidden=true}var returnVal=document.defaultView.getComputedStyle(obj,"").getPropertyValue(propertyNS);if(isSafari&&wasHidden){obj.style.display="none"}}}catch(e){}return returnVal}function getElementsByClass(g,e,a){var d=new Array();if(e==null){e=document}if(a==null){a="*"}var c=e.getElementsByTagName(a);var b=c.length;var f=new RegExp("(^|s)"+g+"(s|$)");for(i=0,j=0;i<b;i++){if(f.test(c[i].className)){d[j]=c[i];j++}}return d}function newCurvyError(a){return new Error("curvyCorners Error:\n"+a)};WebFont.load({custom:{families:["TitilliumText14L400wt","TitilliumText14L800wt","UbuntuTitlingBold","KontrapunktBold","KontrapunktLight","DroidSerifRegular"],urls:["/fonts/fonts.css"]}});function isdefined(a){if(typeof(a)!="undefined"){return true}else{return false}}var OPT_ID=0;var OPT_TITLE=1;var OPT_VOTES=2;var pollOptions=1;var formSubmitted=false;if(!isdefined(fancyeditor)){var fancyeditor=false}var votedID;var validUsername=new Array(false,false,false);var validPassword=new Array(false,false,false);var validPasswordRep=new Array(false,false,false);var validEmail=new Array(false,false,false);$(document).ready(function(){$("#pollfrm").submit(formProcess);$("#forgottenpass").submit(sendPasswordReset);$("#commentform").submit(submitComment);if($("#poll-results").length>0){animateResults()}$(".round").corner("4px");$("div.widget").corner("15px");externalLinks();calculate_time_zone()});function formProcess(a){a.preventDefault();var b=$("input[@name='poll']:checked").attr("value");b=b.replace("opt","");$("#pollwrap").fadeOut("slow",function(){$(this).empty();votedID=b;$.getJSON("/bin/poll.php?answer="+b,loadResults)})}function submitComment(a){a.preventDefault();$("#commentbody").blur();$("#commentbody").oneTime(5,"checkComment",function(){if(fancyeditor){if(CKEDITOR.instances.commentbody.getData().length==0){alert("You didn't consider writing something before submitting your comment?");return false}}else{if($("#commentbody").val().length==0){alert("You didn't consider writing something before submitting your comment?");return false}}disableButton($("#commentsubmit")," Saving... ");var d=$("#ctype").val();var c=$("#cparent").val();if(fancyeditor){var b=CKEDITOR.instances.commentbody.getData()}else{var b="<p>"+stripHTML($("#commentbody").val())+"</p>"}$("#commentbody").val("");$.getJSON("/bin/savecomment.php?type="+d+"&parent="+c+"&commentbody="+escape(b),showComments)})}function showPollResults(a){$("#pollwrap").slideUp("slow",function(){$(this).empty();votedID=99;$.getJSON("/bin/poll.php?mode=show&poll="+a,loadResults)})}function animateResults(){$("#poll-results div").each(function(){var a=$(this).next().text();$(this).css({width:"0%"}).animate({width:a},"slow")})}function loadResults(c){var d=0;var b;for(id in c){d=d+parseInt(c[id][OPT_VOTES])}var a="<ul><li><div id='poll-results'>\n<dl class='graph'>\n";for(id in c){b=Math.round((parseInt(c[id][OPT_VOTES])/parseInt(d))*100);if(isNaN(b)){b=0}if(c[id][OPT_ID]!==votedID){a=a+"<dt class='bar-title'>"+c[id][OPT_TITLE]+"</dt><dd class='bar-container'><div id='bar"+c[id][OPT_ID]+"'style='width:0%;'>&nbsp;</div><strong>"+b+"%</strong></dd>\n"}else{a=a+"<dt class='bar-title'>"+c[id][OPT_TITLE]+"</dt><dd class='bar-container'><div id='bar"+c[id][OPT_ID]+"'style='width:0%;background-color:#005B8F;'>&nbsp;</div><strong>"+b+"%</strong></dd>\n"}}a=a+"</dl><p>Total Votes: "+d+"</p></div></li></ul>\n";$("#pollwrap").append(a).slideDown("slow",function(){animateResults()})}function showComments(b){var a=$('<div class="comment"><blockquote class="commentquote">'+b[0][0]+'</blockquote><cite><strong><a href="'+b[0][2]+'">'+b[0][2]+"</a></strong> on "+b[0][1]+"</cite></div>").hide().fadeIn("slow");$("#objcomments").append(a);$("#commentsubmit").removeAttr("disabled");$("#commentsubmit").attr("value"," Submit comment ")}function showForgottenPassword(){$("#forgottenpassword").fadeIn("slow")}function sendPasswordReset(c){c.preventDefault();$("#forgottenmessage").empty();var a=$("#femail").val();var b="email="+a;$.ajax({type:"POST",url:"/bin/resetpassword.php",data:b,success:function(d){var e=$("<p>"+d+"</p>").slideDown("slow");$("#forgottenmessage").append(e)}});return false}function checkUsernameAvailability(){var a="username="+$("#fusername").val();$("#fusername-info").stopTime("checkUsername");if($("#fusername").val().length<=3){validateInputOutput(false,validUsername,"#fusername-info","Not available","Username has to be four characters or longer.");return}$("#fusername-info").oneTime(350,"checkUsername",function(){$.getJSON("/bin/checkusername.php?"+a,function(b){if(b.response=="false"){validateInputOutput(false,validUsername,"#fusername-info","Not available","Username is not available, try something else.")}else{if(b.response=="true"){validateInputOutput(true,validUsername,"#fusername-info","Available","Username is available!")}}});$("#fusername-info").stopTime("checkUsername")})}function validatePassword(a){if(a=="normal"&&$("#fpassword").val().length<6){validateInputOutput(false,validPassword,"#fpassword-info","Too short","Password has to be six characters or longer.")}else{if(a=="normal"){validateInputOutput(true,validPassword,"#fpassword-info","OK","Password is OK!")}}if(a=="repeat"&&$("#fpassword").val()!=$("#fpasswordrep").val()&&$("#fpasswordrep").val().length>0){validateInputOutput(false,validPasswordRep,"#fpasswordrep-info","Not matching","Passwords don't match.")}else{if(a=="repeat"&&$("#fpasswordrep").val().length>0){validateInputOutput(true,validPasswordRep,"#fpasswordrep-info","OK","Passwords match!")}}}function validateEmail(){if(isValidEmailAddress($("#femail").val())){validateInputOutput(true,validEmail,"#femail-info","OK","E-mail address looks OK!")}else{validateInputOutput(false,validEmail,"#femail-info","Not valid","Not a valid e-mail address.")}}function validateInputOutput(d,c,b,f,a){if(!d){var e=$('<img src="http://static.clandstm.com/images/xmark.gif" width="11" height="10" alt="'+f+'"> <small>'+a+"</small>")}else{var e=$('<img src="http://static.clandstm.com/images/checkmark.gif" width="11" height="10" alt="'+f+'"> <small>'+a+"</small>")}if((!d&&!c[2])||(d&&!c[1])){$(b).fadeOut("fast",function(){$(b).empty();$(b).append(e).fadeIn("slow")})}if(!d){c[0]=false;c[1]=false;c[2]=true}else{c[0]=true;c[1]=true;c[2]=false}checkFormValidity()}function checkFormValidity(){if(validEmail[0]&&validPassword[0]&&validPasswordRep[0]&&validUsername[0]){$("#registersubmit").removeAttr("disabled")}else{$("#registersubmit").attr("disabled","disabled")}}function checkPost(a){$("#postbody").blur();$("#postbody").oneTime(5,"validateForumPost",function(){$("#postbody").stopTime("validateForumPost");if(formSubmitted){return true}var b=false;if(a=="newtopic"){if($("#posttitle").val().length==0){var b=true}}if(fancyeditor){if(CKEDITOR.instances.postbody.getData().length==0||b){alert("Empty posts are rather useless, don't you agree?");return false}}else{if($("#postbody").val().length==0||b){alert("Empty posts are rather useless, don't you agree?");return false}}if(!formSubmitted){$("#forumposteditor").submit();formSubmitted=true}disableButton($("#submitpost")," Saving... ");return true});return false}function confirmDeletion(){if(confirm("Really delete?")){return true}return false}function markMessagesAs(a){var d=false;var e=[];var c=0;$(":checkbox").each(function(){if(this.checked){var f=$(this).attr("id");f=f.replace("msg","");e[c]=f;c++}});var b="markas="+a+"&messages="+e.toString();$.ajax({type:"POST",url:"/bin/markmessages.php",data:b,success:function(){location.reload()}})}function deleteMessages(){var c=false;var d=[];var b=0;if(!confirm("Are you sure you want to delete the selected messages?")){return false}$(":checkbox").each(function(){if(this.checked){var e=$(this).attr("id");e=e.replace("msg","");d[b]=e;b++}});var a="messages="+d.toString();$.ajax({type:"POST",url:"/bin/deletemessages.php",data:a,success:function(){location.reload()}})}function checkMessage(a){$("#messagebody").blur();$("#messagebody").oneTime(5,"validatePM",function(){$("#messagebody").stopTime("validatePM");if(formSubmitted){return true}var b=false;if(a=="newmessage"){if($("#messagesubject").val().length<6){alert("The subject must be at least 6 characters long.");return false}var c=/([a-zA-Z0-9_-]+)/;if(c.test($("#messagesubject").val())==false){alert("The subject must contain a few letters and/or numbers.");return false}}if(fancyeditor){if(CKEDITOR.instances.messagebody.getData().length==0||b){alert("Empty messages are rather useless, don't you agree?");return false}}else{if($("#messagebody").val().length==0||b){alert("Empty messages are rather useless, don't you agree?");return false}}if(!formSubmitted){$("#messageeditor").submit();formSubmitted=true}return true});return false}function slideDiv(a){$(a).slideToggle("slow")}function fadeElement(a){$(a).animate({opacity:"toggle"})}function checkUserPassword(){var a="password="+md5($("#fcurrentpassword").val());$("#fpassword-info").stopTime("checkPassword");if($("#fcurrentpassword").val().length<=5){return}$("#fpassword-info").oneTime(350,"checkPassword",function(){$.getJSON("/bin/checkpassword.php?"+a,function(b){if(b.response=="false"){validateInputOutput(false,validPassword,"#fpassword-info","Not correct","Password is not correct, please try again.")}else{if(b.response=="true"){validEmail[0]=true;validEmail[1]=true;validEmail[2]=false;validPasswordRep[0]=true;validPasswordRep[1]=true;validPasswordRep[2]=false;validPassword[0]=true;validPassword[1]=true;validPassword[2]=false;validateInputOutput(true,validUsername,"#fpassword-info","Correct","Password is correct!")}}});$("#fpassword-info").stopTime("checkPassword")})}function validateNewPassword(a){if(a=="normal"&&$("#fnewpassword").val().length<6){if($("#fnewpasswordrep").val().length==0){validPasswordRep[0]=false;validPasswordRep[1]=false;validPasswordRep[2]=false}validateInputOutput(false,validPassword,"#fnewpassword-info","Too short","Password has to be six characters or longer.")}else{if(a=="normal"){validUsername[0]=true;validUsername[1]=true;validUsername[2]=false;validateInputOutput(true,validPassword,"#fnewpassword-info","OK","Password is OK!")}}if(a=="repeat"&&$("#fnewpassword").val()!=$("#fnewpasswordrep").val()&&$("#fnewpasswordrep").val().length>0){validateInputOutput(false,validPasswordRep,"#fnewpasswordrep-info","Not matching","Passwords don't match.")}else{if(a=="repeat"&&$("#fnewpasswordrep").val().length>0){validateInputOutput(true,validPasswordRep,"#fnewpasswordrep-info","OK","Passwords match!")}}}function validateResetPassword(a){if(a=="normal"&&$("#firstpass").val().length<6){validateInputOutput(false,validPassword,"#firstpass-info","Too short","Password has to be six characters or longer.")}else{if(a=="normal"){validUsername[0]=true;validUsername[1]=true;validUsername[2]=false;validEmail[0]=true;validEmail[1]=true;validEmail[2]=false;validateInputOutput(true,validPassword,"#firstpass-info","OK","Password is OK!")}}if(a=="repeat"&&$("#firstpass").val()!=$("#secondpass").val()&&$("#secondpass").val().length>0){validateInputOutput(false,validPasswordRep,"#secondpass-info","Not matching","Passwords don't match.")}else{if(a=="repeat"&&$("#secondpass").val().length>0){validateInputOutput(true,validPasswordRep,"#secondpass-info","OK","Passwords match!")}}}function addMap(){var d=parseInt($("#nextmapnumber").val());var a="";if(!$("#fmatchplayed").is(":checked")){a=' style="display: none;"'}var b=' <label for="mapourscore-'+d+'" class="sub">Our score:</label> <input type="text" size="1" name="mapourscore-'+d+'" id="mapourscore-'+d+'" value="" /> <label for="maptheirscore-'+d+'" class="sub">Their score:</label> <input type="text" size="1" name="maptheirscore-'+d+'" id="maptheirscore-'+d+'" value="" />';var c=$('									<div><label for="map-'+d+'" class="main">Map '+d+':</label> <input type="text" size="15" name="map-'+d+'" id="map-'+d+'" /><span class="mapscore"'+a+">"+b+"</span><br /></div>").hide().fadeIn("slow");d++;$("#nextmapnumber").val(d);$("#maps").append(c)}function addScreenshot(){var a=$('									<div><label class="main">Choose file:</label> <input type="file" size="30" name="screenshot[]" id="screenshot[]" /><br />').hide().fadeIn("slow");$("#screenshots").append(a)}function stripHTML(a){var c="";var d=false;for(var b=0;b<a.length;b++){if(a.charAt(b)=="<"){d=true}if(a.charAt(b)==">"){if(a.charAt(b+1)!="<"){d=false;b++}}if(!d){c+=a.charAt(b)}}return c}function externalLinks(){if(!document.getElementsByTagName){return}var c=document.getElementsByTagName("a");for(var b=0;b<c.length;b++){var a=c[b];if(a.getAttribute("href")&&a.getAttribute("rel")=="external"){a.target="_blank"}}}function isValidEmailAddress(b){var a=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return a.test(b)}function addPollOption(){pollOptions++;var a=$('<div><label for="pollOption'+pollOptions+'">Option '+pollOptions+':</label><br />\n                                           <input type="text" size="40" name="pollOption'+pollOptions+'" id="pollOption'+pollOptions+'"/><br /></div>\n').hide().fadeIn("slow");$("#pollAnswers").append(a);$("#pollOptions").val(pollOptions)}function displayNotification(){$("#notification").css({display:"block"});$("#notification").animate({top:"+10",opacity:1},200,"swing");hideNotification()}function hideNotification(){$("#notification").oneTime(3000,"hideNotification",function(){$("#notification").animate({top:"-10",opacity:0},200,"swing",function(){$("#notification").css({display:"none"})})})}function removeAttachment(a){$("#attachmentControls").text("Removing attachment... please wait!");var b="postid="+a;$.ajax({type:"POST",url:"/bin/deleteattachment.php",data:b,success:function(){$("#attachment").removeAttr("disabled");$("#currentAttachment").fadeOut("fast")}})}function disableButton(a,b){$(a).attr("disabled","disabled");$(a).attr("value",b);return true}function checkAvatarOption(){if($("#favatar").val()=="custom"){$("#uploadavatar").slideToggle("fast")}else{$("#uploadavatar").slideUp("fast")}}jQuery.fn.log=function(a){console.log("%s: %o",a,this);return this};function md5(C){var D;var w=function(b,a){return(b<<a)|(b>>>(32-a))};var H=function(k,b){var V,a,d,x,c;d=(k&2147483648);x=(b&2147483648);V=(k&1073741824);a=(b&1073741824);c=(k&1073741823)+(b&1073741823);if(V&a){return(c^2147483648^d^x)}if(V|a){if(c&1073741824){return(c^3221225472^d^x)}else{return(c^1073741824^d^x)}}else{return(c^d^x)}};var r=function(a,c,b){return(a&c)|((~a)&b)};var q=function(a,c,b){return(a&b)|(c&(~b))};var p=function(a,c,b){return(a^c^b)};var n=function(a,c,b){return(c^(a|(~b)))};var u=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(r(V,aa,Z),k),Y));return H(w(W,X),V)};var f=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(q(V,aa,Z),k),Y));return H(w(W,X),V)};var F=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(p(V,aa,Z),k),Y));return H(w(W,X),V)};var t=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(n(V,aa,Z),k),Y));return H(w(W,X),V)};var e=function(V){var W;var d=V.length;var c=d+8;var b=(c-(c%64))/64;var x=(b+1)*16;var X=new Array(x-1);var a=0;var k=0;while(k<d){W=(k-(k%4))/4;a=(k%4)*8;X[W]=(X[W]|(V.charCodeAt(k)<<a));k++}W=(k-(k%4))/4;a=(k%4)*8;X[W]=X[W]|(128<<a);X[x-2]=d<<3;X[x-1]=d>>>29;return X};var s=function(d){var a="",b="",k,c;for(c=0;c<=3;c++){k=(d>>>(c*8))&255;b="0"+k.toString(16);a=a+b.substr(b.length-2,2)}return a};var E=[],L,h,G,v,g,U,T,S,R,O=7,M=12,J=17,I=22,B=5,A=9,z=14,y=20,o=4,m=11,l=16,j=23,Q=6,P=10,N=15,K=21;C=this.utf8_encode(C);E=e(C);U=1732584193;T=4023233417;S=2562383102;R=271733878;D=E.length;for(L=0;L<D;L+=16){h=U;G=T;v=S;g=R;U=u(U,T,S,R,E[L+0],O,3614090360);R=u(R,U,T,S,E[L+1],M,3905402710);S=u(S,R,U,T,E[L+2],J,606105819);T=u(T,S,R,U,E[L+3],I,3250441966);U=u(U,T,S,R,E[L+4],O,4118548399);R=u(R,U,T,S,E[L+5],M,1200080426);S=u(S,R,U,T,E[L+6],J,2821735955);T=u(T,S,R,U,E[L+7],I,4249261313);U=u(U,T,S,R,E[L+8],O,1770035416);R=u(R,U,T,S,E[L+9],M,2336552879);S=u(S,R,U,T,E[L+10],J,4294925233);T=u(T,S,R,U,E[L+11],I,2304563134);U=u(U,T,S,R,E[L+12],O,1804603682);R=u(R,U,T,S,E[L+13],M,4254626195);S=u(S,R,U,T,E[L+14],J,2792965006);T=u(T,S,R,U,E[L+15],I,1236535329);U=f(U,T,S,R,E[L+1],B,4129170786);R=f(R,U,T,S,E[L+6],A,3225465664);S=f(S,R,U,T,E[L+11],z,643717713);T=f(T,S,R,U,E[L+0],y,3921069994);U=f(U,T,S,R,E[L+5],B,3593408605);R=f(R,U,T,S,E[L+10],A,38016083);S=f(S,R,U,T,E[L+15],z,3634488961);T=f(T,S,R,U,E[L+4],y,3889429448);U=f(U,T,S,R,E[L+9],B,568446438);R=f(R,U,T,S,E[L+14],A,3275163606);S=f(S,R,U,T,E[L+3],z,4107603335);T=f(T,S,R,U,E[L+8],y,1163531501);U=f(U,T,S,R,E[L+13],B,2850285829);R=f(R,U,T,S,E[L+2],A,4243563512);S=f(S,R,U,T,E[L+7],z,1735328473);T=f(T,S,R,U,E[L+12],y,2368359562);U=F(U,T,S,R,E[L+5],o,4294588738);R=F(R,U,T,S,E[L+8],m,2272392833);S=F(S,R,U,T,E[L+11],l,1839030562);T=F(T,S,R,U,E[L+14],j,4259657740);U=F(U,T,S,R,E[L+1],o,2763975236);R=F(R,U,T,S,E[L+4],m,1272893353);S=F(S,R,U,T,E[L+7],l,4139469664);T=F(T,S,R,U,E[L+10],j,3200236656);U=F(U,T,S,R,E[L+13],o,681279174);R=F(R,U,T,S,E[L+0],m,3936430074);S=F(S,R,U,T,E[L+3],l,3572445317);T=F(T,S,R,U,E[L+6],j,76029189);U=F(U,T,S,R,E[L+9],o,3654602809);R=F(R,U,T,S,E[L+12],m,3873151461);S=F(S,R,U,T,E[L+15],l,530742520);T=F(T,S,R,U,E[L+2],j,3299628645);U=t(U,T,S,R,E[L+0],Q,4096336452);R=t(R,U,T,S,E[L+7],P,1126891415);S=t(S,R,U,T,E[L+14],N,2878612391);T=t(T,S,R,U,E[L+5],K,4237533241);U=t(U,T,S,R,E[L+12],Q,1700485571);R=t(R,U,T,S,E[L+3],P,2399980690);S=t(S,R,U,T,E[L+10],N,4293915773);T=t(T,S,R,U,E[L+1],K,2240044497);U=t(U,T,S,R,E[L+8],Q,1873313359);R=t(R,U,T,S,E[L+15],P,4264355552);S=t(S,R,U,T,E[L+6],N,2734768916);T=t(T,S,R,U,E[L+13],K,1309151649);U=t(U,T,S,R,E[L+4],Q,4149444226);R=t(R,U,T,S,E[L+11],P,3174756917);S=t(S,R,U,T,E[L+2],N,718787259);T=t(T,S,R,U,E[L+9],K,3951481745);U=H(U,h);T=H(T,G);S=H(S,v);R=H(R,g)}var i=s(U)+s(T)+s(S)+s(R);return i.toLowerCase()}function utf8_encode(a){var h=(a+"");var i="";var b,e;var c=0;b=e=0;c=h.length;for(var d=0;d<c;d++){var g=h.charCodeAt(d);var f=null;if(g<128){e++}else{if(g>127&&g<2048){f=String.fromCharCode((g>>6)|192)+String.fromCharCode((g&63)|128)}else{f=String.fromCharCode((g>>12)|224)+String.fromCharCode(((g>>6)&63)|128)+String.fromCharCode((g&63)|128)}}if(f!==null){if(e>b){i+=h.substring(b,e)}i+=f;b=e=d+1}}if(e>b){i+=h.substring(b,h.length)}return i};
(function(e){var d=e.browser.mozilla&&/gecko/i.test(navigator.userAgent);var c=e.browser.safari&&e.browser.version>=3;var g=!d&&!c&&(function(){if(!e.browser.msie){return false}var j=document.createElement("div");try{j.style.setExpression("width","0+0")}catch(i){return false}return true})();function f(i,j){return parseInt(e.css(i,j))||0}function b(i){var i=parseInt(i).toString(16);return(i.length<2)?"0"+i:i}function h(k){for(;k&&k.nodeName.toLowerCase()!="html";k=k.parentNode){var i=e.css(k,"backgroundColor");if(i=="rgba(0, 0, 0, 0)"){continue}if(i.indexOf("rgb")>=0){var j=i.match(/\d+/g);return"#"+b(j[0])+b(j[1])+b(j[2])}if(i&&i!="transparent"){return i}}return"#ffffff"}function a(l,j,k){switch(l){case"round":return Math.round(k*(1-Math.cos(Math.asin(j/k))));case"cool":return Math.round(k*(1+Math.cos(Math.asin(j/k))));case"sharp":return Math.round(k*(1-Math.cos(Math.acos(j/k))));case"bite":return Math.round(k*(Math.cos(Math.asin((k-j-1)/k))));case"slide":return Math.round(k*(Math.atan2(j,k/j)));case"jut":return Math.round(k*(Math.atan2(k,(k-j-1))));case"curl":return Math.round(k*(Math.atan(j)));case"tear":return Math.round(k*(Math.cos(j)));case"wicked":return Math.round(k*(Math.tan(j)));case"long":return Math.round(k*(Math.sqrt(j)));case"sculpt":return Math.round(k*(Math.log((k-j-1),k)));case"dog":return(j&1)?(j+1):k;case"dog2":return(j&2)?(j+1):k;case"dog3":return(j&3)?(j+1):k;case"fray":return(j%2)*k;case"notch":return k;case"bevel":return j+1}}e.fn.corner=function(m){if(this.length==0){if(!e.isReady&&this.selector){var v=this.selector,r=this.context;e(function(){e(v,r).corner(m)})}return this}m=(m||"").toLowerCase();var j=/keep/.test(m);var n=((m.match(/cc:(#[0-9a-f]+)/)||[])[1]);var t=((m.match(/sc:(#[0-9a-f]+)/)||[])[1]);var l=parseInt((m.match(/(\d+)px/)||[])[1])||10;var u=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var p=((m.match(u)||["round"])[0]);var q={T:0,B:1};var i={TL:/top|tl/.test(m),TR:/top|tr/.test(m),BL:/bottom|bl/.test(m),BR:/bottom|br/.test(m)};if(!i.TL&&!i.TR&&!i.BL&&!i.BR){i={TL:1,TR:1,BL:1,BR:1}}if(e.fn.corner.defaults.useNative&&p=="round"&&(d||c)){if(i.TL){this.css(d?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",l+"px")}if(i.TR){this.css(d?"-moz-border-radius-topright":"-webkit-border-top-right-radius",l+"px")}if(i.BL){this.css(d?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",l+"px")}if(i.BR){this.css(d?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",l+"px")}return this}var k=document.createElement("div");k.style.overflow="hidden";k.style.height="1px";k.style.backgroundColor=t||"transparent";k.style.borderStyle="solid";return this.each(function(z){var s={T:parseInt(e.css(this,"paddingTop"))||0,R:parseInt(e.css(this,"paddingRight"))||0,B:parseInt(e.css(this,"paddingBottom"))||0,L:parseInt(e.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!j){this.style.border="none"}k.style.borderColor=n||h(this.parentNode);var B=e.curCSS(this,"height");for(var x in q){var C=q[x];if((C&&(i.BL||i.BR))||(!C&&(i.TL||i.TR))){k.style.borderStyle="none "+(i[x+"R"]?"solid":"none")+" none "+(i[x+"L"]?"solid":"none");var D=document.createElement("div");e(D).addClass("jquery-corner");var o=D.style;C?this.appendChild(D):this.insertBefore(D,this.firstChild);if(C&&B!="auto"){if(e.css(this,"position")=="static"){this.style.position="relative"}o.position="absolute";o.bottom=o.left=o.padding=o.margin="0";if(g){o.setExpression("width","this.parentNode.offsetWidth")}else{o.width="100%"}}else{if(!C&&e.browser.msie){if(e.css(this,"position")=="static"){this.style.position="relative"}o.position="absolute";o.top=o.left=o.right=o.padding=o.margin="0";if(g){var E=f(this,"borderLeftWidth")+f(this,"borderRightWidth");o.setExpression("width","this.parentNode.offsetWidth - "+E+'+ "px"')}else{o.width="100%"}}else{o.position="relative";o.margin=!C?"-"+s.T+"px -"+s.R+"px "+(s.T-l)+"px -"+s.L+"px":(s.B-l)+"px -"+s.R+"px -"+s.B+"px -"+s.L+"px"}}for(var y=0;y<l;y++){var F=Math.max(0,a(p,y,l));var A=k.cloneNode(false);A.style.borderWidth="0 "+(i[x+"R"]?F:0)+"px 0 "+(i[x+"L"]?F:0)+"px";C?D.appendChild(A):D.insertBefore(A,D.firstChild)}}}})};e.fn.uncorner=function(){if(d||c){this.css(d?"-moz-border-radius":"-webkit-border-radius",0)}e("div.jquery-corner",this).remove();return this};e.fn.corner.defaults={useNative:true}})(jQuery);jQuery(function(a){a.fn.quicksearch=function(c){function D(E){return(E===null||E===undefined||E===false)?true:false}function A(F){var G=new RegExp(/\<[^\<]+\>/g);var E=F.replace(G,"");E=a.trim(E.toLowerCase().replace(/\n/,"").replace(/\s{2,}/," "));return E}function o(){var E=A(a('input[rel="'+h.randomElement+'"]').val());if(E.indexOf(" ")===-1){return E}else{return E.split(" ")}}function i(E,G,F){if(F==="string"){return z(E,G)}else{return k(E,G)}}function z(E,F){return(F.indexOf(E)>-1)}function k(E,G){for(var F=0;F<E.length;F++){var H=G.indexOf(E[F]);if(H===-1){return false}}return true}function q(E){if(h.hideElement==="grandparent"){return a(E).parent().parent()}else{if(h.hideElement==="parent"){return a(E).parent()}else{return a(E)}}}function v(F){if(C){var E=0;q(F).filter(":visible").each(function(){for(var G=0;G<j;G++){if(E===G){a(this).addClass(h.stripeRowClass[E])}else{a(this).removeClass(h.stripeRowClass[G])}}E=(E+1)%j})}}function p(E){a(E).find("td").each(function(){a(this).attr("width",parseInt(a(this).css("width")))})}function n(F){if(h.loaderId){var E=a('input[rel="'+h.randomElement+'"]').parent().find(".loader");if(F==="hide"){E.hide()}else{E.show()}}}function l(){var F=h.position;var E=h.attached;if(F==="before"){a(E).before(r())}else{if(F==="prepend"){a(E).prepend(r())}else{if(F==="append"){a(E).append(r())}else{a(E).after(r())}}}}function y(){if(!D(h.labelText)){return'<label for="'+h.randomElement+'" class="'+h.labelClass+'">'+h.labelText+"</label> "}return""}function B(){var E=(!D(h.inputText))?h.inputText:"";return'<input type="text" value="'+E+'" rel="'+h.randomElement+'" class="'+h.inputClass+'" id="'+h.randomElement+'" /> '}function g(){if(!D(h.loaderImg)){return'<img src="'+h.loaderImg+'" alt="Loading" id="'+h.loaderId+'" class="'+h.loaderClass+'" />'}else{return'<span id="'+h.loaderId+'" class="'+h.loaderClass+'">'+h.loaderText+"</span>"}}function r(){var E=(!h.isFieldset)?"form":"fieldset";return"<"+E+' action="#" id="'+h.formId+'" class="quicksearch">'+y()+B()+g()+"</"+E+">"}function t(){a('input[rel="'+h.randomElement+'"]').get(0).focus()}function f(){a('input[rel="'+h.randomElement+'"]').focus(function(){if(a(this).val()===h.inputText){a(this).val("")}});a('input[rel="'+h.randomElement+'"]').blur(function(){if(a(this).val()===""){a(this).val(h.inputText)}})}function e(E){return a(E).map(function(){return A(this.innerHTML)})}function x(){l();if(h.fixWidths){p(d)}if(h.focusOnLoad){t()}if(h.inputText!=""&&h.inputText!=null){f()}s=e(d);v(d);n("hide")}function b(){clearTimeout(m);m=setTimeout(function(){n("show");setTimeout(function(){h.onBefore();var E=o();var G=(typeof E);var F=0;E=h.filter(E);if(E!=""){if(typeof w[E]==="undefined"){w[E]=new Array();s.each(function(H){if(i(E,s[H],G)){w[E][H]=true}})}if(w[E].length===0){q(d).hide()}else{a(d).each(function(H){if(w[E][H]){q(this).show()}else{q(this).hide()}})}}else{q(d).show()}v(d)},h.delay/2);setTimeout(function(){n("hide")},h.delay/2);h.onAfter()},h.delay/2)}var h=a.extend({position:"prepend",attached:"body",formId:"quicksearch",labelText:"Quick Search",labelClass:"qs_label",inputText:null,inputClass:"qs_input",loaderId:"loader",loaderClass:"loader",loaderImg:null,loaderText:"Loading...",stripeRowClass:null,hideElement:null,delay:500,focusOnLoad:false,onBefore:function(){},onAfter:function(){},filter:function(E){return E},randomElement:"qs"+Math.floor(Math.random()*1000000),isFieldset:false,fixWidths:false},c);var m;var w={};var j=(!D(h.stripeRowClass))?h.stripeRowClass.length:0;var C=(j>0)?true:false;var d=this;var s;var u=a(this).selector;a.fn.extend({reset_cache:function(){d=a(u);s=e(d)}});x();a('input[rel="'+h.randomElement+'"]').keydown(function(F){var E=F.keyCode;if(!(E===9||E===13||E===16||E===17||E===18||E===38||E===40||E===224)){b()}});a("form.quicksearch, fieldset.quicksearch").submit(function(){return false});return this}});(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache}function getElementText(config,node){if(!node){return""}var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML}else{t=node.innerHTML}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node)}else{t=$(node).text()}}return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0}$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(!this.sortDisabled){$(this).addClass(table.config.cssHeader)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function sortText(a,b){return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return}var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL="\\"+config.decimal;var exp="/(^[+]?0("+DECIMAL+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+DECIMAL+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+DECIMAL+"0+$)/";return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[??$????.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2")}else{if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1")}else{if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")}}}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}$("tr:visible",table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem">								<div class="cancel">									<a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a>								</div>								<span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span>								<div class="uploadifyProgress">									<div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>								</div>							</div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var g=aG.length;if(g>0){for(var h=0;h<g;h++){var c=aG[h].id;var l=aG[h].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a)}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")}if(i.getAttribute("align")){e.align=i.getAttribute("align")}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j<k;j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")}}ae(e,f,c,l)}else{aF(i);if(l){l(a)}}}}}else{ay(c,true);if(l){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}l(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(f,d,h,e){aU=true;ap=e||null;at={success:false,id:h};var a=aS(h);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=h}f.id=ac;if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");h+="SWFObjectNew";g.setAttribute("id",h);a.parentNode.insertBefore(g,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(f,d,h)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aD)[0];if(e){var a=e.childNodes;if(a){var f=a.length;for(var c=0;c<f;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))}}}}}return d}function aA(e,g,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof e.id==aq){e.id=c}if(ah.ie&&ah.win){var f="";for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'}}}}}var h="";for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";ag[ag.length]=e.id;d=aS(e.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,f,a,c){if(ah.ie&&ah.mac){return}var e=aL.getElementsByTagName("head")[0];if(!e){return}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=g}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var e in ah){ah[e]=null}ah=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};d.id=a;d.swfVersion=e;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);aj(function(){h+="";f+="";var q={};if(g&&typeof g===aD){for(var o in g){q[o]=g[o]}}q.data=k;q.width=h;q.height=f;var n={};if(i&&typeof i===aD){for(var p in i){n[p]=i[p]}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]}else{n.flashvars=l+"="+b[l]}}}if(ao(c)){var m=aA(q,n,e);if(q.id==e){ay(e,true)}d.success=true;d.ref=m}else{if(a&&au()){q.data=a;ae(q,n,e,j);return}else{ay(e,true)}}if(j){j(d)}})}else{if(j){j(d)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();function calculate_time_zone(){var l=new Date();var b=new Date(l.getFullYear(),0,1,0,0,0,0);var j=new Date(l.getFullYear(),6,1,0,0,0,0);var k=b.toGMTString();var m=new Date(k.substring(0,k.lastIndexOf(" ")-1));k=j.toGMTString();var h=new Date(k.substring(0,k.lastIndexOf(" ")-1));var g=(b-m)/(1000*60*60);var f=(j-h)/(1000*60*60);var e;if(g==f){e="0"}else{var a=g-f;if(a>=0){g=f}e="1"}var d;var c=function(i){var n="0"+i;return n.substring(n.length-2)};$(".date").each(function(p){var q=$(this).text();var r=$(this).attr("title");if(!r){r="yyyy-mm-dd hh:ii:ss"}else{$(this).removeAttr("title")}var u=new Date(1997,1,1,1,1,1);var v=r.indexOf("yyyy");if(v>-1){u.setFullYear(Number(q.substr(v,4)))}var n=r.indexOf("mm");if(n>-1){u.setMonth(Number(q.substr(r.indexOf("mm"),2))-1)}u.setDate(Number(q.substr(r.indexOf("dd"),2)));u.setHours(Number(q.substr(r.indexOf("hh"),2)));u.setMinutes(Number(q.substr(r.indexOf("ii"),2)));u.setSeconds(Number(q.substr(r.indexOf("ss"),2)));u.setMinutes(u.getMinutes()+(g*60));var o=r.split("yyyy").join(u.getFullYear()).split("mm").join(c(u.getMonth()+1)).split("dd").join(c(u.getDate())).split("hh").join(c(u.getHours())).split("ii").join(c(u.getMinutes())).split("ss").join(c(u.getSeconds()));$(this).text(o)});if(setSessionVariable){$.get("/bin/setsessionvariable.php?key=dstmtimezone&value="+g)}if($("#currentTimeZone")){$("#currentTimeZone").html(get_time_zone_name(convert(g),g,e))}}function convert(e){var a=parseInt(e);e-=parseInt(e);e*=60;var d=parseInt(e);e-=parseInt(e);e*=60;var c=parseInt(e);var b=a;if(a>=0){b=(a<10)?"+0"+a:"+"+a}else{b=(a>-10)?"-0"+Math.abs(a):a}d=(d<10)?"0"+d:d;return b+":"+d}function get_time_zone_name(a,b,c){tzString="UTC"+a;if(b==1){tzString+=" (CET)"}else{if(b==0){tzString+=" (GMT)"}else{if(b==-5){tzString+=" (ET)"}}}return tzString};
