function ajax_refresh_template()
    {
        check_ajax_referer('new_royalslider_refresh_template_nonce');
        if (isset($_POST['templateId'])) {
            require_once 'NewRoyalSliderOptions.php';
            $templates = NewRoyalSliderOptions::getRsTemplates();
            $template_obj = $templates[$_POST['templateId']];
            ob_start();
            NewRoyalSliderOptions::output_options($template_obj, isset($_POST['type']) ? $_POST['type'] : '');
            $template_css = isset($template_obj['template-css']) ? NEW_ROYALSLIDER_PLUGIN_URL . 'lib/royalslider/' . $template_obj['template-css'] : '';
            $template_css_class = isset($template_obj['template-css-class']) ? $template_obj['template-css-class'] : '';
            ?>
       		<input type="hidden" id="dynamic-options-data" data-css-class="<?php 
            echo $template_css_class;
            ?>
 " data-css-path="<?php 
            echo $template_css;
            ?>
"/>
       		<?php 
            $options = ob_get_contents();
            ob_end_clean();
            $out = array('options' => $options, 'template' => isset($template_obj['template-html']) ? $template_obj['template-html'] : $templates['default']['template-html']);
            echo json_encode($out);
        }
        die;
    }
 function get_slider_options()
 {
     require_once 'NewRoyalSliderOptions.php';
     NewRoyalSliderOptions::output_options(isset($this->res) ? $this->res['options'] : null, $this->slider_type);
 }