<!--
$(document).ready(function(){if($('[name="poll-ques"]').length>0){$('[name="poll-ques"]').maxChar(100,{singularMessage:' character remaining',pluralMessage:' characters remaining'});}
$('.prev-msg').hover(function(){$(this).css('cursor','pointer');},function(){$(this).css('cursor','auto');});$('.prev-msg').click(function(){$(this).html(wait_img_code);var msg_id=$(this).attr('id').replace('msg-','');var data='action=get-msg&msg-id='+msg_id;submit_ajax(data,$(this),'');});$('.btn-edit').live('click',function(){$(this).closest('div.forum-post').find('.forum-msg').slideUp('slow',function(){$(this).closest('div.forum-post').find('div.edit-text').slideDown('slow');});$(this).closest('div.forum-post').find('textarea.edit-text').focus();});$('.approve-post').live('click',function(){$(this).closest('form').submit();});$('.delete-post').live('click',function(){$(this).closest('form').submit();});$('.report-post').live('click',function(){if(confirm('Are you sure you want to report this post?')){$(this).closest('form').submit();}else{return false;}});$('.btn-cancel-edit').live('click',function(){$(this).closest('div.forum-post').find('div.edit-text').slideUp('slow',function(){$(this).closest('div.forum-post').find('.forum-msg').slideDown('slow');});});$('#topic-reply').submit(function(){if(!ajaxAllForms){var error_msg='';if($(this).find('[name="topic_title"]').val()==''){error_msg+='Please enter a title for your topic.\n';$(this).find('[name="topic_title"]').addClass('submit-error');}
if($(this).find('[name="post"]').val()==''){error_msg+='Please enter a message.';$(this).find('[name="post"]').addClass('submit-error');}
if(error_msg!=''){alert(error_msg);return false;}else{return true;}}
return true;});});function addAnswerField(){var maxAnswers=$('#max-poll-answers').val();var thisAnswer=$('div.poll-answer').length+1;if(thisAnswer<=maxAnswers){$('div.poll-answer:last').after($('div.poll-answer:first').clone());$('div.poll-answer:last').find('[name="poll-answers[]"]').val('');$('div.poll-answer:last').find('.answer-label').html('Answer Possibility '+thisAnswer);}else{alert('You are allowed a maximum of '+maxAnswers+' answers');}}
function addPoll(){$('#poll-form').slideDown('slow');}
function addPollVote(submittedForm,responseData){if(responseData.success=='true'){$('div.poll-results').html(responseData.full_msg);showPollResults();}else{submittedForm.find('div.results').html(responseData.full_msg);}}
function lockThread(submittedForm,responseData){$(submittedForm).find('div.results').html(responseData.full_msg);if(responseData.success=='true'){$('#reply').closest('div.box').slideUp('slow');}}
function move_forum(submitted_form,responseData){$('#move-forum-results').html(responseData.full_msg);if(responseData.success=='true'){window.location=responseData.new_url;}}
function quote_text(post_id,user){var sel_text=selected_text();if(sel_text==''){alert('Please select some text from the post before clicking the quote button.');return false;}
$('#post-input').insertAtCaretPos('[quote='+user+', '+post_id+']'+sel_text+'[/quote]\n');return true;}
function show_all_msgs(obj,msg){if(msg.success=='true'){$.each(msg.msgs,function(i,this_msg){show_msg($('#msg-'+this_msg.msg_id),this_msg.full_msg);});}else{$(obj).after(msg.full_msg);}
$('#get-posts-wait').remove();}
function show_full_posts(section,clicked_id){$('#'+clicked_id).after('<div id="get-posts-wait">'+wait_img+'</div>');var msgs=new Array();var i=0;$('div#unread-group-'+section+' .prev-msg').each(function(){var msg_id=$(this).attr('id').replace('msg-','');msgs[i]=msg_id;i++;});var data='action=fetch-msgs&ids='+msgs.join(',');submit_ajax(data,$('#'+clicked_id),'');change_local_times();}
function show_msg(obj,full_msg){$(obj).addClass('invisible');$(obj).html(full_msg);$(obj).slideDown('slow');$(obj).removeClass('prev-msg');$(obj).attr('title','');$(obj).unbind('mouseenter mouseleave');$(obj).unbind('click');}
function show_full_msg(obj,msg){if(msg.success=='true'){show_msg(obj,msg.full_msg);change_local_times()}else{$(obj).html(msg.full_msg);}}
function show_new_post(submitted_form,response){if(response.success=='true'){$('div.forum-post:last').after(response.full_msg);$('div.forum-post:last').slideDown('slow');$('[name="post"]').val('');var new_count=parseInt($('[name="new-count"]').val())+1;$('[name="new-count"]').val(new_count);change_local_times()}else{$('#reply').after(response.full_msg);}}
function showPollResults(){$('div.poll-answers').slideUp('slow',function(){$('div.poll-results').slideDown('slow');});}
function showPollVote(){$('div.poll-results').slideUp('slow',function(){$('div.poll-answers').slideDown('slow');});}
function show_post_delete(submitted_form,response){if(response.success=='true'){$('#post-'+response.post_id).slideUp('slow');}else{$('#post-'+response.post_id).after(response.full_msg);}}
function show_post_edit(submitted_form,response){$(submitted_form).closest('div').find('.forum-msg').html(response.full_msg);$(submitted_form).find('.edit-text').slideUp('slow',function(){$(submitted_form).closest('div').find('.forum-msg').slideDown('slow');});}
function show_post_report(submitted_form,response){$('#post-'+response.post_id).after(response.full_msg);}
function validate_reply(){if($('[name="post"]').val()==''){$('[name="post"]').addClass('submit-error');alert('Please enter a post before submitting.');return false;}else{return true;}}
-->
