function validation(){var A=1;var B="";if($("community_name").value==""){B+="Please fill up you community name.<br />";A=0}if($("community_outline").value==""){B+="Please fill up you community outline.<br />";A=0}if(A==0){$("errorbox").style.display="block";$("error").setHTML(B);return false}else{return true}}function updateTopic(B){var A=site_url+"/article_c/updateTopic/";var C="department_id="+$(B).value;new Ajax(A,{method:"post",postBody:C,update:_showLoading("div_loading_topic"),onComplete:function(D){$("community_topic[]").setHTML(D);$("community_topic_portal[]").setHTML();_hideLoading("div_loading_topic")}}).request()}function updateTopicPortal(A,E){var B=site_url+"/article_c/updateTopicPortal/";var D=new Array();D[0]="topic_ids="+$(A).getValue();D[1]="preSelected_ids="+$(E).getValue();var C=D.join("&");new Ajax(B,{method:"post",postBody:C,update:_showLoading("div_loading_topic_portal"),onComplete:function(F){$("community_topic_portal[]").setHTML(F);_hideLoading("div_loading_topic_portal")}}).request()}function updateTimeframePortal(B,E){var A=site_url+"/article_c/updateTimeframePortal/";var D=new Array();D[0]="timeframe_ids="+$(B).getValue();D[1]="preSelected_ids="+$(E).getValue();var C=D.join("&");new Ajax(A,{method:"post",postBody:C,update:_showLoading("div_loading_timeframe_portal"),onComplete:function(F){$("community_timeframe_portal[]").setHTML(F);_hideLoading("div_loading_timeframe_portal")}}).request()}function updateAll(H,C,B,F,A,G,D,E){updateCountryPortal(H,C);updateState(H,D);updateStatePortal(B,F,C);updateTown(H,E);updateTownPortal(A,G,C)}function updateCountryPortal(E,B){var A=site_url+"/article_c/updateCountryPortal/";var D=new Array();D[0]="country_ids="+$(E).getValue();D[1]="preSelected_ids="+$(B).getValue();var C=D.join("&");new Ajax(A,{method:"post",postBody:C,update:_showLoading("div_loading_country_portal"),onComplete:function(F){$("community_country_portal[]").setHTML(F);_hideLoading("div_loading_country_portal")}}).request()}function updateState(E,B){var A=site_url+"/article_c/updateState/";var D=new Array();D[0]="country_ids="+$(E).getValue();D[1]="preSelected_ids="+$(B).getValue();var C=D.join("&");new Ajax(A,{method:"post",postBody:C,update:_showLoading("div_loading_state"),onComplete:function(F){$("community_state[]").setHTML(F);_hideLoading("div_loading_state")}}).request()}function updateStatePortal(B,D,C){var A=site_url+"/article_c/updateStatePortal/";var F=new Array();F[0]=($(B).getValue())?"state_ids="+$(B).getValue():"";F[1]=($(D).getValue())?"country_portal_ids="+$(D).getValue():"";F[2]=($(C).getValue())?"preSelected_ids="+$(C).getValue():"";var E=F.join("&");new Ajax(A,{method:"post",postBody:E,update:_showLoading("div_loading_state_portal"),onComplete:function(G){$("community_state_portal[]").setHTML(G);_hideLoading("div_loading_state_portal")}}).request()}function updateTown(E,B){var A=site_url+"/article_c/updateTown/";var D=new Array();D[0]="country_ids="+$(E).getValue();D[1]="preSelected_ids="+$(B).getValue();var C=D.join("&");new Ajax(A,{method:"post",postBody:C,update:_showLoading("div_loading_town"),onComplete:function(F){$("community_town[]").setHTML(F);_hideLoading("div_loading_town")}}).request()}function updateTownPortal(A,C,F){var B=site_url+"/article_c/updateTownPortal/";var E=new Array();E[0]=($(A).getValue())?"town_ids="+$(A).getValue():"";E[1]=($(C).getValue())?"country_portal_ids="+$(C).getValue():"";E[2]=($(F).getValue())?"preSelected_ids="+$(F).getValue():"";var D=E.join("&");new Ajax(B,{method:"post",postBody:D,update:_showLoading("div_loading_town_portal"),onComplete:function(G){$("community_town_portal[]").setHTML(G);_hideLoading("div_loading_town_portal")}}).request()}function _showLoading(A){$(A).style.display="block"}function _hideLoading(A){$(A).style.display="none"};