function Country(){}(function(A){A("body").ready(function(){ProviderHelper.enableShareLinks();ProviderHelper.enableSuperUserManagement(A("#_provider_id").val());A(".action_container").show();A("#add_article_link").click(function(){Country.loadCountryAddArticle(A("#_provider_id").val());});A("#help_article_link").click(function(){A("#help_article_container").slideToggle("slow");
});A("#country_university_link").click(function(){SearchHelper.invokeSearchControllerAdvanced("UNIVERSITY","",1,"","#_asp_university");});A("#country_agent_link").click(function(){SearchHelper.invokeSearchControllerAdvanced("AGENT","",1,"","#_asp_agent");});A("#add_content_link").click(function(){Country.loadCountryAddContent(A("#_provider_id").val());
});A("#subject_browse").change(function(){SearchHelper.performBrowse("UNIVERSITY","",Country.getBrowseSubjectParameters());});ProviderHelper.enableBox(A("#_provider_id").val(),"OVERVIEW");ProviderHelper.enableBox(A("#_provider_id").val(),"ABOUT");ProviderHelper.enableBox(A("#_provider_id").val(),"INFO");
});Country.getBrowseSubjectParameters=function(){var F=new Array();var D=0;F[D]='"dsp":"all",';var E=A("#subject_browse").val();if(E&&E!=0){D=D+1;F[D]='"subject":"'+E+'",';}E=A("#_provider_name").val();if(E!=0&&E){D=D+1;F[D]='"country":"'+E+'"';}var C="{";for(var B=0;B<=D;B=B+1){C=C.concat(F[B]);}C=C.concat("}");
return C;};Country.loadCountryArticle=function(B){forward.getWidget("article/list?id="+B+"&t=PROVIDER_COUNTRY&u=country",function(C){A("#article_add_container").html(C);A("#add_article_link").click(function(){Country.loadCountryAddArticle(B);});A("#help_article_link").click(function(){A("#help_article_container").slideToggle("slow");
});A(".action_container").show();});};Country.loadCountryAddArticle=function(B){forward.getWidget("article/add?id="+B,function(C){A("#article_add_container").html(C);A("#article_close_link").click(function(){Country.loadCountryArticle(B);});A("#article_content").htmlarea({css:"http://www.globalcampus.com/static/61/css/jhtmlarea/jHtmlArea.Editor.css",toolbar:["p","h2","h3","|","bold","italic","underline","|","orderedList","unorderedList","|","link","unlink","|","image","|","html"]});
A("#article_add_form").validate({rules:{article_title:{required:true,minlength:3,maxlength:100},article_content:{required:true,minlength:3,maxlength:3000}},errorLabelContainer:"#article_add_error",submitHandler:function(D){article.addProviderArticle(A("#_provider_id").val(),A("#_entity_type").val(),A("#article_title").val(),A("#article_content").val(),function(E){Country.loadCountryArticle(A("#_provider_id").val());
});return false;}});});};Country.loadCountryContent=function(B){forward.getWidget("content/list?id="+B+"&t=PROVIDER_COUNTRY&u=country",function(C){A("#content_add_container").html(C);A("#add_content_link").click(function(){Country.loadCountryAddContent(B);});A(".action_container").show();});};Country.loadCountryAddContent=function(B){forward.getWidget("content/add?id="+B,function(C){A("#content_add_container").html(C);
A("#content_close_link").click(function(){Country.loadCountryContent(B);});A("#content_add_form").validate({rules:{content_title:{required:true,minlength:3,maxlength:100},content_url:{required:true,minlength:10,maxlength:100}},errorLabelContainer:"#content_add_error",submitHandler:function(D){content.addProviderVideo(A("#_provider_id").val(),A("#_entity_type").val(),A("#content_title").val(),A("#content_url").val(),function(E){Country.loadCountryContent(A("#_provider_id").val());
});return false;}});});};})(jQuery);