function _enqueue_scripts()
 {
     global $wp_scripts;
     if (is_admin()) {
         return;
     }
     if (!get_option('asg_new_jquery')) {
         asg_enqueue_scripts();
     }
     asg_enqueue_styles();
 }
 function _admin_enqueue_scripts()
 {
     global $post_type, $hook_suffix, $asg_source_editors;
     if ($post_type != ASG_POST_TYPE || !in_array($hook_suffix, array('post.php', 'post-new.php'))) {
         return;
     }
     wp_enqueue_media();
     wp_enqueue_script('jquery-ui');
     wp_enqueue_script('rivets', ASG_URL . 'assets/admin/js/rivets.js', array('backbone'), ASG_VERSION);
     asg_enqueue_scripts();
     asg_enqueue_styles();
     wp_enqueue_style('asg-gallery-editor', ASG_URL . "assets/admin/css/gallery-editor.css", null, ASG_VERSION);
     asg_enqueue_script('asg-image-selector', 'assets/admin/js/image-selector');
     asg_enqueue_script('asg-gallery-selector', "assets/admin/js/external-gallery-selector", array('media-editor'), ASG_VERSION);
     asg_enqueue_script('asg-preview', "assets/admin/js/preview", array('media-editor'), ASG_VERSION);
     asg_enqueue_script('asg-source-editor', "assets/admin/js/source-editor", array('asg-gallery-selector', 'media-editor'), ASG_VERSION);
     foreach ($asg_source_editors as $slug => $editor) {
         $source_slug = 'asg-source-' . $slug;
         asg_enqueue_script($source_slug, $editor->get_js_editor_path(), array('asg-gallery-selector'), ASG_VERSION);
         $sources[] = $source_slug;
     }
     asg_enqueue_script('asg-gallery-editor', 'assets/admin/js/gallery-editor', $sources);
     wp_localize_script('asg-gallery-editor', 'asgGalleryEditor', array('admin' => true));
 }