loading=new Image();loading.src="http://louistrations.co.uk/img/loading.gif";function fetch($el,$id,$parent,$action,$login_type,$replyTo){if(document.getElementById($el+$id).innerHTML==''){if($id!=''){$("#loading"+$parent).fadeIn("fast")}$.post("ajax.php?",{el:$el,id:$id,parent:$parent,action:$action,login_type:$login_type,replyTo:$replyTo},function(data){$("#"+$el+$id).append(data);$("#"+$el+$id).slideDown(1000,"easeOutBounce");if($id!=''){$("#loading"+$parent).fadeOut("fast")}})}else{$("#"+$el+$id).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#"+$el+$id).empty()}})}}function fetchWithLogin($el,$id,$parent,$action,$replyTo){$email=document.getElementById('email'+$id).value;$password=document.getElementById('password'+$id).value;$remember=document.getElementById('remember'+$id).value;if($id!=''){$("#loading"+$parent).fadeIn("fast")}$("#"+$el+$id).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#"+$el+$id).empty();$.post("ajax.php?",{el:$el,id:$id,parent:$parent,action:$action,email:$email,password:$password,remember:$remember,replyTo:$replyTo},function(data){$("#"+$el+$id).append(data);$("#"+$el+$id).slideDown(1000,"easeOutBounce");userbar();if($id!=''){$("#loading"+$parent).fadeOut("fast")}})}})}function comment($type,$parent,$id){$body=document.getElementById('add_comment'+$id).value;$commentCount=document.getElementById('count'+$parent).innerHTML;$("#loading"+$parent).fadeIn("fast");$("#"+$type+"Form"+$id).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#"+$type+"Form"+$id).empty();$.post("ajax.php?",{type:$type,parent:$parent,id:$id,body:$body,action:'comment'},function(data){if(document.getElementById('comments'+$parent).innerHTML!=''){if($type=='comment'){$type='Comments'}if($type=='reply'){$type='Replies'}document.getElementById('count'+$parent).innerHTML=($commentCount*1)+1;$("#new"+$type+$id).append(data)}else{document.getElementById('count'+$parent).innerHTML=($commentCount*1)+1;alert('Your comment has been posted!')}$("#loading"+$parent).fadeOut("fast")})}})}function editComment($el,$type,$parent,$original,$id){$body=document.getElementById('edit_comment'+$id).value;$("#loading"+$parent).fadeIn("fast");$("#"+$el+$original).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#"+$el+$original).empty();$.post("ajax.php?",{id:$id,body:$body,action:'editComment'},function(data){$("#"+$id).fadeOut({duration:"fast",complete:function(){$("#"+$id).empty();$("#"+$id).append(data);$("#"+$id).fadeIn("fast");$("#loading"+$parent).fadeOut("fast")}})})}})}function createUser($el,$id,$parent,$action){$email=document.getElementById('create_email'+$id).value;$name=document.getElementById('create_name'+$id).value;$("#loading"+$parent).fadeIn("fast");$("#"+$el+$id).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#"+$el+$id).empty();$.post("ajax.php?",{el:$el,id:$id,parent:$parent,action:'createUser',create_email:$email,create_name:$name},function(data){$("#"+$el+$id).append(data);$("#"+$el+$id).slideDown(1000,"easeOutBounce");$("#loading"+$parent).fadeOut("fast")})}})}function requestPassword($el,$id,$parent,$action){$email=document.getElementById('request_email'+$id).value;$("#loading"+$parent).fadeIn("fast");$("#"+$el+$id).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#"+$el+$id).empty();$.post("ajax.php?",{el:$el,id:$id,parent:$parent,action:'requestPassword',request_email:$email},function(data){$("#"+$el+$id).append(data);$("#"+$el+$id).slideDown(1000,"easeOutBounce");$("#loading"+$parent).fadeOut("fast")})}})}function loginSwitch($id,$type){$("#existing"+$id).hide();$("#create"+$id).hide();$("#request"+$id).hide();$("#"+$type+$id).fadeIn('slow')}function loadExtra($id){if(document.getElementById('extra'+$id).innerHTML==''){$("#loading"+$id).fadeIn("fast");$.post("ajax.php?",{action:"extra",i:$id},function(data){$("#extra"+$id).append(data);$("#extra"+$id).slideDown(1000,"easeOutBounce");$("#loading"+$id).fadeOut("fast")})}else{$("#extra"+$id).slideUp({duration:1000,easing:"easeOutBounce",complete:function(){$("#extra"+$id).empty()}})}}function loadCalendar($date){$.post("ajax.php?",{action:"calendar",date:$date},function(data){$("#cal").fadeOut({duration:"fast",complete:function(){$("#cal").empty();$("#cal").append(data);$("#cal").fadeIn("fast")}})})}function clearSearch(){if(document.getElementById('searchbox').value=='Search Louistrations'){document.getElementById('searchbox').value='';document.getElementById('searchbox').style.color='#000'}}function userbar(){$.post("ajax.php?",{action:"userbar"},function(data){$("#userbar").fadeOut({duration:"fast",complete:function(){$("#userbar").empty();$("#userbar").append(data);$("#userbar").fadeIn("fast")}})})}function logout(){$.post("ajax.php?",{action:"logout"},function(data){$("#userbar").fadeOut({duration:"fast",complete:function(){$("#userbar").empty();$("#userbar").append(data);$("#userbar").fadeIn("fast")}})})}function selectAvatar($selected){$email=document.getElementById('md5email').value;$currentAvatar=document.getElementById('current_avatar').value;$previousAvatar=document.getElementById('previous_avatar').value;if($selected=='keep'){$("#avatarPreview").css('background-image','url(img/avatars/'+$currentAvatar+')')}if($selected=='previous'){$("#avatarPreview").css('background-image','url(img/avatars/'+$previousAvatar+')')}if($selected=='gravatar'){$("#avatarPreview").css('background-image','url(http://www.gravatar.com/avatar.php?gravatar_id='+$email+'&default=http%3A%2F%2Flouistrations.co.uk%2Fchipper%2Fimg%2Favatars%2Fdefault.jpg&size=50)')}if($selected=='remove'||$selected=='new'){$("#avatarPreview").css('background-image','url()')}if($selected=='new'){$("#uploadForm").slideDown({duration:1000,easing:"easeOutBounce"})}else{$("#uploadForm").slideUp({duration:1000,easing:"easeOutBounce"})}}function insertEmoticon($el,$emoticon){$currentText=document.getElementById($el);$currentText.value+=" "+$emoticon+" ";$currentText.focus()}jQuery.fn.fadeToggle=function(speed,easing,callback){return this.animate({opacity:'toggle'},speed,easing,callback)};$(document).ready(function(){$("a[rel^='lightbox']").prettyPhoto({animationSpeed:'normal',padding:40,opacity:0.80,showTitle:false,allowresize:true,counter_separator_label:'/',theme:'light_rounded',callback:function(){}})});function getSelect(s){location=s}