var new_comm_fields=new Array();var new_comm_blocks=new Array();var error_found='';function new_community_form()
{new_comm_fields['comm_short']=document.getElementById('comm_short');new_comm_blocks['comm_short']=document.getElementById('communityShort');new_comm_blocks['comm_short_text']=document.getElementById('communityShort_text');new_comm_blocks['comm_short_img']=document.getElementById('commImg');new_comm_fields['comm_short'].onblur=check_short_tag;if(!new_comm_blocks['comm_short'].innerHTML)
{new_comm_blocks['comm_short'].style.display='none';}}
function check_short_tag(event)
{if(!new_comm_fields['comm_short'].value)
{new_comm_blocks['comm_short_img'].src=ipb_var_image_url+'/'+ img_cross;new_comm_blocks['comm_short_text'].innerHTML='Please enter a short name for your community.';new_comm_blocks['comm_short'].style.display='block';}
if(use_enhanced_js&&new_comm_fields['comm_short'].value)
{var url=ipb_var_base_url+'act=xmlout&do=check-short-tag&tag='+escape(new_comm_fields['comm_short'].value);do_request_function=function()
{if(!xmlobj.readystate_ready_and_ok())
{return;}
var html=xmlobj.xmlhandler.responseText;if(html=='found')
{error_found+='Sorry, that short name is already taken.'+"<br />";}
if(html=='illegal')
{error_found+='You appear to have illegal characters in your shortname.'+"<br />";}
if(html=='length')
{error_found+='Your shortname is too long.  It must be under 16 characters.'+"<br />";}
if(error_found)
{new_comm_blocks['comm_short_img'].src=ipb_var_image_url+'/'+ img_cross;new_comm_blocks['comm_short_text'].innerHTML=error_found;new_comm_blocks['comm_short'].style.display='block';}
else
{new_comm_blocks['comm_short_img'].src=ipb_var_image_url+'/'+ img_tick;new_comm_blocks['comm_short_text'].innerHTML='Short Name Approved.';new_comm_blocks['comm_short'].style.display='block';}
error_found='';}
xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(url);}}
function change_status(group_id)
{var community_status_img=new Array('user1_lock.png','users2.png');var community_status_text=new Array('<b>Private Group</b>','<b>Public Group</b>');var community_status_html=new Array();var url=ipb_var_base_url+'act=xmlout&do=change-comm-status&id='+group_id;do_request_function=function()
{if(!xmlobj.readystate_ready_and_ok())
{return;}
var html=xmlobj.xmlhandler.responseText;if(html=='invalid')
{}
else
{community_status_html['image']=document.getElementById('statusImg_'+ group_id);community_status_html['text']=document.getElementById('statusText_'+ group_id);community_status_html['image'].src='./style_images/community/'+ community_status_img[html];community_status_html['text'].innerHTML=community_status_text[html];}}
xmlobj=new ajax_request();xmlobj.onreadystatechange(do_request_function);xmlobj.process(url);}
