/**
 *  Copyright (C) 2010 Cloud.com, Inc.  All rights reserved.
 * 
 * This software is licensed under the GNU General Public License v3 or later.
 * 
 * It is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 * 
 */
function afterLoadGlobalSettingJSP() {
    var $actionLink = $("#right_panel_content #tab_content_details #action_link");
    bindActionLink($actionLink);
    /*    
	$actionLink.bind("mouseover", function(event) {	    
		$(this).find("#action_menu").show();    
		return false;
	});
	$actionLink.bind("mouseout", function(event) {       
		$(this).find("#action_menu").hide();    
		return false;
	});	   	
	*/
					
    populateGlobalSettingGrid();
    
    //actions      
    var $actionList = $("#right_panel_content #tab_content_details #action_link #action_menu").find("#action_list").empty();        
    var $listItem = $("#action_list_item").clone();
    $listItem.find("#link").text(dictionary["label.action.edit.global.setting"]);   
    $listItem.bind("click", function(event) {        
        doEditGlobalSetting();
        return false;
    });
    $actionList.append($listItem.show());
    
    //dialogs
    initDialogWithOK("dialog_alert_restart_management_server");   
}
function populateGlobalSettingGrid() {  
    var $thisTab = $("#right_panel_content #tab_content_details");  
    $thisTab.find("#tab_container").hide(); 
    $thisTab.find("#tab_spinning_wheel").show();   
 
    $.ajax({
        data: createURL("command=listConfigurations"),
        dataType: "json",
        success: function(json) {           
            var items = json.listconfigurationsresponse.configuration;
            $container = $("#tab_content_details").find("#grid_content").empty();
            $templateText = $("#globalsetting_template_text");    
            $templatePassword = $("#globalsetting_template_password");          
            if(items != null && items.length > 0) {
                for(var i=0; i