function prova(request){var datajson=request.responseText.evalJSON(true);var undato=datajson.title;alert(undato);}
function loading(){Element.show("waiting");}
function ForumEndLoad(view){Event.observe(window,'load',function(){init_iev(view);load_Image(0,0,0);});}
function fromGreyboxToMain(el){parent.parent.GB_hide();top.window.location=el.href;}
function setwidth()
{var browser_viewportwidth;var browser_viewportheight;if(typeof window.innerWidth!='undefined')
{browser_viewportwidth=window.innerWidth,browser_viewportheight=window.innerHeight}
else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0)
{browser_viewportwidth=document.documentElement.clientWidth,browser_viewportheight=document.documentElement.clientHeight}
else
{browser_viewportwidth=document.getElementsByTagName('body')[0].clientWidth,browser_viewportheight=document.getElementsByTagName('body')[0].clientHeight}
cust_width=(browser_viewportwidth-50)+"px";;cust_height=(browser_viewportheight-50)+"px";viewer_box=$('openviewer');viewer_box.setStyle({width:cust_width,height:cust_height});cust_width=(browser_viewportwidth-60)+"px";cust_height=(browser_viewportheight-60)+"px";viewer_main=$('ImageViewer_main_layer');viewer_main.setStyle({width:cust_width,height:cust_height});}
function checkForm(submit_button,post_text,thread_title,thread_recipient)
{if($(thread_title))
{if($(thread_title).value==null||$(thread_title).value=="")
{alert('Please choose a title for your new thread');return false;}}
if($(post_text))
{if($(post_text).value==null||$(post_text).value=="")
{alert('Please type some text in your post.');return false;}}
if($(thread_recipient))
{if($(thread_recipient).value==null||$(thread_recipient).value=="")
{alert('Please select a recipient for your new thread');return false;}}
$(submit_button).hide();if($("sending")){Element.show("sending");Effect.Pulsate("sending",{pulses:50,duration:100});}
return true;}
var current_position=0;function get_gallery_index(ind){current_position+=ind;return'position='+current_position;}
if($("post_text")){new Form.Element.Observer('post_text',1,function(element,value){checkEditBox()})}
var open_viewer='';var tab_name='';function set_tab_name(t){tab_name=t;}
function loading_order(){if($('body_threads'+'_'+tab_name))
$('body_threads'+'_'+tab_name).toggle();if($('zero_message_forum'))
$('zero_message_forum').toggle();if($('loading_threads_'+tab_name)==null)return;$('loading_threads_'+tab_name).show();}
function loading_order_stop(){$('loading_threads').update('');}
function load_type_order(el_id,type){if($(el_id)==null){return;}
img_tag='<img src = "/images/forum/asc.png" />'
if(type=="DESC"){img_tag='<img src = "/images/forum/desc.png" />';}
$(el_id).insert(img_tag);}
function load_threads_number(el_id,number){if($(el_id)==null)return;new_el=el_id+"_number";if($(new_el))$(new_el).remove();$(el_id).insert("<span id='"+new_el+"' class='flat-tab-link'> ("+number+")");}
function ajax_pagination(){Event.addBehavior.reassignAfterAjax=true;Event.addBehavior({'div.pagination a':Remote.Link})
pagination_links=$$('.pagination a');pagination_links.each(function(el){Event.observe(el,'click',function(event){loading_order();});});}
function load_list_description(tab,order,type_order,group_name){tab=tab.capitalize();type_order=(type_order=="ASC")?"ascending":"discending";if(order=="favorite")order="favorites";else if(order=="read")order="read";else if(order=="topic")order="title";else if(order=="rate")order="score";else if(order=="author")order="author name";else if(order=="posts")order="number of posts";else if(order=="views")order="number of views";else if(order=="last_post")order="last post date";m1="<b>";m2="</b>";}
function checkEditBox()
{var filled=true;if($('post_text').value.replace(/^\s+|\s+$/g,'')=='')
filled=false;if($('post_button')==null){if($('send-message')!=null)
button='send-message';else
button=false;}
else
button='post_button';if(button!=false){if(filled){$(button).disabled=false;$(button).style.background="#FAAD11";$(button).style.cursor="pointer";}
else{$(button).disabled=true;$(button).style.background="#DCDAD5";$(button).style.cursor="default";}}}
function checkFilledMessage(){var buttonId='send-message';if($(buttonId)){var filled=((!$('recipient_id')||$('recipient_id').value.length>0)&&(!$('topic_title')||$('topic_title').value.length>0)&&(!$('post_text')||$('post_text').value.length>0));if(filled){$(buttonId).enable().addClassName("submit-enabled");}else{$(buttonId).disable().removeClassName("submit-enabled");}}}