summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2013-10-06 12:49:03 +0200
committerTheo Chatzimichos <tampakrap@gentoo.org>2013-10-06 12:49:03 +0200
commit2585802e750dc170833e3c37bf9ea2941d1d06dc (patch)
treec62747fd124aa6b9c550b8a8a282d09eef912805
parentUpdate akismet (diff)
downloadblogs-gentoo-2585802e750dc170833e3c37bf9ea2941d1d06dc.tar.gz
blogs-gentoo-2585802e750dc170833e3c37bf9ea2941d1d06dc.tar.bz2
blogs-gentoo-2585802e750dc170833e3c37bf9ea2941d1d06dc.zip
Add mantra theme, requested by hwoarang
-rwxr-xr-xbin/update-wordpress1
-rw-r--r--themes/mantra/404.php32
-rw-r--r--themes/mantra/admin/admin-functions.php192
-rw-r--r--themes/mantra/admin/css/admin.css578
-rw-r--r--themes/mantra/admin/custom-styles.php300
-rw-r--r--themes/mantra/admin/defaults.php216
-rw-r--r--themes/mantra/admin/images/1c.pngbin0 -> 427 bytes
-rw-r--r--themes/mantra/admin/images/2cSl.pngbin0 -> 581 bytes
-rw-r--r--themes/mantra/admin/images/2cSr.pngbin0 -> 560 bytes
-rw-r--r--themes/mantra/admin/images/3cSl.pngbin0 -> 671 bytes
-rw-r--r--themes/mantra/admin/images/3cSr.pngbin0 -> 676 bytes
-rw-r--r--themes/mantra/admin/images/3cSs.pngbin0 -> 678 bytes
-rw-r--r--themes/mantra/admin/images/coffee.pngbin0 -> 7120 bytes
-rw-r--r--themes/mantra/admin/images/mantra-logo.pngbin0 -> 10900 bytes
-rw-r--r--themes/mantra/admin/images/placeholder.gifbin0 -> 2080 bytes
-rw-r--r--themes/mantra/admin/images/testimg.pngbin0 -> 8213 bytes
-rw-r--r--themes/mantra/admin/js/accordion-slider.js96
-rw-r--r--themes/mantra/admin/js/admin.js185
-rw-r--r--themes/mantra/admin/main.php478
-rw-r--r--themes/mantra/admin/sanitize.php237
-rw-r--r--themes/mantra/admin/settings.php2105
-rw-r--r--themes/mantra/archive.php76
-rw-r--r--themes/mantra/attachment.php118
-rw-r--r--themes/mantra/author.php92
-rw-r--r--themes/mantra/category.php67
-rw-r--r--themes/mantra/comments.php53
-rw-r--r--themes/mantra/content-aside.php51
-rw-r--r--themes/mantra/content-chat.php52
-rw-r--r--themes/mantra/content-frontpage.php36
-rw-r--r--themes/mantra/content-gallery.php78
-rw-r--r--themes/mantra/content-image.php45
-rw-r--r--themes/mantra/content-link.php52
-rw-r--r--themes/mantra/content-page.php30
-rw-r--r--themes/mantra/content-quote.php49
-rw-r--r--themes/mantra/content-status.php51
-rw-r--r--themes/mantra/content.php83
-rw-r--r--themes/mantra/editor-style-rtl.css56
-rw-r--r--themes/mantra/editor-style.css289
-rw-r--r--themes/mantra/footer.php38
-rw-r--r--themes/mantra/functions.php26
-rw-r--r--themes/mantra/header.php59
-rw-r--r--themes/mantra/images/back2top.pngbin0 -> 3659 bytes
-rw-r--r--themes/mantra/images/bullet.pngbin0 -> 501 bytes
-rw-r--r--themes/mantra/images/bullets/arrow_black.pngbin0 -> 226 bytes
-rw-r--r--themes/mantra/images/bullets/arrow_white.pngbin0 -> 283 bytes
-rw-r--r--themes/mantra/images/bullets/bullet_dark.pngbin0 -> 304 bytes
-rw-r--r--themes/mantra/images/bullets/bullet_gray.pngbin0 -> 304 bytes
-rw-r--r--themes/mantra/images/bullets/bullet_light.pngbin0 -> 270 bytes
-rw-r--r--themes/mantra/images/bullets/mantra_dot2.pngbin0 -> 181 bytes
-rw-r--r--themes/mantra/images/bullets/square_dark.pngbin0 -> 247 bytes
-rw-r--r--themes/mantra/images/bullets/square_white.pngbin0 -> 250 bytes
-rw-r--r--themes/mantra/images/bullets/triangle_dark.pngbin0 -> 311 bytes
-rw-r--r--themes/mantra/images/bullets/triangle_gray.pngbin0 -> 346 bytes
-rw-r--r--themes/mantra/images/bullets/triangle_white.pngbin0 -> 271 bytes
-rw-r--r--themes/mantra/images/headers/mantra.pngbin0 -> 19384 bytes
-rw-r--r--themes/mantra/images/headers/mantra_thumbnail.pngbin0 -> 19341 bytes
-rw-r--r--themes/mantra/images/icon-back.pngbin0 -> 242 bytes
-rw-r--r--themes/mantra/images/icon-featured.pngbin0 -> 1395 bytes
-rw-r--r--themes/mantra/images/icon-tooltip.pngbin0 -> 619 bytes
-rw-r--r--themes/mantra/images/nivoslider/arrows.pngbin0 -> 824 bytes
-rw-r--r--themes/mantra/images/nivoslider/bullets.pngbin0 -> 1281 bytes
-rw-r--r--themes/mantra/images/nivoslider/loading.gifbin0 -> 1737 bytes
-rw-r--r--themes/mantra/images/pins/Pin1.pngbin0 -> 1114 bytes
-rw-r--r--themes/mantra/images/pins/Pin2.pngbin0 -> 1323 bytes
-rw-r--r--themes/mantra/images/pins/Pin3.pngbin0 -> 1322 bytes
-rw-r--r--themes/mantra/images/pins/Pin4.pngbin0 -> 1146 bytes
-rw-r--r--themes/mantra/images/pins/Pin5.pngbin0 -> 1156 bytes
-rw-r--r--themes/mantra/images/pins/mantra_dot.pngbin0 -> 181 bytes
-rw-r--r--themes/mantra/images/post-formats/brackets.pngbin0 -> 1315 bytes
-rw-r--r--themes/mantra/images/post-formats/brackets2.pngbin0 -> 4552 bytes
-rw-r--r--themes/mantra/images/post-formats/bubble.pngbin0 -> 932 bytes
-rw-r--r--themes/mantra/images/post-formats/link.pngbin0 -> 1606 bytes
-rw-r--r--themes/mantra/images/post-formats/picture.pngbin0 -> 874 bytes
-rw-r--r--themes/mantra/images/post-formats/quotes.pngbin0 -> 691 bytes
-rw-r--r--themes/mantra/images/slider/mantra-column.jpgbin0 -> 6975 bytes
-rw-r--r--themes/mantra/images/slider/mantra-slide1.jpgbin0 -> 90735 bytes
-rw-r--r--themes/mantra/images/slider/mantra-slide2.jpgbin0 -> 39538 bytes
-rw-r--r--themes/mantra/images/socials/Amazon.pngbin0 -> 5105 bytes
-rw-r--r--themes/mantra/images/socials/Delicious.pngbin0 -> 1864 bytes
-rw-r--r--themes/mantra/images/socials/DeviantArt.pngbin0 -> 1725 bytes
-rw-r--r--themes/mantra/images/socials/Digg.pngbin0 -> 2388 bytes
-rw-r--r--themes/mantra/images/socials/Etsy.pngbin0 -> 2494 bytes
-rw-r--r--themes/mantra/images/socials/Facebook.pngbin0 -> 2174 bytes
-rw-r--r--themes/mantra/images/socials/Flickr.pngbin0 -> 2277 bytes
-rw-r--r--themes/mantra/images/socials/GoodReads.pngbin0 -> 2667 bytes
-rw-r--r--themes/mantra/images/socials/Google.pngbin0 -> 2702 bytes
-rw-r--r--themes/mantra/images/socials/GooglePlus.pngbin0 -> 2606 bytes
-rw-r--r--themes/mantra/images/socials/IMDb.pngbin0 -> 2783 bytes
-rw-r--r--themes/mantra/images/socials/Instagram.pngbin0 -> 3522 bytes
-rw-r--r--themes/mantra/images/socials/LastFM.pngbin0 -> 2466 bytes
-rw-r--r--themes/mantra/images/socials/LinkedIn.pngbin0 -> 2444 bytes
-rw-r--r--themes/mantra/images/socials/Mail.pngbin0 -> 1812 bytes
-rw-r--r--themes/mantra/images/socials/MySpace.pngbin0 -> 2658 bytes
-rw-r--r--themes/mantra/images/socials/Picasa.pngbin0 -> 2426 bytes
-rw-r--r--themes/mantra/images/socials/Pinterest.pngbin0 -> 1952 bytes
-rw-r--r--themes/mantra/images/socials/RSS.pngbin0 -> 2987 bytes
-rw-r--r--themes/mantra/images/socials/Reddit.pngbin0 -> 2857 bytes
-rw-r--r--themes/mantra/images/socials/Skype.pngbin0 -> 2636 bytes
-rw-r--r--themes/mantra/images/socials/SoundCloud.pngbin0 -> 1946 bytes
-rw-r--r--themes/mantra/images/socials/StumbleUpon.pngbin0 -> 2613 bytes
-rw-r--r--themes/mantra/images/socials/Technorati.pngbin0 -> 2704 bytes
-rw-r--r--themes/mantra/images/socials/Tumblr.pngbin0 -> 1598 bytes
-rw-r--r--themes/mantra/images/socials/Twitch.pngbin0 -> 4801 bytes
-rw-r--r--themes/mantra/images/socials/Twitter.pngbin0 -> 2180 bytes
-rw-r--r--themes/mantra/images/socials/VK.pngbin0 -> 4366 bytes
-rw-r--r--themes/mantra/images/socials/Vimeo.pngbin0 -> 1774 bytes
-rw-r--r--themes/mantra/images/socials/WordPress.pngbin0 -> 2677 bytes
-rw-r--r--themes/mantra/images/socials/Xing.pngbin0 -> 4834 bytes
-rw-r--r--themes/mantra/images/socials/Yahoo.pngbin0 -> 2332 bytes
-rw-r--r--themes/mantra/images/socials/Yelp.pngbin0 -> 5049 bytes
-rw-r--r--themes/mantra/images/socials/YouTube.pngbin0 -> 3144 bytes
-rw-r--r--themes/mantra/includes/theme-comments.php143
-rw-r--r--themes/mantra/includes/theme-frontpage.php284
-rw-r--r--themes/mantra/includes/theme-functions.php445
-rw-r--r--themes/mantra/includes/theme-hooks.php159
-rw-r--r--themes/mantra/includes/theme-loop.php306
-rw-r--r--themes/mantra/includes/theme-seo.php201
-rw-r--r--themes/mantra/includes/theme-setup.php383
-rw-r--r--themes/mantra/includes/theme-shortcodes.php293
-rw-r--r--themes/mantra/includes/theme-styles.php133
-rw-r--r--themes/mantra/index.php57
-rw-r--r--themes/mantra/js/PIE/PIE.htc96
-rw-r--r--themes/mantra/js/PIE/PIE.js88
-rw-r--r--themes/mantra/js/PIE/PIE.php19
-rw-r--r--themes/mantra/js/PIE/PIE_uncompressed.htc4505
-rw-r--r--themes/mantra/js/PIE/PIE_uncompressed.js4474
-rw-r--r--themes/mantra/js/buttons/button-color.pngbin0 -> 319 bytes
-rw-r--r--themes/mantra/js/buttons/button-dark.pngbin0 -> 301 bytes
-rw-r--r--themes/mantra/js/buttons/button-light.pngbin0 -> 299 bytes
-rw-r--r--themes/mantra/js/buttons/multi-column.pngbin0 -> 258 bytes
-rw-r--r--themes/mantra/js/buttons/pullquote.pngbin0 -> 361 bytes
-rw-r--r--themes/mantra/js/frontend.js253
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.pngbin0 -> 260 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.pngbin0 -> 251 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.pngbin0 -> 178 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.pngbin0 -> 104 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.pngbin0 -> 125 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.pngbin0 -> 105 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.pngbin0 -> 3762 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.pngbin0 -> 90 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.pngbin0 -> 129 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_222222_256x240.pngbin0 -> 4369 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_228ef1_256x240.pngbin0 -> 4369 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_ef8c08_256x240.pngbin0 -> 4369 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_ffd27a_256x240.pngbin0 -> 4369 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/images/ui-icons_ffffff_256x240.pngbin0 -> 4369 bytes
-rw-r--r--themes/mantra/js/jqueryui/css/ui-lightness/jquery-ui-1.8.16.custom.css568
-rw-r--r--themes/mantra/js/mce-shortcodes.js59
-rw-r--r--themes/mantra/js/nivo-slider.js10
-rw-r--r--themes/mantra/languages/_mantra.mobin0 -> 416 bytes
-rw-r--r--themes/mantra/languages/_mantra.po2032
-rw-r--r--themes/mantra/languages/da_DK.mobin0 -> 43655 bytes
-rw-r--r--themes/mantra/languages/da_DK.po2425
-rw-r--r--themes/mantra/languages/de_DE.mobin0 -> 41890 bytes
-rw-r--r--themes/mantra/languages/de_DE.po2461
-rw-r--r--themes/mantra/languages/el.mobin0 -> 68429 bytes
-rw-r--r--themes/mantra/languages/el.po2168
-rw-r--r--themes/mantra/languages/el_EL.mobin0 -> 68429 bytes
-rw-r--r--themes/mantra/languages/el_EL.po2168
-rw-r--r--themes/mantra/languages/es_ES.mobin0 -> 50716 bytes
-rw-r--r--themes/mantra/languages/es_ES.po2219
-rw-r--r--themes/mantra/languages/fa_IR.mobin0 -> 57574 bytes
-rw-r--r--themes/mantra/languages/fa_IR.po1920
-rw-r--r--themes/mantra/languages/fr_FR.mobin0 -> 47198 bytes
-rw-r--r--themes/mantra/languages/fr_FR.po2479
-rw-r--r--themes/mantra/languages/he_IL.mobin0 -> 467 bytes
-rw-r--r--themes/mantra/languages/he_IL.po1889
-rw-r--r--themes/mantra/languages/hu_HU.mobin0 -> 47880 bytes
-rw-r--r--themes/mantra/languages/hu_HU.po2298
-rw-r--r--themes/mantra/languages/it_IT.mobin0 -> 51078 bytes
-rw-r--r--themes/mantra/languages/it_IT.po2331
-rw-r--r--themes/mantra/languages/ja.mobin0 -> 52403 bytes
-rw-r--r--themes/mantra/languages/ja.po2088
-rw-r--r--themes/mantra/languages/ja_JP.mobin0 -> 52403 bytes
-rw-r--r--themes/mantra/languages/ja_JP.po2088
-rw-r--r--themes/mantra/languages/nb_NO.mobin0 -> 4409 bytes
-rw-r--r--themes/mantra/languages/nb_NO.po1819
-rw-r--r--themes/mantra/languages/nl_NL.mobin0 -> 40887 bytes
-rw-r--r--themes/mantra/languages/nl_NL.po2456
-rw-r--r--themes/mantra/languages/pl_PL.mobin0 -> 48403 bytes
-rw-r--r--themes/mantra/languages/pl_PL.po2123
-rw-r--r--themes/mantra/languages/pt_BR.mobin0 -> 50162 bytes
-rw-r--r--themes/mantra/languages/pt_BR.po2135
-rw-r--r--themes/mantra/languages/ru_RU.mobin0 -> 64420 bytes
-rw-r--r--themes/mantra/languages/ru_RU.po2313
-rw-r--r--themes/mantra/languages/tr_TR.mobin0 -> 47699 bytes
-rw-r--r--themes/mantra/languages/tr_TR.po2097
-rw-r--r--themes/mantra/languages/zh_CN.mo1845
-rw-r--r--themes/mantra/languages/zh_CN.po1845
-rw-r--r--themes/mantra/license.txt281
-rw-r--r--themes/mantra/page.php34
-rw-r--r--themes/mantra/readme.txt36
-rw-r--r--themes/mantra/rtl.css361
-rw-r--r--themes/mantra/screenshot.pngbin0 -> 69529 bytes
-rw-r--r--themes/mantra/search.php53
-rw-r--r--themes/mantra/searchform.php11
-rw-r--r--themes/mantra/sidebar-footer.php59
-rw-r--r--themes/mantra/sidebar.php95
-rw-r--r--themes/mantra/single.php73
-rw-r--r--themes/mantra/style-mobile.css217
-rw-r--r--themes/mantra/style.css2589
-rw-r--r--themes/mantra/tag.php68
-rw-r--r--themes/mantra/template-blog.php54
-rw-r--r--themes/mantra/template-onecolumn.php38
-rw-r--r--themes/mantra/template-page-with-intro.php54
-rw-r--r--themes/mantra/template-threecolumns-center.php21
-rw-r--r--themes/mantra/template-threecolumns-left.php21
-rw-r--r--themes/mantra/template-threecolumns-right.php21
-rw-r--r--themes/mantra/template-twocolumns-left.php21
-rw-r--r--themes/mantra/template-twocolumns-right.php21
210 files changed, 67624 insertions, 0 deletions
diff --git a/bin/update-wordpress b/bin/update-wordpress
index 206a95d1..4624d570 100755
--- a/bin/update-wordpress
+++ b/bin/update-wordpress
@@ -18,6 +18,7 @@ THEMES=(
wp-oxygen
kde-breathe
kde-graffiti
+ mantra
)
for THEME in ${THEMES[@]} ; do
diff --git a/themes/mantra/404.php b/themes/mantra/404.php
new file mode 100644
index 00000000..cd47c44f
--- /dev/null
+++ b/themes/mantra/404.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * The template for displaying 404 pages (Not Found).
+ *
+ * @package Cryout Creations
+ * @subpackage mantra
+ * @since mantra 0.5
+ */
+
+get_header(); ?>
+
+ <div id="container">
+
+ <div id="content" role="main">
+
+ <div id="post-0" class="post error404 not-found">
+ <h1 class="entry-title"><?php _e( 'Not Found', 'mantra' ); ?></h1>
+ <div class="entry-content">
+ <p><?php _e( 'Apologies, but the page you requested could not be found. Perhaps searching will help.', 'mantra' ); ?></p>
+ <div class="contentsearch"><?php get_search_form(); ?></div>
+ </div><!-- .entry-content -->
+ </div><!-- #post-0 -->
+
+ </div><!-- #content -->
+<?php get_sidebar(); ?>
+ </div><!-- #container -->
+ <script type="text/javascript">
+ // focus on search field after it has loaded
+ document.getElementById('s') && document.getElementById('s').focus();
+ </script>
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/themes/mantra/admin/admin-functions.php b/themes/mantra/admin/admin-functions.php
new file mode 100644
index 00000000..b361652c
--- /dev/null
+++ b/themes/mantra/admin/admin-functions.php
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Export Mantra settings to file
+ */
+
+function mantra_export_options(){
+
+ ob_clean();
+
+ /* Check authorisation */
+ $authorised = true;
+ // Check nonce
+ if ( ! wp_verify_nonce( $_POST['mantra-export'], 'mantra-export' ) ) {
+ $authorised = false;
+ }
+ // Check permissions
+ if ( ! current_user_can( 'edit_theme_options' ) ){
+ $authorised = false;
+ }
+
+ if ( $authorised) {
+global $mantra_options;
+/*date_default_timezone_set('UTC');
+$today = date("YmdGis");
+$name = 'mantra-settings'.$today.'.txt';*/
+ $name = 'mantra-settings.txt';
+ $data = $mantra_options;
+ $data = json_encode( $data );
+ $size = strlen( $data );
+
+ header( 'Content-Type: text/plain' );
+ header( 'Content-Disposition: attachment; filename="'.$name.'"' );
+ header( "Content-Transfer-Encoding: binary" );
+ header( 'Accept-Ranges: bytes' );
+
+ /* The three lines below basically make the download non-cacheable */
+ header( "Cache-control: private" );
+ header( 'Pragma: private' );
+ header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
+
+ header( "Content-Length: " . $size);
+ print( $data );
+}
+die();
+}
+
+if ( isset( $_POST['mantra_export'] ) ){
+ add_action( 'init', 'mantra_export_options' );
+}
+
+/**
+ * This file manages the theme settings uploading and import operations.
+ * Uses the theme page to create a new form for uplaoding the settings
+ * Uses WP_Filesystem
+*/
+function mantra_import_form(){
+
+ $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
+ $size = wp_convert_bytes_to_hr( $bytes );
+ $upload_dir = wp_upload_dir();
+ if ( ! empty( $upload_dir['error'] ) ) :
+ ?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'mantra'); ?></p>
+ <p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
+ else :
+ ?>
+
+ <div class="wrap">
+ <div style="width:400px;display:block;margin-left:30px;">
+ <div id="icon-tools" class="icon32"><br></div>
+ <h2><?php echo __( 'Import Mantra Theme Options', 'mantra' );?></h2>
+ <form enctype="multipart/form-data" id="import-upload-form" method="post" action="">
+ <p><?php _e('Hi! This is where you import the Mantra settings.<i> Please remember that this is still an experimental feature.</i>', 'mantra'); ?></p>
+ <p>
+ <label for="upload"><strong><?php _e('Just choose a file from your computer:', 'mantra'); ?> </strong><i>(mantra-settings.txt)</i></label>
+ <input type="file" id="upload" name="import" size="25" />
+ <span style="font-size:10px;">(<?php printf( __( 'Maximum size: %s', 'mantra' ), $size ); ?> )</span>
+ <input type="hidden" name="action" value="save" />
+ <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
+ <?php wp_nonce_field('mantra-import', 'mantra-import'); ?>
+ <input type="hidden" name="mantra_import_confirmed" value="true" />
+ </p>
+ <input type="submit" class="button" value="<?php _e('And import!', 'mantra'); ?>" />
+ </form>
+ </div>
+ </div> <!-- end wrap -->
+ <?php
+ endif;
+} // Closes the mantra_import_form() function definition
+
+
+/**
+ * This actual import of the options from the file to the settings array.
+*/
+function mantra_import_file() {
+ global $mantra_options;
+
+ /* Check authorisation */
+ $authorised = true;
+ // Check nonce
+ if (!wp_verify_nonce($_POST['mantra-import'], 'mantra-import')) {$authorised = false;}
+ // Check permissions
+ if (!current_user_can('edit_theme_options')){ $authorised = false; }
+
+ // If the user is authorised, import the theme's options to the database
+ if ($authorised) {?>
+ <?php
+ // make sure there is an import file uploaded
+ if ( (isset($_FILES["import"]["size"]) && ($_FILES["import"]["size"] > 0) ) ) {
+
+ $form_fields = array('import');
+ $method = '';
+
+ $url = wp_nonce_url('themes.php?page=mantra-page', 'mantra-import');
+
+ // Get file writing credentials
+ if (false === ($creds = request_filesystem_credentials($url, $method, false, false, $form_fields) ) ) {
+ return true;
+ }
+
+ if ( ! WP_Filesystem($creds) ) {
+ // our credentials were no good, ask the user for them again
+ request_filesystem_credentials($url, $method, true, false, $form_fields);
+ return true;
+ }
+
+ // Write the file if credentials are good
+ $upload_dir = wp_upload_dir();
+ $filename = trailingslashit($upload_dir['path']).'mantra_options.txt';
+
+ // by this point, the $wp_filesystem global should be working, so let's use it to create a file
+ global $wp_filesystem;
+ if ( ! $wp_filesystem->move($_FILES['import']['tmp_name'], $filename, true) ) {
+ echo 'Error saving file!';
+ return;
+ }
+
+ $file = $_FILES['import'];
+
+ if ($file['type'] == 'text/plain') {
+ $data = $wp_filesystem->get_contents($filename);
+ // try to read the file
+ if ($data !== FALSE){
+ $settings = json_decode($data, true);
+ // try to read the settings array
+ if (isset($settings['mantra_db'])){ ?>
+ <div class="wrap">
+ <div id="icon-tools" class="icon32"><br></div>
+ <h2><?php echo __( 'Import Mantra Theme Options ', 'mantra' );?></h2> <?php
+ $settings = array_merge($mantra_options, $settings);
+ update_option('ma_options', $settings);
+ echo '<div class="updated fade"><p>'. __('Great! The options have been imported!', 'mantra').'<br />';
+ echo '<a href="themes.php?page=mantra-page">'.__('Go back to the Mantra options page and check them out!', 'mantra').'<a></p></div>';
+ }
+ else { // else: try to read the settings array
+ echo '<div class="error"><p><strong>'.__('Oops, there\'s a small problem.', 'mantra').'</strong><br />';
+ echo __('The uploaded file does not contain valid Mantra options. Make sure the file is exported from the Mantra Options page.', 'mantra').'</p></div>';
+ mantra_import_form();
+ }
+ }
+ else { // else: try to read the file
+ echo '<div class="error"><p><strong>'.__('Oops, there\'s a small problem.', 'mantra').'</strong><br />';
+ echo __('The uploaded file could not be read.', 'mantra').'</p></div>';
+ mantra_import_form();
+ }
+ }
+ else { // else: make sure the file uploaded was a plain text file
+ echo '<div class="error"><p><strong>'.__('Oops, there\'s a small problem.', 'mantra').'</strong><br />';
+ echo __('The uploaded file is not supported. Make sure the file was exported from the Mantra page and that it is a text file.', 'mantra').'</p></div>';
+ mantra_import_form();
+ }
+
+ // Delete the file after we're done
+ $wp_filesystem->delete($filename);
+
+ }
+ else { // else: make sure there is an import file uploaded
+ echo '<div class="error"><p>'.__( 'Oops! The file is empty or there was no file. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.', 'mantra' ).'</p></div>';
+ mantra_import_form();
+ }
+ echo '</div> <!-- end wrap -->';
+ }
+ else {
+ wp_die(__('ERROR: You are not authorised to perform that operation', 'mantra'));
+ }
+} // Closes the mantra_import_file() function definition
+
+// Truncate function for use in the Admin RSS feed
+function mantra_truncate_words($string,$words=20, $ellipsis=' ...') {
+ $new = preg_replace('/((\w+\W+\'*){'.($words-1).'}(\w+))(.*)/', '${1}', $string);
+ return $new.$ellipsis;
+}
+?> \ No newline at end of file
diff --git a/themes/mantra/admin/css/admin.css b/themes/mantra/admin/css/admin.css
new file mode 100644
index 00000000..1be4cb73
--- /dev/null
+++ b/themes/mantra/admin/css/admin.css
@@ -0,0 +1,578 @@
+ /* Farbtastic overwrites */
+
+.farbtastic {
+ position: absolute !important;
+ z-index:2;
+margin-left:50px;
+margin-top:-110px;
+background-color:#F7F7F7;
+border:1px solid #CCC;
+}
+.farbtastic * {
+ position: absolute;
+ cursor: crosshair;
+}
+.farbtastic, .farbtastic .wheel {
+ width: 195px;
+ height: 195px;
+}
+.farbtastic .color, .farbtastic .overlay {
+ top: 47px;
+ left: 47px;
+ width: 101px;
+ height: 101px;
+}
+
+
+/* end of Farbtastic overwrites */
+
+
+#lefty {
+clear:left;
+float:left;
+width:60%;
+min-width:500px;
+max-width:820px;
+margin-right:1%;
+}
+
+#main-options {
+width:100%;
+display:block;
+clear:left;
+/*border:1px solid #DFDFDF;
+background:#F5F5F5;
+border-radius:5px;
+-moz-border-radius:5px;
+-webkit-border-radius:5px;
+*/
+padding-top:10px;
+background:#FFF;
+font-family: Segoe UI !important;
+font-size: 12px;
+margin-bottom:10px;
+
+}
+
+ #righty {
+float:left;
+width:39%;
+margin-top:10px;
+}
+#righty p, #righty span, .form-table small, #righty ul li, #righty h3 {
+font-size: 12px;
+color:#444;
+font-family:Segoe UI;
+}
+
+.form-table small {
+font-style:italic;
+display:block;
+float:none;
+clear:both;
+}
+
+ .donate, .support {
+width:100%;
+}
+
+.postbox .hndle {
+ cursor: auto;
+ font-size: 13px;
+ margin: 0;
+ padding: 6px 10px 7px;
+}
+
+
+.wrap h2 {
+font-family: Calibri, Arial !important;
+margin-bottom:5px;
+}
+
+#accordion {
+width:95% ;
+margin:0px auto;
+font-family:Segoe UI,Calibri, Arial !important;
+display:block;
+float:none;
+}
+
+#submitDiv {
+display:block;
+float:none;
+height:30px;
+margin:10px 40px;
+font-family:Segoe UI,Calibri, Arial !important;
+}
+
+#version {
+display:block;
+float:none;
+clear:both;
+padding-top:10px;
+margin-left:20px;
+color:#666;
+}
+
+#accordion h3 {
+border:none;
+background-image:none;
+background:#2C5353;
+margin:0;
+padding:8px;
+clear:both;
+display:block;
+float:none;
+font-size: 17px ;
+padding-left:30px ;
+font-weight:normal;
+text-transform:uppercase;
+color:#F5F5F5;
+border-top:1px solid #4C7373;
+border-bottom:1px solid #0C3333;
+line-height: 1.3;
+-moz-border-radius:0;
+-webkit-border-radius:0;
+border-radius:0;
+transition:background ease-in-out .2s;
+}
+
+#accordion h3:hover {
+background:#3C6363;
+}
+
+#accordion select option {
+font-size:1.1em;
+}
+
+.form-table th, .form-wrap label {
+ color: #222 !important;
+font-size: 16px;
+font-weight:normal;
+}
+
+.form-table tr {
+border-bottom:1px dashed #DDD;
+}
+
+.form-table td {
+vertical-align:middle;
+}
+
+input[type="text"] , select {
+border:1px solid #AAA !important;
+border-radius:2px;
+-moz-border-radius:2px;
+-webkit-border-radius:2px;
+}
+
+.submit {
+text-align:right;
+margin-right:20px;
+}
+
+ #accordion select {
+min-width:120px;
+max-width:200px;
+}
+
+ #accordion textarea, #mantra_favicon {
+max-width:90%;
+}
+
+.googlefonts {
+width:200px;
+}
+
+/* Images */
+
+
+.images {
+display:inline-block;
+}
+
+#imageOne {
+border:1px solid #DDD !important;
+padding:3px;
+ height: auto;
+}
+
+#imageTwo{
+ background-color: #FFFFFF;
+ border: 1px solid #EEE;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ padding: 3px;
+ -moz-box-shadow:0px 0px 4px #CCC;
+ -webkit-box-shadow:0px 0px 4px #CCC;
+ box-shadow:0px 0px 4px #CCC;
+}
+
+#imageThree{
+ background-color: #FFFFFF;
+ border: 6px solid #EEEEEE;
+ -moz-border-radius: 5px 5px 5px 5px;
+ -webkit-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
+ padding: 3px;
+}
+
+
+
+#imageFour{
+border:1px solid #666 !important;
+ -moz-box-shadow:0px 0px 4px #666;
+ -webkit-box-shadow:0px 0px 4px #666;
+ box-shadow:0px 3px 4px #999;
+}
+
+#imageFive{
+border:3px solid #DDD !important;
+}
+
+#imageSix{
+border:8px solid #BBB !important;
+ -moz-box-shadow:0px 0px 5px #333;
+ -webkit-box-shadow:0px 0px 5px #333;
+ box-shadow: 0px 0px 5px #333;
+}
+
+#imageSeven{
+ background-color: #FFFFFF;
+ border: 1px solid #CCC;
+ padding: 7px;
+ -moz-box-shadow:2px 2px 2px #CCC;
+ -webkit-box-shadow:2px 2px 2px #CCC;
+ box-shadow:inset 0px 0px 7px #CCC;
+}
+
+/* Labels */
+
+label {
+display:inline-block;
+width:auto;
+border:2px solid #FFF;
+text-align:center;
+background-color:#FFF;
+padding:5px 2px;
+-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
+filter: alpha(opacity=80);
+opacity:0.8;
+}
+
+label.hideareas {
+display:block;
+float:none;
+text-align:left;
+
+}
+
+label:hover {
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ filter: alpha(opacity=100);
+ opacity:1;
+background-color:#EEE;
+}
+
+
+label input[type=radio] {
+display:none;
+}
+
+label.layouts {
+display:block;
+float:left;
+padding:3px;
+height:55px;
+}
+
+label.layouts:hover {
+background:none;
+border:2px solid #CCC;
+}
+
+
+.layouts img {
+width:60px;
+}
+
+
+.borderful {
+border-color:#F6A828 ;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ filter: alpha(opacity=100);
+ opacity:1;
+}
+
+ label.layouts.checkedClass, label.images.checkedClass, label.pins.checkedClass, label.sidebullets.checkedClass {
+border-color:#F6A828;
+-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+filter: alpha(opacity=100);
+opacity:1;
+}
+
+
+#accordion input[type="text"] {
+font-family:"Lucida Console", Monaco, monospace !important;
+font-size:12px;
+}
+
+#accordion > * {
+display:none;
+}
+
+#accrodion > h3 {
+display:block;
+}
+
+.ui-accordion-content {
+border-color:#EEE !important;
+background:#FFF !important;
+margin-bottom:10px !important;
+border:1px solid #DDD !important;
+border-top:none !important;
+overflow: hidden;
+padding:1em !important;
+}
+.ui-accordion .ui-accordion-content { overflow: hidden !important; }
+.ui-accordion .ui-accordion-content-overflow { overflow: visible !important; }
+
+.ui-state-active {
+ background:#0C3333 !important;
+}
+
+.darkbg{
+ background:#ddd !important;
+}
+#status{
+ font-family:Arial; padding:5px;
+}
+ul#files{ list-style:none; padding:0; margin:0; }
+ul#files li{ padding:10px; margin-bottom:2px; width:400px; float:left; margin-right:10px;}
+ul#files li img{ max-width:180px; max-height:150px; }
+.success{ background:#99f099; border:1px solid #339933; }
+.error{ background:#f0c6c3; border:1px solid #cc6622; }
+
+#uploadpreview {
+max-width:64px;
+display:block;float:left;
+border:1px solid #DDD;
+padding:2px;
+}
+
+#filename {
+display:block;
+width:auto;
+float:left;
+margin-left:10px;
+font-weight:bold;
+}
+
+#uploadarea {
+margin-top:10px;
+}
+
+#absolutedim, #relativedim {
+margin-top:30px;
+position:relative;
+}
+#absolutedim small, #relativedim small{
+margin-top:20px;}
+
+.slmini, #cdimensions {
+display:block;
+float:none;
+margin:10px;
+}
+
+.slmini {
+background:#F9F9F9;
+border:1px dashed #CCC;
+padding:5px;
+}
+
+.slmini b {
+width:130px;
+display:inline-block;
+float:left;}
+
+.slidebox {
+background:#F7F7F7;
+border-bottom:2px solid #eaeaea;
+transition:border-color .3s ease-in-out;
+}
+
+.slidebox:hover {
+border-color:#8CB3B3;
+}
+
+.slidercontent{
+display:none;
+padding:0 10px 10px;
+}
+
+
+.slidetitle{
+color:#777;
+background:#F7F7F7;
+padding: 2px 10px;
+margin:3px;
+cursor:pointer;
+}
+
+.slidetitle:after {
+content:"\25BC";
+float:right;
+margin-right:5px;
+color:#AAA;
+font-size:10px;
+}
+
+.slidetitle:hover{
+background:#F6F6F6;
+}
+
+.slidetitle:hover:after {
+color:#6C9393;
+}
+
+.slidebox h5 {
+display:inline-block;
+float:none;
+font-size:12px;
+background:#FFF;
+color:#777;
+padding:0 10px;
+margin:10px 0px 0 10px;
+position:relative;
+top:2px;
+border:1px solid #DFDFDF;
+border-bottom:none;
+-moz-border-radius:4px;
+-webkit-border-radius:4px;
+border-radius:4px;
+}
+
+.slidebox .description {
+display:block;
+float:none;
+}
+
+.slidebox input[type="text"], .slidebox textarea {
+width:100%;
+border-color:#DFDFDF !important;
+color:#444;
+}
+
+#sliderCustomSlides {margin-top:10px;}
+
+a.upload_image_button {
+color:#C67828 !important;
+text-decoration:none;
+clear:both;
+padding:2px 4px;
+display:block;
+float:none;
+}
+
+#submitDiv input.button {
+font-size:13px !important;
+padding:4px 10px !important;
+height:auto;
+}
+
+.header_upload_inputs {
+width:300px;
+}
+
+/* NEWS LISTS */
+
+#righty .news-list li {
+background:#FFF;
+padding:7px;
+border:1px solid #EEE;
+}
+
+#righty span.news-item-date {
+color:#999;
+font-size:11px;
+}
+
+a.news-header {
+text-decoration:none;
+color:#4C7373;
+font-size:14px;
+font-weight:bold;
+text-transform:uppercase;
+}
+
+a.news-header:hover, a.news-read:hover {
+color:#C47D09 !important;
+}
+
+/*Tooltip */
+
+.tooltip_div{
+display:inline-block;
+clear:none;
+height:22px;
+line-height:22px;
+}
+
+a.tooltip{
+display:inline-block;
+clear:none;
+height:22px;
+line-height:22px;
+margin-left:7px;
+}
+
+a.tooltip img {
+vertical-align:bottom;
+}
+
+.ui-tooltip {
+display:block;
+max-width:300px;
+padding:5px;
+z-index:3;
+}
+
+/* ADMIN HEADER AND LINKS */
+
+#admin_header {
+ padding-top:10px;
+ padding-left:20px;
+ display:block;
+ float:left;
+ }
+#admin_links {
+ display:block;
+ float:left;
+ clear:both;
+ text-align:left;
+ margin-left:90px;
+ margin-top:-18px;
+ }
+
+#admin_links a {
+display:block;
+float:left;
+margin-left:3px;
+margin-right:9px;
+text-decoration:none;
+font-family:Segoe UI, Arial;
+font-size:11px;
+color:#3F5F5F;
+text-transform:uppercase;
+}
+
+#admin_links a:hover {
+color:#C47D09;
+}
+
+.wrap div.updated, .wrap div.error {
+margin-left: 15px; margin-right: 15px;
+margin-top: 20px; }
+
diff --git a/themes/mantra/admin/custom-styles.php b/themes/mantra/admin/custom-styles.php
new file mode 100644
index 00000000..c8a7439e
--- /dev/null
+++ b/themes/mantra/admin/custom-styles.php
@@ -0,0 +1,300 @@
+<?php
+
+function cryout_optset($var,$val1,$val2='',$val3='',$val4=''){
+$vals = array($val1,$val2,$val3,$val4);
+if (in_array($var,$vals)): return false; else: return true; endif;
+}
+
+function mantra_custom_styles() {
+
+/* This retrieves admin options. */
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = esc_attr($value) ;
+}
+if ($mantra_dimselect=="Absolute") {
+$totalwidth = $mantra_sidewidth+$mantra_sidebar+50;
+$contentSize = $mantra_sidewidth;
+$sidebarSize = $mantra_sidebar;
+}
+else if ($mantra_dimselect=="Relative") {
+$totalwidth = $mantra_sidewidthRel+$mantra_sidebarRel;
+$contentSize = intval(($mantra_sidewidthRel/$totalwidth*100)-2);
+$sidebarSize = intval(($mantra_sidebarRel/$totalwidth*100)-2);
+}
+ob_start(); ?>
+
+<style type="text/css">
+<?php
+/*
+ * LAYOUT CSS
+ */
+
+/* ABSOLUTE DIMENSIONS. */
+
+if ($mantra_dimselect=="Absolute") { ?>
+#wrapper, #access, #colophon, #branding, #main { width:<?php echo ($totalwidth) ?>px ;}
+#access .menu-header, div.menu {width:<?php echo ($totalwidth-12) ?>px ;}
+<?php if (is_page_template() && !is_page_template('template-blog.php') && !is_page_template('template-onecolumn.php') && !is_page_template('template-page-with-intro.php')) {
+
+ if (is_page_template("template-twocolumns-right.php") ) { ?>
+#content { width:<?php echo ($contentSize- 10) ?>px;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>px;}<?php }
+
+?><?php if ( is_page_template("template-twocolumns-left.php")) { ?>
+#content { width:<?php echo ($contentSize - 10) ?>px;float:right;margin:0px 20px 0 0;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>px;float:left;padding-left:0px;clear:left;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+.widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ;text-align:right;}
+ #primary ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+?><?php if ( is_page_template("template-threecolumns-right.php")) { ?>
+#content { width:<?php echo ($contentSize- 20) ?>px;}
+#primary,#secondary {width:<?php echo ($mantra_sidebar/2 ) ?>px;} <?php }
+
+?><?php if ( is_page_template("template-threecolumns-left.php")) { ?>
+#content { width:<?php echo ($contentSize - 20) ?>px;float:right;margin:0px 20px 0 0;display:block;}
+#primary,#secondary {width:<?php echo ($sidebarSize/2 ) ?>px;float:left;padding-left:0px;;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+.widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ;text-align:right;}
+#main .widget-area ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+?><?php if (is_page_template("template-threecolumns-center.php")) { ?>
+#content { width:<?php echo ($contentSize - 20) ?>px;float:right;margin:0px <?php echo $sidebarSize/2+35 ?>px 0 <?php echo -($contentSize+$sidebarSize) ?>px;display:block;}
+#primary {width:<?php echo ($sidebarSize/2 ) ?>px;float:left;padding-left:0px;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+#secondary {width:<?php echo ($sidebarSize/2 ) ?>px;float:right;}
+#primary .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:15px;width:100%;margin-left:-15px;}
+#primary ul.xoxo {padding:0 0 0 10px;}<?php }
+
+ } //is_page_template
+ else { // IF NO PAGE TEMPLATE HAS BEEN SELECTED
+
+ if ($mantra_side == "1c" ) { ?>
+#content {width:<?php echo ($totalwidth-40) ?>px; margin:20px;margin-top:0px;} <?php }
+
+?><?php if ($mantra_side == "2cSr" ) { ?>
+#content { width:<?php echo ($contentSize- 10) ?>px;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>px;}<?php }
+
+?><?php if ($mantra_side == "2cSl" ) { ?>
+#content { width:<?php echo ($contentSize - 10) ?>px;float:right;margin:0px 20px 0 0;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>px;float:left;padding-left:0px;clear:left;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+ .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;width:100%;}
+ #primary ul.xoxo {padding:0 0 0 10px ;}<?php }
+
+?><?php if ($mantra_side == "3cSr" ) { ?>
+#content { width:<?php echo ($contentSize- 20) ?>px;}
+#primary,#secondary {width:<?php echo ($mantra_sidebar/2 ) ?>px;} <?php }
+
+?><?php if ($mantra_side == "3cSl" ) { ?>
+#content { width:<?php echo ($contentSize - 20) ?>px;float:right;margin:0px 20px 0 0;display:block;}
+#primary,#secondary {width:<?php echo ($sidebarSize/2 ) ?>px;float:left;padding-left:0px;;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+ .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;}
+#main .widget-area ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+?><?php if ($mantra_side == "3cSs") { ?>
+#content { width:<?php echo ($contentSize - 20) ?>px;float:right;margin:0px <?php echo $sidebarSize/2+35 ?>px 0 <?php echo -($contentSize+$sidebarSize) ?>px;display:block;}
+#primary {width:<?php echo ($sidebarSize/2 ) ?>px;float:left;padding-left:0px;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+#secondary {width:<?php echo ($sidebarSize/2 ) ?>px;float:right;}
+#primary .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:15px;width:100%;margin-left:-15px;}
+#primary ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+ }//else
+}//absolute dim
+
+/* RELATIVE DIMENSIONS. */
+
+else if ($mantra_dimselect=="Relative") { ?>
+#wrapper { width:<?php echo ($totalwidth) ?>% ;}
+#access, #colophon, #branding, #main {width:100%;}
+#access .menu-header, div.menu {width:96% ;}
+#content {margin-left:2%;}
+#primary, #secondary {padding-left:1%;}
+<?php
+ if (is_page_template() && !is_page_template('template-blog.php') && !is_page_template('template-onecolumn.php') && !is_page_template('template-page-with-intro.php')) {
+
+?><?php if (is_page_template("template-twocolumns-right.php")) { ?>
+#content { width:<?php echo ($contentSize) ?>%;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>%;}<?php }
+
+?><?php if (is_page_template("template-twocolumns-left.php")) { ?>
+#content { width:<?php echo ($contentSize ) ?>%;float:right;margin:0px 20px 0 0;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>%;float:left;padding-left:0px;clear:left;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+ .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:5%;width:95%;margin-left:-10px;}
+#primary ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+?><?php if ( is_page_template("template-threecolumns-right.php")) { ?>
+#content { width:<?php echo ($contentSize-2) ?>%;}
+#primary,#secondary {width:<?php echo ($sidebarSize/2 ) ?>%;} <?php }
+
+?><?php if (is_page_template("template-threecolumns-left.php")) { ?>
+#content { width:<?php echo ($contentSize-2) ?>%;float:right;margin:0px 20px 0 0;display:block;}
+#primary,#secondary {width:<?php echo ($sidebarSize/2 ) ?>%;float:left;padding-left:0px;;border:none;border-right:1px dashed #EEE;padding-right:10px;}
+ .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:8%;width:95%;margin-left:-10px;}
+#main .widget-area ul.xoxo {margin:0 0 0 10px ;} <?php }
+
+?><?php if ( is_page_template("template-threecolumns-center.php")) { ?>
+#content { width:<?php echo ($contentSize-1 ) ?>%;float:right;margin:0px <?php echo $sidebarSize/2+2 ?>% 0 <?php echo -($contentSize+$sidebarSize) ?>%;display:block;}
+#primary {width:<?php echo ($sidebarSize/2 ) ?>%;float:left;padding-left:0px;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+#secondary {width:<?php echo ($sidebarSize/2 ) ?>%;float:right;}
+#primary .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:8%;width:100%;margin-left:-10px;}
+#primary ul.xoxo {padding:0 0 0 10px ;} <?php }
+ }// is_page_template
+
+ else { // IF NO PAGE TEMPLATE HAS BEEN SELECTED
+
+ if ($mantra_side == "1c") { ?>
+#content {width:96%; margin:20px;} <?php }
+
+?><?php if ($mantra_side == "2cSr" ) { ?>
+#content { width:<?php echo ($contentSize) ?>%;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>%;}<?php }
+
+?><?php if ($mantra_side == "2cSl" ) { ?>
+#content { width:<?php echo ($contentSize ) ?>%;float:right;margin:0px 20px 0 0;}
+#primary,#secondary {width:<?php echo ($sidebarSize ) ?>%;float:left;padding-left:0px;clear:left;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+ .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:5%;width:95%;margin-left:-10px;}
+#primary ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+?><?php if ($mantra_side == "3cSr" ) { ?>
+#content { width:<?php echo ($contentSize-2) ?>%;}
+#primary,#secondary {width:<?php echo ($sidebarSize/2 ) ?>%;} <?php }
+
+?><?php if ($mantra_side == "3cSl" ) { ?>
+#content { width:<?php echo ($contentSize-2) ?>%;float:right;margin:0px 20px 0 0;display:block;}
+#primary,#secondary {width:<?php echo ($sidebarSize/2 ) ?>%;float:left;padding-left:0px;;border:none;border-right:1px dashed #EEE;padding-right:15px;}
+ .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:8%;width:100%;margin-left:-10px;}
+#main .widget-area ul.xoxo {margin:0 0 0 10px ;} <?php }
+
+?><?php if ($mantra_side == "3cSs") { ?>
+#content { width:<?php echo ($contentSize-1 ) ?>%;float:right;margin:0px <?php echo $sidebarSize/2+2 ?>% 0 <?php echo -($contentSize+$sidebarSize) ?>%;display:block;}
+#primary {width:<?php echo ($sidebarSize/2 ) ?>%;float:left;padding-left:0px;border:none;border-right:1px dashed #EEE;padding-right:20px;}
+#secondary {width:<?php echo ($sidebarSize/2 ) ?>%;float:right;}
+#primary .widget-title { -moz-border-radius:0 10px 0 0; -webkit-border-radius:0 10px 0 0;border-radius:0 10px 0 0 ; text-align:right;padding-right:8%;width:100%;margin-left:-10px;}
+#primary ul.xoxo {padding:0 0 0 10px ;} <?php }
+
+ }//else
+}
+
+/*
+ * THE REST OF THE CSS
+ */
+?>
+#content, #content p, #content ul, #content ol, #content input, #content select, #content textarea{
+font-size:<?php echo $mantra_fontsize ?>;
+<?php if ($mantra_lineheight != "Default") { ?>line-height:<?php echo $mantra_lineheight ?>; <?php }
+?><?php if ($mantra_wordspace != "Default") { ?>word-spacing:<?php echo $mantra_wordspace ?>;<?php }
+?><?php if ($mantra_letterspace != "Default") { ?>letter-spacing:<?php echo $mantra_letterspace ?>;<?php }
+?><?php if ($mantra_textalign != "Default") { ?>text-align:<?php echo $mantra_textalign; ?> ; <?php } ?>}
+
+<?php if ($mantra_hcenter != "") { ?> #bg_image { display:block;margin:0 auto;} <?php }
+?><?php if ($mantra_contentbg != "#FFFFFF") { ?> #main, #access ul li.current_page_item, #access ul li.current-menu-item ,#access ul ul li { background-color:<?php echo $mantra_contentbg; ?>} <?php }
+?><?php if ($mantra_menubg != "#FAFAFA") { ?> #access ul li { background-color:<?php echo $mantra_menubg; ?>} <?php }
+?><?php if (cryout_optset($mantra_s1bg, "")) { ?> #primary { background-color:<?php echo $mantra_s1bg; ?>} <?php }
+?><?php if (cryout_optset($mantra_s2bg ,"" )){ ?> #secondary { background-color:<?php echo $mantra_s2bg; ?>} <?php }
+
+$mantra_googlefont = str_replace('+',' ',preg_replace('/:.*/i','',$mantra_googlefont));
+$mantra_googlefonttitle = str_replace('+',' ',preg_replace('/:.*/i','',$mantra_googlefonttitle));
+$mantra_googlefontside = str_replace('+',' ',preg_replace('/:.*/i','',$mantra_googlefontside));
+$mantra_googlefontsubheader = str_replace('+',' ',preg_replace('/:.*/i','',$mantra_googlefontsubheader));
+
+?><?php if (stripslashes($mantra_fontfamily) != '"Segoe UI", Arial, sans-serif' || $mantra_googlefont) { ?> * , .widget-title {font-family:<?php if (!$mantra_googlefont) echo $mantra_fontfamily; else echo "\"$mantra_googlefont\""; ?> ; }<?php }
+?><?php if ($mantra_fonttitle != "Default" || $mantra_googlefonttitle) { ?> #content h1.entry-title a, #content h2.entry-title a, #content h1.entry-title , #content h2.entry-title {font-family:<?php if (!$mantra_googlefonttitle) echo $mantra_fonttitle; else echo "\"$mantra_googlefonttitle\""; ?> ; }<?php }
+?><?php if ($mantra_fontside != "Default" || $mantra_googlefontside) { ?> .widget-area * {font-family:<?php if (!$mantra_googlefontside) echo $mantra_fontside; else echo "\"$mantra_googlefontside\""; ?> ; }<?php }
+?><?php if ($mantra_fontsubheader != "Default" || $mantra_googlefontsubheader ) { ?> .entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6 {font-family:<?php if (!$mantra_googlefontsubheader) echo $mantra_fontsubheader; else echo "\"$mantra_googlefontsubheader\""; ?> ; }<?php }
+?><?php if ($mantra_caption != "Light") { ?> #content .wp-caption { <?php }
+?><?php if ($mantra_caption == "White") { ?> background-color:#FFF;}
+ <?php } else if ($mantra_caption == "Light Gray") {?> background-color:#EEE; }
+ <?php } else if ($mantra_caption == "Gray") {?> background-color:#CCC;}
+ <?php } else if ($mantra_caption == "Dark Gray") {?> background-color:#444;color:#CCC;}
+ <?php } else if ($mantra_caption == "Black") {?> background-color:#000;color:#CCC;}
+<?php }
+?><?php if ($mantra_menurounded == "Disable") { ?> #access ul li { border-radius:0;-moz-border-radius:0;border-radius:0;}<?php }
+?><?php if ($mantra_metaback == "White") { ?> .entry-meta { background:#FFF;} <?php } else if ($mantra_metaback == "None") { ?> .entry-meta { background:#FFF;border:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} <?php }
+?><?php if ($mantra_postseparator == "Show") { ?> article.post, article.page { padding-bottom:10px;border-bottom:3px solid #EEE} <?php }
+?><?php if ($mantra_contentlist == "Hide") { ?> .entry-content ul li { background-image:none ; padding-left:0;} .entry-content ul { margin-left:0;} <?php }
+?><?php if ($mantra_comtext == "Hide") { ?> #respond .form-allowed-tags { display:none;} <?php }
+?><?php if ($mantra_comclosed == "Hide in posts") { ?> .nocomments { display:none;} <?php } elseif ($mantra_comclosed == "Hide in pages") { ?> .nocomments2 {display:none;} <?php } elseif ($mantra_comclosed == "Hide everywhere") { ?> .nocomments, .nocomments2 {display:none;} <?php }
+?><?php if ($mantra_comoff == "Hide") { ?> .comments-link span { display:none;} <?php }
+?><?php if ($mantra_tables == "Enable") { ?> #content table {border:none;} #content tr {background:none;} #content table {border:none;} #content tr th,
+#content thead th {background:none;} #content tr td {border:none;}<?php }
+?><?php if ($mantra_headfontsize != "Default") { ?> #content h1.entry-title, #content h2.entry-title { font-size:<?php echo $mantra_headfontsize; ?> ;}<?php }
+?><?php if ($mantra_sidefontsize != "Default") { ?> .widget-area a:link, .widget-area a:visited { font-size:<?php echo $mantra_sidefontsize; ?> ;}<?php }
+?><?php if ($mantra_textshadow != "Enable") { ?> #content h1, #content h2, #content h3, #content h4, #content h5, #content h6, #content .entry-title, #site-title a , #site-description { text-shadow:none; moz-text-shadow:none; -webkit-text-shadow:none ;}<?php }
+?><?php if ($mantra_headerindent == "Enable") { ?> #content h1, #content h2, #content h3, #content h4, #content h5, #content h6 { margin-left:20px;} .sticky hgroup { background: url(<?php echo get_template_directory_uri().'/images/icon-featured.png' ; ?>) no-repeat 12px 10px transparent; padding-left: 15px;}<?php } ?>
+
+#header-container > div { margin-top:<?php echo $mantra_headermargintop; ?>px;}
+#header-container > div { margin-left:<?php echo $mantra_headermarginleft; ?>px;}
+<?php if ($mantra_backcolor != "444444") { ?> body { background-color:<?php echo $mantra_backcolor; ?> !important ;}<?php }
+?><?php if ($mantra_headercolor != "333333") { ?> #header { background-color:<?php echo $mantra_headercolor; ?> ;}<?php }
+?><?php if ($mantra_prefootercolor != "222222") { ?> #footer { background-color:<?php echo $mantra_prefootercolor; ?> ;}<?php }
+?><?php if ($mantra_footercolor != "171717") { ?> #footer2 { background-color:<?php echo $mantra_footercolor; ?> ;}<?php }
+?><?php if ($mantra_titlecolor != "0D85CC") { ?> #site-title span a { color:<?php echo $mantra_titlecolor; ?> ;}<?php }
+?><?php if ($mantra_descriptioncolor != "0D85CC") { ?> #site-description { color:<?php echo $mantra_descriptioncolor; ?> ;}<?php }
+?><?php if ($mantra_contentcolor != "333333") { ?> #content, #content p, #content ul, #content ol { color:<?php echo $mantra_contentcolor; ?> ;}<?php }
+?><?php if ($mantra_linkscolor != "0D85CC") { ?> .widget-area a:link, .widget-area a:visited, a:link, a:visited ,#searchform #s:hover , #container #s:hover, #access a:hover, #wp-calendar tbody td a , #site-info a ,#site-copyright a, #access li:hover > a, #access ul ul :hover > a { color:<?php echo $mantra_linkscolor; ?>;}<?php }
+?><?php if ($mantra_hovercolor != "333333") { ?> a:hover, .entry-meta a:hover, .entry-utility a:hover , .widget-area a:hover { color:<?php echo $mantra_hovercolor; ?> ;}<?php }
+?><?php if ($mantra_headtextcolor != "333333") { ?> #content .entry-title a, #content .entry-title, #content h1, #content h2, #content h3, #content h4, #content h5, #content h6{ color:<?php echo $mantra_headtextcolor; ?> ;}<?php }
+?><?php if ($mantra_headtexthover != "000000") { ?> #content .entry-title a:hover { color:<?php echo $mantra_headtexthover; ?> ;}<?php }
+?><?php if ($mantra_sideheadbackcolor != "444444") { ?> .widget-title,#footer-widget-area .widget-title { background-color:<?php echo $mantra_sideheadbackcolor; ?> ;}<?php }
+?><?php if ($mantra_sideheadtextcolor != "2EA5FD") { ?> .widget-title { color:<?php echo $mantra_sideheadtextcolor; ?> ;}<?php }
+
+?><?php if ($mantra_magazinelayout == "Enable") { ?> #content article.post{float:left;width:47%;margin-right:3%; } #content article.sticky { margin-right:3%;padding:0; } #content article.sticky > * {margin:2%;} #content article:nth-of-type(2n+1) {clear: both;} <?php }
+
+?><?php if (1) { ?> #footer-widget-area .widget-title { color:<?php echo $mantra_footerheader; ?> ; ;}<?php }
+?><?php if (1) { ?> #footer-widget-area a { color:<?php echo $mantra_footertext; ?> ;}<?php }
+?><?php if (1) { ?> #footer-widget-area a:hover { color:<?php echo $mantra_footerhover; ?> ;}<?php }
+
+switch ($mantra_menualign):
+ case "center": ?> #access ul { display: table; margin: 0 auto; } <?php break;
+ case "right": ?> #access ul li { float: right; } <?php break;
+ default: break;
+endswitch;
+
+?><?php if ($mantra_pin != "Pin2") { ?> #content .wp-caption { background-image:url(<?php echo get_template_directory_uri()."/images/pins/".$mantra_pin; ?>.png) ;} <?php }
+?><?php if ($mantra_sidebullet != "arrow_white") { ?>.widget-area ul ul li{ background-image:url(<?php echo get_template_directory_uri()."/images/bullets/".$mantra_sidebullet; ?>.png);background-position: 0px 8px ;}<?php }
+
+?><?php if ($mantra_pagetitle == "Hide") { ?> .page h1.entry-title, .home .page h2.entry-title { display:none;} <?php }
+?><?php if ($mantra_categtitle == "Hide") { ?> h1.page-title { display:none;} <?php }
+?><?php if (($mantra_postdate == "Hide" && $mantra_postcateg == "Hide") || ($mantra_postauthor == "Hide" && $mantra_postcateg == "Hide") ) { ?>.entry-meta .bl_sep {display:none;} <?php }
+?><?php if ($mantra_postdate == "Hide") { ?>.entry-meta span.entry-date,.entry-meta span.onDate {display:none;} <?php }
+?><?php if ($mantra_postcomlink == "Hide") { ?>.entry-meta .comments-link,.entry-meta2 .comments-link{display:none;} <?php }
+?><?php if ($mantra_postauthor == "Hide") { ?>.entry-meta .author {display:none;} <?php }
+?><?php if ($mantra_postcateg == "Hide") { ?>.entry-meta span.bl_categ {display:none;} <?php }
+?><?php if ($mantra_posttag == "Hide") { ?> .entry-utility span.bl_posted, .entry-meta2 span.bl_tagg,.entry-meta3 span.bl_tagg {display:none;} <?php }
+?><?php if ($mantra_postbook == "Hide") { ?> .entry-utility span.bl_bookmark {display:none;} <?php }
+?><?php if ($mantra_parmargin) { ?> #content p, .entry-content ul, .entry-summary ul , .entry-content ol, .entry-summary ol { margin-bottom:<?php echo $mantra_parmargin; ?>;} <?php }
+?><?php if ($mantra_parindent != "0px") { ?> p {text-indent:<?php echo $mantra_parindent;?> ;} <?php }
+?><?php if ($mantra_posttime == "Hide") { ?> .entry-meta .entry-time {display:none;} <?php }
+?><?php if ($mantra_postmetas == "Hide") { ?> #content .entry-meta {display:none;} <?php }
+?><?php if (($mantra_mobile == "Enable") && $mantra_hcontain) { ?> #branding{ -webkit-background-size:contain !important;-moz-background-size:contain !important;background-size:contain !important; } <?php } ?>
+#branding { height:<?php echo HEADER_IMAGE_HEIGHT; ?>px ;}
+<?php if ($mantra_hratio) { ?> @media (max-width: 800px) {#branding, #bg_image { min-height:inherit !important; } } <?php } ?>
+</style>
+
+<?php $mantra_custom_styling = ob_get_contents();
+ ob_end_clean();
+
+return $mantra_custom_styling;
+}
+
+// Mantra function for inseting into the header the Custom Css field in the theme options
+
+function mantra_customcss() {
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = esc_attr($value) ; }
+
+if ($mantra_customcss != "") {
+ return '<style>'.htmlspecialchars_decode($mantra_customcss, ENT_QUOTES).'</style>';
+ }
+}
+
+function mantra_customjs() {
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = esc_attr($value) ; }
+
+if ($mantra_customjs != "") {
+ echo '<script>'.htmlspecialchars_decode($mantra_customjs, ENT_QUOTES).'</script>';
+ }
+}
+?> \ No newline at end of file
diff --git a/themes/mantra/admin/defaults.php b/themes/mantra/admin/defaults.php
new file mode 100644
index 00000000..44927d29
--- /dev/null
+++ b/themes/mantra/admin/defaults.php
@@ -0,0 +1,216 @@
+<?php
+
+// DEFAULT OPTIONS ARRAY
+
+$mantra_defaults = array(
+
+"mantra_db" => "1.0",
+
+"mantra_side" => "2cSr",
+"mantra_dimselect" => 'Absolute',
+"mantra_sidewidth" => 800,
+"mantra_sidebar" => 250,
+"mantra_sidewidthRel" => 60,
+"mantra_sidebarRel" => 20,
+"mantra_mobile" => "Enable",
+"mantra_hcontain" => "",
+
+
+"mantra_frontpage" => "Disable",
+"mantra_frontposts" => "Disable",
+"mantra_frontpostscount" => 5,
+"mantra_menualign" => "left",
+"mantra_fpsliderwidth" => "800",
+"mantra_fpsliderheight" => "250",
+"mantra_fpslideranim" => "random",
+"mantra_fpsliderborderwidth" => "10",
+"mantra_fpsliderbordercolor" => "#EEEEEE",
+"mantra_fpslidertime" => "750",
+"mantra_fpsliderpause" => "5000",
+"mantra_fpslidernav" => "Bullets",
+"mantra_fpsliderarrows" => "Visible on Hover",
+
+"mantra_slideType" => "Custom Slides",
+"mantra_slideCateg" => "",
+"mantra_slideNumber" => "5",
+"mantra_slideSpecific" => "",
+
+"mantra_sliderimg1" => get_template_directory_uri()."/images/slider/mantra-slide1.jpg",
+"mantra_slidertitle1" => "This is your caption's title",
+"mantra_slidertext1" => "And this is the text that could accompany it. It is all optional so if you delete it in the Mantra Settings there will be no more caption with the black background.",
+"mantra_sliderlink1" => "",
+"mantra_sliderimg2" => get_template_directory_uri()."/images/slider/mantra-slide2.jpg",
+"mantra_slidertitle2" => "This is yet another caption title",
+"mantra_slidertext2" => "And some more text to give you as an example. You can use <a href='http://www.riotreaction.com' >links</a> and other type of <b>HTML</b> <i>formats</i>.",
+"mantra_sliderlink2" => "",
+"mantra_sliderimg3" => "",
+"mantra_slidertitle3" => "",
+"mantra_slidertext3" => "",
+"mantra_sliderlink3" => "",
+"mantra_sliderimg4" => "",
+"mantra_slidertitle4" => "",
+"mantra_slidertext4" => "",
+"mantra_sliderlink4" => "",
+"mantra_sliderimg5" => "",
+"mantra_slidertitle5" => "",
+"mantra_slidertext5" => "",
+"mantra_sliderlink5" => "",
+
+"mantra_nrcolumns" => "4",
+"mantra_colimageheight" => "120",
+"mantra_columnreadmore" => "Read more",
+
+"mantra_columnimg1" => get_template_directory_uri()."/images/slider/mantra-column.jpg",
+"mantra_columntitle1" => "Hi there!",
+"mantra_columntext1" => "You can also have some text here. Just like with the slider, it's all optional (including the title and the link inputs). All you need is an image, unless you want the Mantra image above to follow you everywhere.",
+"mantra_columnlink1" => "",
+"mantra_columnimg2" => get_template_directory_uri()."/images/slider/mantra-column.jpg",
+"mantra_columntitle2" => " HTML tags",
+"mantra_columntext2" => "You can also have <a href='http://www.riotreactions.com'>links</a> here as well as some <strong>HTML tags</strong>.",
+"mantra_columnlink2" => "",
+"mantra_columnimg3" => get_template_directory_uri()."/images/slider/mantra-column.jpg",
+"mantra_columntitle3" => "",
+"mantra_columntext3" => "",
+"mantra_columnlink3" => "",
+"mantra_columnimg4" => get_template_directory_uri()."/images/slider/mantra-column.jpg",
+"mantra_columntitle4" => "",
+"mantra_columntext4" => "",
+"mantra_columnlink4" => "",
+
+"mantra_fronttext1" => "This could be a title",
+"mantra_fronttext2" => "And this is a second title",
+"mantra_fronttitlecolor" => "#333333",
+"mantra_fronttext3" => "And here you could have a whole lot of text. Or not. It's all up to you. Deleting all text inside the appropriate input in the Mantra Settings will remove this whole text zone. It can also contain some HTML tags.<br /> Just try everything out and see what suits you. Have fun and good luck! ",
+"mantra_fronttext4" => "",
+
+"mantra_fronthideheader" => "",
+"mantra_fronthidemenu" => "",
+"mantra_fronthidewidget" => "",
+"mantra_fronthidefooter" => "",
+"mantra_fronthideback" => "",
+
+
+"mantra_hheight" => "75",
+"mantra_hcenter" => "",
+"mantra_hratio" => "",
+"mantra_menurounded" => "Enable",
+"mantra_logoupload" => "",
+"mantra_favicon" => "",
+"mantra_siteheader" => "Site Title and Description",
+"mantra_headermargintop" => "20",
+"mantra_headermarginleft" => "40",
+
+"mantra_fontfamily" => 'Segoe UI, Arial, sans-serif',
+"mantra_googlefont" => '',
+"mantra_googlefont2" => '',
+"mantra_fontsize" => "14px",
+"mantra_fonttitle" => 'Georgia, Times New Roman, Times, serif',
+"mantra_googlefonttitle" => '',
+"mantra_googlefonttitle2" => '',
+"mantra_headfontsize" => "Default",
+"mantra_fontside" => 'Helvetica, sans-serif',
+"mantra_googlefontside" => '',
+"mantra_googlefontside2" => '',
+"mantra_sidefontsize" => "Default",
+"mantra_fontsubheader" => 'Georgia, Times New Roman, Times, serif',
+"mantra_googlefontsubheader" => '',
+"mantra_googlefontsubheader2" => '',
+"mantra_textalign" => "Default",
+"mantra_parmargin" => "1.5em",
+"mantra_parindent" => "0px",
+"mantra_headerindent" => "Disable",
+"mantra_lineheight" => "Default",
+"mantra_wordspace" => "Default",
+"mantra_letterspace" => "Default",
+"mantra_textshadow" => "Enable",
+
+"mantra_contentbg" => "#FFFFFF",
+"mantra_menubg" => "#FAFAFA",
+"mantra_s1bg" => "",
+"mantra_s2bg" => "",
+"mantra_backcolor" => "#444444",
+"mantra_headercolor" => "#333333",
+"mantra_prefootercolor" => "#222222",
+"mantra_footercolor" => "#171717",
+"mantra_titlecolor" => "#0D85CC",
+"mantra_descriptioncolor" => "#999999",
+"mantra_contentcolor" => "#333333",
+"mantra_linkscolor" => "#0D85CC",
+"mantra_hovercolor" => "#12a7ff",
+"mantra_headtextcolor" => "#444444",
+"mantra_headtexthover" => "#000000",
+"mantra_sideheadbackcolor" => "#444444",
+"mantra_sideheadtextcolor" => "#2EA5FD",
+
+"mantra_footerheader" => "#0C85CD",
+"mantra_footertext" => "#666666",
+"mantra_footerhover" => "#888888",
+
+"mantra_breadcrumbs" => "Disable",
+"mantra_pagination" => "Enable",
+"mantra_caption" => "Light",
+"mantra_image" => "Seven",
+"mantra_pin" => "Pin2",
+"mantra_sidebullet" => "arrow_white",
+"mantra_metaback" => "Gray",
+"mantra_postseparator" => "Hide",
+"mantra_contentlist" => "Show",
+"mantra_pagetitle" => "Show",
+"mantra_categtitle" => "Show",
+"mantra_tables" => "Disable",
+"mantra_backtop" => "Enable",
+"mantra_comtext" => "Show",
+"mantra_comclosed" => "Hide everywhere",
+"mantra_comoff" => "Show",
+
+"mantra_postcomlink" => "Show",
+"mantra_postdate" => "Show",
+"mantra_posttime" => "Hide",
+"mantra_postauthor" => "Show",
+"mantra_postcateg" => "Show",
+"mantra_posttag" => "Show",
+"mantra_postbook" => "Show",
+"mantra_postmetas" => "Show",
+
+"mantra_excerpthome" => "Full Post",
+"mantra_excerptsticky" => "Full Post",
+"mantra_excerptarchive" => "Full Post",
+"mantra_excerptwords" => "50",
+"mantra_magazinelayout" => "Disable",
+"mantra_excerptdots" => " &hellip;",
+"mantra_excerptcont" => " Continue reading",
+"mantra_excerpttags" => "Disable",
+
+"mantra_fpost" => "Disable",
+"mantra_fpostlink" => "1",
+"mantra_fauto" => "Disable",
+"mantra_falign" => "Left",
+"mantra_fwidth" => "250",
+"mantra_fheight" => "150",
+"mantra_fcrop" => "",
+"mantra_fheader" => "Disable",
+
+"mantra_social1" => "",
+"mantra_social2" => "",
+"mantra_social3" => "",
+"mantra_social4" => "",
+"mantra_social5" => "",
+"mantra_social6" => "",
+"mantra_social7" => "",
+"mantra_social8" => "",
+"mantra_social9" => "",
+"mantra_social10" => "",
+"mantra_socialsdisplay0" => "",
+"mantra_socialsdisplay1" => "",
+"mantra_socialsdisplay2" => "",
+"mantra_socialsdisplay3" => "",
+
+"mantra_copyright" => "",
+"mantra_customcss" => "/* Mantra Custom CSS */ ",
+"mantra_customjs" => "",
+"mantra_seo" => "Enable",
+"mantra_seo_home_desc" => "",
+"mantra_seo_gen_desc" => "Auto",
+"mantra_seo_author" => "Do not use");
+
+?> \ No newline at end of file
diff --git a/themes/mantra/admin/images/1c.png b/themes/mantra/admin/images/1c.png
new file mode 100644
index 00000000..29891b17
--- /dev/null
+++ b/themes/mantra/admin/images/1c.png
Binary files differ
diff --git a/themes/mantra/admin/images/2cSl.png b/themes/mantra/admin/images/2cSl.png
new file mode 100644
index 00000000..61ca2efb
--- /dev/null
+++ b/themes/mantra/admin/images/2cSl.png
Binary files differ
diff --git a/themes/mantra/admin/images/2cSr.png b/themes/mantra/admin/images/2cSr.png
new file mode 100644
index 00000000..13928446
--- /dev/null
+++ b/themes/mantra/admin/images/2cSr.png
Binary files differ
diff --git a/themes/mantra/admin/images/3cSl.png b/themes/mantra/admin/images/3cSl.png
new file mode 100644
index 00000000..f47dbab9
--- /dev/null
+++ b/themes/mantra/admin/images/3cSl.png
Binary files differ
diff --git a/themes/mantra/admin/images/3cSr.png b/themes/mantra/admin/images/3cSr.png
new file mode 100644
index 00000000..a21b6d98
--- /dev/null
+++ b/themes/mantra/admin/images/3cSr.png
Binary files differ
diff --git a/themes/mantra/admin/images/3cSs.png b/themes/mantra/admin/images/3cSs.png
new file mode 100644
index 00000000..0e6b5fe2
--- /dev/null
+++ b/themes/mantra/admin/images/3cSs.png
Binary files differ
diff --git a/themes/mantra/admin/images/coffee.png b/themes/mantra/admin/images/coffee.png
new file mode 100644
index 00000000..6a94cc89
--- /dev/null
+++ b/themes/mantra/admin/images/coffee.png
Binary files differ
diff --git a/themes/mantra/admin/images/mantra-logo.png b/themes/mantra/admin/images/mantra-logo.png
new file mode 100644
index 00000000..68d6c88f
--- /dev/null
+++ b/themes/mantra/admin/images/mantra-logo.png
Binary files differ
diff --git a/themes/mantra/admin/images/placeholder.gif b/themes/mantra/admin/images/placeholder.gif
new file mode 100644
index 00000000..7e063df0
--- /dev/null
+++ b/themes/mantra/admin/images/placeholder.gif
Binary files differ
diff --git a/themes/mantra/admin/images/testimg.png b/themes/mantra/admin/images/testimg.png
new file mode 100644
index 00000000..9b2bcbf1
--- /dev/null
+++ b/themes/mantra/admin/images/testimg.png
Binary files differ
diff --git a/themes/mantra/admin/js/accordion-slider.js b/themes/mantra/admin/js/accordion-slider.js
new file mode 100644
index 00000000..e43b28a8
--- /dev/null
+++ b/themes/mantra/admin/js/accordion-slider.js
@@ -0,0 +1,96 @@
+/*!
+ * jQuery UI Widget 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
+function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
+d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
+b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
+c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
+;/*!
+ * jQuery UI Mouse 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Mouse
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ */
+(function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
+this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
+this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
+!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
+false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
+;/*
+ * jQuery UI Accordion 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
+a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
+if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
+function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
+this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
+this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
+b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
+a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
+if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
+if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
+e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
+e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
+"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16",
+animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
+f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
+paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
+;/*
+ * jQuery UI Slider 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
+this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
+g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length?
+(h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i-
+m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
+return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false;
+this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
+this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
+this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
+c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
+a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
+this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):
+this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
+this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
+return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
+this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e-
+g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"},
+b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery);
+; \ No newline at end of file
diff --git a/themes/mantra/admin/js/admin.js b/themes/mantra/admin/js/admin.js
new file mode 100644
index 00000000..6ee51806
--- /dev/null
+++ b/themes/mantra/admin/js/admin.js
@@ -0,0 +1,185 @@
+/*!
+ * Admin js
+ */
+
+jQuery(document).ready(function() {
+
+// WP image uploader for custom use in the admin section
+ var uploadparent = 0;
+ var old_send_to_editor = window.send_to_editor;
+ var old_tb_remove = window.tb_remove;
+
+ jQuery('.upload_image_button').click(function(){
+ uploadparent = jQuery(this).closest('div');
+ //Change "insert into post" to "Use this Button"
+ tbframe_interval = setInterval( function() {jQuery('#TB_iframeContent').contents().find('.savesend .button').val('Use This Image');}, 2000);
+ tb_show('Select File', 'media-upload.php?post_id=0&amp;type=file&amp;TB_iframe=true');
+ return false;
+ });
+
+ window.tb_remove = function() {
+ uploadparent = 0;
+ old_tb_remove();
+ }
+
+ window.send_to_editor = function(html) {
+ if(uploadparent){
+ imgurl = jQuery('img',html).attr('src');
+ uploadparent.find('.slideimages').attr('value', imgurl);
+ uploadparent.find('.imagebox').attr('src', imgurl);
+ tb_remove();
+ } else {
+ old_send_to_editor();
+ }
+ }
+
+
+// Show/hide slides
+ jQuery('.slidetitle').click(function() {
+ jQuery(this).next().toggle("fast");
+ });
+
+
+// Jquery confim window on reset to defaults
+jQuery('#mantra_defaults').click (function() {
+ if (!confirm('Reset Mantra Settings to Defaults?')) { return false;}
+ });
+
+// Hide or show dimmensions
+jQuery('#mantra_dimselect').change(function() {
+ if (jQuery('#mantra_dimselect option:selected').val()=="Absolute") {
+ jQuery('#relativedim').hide("normal");jQuery('#absolutedim').show("normal");
+ }
+ else {
+ jQuery('#relativedim').show("normal");jQuery('#absolutedim').hide("normal");
+ }
+ });
+
+if (jQuery('#mantra_dimselect option:selected').val()=="Absolute") {
+ jQuery('#relativedim').hide("normal");jQuery('#absolutedim').show("normal");}
+else {
+ jQuery('#relativedim').show("normal");jQuery('#absolutedim').hide("normal");
+ }
+
+
+// Hide or show slider settings
+jQuery('#mantra_slideType').change(function() {
+ jQuery('.slideDivs').hide("normal");
+ switch (jQuery('#mantra_slideType option:selected').val()) {
+
+ case "Custom Slides" :
+ jQuery('#sliderCustomSlides').show("normal");
+ break;
+
+ case "Latest Posts" :
+ jQuery('#sliderLatestPosts').show("normal");
+ break;
+
+ case "Random Posts" :
+ jQuery('#sliderRandomPosts').show("normal");
+ break;
+
+ case "Sticky Posts" :
+ jQuery('#sliderStickyPosts').show("normal");
+ break;
+
+ case "Latest Posts from Category" :
+ jQuery('#sliderLatestCateg').show("normal");
+ break;
+
+ case "Random Posts from Category" :
+ jQuery('#sliderRandomCateg').show("normal");
+ break;
+
+ case "Specific Posts" :
+ jQuery('#sliderSpecificPosts').show("normal");
+ break;
+
+ }//switch
+
+});//function
+
+jQuery('.slideDivs').hide("normal");
+ switch (jQuery('#mantra_slideType option:selected').val()) {
+
+ case "Custom Slides" :
+ jQuery('#sliderCustomSlides').show("normal");
+ break;
+
+ case "Latest Posts" :
+ jQuery('#sliderLatestPosts').show("normal");
+ break;
+
+ case "Random Posts" :
+ jQuery('#sliderRandomPosts').show("normal");
+ break;
+
+ case "Sticky Posts" :
+ jQuery('#sliderStickyPosts').show("normal");
+ break;
+
+ case "Latest Posts from Category" :
+ jQuery('#sliderLatestCateg').show("normal");
+ break;
+
+ case "Random Posts from Category" :
+ jQuery('#sliderRandomCateg').show("normal");
+ break;
+
+ case "Specific Posts" :
+ jQuery('#sliderSpecificPosts').show("normal");
+ break;
+};//switch
+
+//Slide type value
+$sliderNr=jQuery('#mantra_slideType').val();
+
+//Show category if a category type is selected
+if ($sliderNr=="Latest Posts from Category" || $sliderNr=="Random Posts from Category" )
+ jQuery('#slider-category').show();
+else jQuery('#slider-category').hide();
+
+//Show number of slides if that's the case
+if ($sliderNr=="Latest Posts" || $sliderNr =="Random Posts" || $sliderNr =="Sticky Posts" || $sliderNr=="Latest Posts from Category" || $sliderNr=="Random Posts from Category" )
+ jQuery('#slider-post-number').show();
+else jQuery('#slider-post-number').hide();
+
+//On change
+jQuery('#mantra_slideType').change(function(){
+ $sliderNr=jQuery('#mantra_slideType').val();
+//Show category if a category type is selected
+ if ($sliderNr=="Latest Posts from Category" || $sliderNr=="Random Posts from Category" )
+ jQuery('#slider-category').show();
+ else jQuery('#slider-category').hide();
+//Show number of slides if that's the case
+ if ($sliderNr=="Latest Posts" || $sliderNr =="Random Posts" || $sliderNr =="Sticky Posts" || $sliderNr=="Latest Posts from Category" || $sliderNr=="Random Posts from Category" )
+ jQuery('#slider-post-number').show();
+else jQuery('#slider-post-number').hide();
+ });//onchange funciton
+
+
+
+// Create accordion from existing settings table
+ jQuery('.form-table').wrap('<div>');
+ jQuery(function() {
+ jQuery( "#accordion" ).accordion({
+ header: 'h3',
+ autoHeight: false, // for jQueryUI <1.10
+ heightStyle: "content", // required in jQueryUI 1.10
+ collapsible: true,
+ navigation: true,
+ active: false
+ });
+ });
+
+
+ });// ready
+
+ // Change border for selecte inputs
+function changeBorder (idName, className) {
+ jQuery('.'+className).removeClass( 'checkedClass' );
+ jQuery('.'+className).removeClass( 'borderful' );
+ jQuery('#'+idName).addClass( 'borderful' );
+
+return 0;
+} \ No newline at end of file
diff --git a/themes/mantra/admin/main.php b/themes/mantra/admin/main.php
new file mode 100644
index 00000000..379303e0
--- /dev/null
+++ b/themes/mantra/admin/main.php
@@ -0,0 +1,478 @@
+<?php
+// Loading files for frontend
+
+// Loading Default values
+require_once(dirname(__FILE__) . "/defaults.php");
+// Loading function that generates the custom css
+require_once(dirname(__FILE__) . "/custom-styles.php");
+
+// Loading the admin files
+
+if( is_admin() ) {
+// Loading the settings arrays
+require_once(dirname(__FILE__) . "/settings.php");
+// Loading the callback functions
+require_once(dirname(__FILE__) . "/admin-functions.php");
+// Loading the sanitize funcions
+require_once(dirname(__FILE__) . "/sanitize.php");
+}
+
+// Getting the theme options and making sure defaults are used if no values are set
+function mantra_get_theme_options() {
+ global $mantra_defaults;
+ $optionsMantra = get_option( 'ma_options', (array)$mantra_defaults );
+ $optionsMantra = array_merge((array)$mantra_defaults, (array)$optionsMantra);
+return $optionsMantra;
+}
+
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+}
+
+
+// Hooks/Filters
+add_action('admin_init', 'mantra_init_fn' );
+add_action('admin_menu', 'mantra_add_page_fn');
+add_action('init', 'mantra_init');
+
+
+$mantra_options= mantra_get_theme_options();
+
+// Registering and enqueuing all scripts and styles for the init hook
+function mantra_init() {
+//Loading Mantra text domain into the admin section
+ load_theme_textdomain( 'mantra', get_template_directory_uri() . '/languages' );
+}
+
+// Creating the mantra subpage
+function mantra_add_page_fn() {
+$page = add_theme_page('Mantra Settings', 'Mantra Settings', 'edit_theme_options', 'mantra-page', 'mantra_page_fn');
+ add_action( 'admin_print_styles-'.$page, 'mantra_admin_styles' );
+ add_action('admin_print_scripts-'.$page, 'mantra_admin_scripts');
+
+}
+
+// Adding the styles for the Mantra admin page used when mantra_add_page_fn() is launched
+function mantra_admin_styles() {
+
+ wp_register_style( 'mantra-admin-style',get_template_directory_uri() . '/admin/css/admin.css' );
+ wp_register_style( 'jquery-ui-style',get_template_directory_uri() . '/js/jqueryui/css/ui-lightness/jquery-ui-1.8.16.custom.css' );
+ wp_enqueue_style( 'mantra-admin-style' );
+ wp_enqueue_style( 'jquery-ui-style' );
+
+}
+
+// Adding the styles for the Mantra admin page used when mantra_add_page_fn() is launched
+function mantra_admin_scripts() {
+// The farbtastic color selector already included in WP
+ wp_enqueue_script("farbtastic");
+ wp_enqueue_style( 'farbtastic' );
+
+//Jquery accordion and slider libraries alreay included in WP
+ wp_enqueue_script('jquery-ui-accordion');
+ wp_enqueue_script('jquery-ui-slider');
+ wp_enqueue_script('jquery-ui-tooltip');
+// For backwards compatibility where Mantra is installed on older versions of WP where the ui accordion and slider are not included
+ if (!wp_script_is('jquery-ui-accordion',$list='registered')) {
+ wp_register_script('cryout_accordion',get_template_directory_uri() . '/admin/js/accordion-slider.js', array('jquery') );
+ wp_enqueue_script('cryout_accordion');
+ }
+// For the WP uploader
+ wp_enqueue_script('media-upload');
+ wp_enqueue_script('thickbox');
+ wp_enqueue_style('thickbox');
+// The js used in the admin
+ wp_register_script('cryout-admin-js',get_template_directory_uri() . '/admin/js/admin.js' );
+ wp_enqueue_script('cryout-admin-js');
+}
+
+// The settings sectoions. All the referenced functions are found in admin-functions.php
+function mantra_init_fn(){
+
+
+ register_setting('ma_options', 'ma_options', 'ma_options_validate' );
+
+/**************
+ sections
+**************/
+
+ add_settings_section('layout_section', __('Layout Settings','mantra'), 'cryout_section_layout_fn', __FILE__);
+ add_settings_section('header_section', __('Header Settings','mantra'), 'cryout_section_header_fn', __FILE__);
+ add_settings_section('presentation_section', __('Presentation Page','mantra'), 'cryout_section_presentation_fn', __FILE__);
+ add_settings_section('text_section', __('Text Settings','mantra'), 'cryout_section_text_fn', __FILE__);
+ add_settings_section('appereance_section',__('Color Settings','mantra') , 'cryout_section_appereance_fn', __FILE__);
+ add_settings_section('graphics_section', __('Graphics Settings','mantra') , 'cryout_section_graphics_fn', __FILE__);
+ add_settings_section('post_section', __('Post Information Settings','mantra') , 'cryout_section_post_fn', __FILE__);
+ add_settings_section('excerpt_section', __('Post Excerpt Settings','mantra') , 'cryout_section_excerpt_fn', __FILE__);
+ add_settings_section('featured_section', __('Featured Image Settings','mantra') , 'cryout_section_featured_fn', __FILE__);
+ add_settings_section('socials_section', __('Social Media Settings','mantra') , 'cryout_section_social_fn', __FILE__);
+ add_settings_section('misc_section', __('Miscellaneous Settings','mantra') , 'cryout_section_misc_fn', __FILE__);
+
+/*** layout ***/
+ add_settings_field('mantra_side', __('Main Layout','mantra') , 'cryout_setting_side_fn', __FILE__, 'layout_section');
+ add_settings_field('mantra_sidewidth', __('Content / Sidebar Width','mantra') , 'cryout_setting_sidewidth_fn', __FILE__, 'layout_section');
+ add_settings_field('mantra_mobile', __('Responsiveness','mantra') , 'cryout_setting_mobile_fn', __FILE__, 'layout_section');
+/*** presentation ***/
+
+ add_settings_field('mantra_frontpage', __('Enable Presentation Page','mantra') , 'cryout_setting_frontpage_fn', __FILE__, 'presentation_section');
+ add_settings_field('mantra_frontposts', __('Show Posts on Presentation Page','mantra') , 'cryout_setting_frontposts_fn', __FILE__, 'presentation_section');
+ add_settings_field('mantra_frontslider', __('Slider Settings','mantra') , 'cryout_setting_frontslider_fn', __FILE__, 'presentation_section');
+ add_settings_field('mantra_frontslider2', __('Slides','mantra') , 'cryout_setting_frontslider2_fn', __FILE__, 'presentation_section');
+ add_settings_field('mantra_frontcolumns', __('Presentation Page Columns','mantra') , 'cryout_setting_frontcolumns_fn', __FILE__, 'presentation_section');
+ add_settings_field('mantra_fronttext', __('Extras','mantra') , 'cryout_setting_fronttext_fn', __FILE__, 'presentation_section');
+
+/*** header ***/
+ add_settings_field('mantra_hheight', __('Header Height','mantra') , 'cryout_setting_hheight_fn', __FILE__, 'header_section');
+ add_settings_field('mantra_himage', __('Header Image','mantra') , 'cryout_setting_himage_fn', __FILE__, 'header_section');
+ add_settings_field('mantra_siteheader', __('Site Header','mantra') , 'cryout_setting_siteheader_fn', __FILE__, 'header_section');
+ add_settings_field('mantra_logoupload', __('Custom Logo Upload','mantra') , 'cryout_setting_logoupload_fn', __FILE__, 'header_section');
+ add_settings_field('mantra_headermargin', __('Header Spacing','mantra') , 'cryout_setting_headermargin_fn', __FILE__, 'header_section');
+ add_settings_field('mantra_menurounded', __('Rounded Menu Corners','mantra') , 'cryout_setting_menurounded_fn', __FILE__, 'header_section');
+ add_settings_field('mantra_favicon', __('FavIcon Upload','mantra') , 'cryout_setting_favicon_fn', __FILE__, 'header_section');
+/*** text ***/
+ add_settings_field('mantra_fontfamily', __('General Font','mantra') , 'cryout_setting_fontfamily_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_fontsize', __('General Font Size','mantra') , 'cryout_setting_fontsize_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_fonttitle', __('Post Title Font ','mantra') , 'cryout_setting_fonttitle_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_headfontsize', __('Post Title Font Size','mantra') , 'cryout_setting_headfontsize_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_fontside', __('Sidebar Font','mantra') , 'cryout_setting_fontside_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_sidefontsize', __('SideBar Font Size','mantra') , 'cryout_setting_sidefontsize_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_fontsubheader', __('Headings Font','mantra') , 'cryout_setting_fontsubheader_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_textalign', __('Force Text Align','mantra') , 'cryout_setting_textalign_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_parmargin', __('Paragraph spacing','mantra') , 'cryout_setting_parmargin_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_parindent', __('Paragraph indent','mantra') , 'cryout_setting_parindent_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_headerindent', __('Header indent','mantra') , 'cryout_setting_headerindent_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_lineheight', __('Line Height','mantra') , 'cryout_setting_lineheight_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_wordspace', __('Word spacing','mantra') , 'cryout_setting_wordspace_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_letterspace', __('Letter spacing','mantra') , 'cryout_setting_letterspace_fn', __FILE__, 'text_section');
+ add_settings_field('mantra_textshadow', __('Text shadow','mantra') , 'cryout_setting_textshadow_fn', __FILE__, 'text_section');
+/*** appereance ***/
+ add_settings_field('mantra_sitebackground', __('Background Image','mantra') , 'cryout_setting_sitebackground_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_backcolor', __('Background Color','mantra') , 'cryout_setting_backcolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_headercolor', __('Header (Banner and Menu) Background Color','mantra') , 'cryout_setting_headercolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_contentbg', __('Content Background Color','mantra') , 'cryout_setting_contentbg_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_menubg', __('Menu Items Background Color','mantra') , 'cryout_setting_menubg_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_s1bg', __('First Sidebar Background Color','mantra') , 'cryout_setting_first_sidebar_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_s2bg', __('Second Sidebar Background Color','mantra') , 'cryout_setting_second_sidebar_fn', __FILE__, 'appereance_section');
+
+ add_settings_field('mantra_titlecolor', __('Site Title Color','mantra') , 'cryout_setting_titlecolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_descriptioncolor', __('Site Description Color','mantra') , 'cryout_setting_descriptioncolor_fn', __FILE__, 'appereance_section');
+
+ add_settings_field('mantra_contentcolor', __('Content Text Color','mantra') , 'cryout_setting_contentcolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_linkscolor', __('Links Color','mantra') , 'cryout_setting_linkscolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_hovercolor', __('Links Hover Color','mantra') , 'cryout_setting_hovercolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_headtextcolor',__( 'Post Title Color','mantra') , 'cryout_setting_headtextcolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_headtexthover', __('Post Title Hover Color','mantra') , 'cryout_setting_headtexthover_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_sideheadbackcolor', __('Sidebar Header Background Color','mantra') , 'cryout_setting_sideheadbackcolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_sideheadtextcolor', __('Sidebar Header Text Color','mantra') , 'cryout_setting_sideheadtextcolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_prefootercolor', __('Footer Widget Background Color','mantra') , 'cryout_setting_prefootercolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_footercolor', __('Footer Background Color','mantra') , 'cryout_setting_footercolor_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_footerheader', __('Footer Widget Header Text Color','mantra') , 'cryout_setting_footerheader_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_footertext', __('Footer Widget Link Color','mantra') , 'cryout_setting_footertext_fn', __FILE__, 'appereance_section');
+ add_settings_field('mantra_footerhover', __('Footer Widget Hover Color','mantra') , 'cryout_setting_footerhover_fn', __FILE__, 'appereance_section');
+/*** graphics ***/
+ add_settings_field('mantra_breadcrumbs', __('Breadcrumbs','mantra') , 'cryout_setting_breadcrumbs_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_pagination', __('Pagination','mantra') , 'cryout_setting_pagination_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_menualign', __('Main Menu Alignment','mantra') , 'cryout_setting_menualign_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_image', __('Post Images Border','mantra') , 'cryout_setting_image_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_caption', __('Caption Border','mantra') , 'cryout_setting_caption_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_pin', __('Caption Pin','mantra') , 'cryout_setting_pin_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_sidebullet', __('Sidebar Menu Bullets','mantra') , 'cryout_setting_sidebullet_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_metaback', __('Meta Area Background','mantra') , 'cryout_setting_metaback_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_postseparator', __('Post Separator','mantra') , 'cryout_setting_postseparator_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_contentlist', __('Content List Bullets','mantra') , 'cryout_setting_contentlist_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_pagetitle', __('Page Titles','mantra') , 'cryout_setting_pagetitle_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_categetitle', __('Category Page Titles','mantra') , 'cryout_setting_categtitle_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_tables', __('Hide Tables','mantra') , 'cryout_setting_tables_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_backtop', __('Back to Top button','mantra') , 'cryout_setting_backtop_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_comtext', __('Text Under Comments','mantra') , 'cryout_setting_comtext_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_comclosed', __('Comments are closed text','mantra') , 'cryout_setting_comclosed_fn', __FILE__, 'graphics_section');
+ add_settings_field('mantra_comoff', __('Comments off','mantra') , 'cryout_setting_comoff_fn', __FILE__, 'graphics_section');
+/*** post metas***/
+ add_settings_field('mantra_postcomlink', __('Post Comments Link','mantra') , 'cryout_setting_postcomlink_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_postdate', __('Post Date','mantra') , 'cryout_setting_postdate_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_posttime', __('Post Time','mantra') , 'cryout_setting_posttime_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_postauthor', __('Post Author','mantra') , 'cryout_setting_postauthor_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_postcateg', __('Post Category','mantra') , 'cryout_setting_postcateg_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_postmetas', __('Meta Bar','mantra') , 'cryout_setting_postmetas_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_posttag', __('Post Tags','mantra') , 'cryout_setting_posttag_fn', __FILE__, 'post_section');
+ add_settings_field('mantra_postbook', __('Post Permalink','mantra') , 'cryout_setting_postbook_fn', __FILE__, 'post_section');
+/*** post exceprts***/
+ add_settings_field('mantra_excerpthome', __('Post Excerpts on Home Page','mantra') , 'cryout_setting_excerpthome_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_excerptsticky', __('Affect Sticky Posts','mantra') , 'cryout_setting_excerptsticky_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_excerptarchive', __('Post Excerpts on Archive and Category Pages','mantra') , 'cryout_setting_excerptarchive_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_excerptwords', __('Number of Words for Post Excerpts ','mantra') , 'cryout_setting_excerptwords_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_magazinelayout', __('Magazine Layout','mantra') , 'cryout_setting_magazinelayout_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_excerptdots', __('Excerpt suffix','mantra') , 'cryout_setting_excerptdots_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_excerptcont', __('Continue reading link text ','mantra') , 'cryout_setting_excerptcont_fn', __FILE__, 'excerpt_section');
+ add_settings_field('mantra_excerpttags', __('HTML tags in Excerpts','mantra') , 'cryout_setting_excerpttags_fn', __FILE__, 'excerpt_section');
+/*** featured ***/
+ add_settings_field('mantra_fpost', __('Featured Images as POST Thumbnails ','mantra') , 'cryout_setting_fpost_fn', __FILE__, 'featured_section');
+ add_settings_field('mantra_fauto', __('Auto Select Images From Posts ','mantra') , 'cryout_setting_fauto_fn', __FILE__, 'featured_section');
+ add_settings_field('mantra_falign', __('Thumbnails Alignment ','mantra') , 'cryout_setting_falign_fn', __FILE__, 'featured_section');
+ add_settings_field('mantra_fsize', __('Thumbnails Size ','mantra') , 'cryout_setting_fsize_fn', __FILE__, 'featured_section');
+ add_settings_field('mantra_fheader', __('Featured Images as HEADER Images ','mantra') , 'cryout_setting_fheader_fn', __FILE__, 'featured_section');
+/*** socials ***/
+ add_settings_field('mantra_socials1', __('Link nr. 1','mantra') , 'cryout_setting_socials1_fn', __FILE__, 'socials_section');
+ add_settings_field('mantra_socials2', __('Link nr. 2','mantra') , 'cryout_setting_socials2_fn', __FILE__, 'socials_section');
+ add_settings_field('mantra_socials3', __('Link nr. 3','mantra') , 'cryout_setting_socials3_fn', __FILE__, 'socials_section');
+ add_settings_field('mantra_socials4', __('Link nr. 4','mantra') , 'cryout_setting_socials4_fn', __FILE__, 'socials_section');
+ add_settings_field('mantra_socials5', __('Link nr. 5','mantra') , 'cryout_setting_socials5_fn', __FILE__, 'socials_section');
+ add_settings_field('mantra_socialshow', __('Socials display','mantra') , 'cryout_setting_socialsdisplay_fn', __FILE__, 'socials_section');
+/*** misc ***/
+ add_settings_field('mantra_seo', __('SEO Settings','mantra') , 'cryout_setting_seo_fn', __FILE__, 'misc_section');
+ add_settings_field('mantra_copyright', __('Custom Footer Text','mantra') , 'cryout_setting_copyright_fn', __FILE__, 'misc_section');
+ add_settings_field('mantra_customcss', __('Custom CSS','mantra') , 'cryout_setting_customcss_fn', __FILE__, 'misc_section');
+ add_settings_field('mantra_customjs', __('Custom JavaScript','mantra') , 'cryout_setting_customjs_fn', __FILE__, 'misc_section');
+}
+
+ // Display the admin options page
+function mantra_page_fn() {
+ // Load the import form page if the import button has been pressed
+ if (isset($_POST['mantra_import'])) {
+ mantra_import_form();
+ return;
+ }
+ // Load the import form page after upload button has been pressed
+ if (isset($_POST['mantra_import_confirmed'])) {
+ mantra_import_file();
+ return;
+ }
+
+ if (!current_user_can('edit_theme_options')) {
+ wp_die( __('Sorry, but you do not have sufficient permissions to access this page.','mantra') );
+ }?>
+
+
+<div class="wrap"><!-- Admin wrap page -->
+
+<div id="lefty"><!-- Left side of page - the options area -->
+ <div>
+<div id="admin_header"><img src="<?php echo get_template_directory_uri() . '/admin/images/mantra-logo.png' ?>" /> </div>
+
+<div id="admin_links">
+ <a target="_blank" href="http://www.cryoutcreations.eu/mantra">Mantra Homepage</a>
+ <a target="_blank" href="http://www.cryoutcreations.eu/forum">Support</a>
+ <a target="_blank" href="http://www.cryoutcreations.eu">Cryout Creations</a>
+</div>
+ <div style="clear: both;"></div>
+</div>
+<div id="jsAlert" class="error" style="padding:5px 10px;">If this message remains visible after the page has loaded then there is a problem with your WordPress jQuery library. This can have several causes, including incompatible plugins.<br> The Mantra Settings page cannot function without jQuery. You need to fix this issue before you can configure Mantra.</div>
+<?php if ( isset( $_GET['settings-updated'] ) ) {
+ echo "<div class='updated fade' style='clear:left;'><p>";
+ echo _e('Mantra settings updated successfully.','mantra');
+ echo "</p></div>";
+} ?>
+
+ <div id="main-options">
+ <form name="mantra_form" action="options.php" method="post" enctype="multipart/form-data">
+ <div id="accordion">
+ <?php settings_fields('ma_options'); ?>
+ <?php do_settings_sections(__FILE__); ?>
+ </div>
+ <div id="submitDiv">
+ <br>
+ <input class="button" name="ma_options[mantra_submit]" type="submit" style="float:right;" value="<?php _e('Save Changes','mantra'); ?>" />
+ <input class="button" name="ma_options[mantra_defaults]" id="mantra_defaults" type="submit" style="float:left;" value="<?php _e('Reset to Defaults','mantra'); ?>" />
+ </div>
+ </form>
+ <?php $mantra_theme_data = get_transient( 'mantra_theme_info'); ?>
+ <span id="version">
+ Mantra v <?php echo MANTRA_VERSION; ?> by <a href="http://www.cryoutcreations.eu" target="_blank">Cryout Creations</a>
+ </span>
+ </div><!-- main-options -->
+</div><!--lefty -->
+
+
+<div id="righty" ><!-- Right side of page - Coffee, RSS tips and others -->
+ <div class="postbox donate">
+ <h3 class="hndle"> Coffee Break </h3>
+ <div class="inside"><?php echo "<p>Here at Cryout Creations (the developers of yours truly Mantra Theme), we spend night after night improving the Mantra Theme. We fix a lot of bugs (that we previously created); we add more and more customization options while also trying to keep things as simple as possible; then... we might play a game or two but rest assured that we return to read and (in most cases) reply to your late night emails and comments, take notes and draw dashboards of things to implement in future versions.</p>
+ <p>So you might ask yourselves: <i>How do they do it? How can they keep so fresh after all that hard labor for that darned theme? </i> Well folks, it's simple. We drink coffee. Industrial quantities of hot boiling coffee. We love it! So if you want to help with the further development of the Mantra Theme...</p>"; ?>
+ <div style="display:block;float:none;margin:0 auto;text-align:center;">
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYB6t4g8WkJ5qwckdcHRKES3Ix+MBMSRbUgkzMnO6B+ynKXEuDkNPsQ1WzC48YDtegeKk+UgR+PbsMg8c5JTpz3NwwOus3CJQRS7hVuZwhWWGU2AYgYff9zE0D4AtymmA1sCWAneI4HmKJ8uYDX9sQes46PC5gJykiChbI3A9Lk90DELMAkGBSsOAwIaBQAwgcwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQINfugE9rcRE6AgaiT+Rt+4rKFBHUClxMWacpSO3ncnbXrPi9IP+nX6D1KtZM3rPGuAV/r7aOkMeeA4lZMoluo+oqpKFSiheLfzxJoGyOy157fodhiDbByUyhPwMYAmruw1nHpdG3OaRMMseKgsF9XpzC8Zy25vxmUHfK5yoM++9weqIivrHzITOAWB836ld1Og/CKHEbz3kOwvkBIXcZN55atVeTAx1f2sceSN4ySw6ofQtOgggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMzA2MTcxMDUwMTdaMCMGCSqGSIb3DQEJBDEWBBRziaGZd05x/anpxTJypCrQLy34PDANBgkqhkiG9w0BAQEFAASBgGEGJ2bSXcAk+BjFAw/JB6piIwJrt1i2sVd8/NfXsWBDhrfLpJPX/ipMEh5e7EG2K0QRFB5w5uCy4Lz1PYW7VFPGq9snsqyqqfMrq9oXQ/yPqF91R3kE6lnSdnYmHOrazDFwrN1aaxO3boVOKSf+xaY/y2+oXHgdw7nDghgk7kdn-----END PKCS7-----
+">
+<input type="image" src="<?php echo get_template_directory_uri() . '/admin/images/coffee.png' ?>" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
+</form>
+
+ </div>
+ </div><!-- inside -->
+ </div><!-- donate -->
+
+ <div class="postbox export non-essential-option" style="overflow:hidden;">
+ <div class="head-wrap">
+ <div title="Click to toggle" class="handlediv"><br /></div>
+ <h3 class="hndle"><?php _e( 'Import/Export Settings', 'mantra' ); ?></h3>
+ </div><!-- head-wrap -->
+ <div class="panel-wrap inside">
+ <form action="" method="post">
+ <?php wp_nonce_field('mantra-export', 'mantra-export'); ?>
+ <input type="hidden" name="mantra_export" value="true" />
+ <input type="submit" class="button" value="<?php _e('Export Theme options', 'mantra'); ?>" />
+ <p style="display:block;float:left;clear:left;margin-top:0;"><?php _e("It's that easy: a mouse click away - the ability to export your Mantra settings and save them on your computer. Feeling safer? You should!","mantra"); ?></p>
+ </form>
+ <br />
+ <form action="" method="post">
+ <input type="hidden" name="mantra_import" value="true" />
+ <input type="submit" class="button" value="<?php _e('Import Theme options', 'mantra'); ?>" />
+ <p style="display:block;float:left;clear:left;margin-top:0;"><?php _e(" Without the import, the export would just be a fool's exercise. Make sure you have the exported file ready and see you after the mouse click.","mantra"); ?></p>
+ </form>
+ </div><!-- inside -->
+ </div><!-- export -->
+
+
+ <div class="postbox news" >
+ <div>
+ <h3 class="hndle"><?php _e( 'Mantra Latest News', 'mantra' ); ?></h3>
+ </div>
+ <div class="panel-wrap inside" style="height:200px;overflow:auto;">
+ <?php
+ $mantra_news = fetch_feed( array( 'http://www.cryoutcreations.eu/cat/mantra/feed') );
+ if ( ! is_wp_error( $mantra_news ) ) {
+ $maxitems = $mantra_news->get_item_quantity( 10 );
+ $news_items = $mantra_news->get_items( 0, $maxitems );
+ }
+ ?>
+ <ul class="news-list">
+ <?php if ( $maxitems == 0 ) : echo '<li>' . __( 'No news items.', 'mantra' ) . '</li>'; else :
+ foreach( $news_items as $news_item ) : ?>
+ <li>
+ <a class="news-header" href='<?php echo esc_url( $news_item->get_permalink() ); ?>'><?php echo esc_html( $news_item->get_title() ); ?></a><br />
+ <span class="news-item-date"><?php _e('Posted on','mantra');echo $news_item->get_date(' j F Y, H:i'); ?></span><br />
+ <?php echo mantra_truncate_words(strip_tags( $news_item->get_description() ),40,'...') ; ?>
+ <br><a class="news-read" href='<?php echo esc_url( $news_item->get_permalink() ); ?>'>Read more &raquo;</a>
+ </li>
+ <?php endforeach; endif; ?>
+ </ul>
+ </div><!-- inside -->
+ </div><!-- news -->
+
+
+</div><!-- righty -->
+</div><!-- wrap -->
+
+<script>
+
+function startfarb(a,b) {
+ jQuery(b).css('display','none');
+ jQuery(b).farbtastic(a);
+
+ jQuery(a).click(function() {
+ if(jQuery(b).css('display') == 'none') {
+ jQuery(b).parents('div:eq(0)').addClass('ui-accordion-content-overflow');
+ jQuery(b).css('display','inline-block').hide().show(300);
+ }
+ });
+
+ jQuery(document).mousedown( function() {
+ jQuery(b).hide(700, function(){ jQuery(b).parents('div:eq(0)').removeClass('ui-accordion-content-overflow'); });
+ // todo: find a better way to remove class after the fade on IEs
+ });
+}
+
+function tooltip_terain() {
+jQuery('#accordion small').parent('div').append('<a class="tooltip"><img src="<?php echo get_template_directory_uri(); ?>/images/icon-tooltip.png" /></a>').
+ each(function() {
+ //jQuery(this).children('a.tooltip').attr('title',jQuery(this).children('small').html() );
+ var tooltip_info = jQuery(this).children('small').html();
+ jQuery(this).children('.tooltip').tooltip({content : tooltip_info});
+ jQuery(this).children('.tooltip').tooltip( "option", "items", "a" );
+ //jQuery(this).children('.tooltip').tooltip( "option", "show", "false");
+ jQuery(this).children('.tooltip').tooltip( "option", "hide", "false");
+ jQuery(this).children('small').remove();
+ if (!jQuery(this).hasClass('slmini') && !jQuery(this).hasClass('slidercontent') && !jQuery(this).hasClass('slideDivs')) jQuery(this).addClass('tooltip_div');
+ });
+}
+
+function coloursel(el){
+ var id = "#"+jQuery(el).attr('id');
+ jQuery(id+"2").hide();
+ var bgcolor = jQuery(id).val();
+ if (bgcolor <= "#666666") { jQuery(id).css('color','#ffffff'); } else { jQuery(id).css('color','#000000'); };
+ jQuery(id).css('background-color',jQuery(id).val());
+}
+
+function vercomp(ver, req) {
+ var v = ver.split('.');
+ var q = req.split('.');
+ for (var i = 0; i < v.length; ++i) {
+ if (q.length == i) { return true; } // v is bigger
+ if (parseInt(v[i]) == parseInt(q[i])) { continue; } // nothing to do here, move along
+ else if (parseInt(v[i]) > parseInt(q[i])) { return true; } // v is bigger
+ else { return false; } // q is bigger
+ }
+ if (v.length != q.length) { return false; } // q is bigger
+ return true; // v = q;
+}
+
+jQuery(document).ready(function(){
+ //var _jQueryVer = parseFloat('.'+jQuery().jquery.replace(/\./g, '')); // jQuery version as float, eg: 0.183
+ //var _jQueryUIVer = parseFloat('.'+jQuery.ui.version.replace(/\./g, '')); // jQuery UI version as float, eg: 0.192
+ //if (_jQueryUIVer >= 0.190) {
+ if (vercomp(jQuery.ui.version,"1.9.0")) {
+ // tooltip function is included since jQuery UI 1.9.0
+ tooltip_terain();
+ startfarb("#mantra_backcolor","#mantra_backcolor2");
+ startfarb("#mantra_headercolor","#mantra_headercolor2");
+ startfarb("#mantra_contentbg","#mantra_contentbg2");
+ startfarb("#mantra_menubg","#mantra_menubg2");
+ startfarb("#mantra_s1bg","#mantra_s1bg2");
+ startfarb("#mantra_s2bg","#mantra_s2bg2");
+ startfarb("#mantra_prefootercolor","#mantra_prefootercolor2");
+ startfarb("#mantra_footercolor","#mantra_footercolor2");
+ startfarb("#mantra_titlecolor","#mantra_titlecolor2");
+ startfarb("#mantra_descriptioncolor","#mantra_descriptioncolor2");
+ startfarb("#mantra_contentcolor","#mantra_contentcolor2");
+ startfarb("#mantra_linkscolor","#mantra_linkscolor2");
+ startfarb("#mantra_hovercolor","#mantra_hovercolor2");
+ startfarb("#mantra_headtextcolor","#mantra_headtextcolor2");
+ startfarb("#mantra_headtexthover","#mantra_headtexthover2");
+ startfarb("#mantra_sideheadbackcolor","#mantra_sideheadbackcolor2");
+ startfarb("#mantra_sideheadtextcolor","#mantra_sideheadtextcolor2");
+ startfarb("#mantra_footerheader","#mantra_footerheader2");
+ startfarb("#mantra_footertext","#mantra_footertext2");
+ startfarb("#mantra_footerhover","#mantra_footerhover2");
+ startfarb("#mantra_fpsliderbordercolor","#mantra_fpsliderbordercolor2");
+ startfarb("#mantra_fronttitlecolor","#mantra_fronttitlecolor2");
+ } else {
+ jQuery("#mantra_backcolor").addClass('colorthingy');
+ jQuery("#mantra_headercolor").addClass('colorthingy');
+ jQuery("#mantra_contentbg").addClass('colorthingy');
+ jQuery("#mantra_menubg").addClass('colorthingy');
+ jQuery("#mantra_s1bg").addClass('colorthingy');
+ jQuery("#mantra_s2bg").addClass('colorthingy');
+ jQuery("#mantra_prefootercolor").addClass('colorthingy');
+ jQuery("#mantra_footercolor").addClass('colorthingy');
+ jQuery("#mantra_titlecolor").addClass('colorthingy');
+ jQuery("#mantra_descriptioncolor").addClass('colorthingy');
+ jQuery("#mantra_contentcolor").addClass('colorthingy');
+ jQuery("#mantra_linkscolor").addClass('colorthingy');
+ jQuery("#mantra_hovercolor").addClass('colorthingy');
+ jQuery("#mantra_headtextcolor").addClass('colorthingy');
+ jQuery("#mantra_sideheadbackcolor").addClass('colorthingy');
+ jQuery("#mantra_sideheadtextcolor").addClass('colorthingy');
+ jQuery("#mantra_footerheader").addClass('colorthingy');
+ jQuery("#mantra_footertext").addClass('colorthingy');
+ jQuery("#mantra_headtexthover").addClass('colorthingy');
+ jQuery("#mantra_footerhover").addClass('colorthingy');
+ jQuery("#mantra_fpsliderbordercolor").addClass('colorthingy');
+ jQuery("#mantra_fronttitlecolor").addClass('colorthingy');
+ jQuery('.colorthingy').each(function(){
+ id = "#"+jQuery(this).attr('id');
+ jQuery(this).on('keyup',function(){coloursel(this)});
+ coloursel(this);
+ });
+ // inform the user about the old partially unsupported version
+ jQuery("#jsAlert").after("<div class='updated fade' style='clear:left; font-size: 16px;'><p>Mantra has detected you are running an old version of Wordpress (jQuery) and will be running in compatibility mode. Some features may not work correctly. Consider updating your Wordpress to the latest version.</p></div>");
+ }
+
+});
+
+jQuery('#jsAlert').hide();
+</script>
+
+<?php } // mantra_page_fn()
+?>
diff --git a/themes/mantra/admin/sanitize.php b/themes/mantra/admin/sanitize.php
new file mode 100644
index 00000000..30ed0b67
--- /dev/null
+++ b/themes/mantra/admin/sanitize.php
@@ -0,0 +1,237 @@
+<?php
+
+/*
+ *
+ * Settings arrays
+ *
+ */
+
+/* Font family arrays */
+
+ $fontSans = array("Segoe UI, Arial, sans-serif",
+ "Verdana, Geneva, sans-serif " ,
+ "Geneva, sans-serif ",
+ "Helvetica Neue, Arial, Helvetica, sans-serif",
+ "Helvetica, sans-serif" ,
+ "Century Gothic, AppleGothic, sans-serif",
+ "Futura, Century Gothic, AppleGothic, sans-serif",
+ "Calibri, Arian, sans-serif",
+ "Myriad Pro, Myriad,Arial, sans-serif",
+ "Trebuchet MS, Arial, Helvetica, sans-serif" ,
+ "Gill Sans, Calibri, Trebuchet MS, sans-serif",
+ "Impact, Haettenschweiler, Arial Narrow Bold, sans-serif ",
+ "Tahoma, Geneva, sans-serif" ,
+ "Arial, Helvetica, sans-serif" ,
+ "Arial Black, Gadget, sans-serif",
+ "Lucida Sans Unicode, Lucida Grande, sans-serif ");
+
+ $fontSerif = array("Georgia, Times New Roman, Times, serif" ,
+ "Times New Roman, Times, serif",
+ "Cambria, Georgia, Times, Times New Roman, serif",
+ "Palatino Linotype, Book Antiqua, Palatino, serif",
+ "Book Antiqua, Palatino, serif",
+ "Palatino, serif",
+ "Baskerville, Times New Roman, Times, serif",
+ "Bodoni MT, serif",
+ "Copperplate Light, Copperplate Gothic Light, serif",
+ "Garamond, Times New Roman, Times, serif");
+
+ $fontMono = array( "Courier New, Courier, monospace" ,
+ "Lucida Console, Monaco, monospace",
+ "Consolas, Lucida Console, Monaco, monospace",
+ "Monaco, monospace");
+
+ $fontCursive = array( "Lucida Casual, Comic Sans MS , cursive ",
+ "Brush Script MT,Phyllis,Lucida Handwriting,cursive",
+ "Phyllis,Lucida Handwriting,cursive",
+ "Lucida Handwriting,cursive",
+ "Comic Sans MS, cursive");
+
+/* Social media links */
+
+ $socialNetworks = array ("Amazon", "Delicious", "DeviantArt", "Digg", "Etsy", "Facebook", "Flickr", "Google", "GoodReads", "GooglePlus",
+ "IMDb", "Instagram", "LastFM", "LinkedIn", "Mail", "MySpace", "Picasa", "Pinterest", "Reddit", "RSS", "Skype",
+ "SoundCloud", "StumbleUpon", "Technorati", "Tumblr", "Twitch", "Twitter", "Vimeo", "VK", "WordPress",
+ "Xing", "Yahoo", "Yelp", "YouTube" );
+
+
+
+
+if (!function_exists ('ma_options_validate') ) :
+/*
+ *
+ * Validate user data
+ *
+ */
+function ma_options_validate($input) {
+global $mantra_defaults;
+ // Sanitize the texbox input
+
+/*** 1 ***/
+ if(isset($input['mantra_sidewidth']) && is_numeric($input['mantra_sidewidth']) && $input['mantra_sidewidth']>=500 && $input['mantra_sidewidth'] <=1760) {} else {$input['mantra_sidewidth']=$mantra_defaults['mantra_sidewidth']; }
+ if(isset($input['mantra_sidebar']) && is_numeric($input['mantra_sidebar']) && $input['mantra_sidebar']>=220 && $input['mantra_sidebar'] <=800) {} else {$input['mantra_sidebar']=$mantra_defaults['mantra_sidebar']; }
+
+ if(isset($input['mantra_sidewidthRel']) && is_numeric($input['mantra_sidewidthRel']) && $input['mantra_sidewidthRel']>=40 && $input['mantra_sidewidthRel'] <=80) {} else {$input['mantra_sidewidthRel']=$mantra_defaults['mantra_sidewidthRel']; }
+ if(isset($input['mantra_sidebarRel']) && is_numeric($input['mantra_sidebarRel']) && $input['mantra_sidebarRel']>=20 && $input['mantra_sidebarRel'] <=50) {} else {$input['mantra_sidebarRel']=$mantra_defaults['mantra_sidebarRel']; }
+
+
+ $input['mantra_hheight'] = intval(wp_kses_data($input['mantra_hheight']));
+
+ $input['mantra_copyright'] = trim(wp_kses_post($input['mantra_copyright']));
+
+ $input['mantra_backcolor'] = wp_kses_data($input['mantra_backcolor']);
+ $input['mantra_headercolor'] = wp_kses_data($input['mantra_headercolor']);
+ $input['mantra_contentbg'] = wp_kses_data($input['mantra_contentbg']);
+ $input['mantra_menubg'] = wp_kses_data($input['mantra_menubg']);
+ $input['mantra_s1bg'] = wp_kses_data($input['mantra_s1bg']);
+ $input['mantra_s2bg'] = wp_kses_data($input['mantra_s2bg']);
+ $input['mantra_prefootercolor'] = wp_kses_data($input['mantra_prefootercolor']);
+ $input['mantra_footercolor'] = wp_kses_data($input['mantra_footercolor']);
+ $input['mantra_titlecolor'] = wp_kses_data($input['mantra_titlecolor']);
+ $input['mantra_descriptioncolor'] = wp_kses_data($input['mantra_descriptioncolor']);
+ $input['mantra_contentcolor'] = wp_kses_data($input['mantra_contentcolor']);
+ $input['mantra_linkscolor'] = wp_kses_data($input['mantra_linkscolor']);
+ $input['mantra_hovercolor'] = wp_kses_data($input['mantra_hovercolor']);
+ $input['mantra_headtextcolor'] = wp_kses_data($input['mantra_headtextcolor']);
+ $input['mantra_headtexthover'] = wp_kses_data($input['mantra_headtexthover']);
+ $input['mantra_sideheadbackcolor'] = wp_kses_data($input['mantra_sideheadbackcolor']);
+ $input['mantra_sideheadtextcolor'] = wp_kses_data($input['mantra_sideheadtextcolor']);
+ $input['mantra_footerheader'] = wp_kses_data($input['mantra_footerheader']);
+ $input['mantra_footertext'] = wp_kses_data($input['mantra_footertext']);
+ $input['mantra_footerhover'] = wp_kses_data($input['mantra_footerhover']);
+
+ $input['mantra_excerptwords'] = intval(wp_kses_data($input['mantra_excerptwords']));
+ $input['mantra_excerptdots'] = wp_kses_data($input['mantra_excerptdots']);
+ $input['mantra_excerptcont'] = wp_kses_data($input['mantra_excerptcont']);
+
+ $input['mantra_fwidth'] = intval(wp_kses_data($input['mantra_fwidth']));
+ $input['mantra_fheight'] = intval(wp_kses_data($input['mantra_fheight']));
+
+/*** 2 ***/
+
+ $cryout_special_terms = array('mailto:','callto://');
+ $cryout_special_keys = array('Mail', 'Skype');
+ for ($i=1;$i<10;$i+=2) {
+ $j=$i+1;
+
+ if (in_array($input['mantra_social'.$i],$cryout_special_keys)) :
+ $input['mantra_social'.$j] = wp_kses_data(str_replace($cryout_special_terms,'',$input['mantra_social'.$j]));
+ if ($input['mantra_social'.$i]=='Mail') {$input['mantra_social'.$j]='mailto:'.$input['mantra_social'.$j];};
+ if ($input['mantra_social'.$i]=='Skype') {$input['mantra_social'.$j]='callto://'.$input['mantra_social'.$j];};
+ else :
+ $input['mantra_social'.$j] = esc_url_raw($input['mantra_social'.$j]);
+ endif;
+
+ }
+
+ $input['mantra_favicon'] = esc_url_raw($input['mantra_favicon']);
+ $input['mantra_logoupload'] = esc_url_raw($input['mantra_logoupload']);
+ $input['mantra_headermargintop'] = intval(wp_kses_data($input['mantra_headermargintop']));
+ $input['mantra_headermarginleft'] = intval(wp_kses_data($input['mantra_headermarginleft']));
+
+ $input['mantra_customcss'] = wp_kses_post(trim($input['mantra_customcss']));
+ $input['mantra_customjs'] = wp_kses_post(trim($input['mantra_customjs']));
+ $input['mantra_seo_home_desc'] = wp_kses_post(trim($input['mantra_seo_home_desc']));
+
+ $input['mantra_googlefont'] = trim(wp_kses_data($input['mantra_googlefont']));
+ $input['mantra_googlefonttitle'] = trim(wp_kses_data($input['mantra_googlefonttitle']));
+ $input['mantra_googlefontside'] = trim(wp_kses_data($input['mantra_googlefontside']));
+ $input['mantra_googlefontsubheader'] = trim(wp_kses_data($input['mantra_googlefontsubheader']));
+
+ if($input['mantra_googlefont']) {
+ $mantra_googlefont2 = $input['mantra_googlefont'];
+ $mantra_googlefont2= preg_replace( '/\s+/', '+', $mantra_googlefont2 );
+ $mantra_googlefont2= "http://fonts.googleapis.com/css?family=".$mantra_googlefont2;
+ }
+ if($input['mantra_googlefonttitle']) {
+ $mantra_googlefonttitle2 = $input['mantra_googlefonttitle'];
+ $mantra_googlefonttitle2= preg_replace( '/\s+/', '+', $mantra_googlefonttitle2 );
+ $mantra_googlefonttitle2= "http://fonts.googleapis.com/css?family=".$mantra_googlefonttitle2;
+ }
+ if($input['mantra_googlefontside']) {
+ $mantra_googlefontside2 = $input['mantra_googlefontside'];
+ $mantra_googlefontside2= preg_replace( '/\s+/', '+', $mantra_googlefontside2 );
+ $mantra_googlefontside2= "http://fonts.googleapis.com/css?family=".$mantra_googlefontside2;
+ }
+ if($input['mantra_googlefontsubheader']) {
+ $mantra_googlefontsubheader2 = $input['mantra_googlefontsubheader'];
+ $mantra_googlefontsubheader2= preg_replace( '/\s+/', '+', $mantra_googlefontsubheader2 );
+ $mantra_googlefontsubheader2= "http://fonts.googleapis.com/css?family=".$mantra_googlefontsubheader2;
+ }
+
+ $input['mantra_googlefont2'] = $mantra_googlefont2;
+ $input['mantra_googlefonttitle2'] = $mantra_googlefonttitle2;
+ $input['mantra_googlefontside2'] = $mantra_googlefontside2;
+ $input['mantra_googlefontsubheader2'] = $mantra_googlefontsubheader2;
+
+ $input['mantra_frontpostscount'] = intval(wp_kses_data($input['mantra_frontpostscount']));
+
+ $input['mantra_fpsliderborderwidth'] = intval(wp_kses_data($input['mantra_fpsliderborderwidth']));
+
+ $input['mantra_slideNumber'] = intval(wp_kses_data($input['mantra_slideNumber']));
+ $input['mantra_slideSpecific'] = wp_kses_data($input['mantra_slideSpecific']);
+
+ $input['mantra_fpsliderwidth'] = intval(wp_kses_data($input['mantra_fpsliderwidth']));
+ $input['mantra_fpsliderheight'] = intval(wp_kses_data($input['mantra_fpsliderheight']));
+
+/** 3 ***/
+ $input['mantra_sliderimg1'] = wp_kses_data($input['mantra_sliderimg1']);
+ $input['mantra_slidertitle1'] = wp_kses_data($input['mantra_slidertitle1']);
+ $input['mantra_slidertext1'] = wp_kses_post($input['mantra_slidertext1']);
+ $input['mantra_sliderlink1'] = esc_url_raw($input['mantra_sliderlink1']);
+ $input['mantra_sliderimg2'] = wp_kses_data($input['mantra_sliderimg2']);
+ $input['mantra_slidertitle2'] = wp_kses_data($input['mantra_slidertitle2']);
+ $input['mantra_slidertext2'] = wp_kses_post($input['mantra_slidertext2']);
+ $input['mantra_sliderlink2'] = esc_url_raw($input['mantra_sliderlink2']);
+ $input['mantra_sliderimg3'] = wp_kses_data($input['mantra_sliderimg3']);
+ $input['mantra_slidertitle3'] = wp_kses_data($input['mantra_slidertitle3']);
+ $input['mantra_slidertext3'] = wp_kses_post($input['mantra_slidertext3']);
+ $input['mantra_sliderlink3'] = esc_url_raw($input['mantra_sliderlink3']);
+ $input['mantra_sliderimg4'] = wp_kses_data($input['mantra_sliderimg4']);
+ $input['mantra_slidertitle4'] = wp_kses_data($input['mantra_slidertitle4']);
+ $input['mantra_slidertext4'] = wp_kses_post($input['mantra_slidertext4']);
+ $input['mantra_sliderlink4'] = esc_url_raw($input['mantra_sliderlink4']);
+ $input['mantra_sliderimg5'] = wp_kses_data($input['mantra_sliderimg5']);
+ $input['mantra_slidertitle5'] = wp_kses_data($input['mantra_slidertitle5']);
+ $input['mantra_slidertext5'] = wp_kses_post($input['mantra_slidertext5']);
+ $input['mantra_sliderlink5'] = esc_url_raw($input['mantra_sliderlink5']);
+
+ $input['mantra_colimageheight'] = intval(wp_kses_data($input['mantra_colimageheight']));
+
+/** 4 **/
+ $input['mantra_columnimg1'] = wp_kses_data($input['mantra_columnimg1']);
+ $input['mantra_columntitle1'] = wp_kses_data($input['mantra_columntitle1']);
+ $input['mantra_columntext1'] = wp_kses_post($input['mantra_columntext1']);
+ $input['mantra_columnlink1'] = esc_url_raw($input['mantra_columnlink1']);
+ $input['mantra_columnimg2'] = wp_kses_data($input['mantra_columnimg2']);
+ $input['mantra_columntitle2'] = wp_kses_data($input['mantra_columntitle2']);
+ $input['mantra_columntext2'] = wp_kses_post($input['mantra_columntext2']);
+ $input['mantra_columnlink2'] = esc_url_raw($input['mantra_columnlink2']);
+ $input['mantra_columnimg3'] = wp_kses_data($input['mantra_columnimg3']);
+ $input['mantra_columntitle3'] = wp_kses_data($input['mantra_columntitle3']);
+ $input['mantra_columntext3'] = wp_kses_post($input['mantra_columntext3']);
+ $input['mantra_columnlink3'] = esc_url_raw($input['mantra_columnlink3']);
+ $input['mantra_columnimg4'] = wp_kses_data($input['mantra_columnimg4']);
+ $input['mantra_columntitle4'] = wp_kses_data($input['mantra_columntitle4']);
+ $input['mantra_columntext4'] = wp_kses_post($input['mantra_columntext4']);
+ $input['mantra_columnlink4'] = esc_url_raw($input['mantra_columnlink4']);
+
+ $input['mantra_columnreadmore'] = wp_kses($input['mantra_columnreadmore'],'');
+
+ $input['mantra_fronttext1'] = wp_kses_data($input['mantra_fronttext1']);
+ $input['mantra_fronttext2'] = wp_kses_data($input['mantra_fronttext2']);
+ $input['mantra_fpsliderbordercolor'] = wp_kses_data($input['mantra_fpsliderbordercolor']);
+ $input['mantra_fronttitlecolor'] = wp_kses_data($input['mantra_fronttitlecolor']);
+ $input['mantra_fronttext3'] = trim( wp_kses_post($input['mantra_fronttext3']));
+ $input['mantra_fronttext4'] = trim (wp_kses_post($input['mantra_fronttext4']));
+
+ $resetDefault = ( ! empty( $input['mantra_defaults']) ? true : false );
+
+ if ($resetDefault) {$input=$mantra_defaults;}
+
+ return $input; // return validated input
+
+}
+
+endif;
+?>
diff --git a/themes/mantra/admin/settings.php b/themes/mantra/admin/settings.php
new file mode 100644
index 00000000..6d9d0fe2
--- /dev/null
+++ b/themes/mantra/admin/settings.php
@@ -0,0 +1,2105 @@
+<?php
+// Callback functions
+
+// General suboptions description
+
+function cryout_section_layout_fn() {
+
+// echo "<p>".__("Settings for adjusting your blog's layout.", "mantra")."</p>";
+}
+
+function cryout_section_presentation_fn() {
+
+// echo "<p>".__("Settings for adjusting your blog's layout.", "mantra")."</p>";
+}
+
+function cryout_section_header_fn() {
+
+// echo "<p>".__("Settings for adjusting your blog's layout.", "mantra")."</p>";
+}
+
+
+function cryout_section_text_fn() {
+ //echo "<p>".__("All text related customization options.", "mantra")."</p>";
+}
+
+function cryout_section_graphics_fn() {
+// echo "<p>".__("Settings for hiding or showing different graphics.", "mantra")."</p>";
+}
+
+function cryout_section_post_fn() {
+ //echo "<p>".__("Settings for hiding or showing different post tags.", "mantra")."</p>";
+}
+
+function cryout_section_excerpt_fn() {
+// echo "<p>".__("Settings for post excerpts", "mantra")."</p>";
+}
+
+function cryout_section_appereance_fn() {
+// echo "<p>".__("Set text and background colors.", "mantra")."</p>";
+}
+
+
+function cryout_section_featured_fn() {
+// echo "<p>".__("Insert the addreses for your social media. Leave blank if not the case.
+// Please type the whole address (including <i>http://</i> ) Example : <u>http://www.facebook.com</u>.", "mantra")."</p>";
+}
+
+function cryout_section_social_fn() {
+// echo "<p>".__("Insert the addreses for your social media. Leave blank if not the case.
+// Please type the whole address (including <i>http://</i> ) Example : <u>http://www.facebook.com</u>.", "mantra")."</p>";
+}
+
+function cryout_section_misc_fn() {
+
+}
+
+////////////////////////////////
+//// LAYOUT SETTINGS ///////////
+////////////////////////////////
+
+
+// RADIO-BUTTON - Name: ma_options[side]
+function cryout_setting_side_fn() {
+global $mantra_options;
+ $items = array("1c", "2cSr", "2cSl", "3cSr" , "3cSl", "3cSs");
+ $layout_text["1c"] = __("One column (no sidebars)","mantra");
+ $layout_text["2cSr"] = __("Two columns, sidebar on the right","mantra");
+ $layout_text["2cSl"] = __("Two columns, sidebar on the left","mantra");
+ $layout_text["3cSr"] = __("Three columns, sidebars on the right","mantra");
+ $layout_text["3cSl"] = __("Three columns, sidebars on the left","mantra");
+ $layout_text["3cSs"] = __("Three columns, one sidebar on each side","mantra");
+
+// For backward compatibility;
+ if ($mantra_options['mantra_side'] == 'Disable') $mantra_options['mantra_side'] = '1c';
+ if ($mantra_options['mantra_side'] == 'Right') $mantra_options['mantra_side'] = '2cSr';
+ if ($mantra_options['mantra_side'] == 'Left') $mantra_options['mantra_side'] = '2cSl';
+
+
+ foreach($items as $item) {
+
+ $checkedClass = ($mantra_options['mantra_side']==$item) ? ' checkedClass' : '';
+ echo "<label id='$item' class='layouts $checkedClass'><input ";
+ checked($mantra_options['mantra_side'],$item);
+ echo " value='$item' onClick=\"changeBorder('$item','layouts');\" name='ma_options[mantra_side]' type='radio' /><img title='$layout_text[$item]' src='".get_template_directory_uri()."/admin/images/".$item.".png'/></label>";
+ }
+ echo "<div><small>".__("Choose your layout. Possible options are: <br> No sidebar, a single sidebar on either left of right, two sidebars on either left or
+ right and two sidebars on each side.","mantra")."</small></div>";
+}
+
+ //SLIDER - Name: ma_options[sidewidth]
+function cryout_setting_sidewidth_fn()
+ {
+global $mantra_options;
+ $items = array ("Absolute" , "Relative");
+ $itemsare = array( __("Absolute","mantra"), __("Relative *DEPRECATED","mantra"));
+ echo __("Dimensions to use: ","mantra")." <select id='mantra_dimselect' name='ma_options[mantra_dimselect]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_dimselect'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+echo "</select>";
+?>
+<script>
+
+jQuery(document).ready(function() {
+
+ jQuery( "#slider-range" ).slider({
+ range: true,
+ step:10,
+ min: 0,
+ max: 1980,
+ values: [ <?php echo $mantra_options['mantra_sidewidth'] ?>, <?php echo ($mantra_options['mantra_sidewidth']+$mantra_options['mantra_sidebar']); ?> ],
+ slide: function( event, ui ) {
+ range=ui.values[ 1 ] - ui.values[ 0 ];
+ if (ui.values[ 0 ]<500) {ui.values[ 0 ]=500; return false;};
+ if( range<220 || range>800 ){ ui.values[ 1 ] = <?php echo $mantra_options['mantra_sidebar']+$mantra_options['mantra_sidewidth'];?>; return false; };
+ jQuery( "#mantra_sidewidth" ).val( ui.values[ 0 ] );
+ jQuery( "#mantra_sidebar" ).val( ui.values[ 1 ] - ui.values[ 0 ] );
+ jQuery( "#totalsize" ).html( ui.values[ 1 ]);
+ jQuery( "#contentsize" ).html( ui.values[ 0 ]);jQuery( "#barsize" ).html( ui.values[ 1 ]-ui.values[ 0 ]);
+ var percentage = parseInt( jQuery( "#slider-range .ui-slider-range" ).css('width') );
+ var leftwidth = parseInt(jQuery( "#slider-range .ui-slider-range" ).position().left );
+ jQuery( "#barb" ).css('left',-80+leftwidth+percentage/2+"px");
+ jQuery( "#contentb" ).css('left',-50+leftwidth/2+"px");
+ jQuery( "#totalb" ).css('left',-100+(percentage+leftwidth)/2+"px");
+ }
+ });
+
+ jQuery( "#mantra_sidewidth" ).val( <?php echo $mantra_options['mantra_sidewidth'];?> );
+ jQuery( "#mantra_sidebar" ).val( <?php echo $mantra_options['mantra_sidebar'];?> );
+ var percentage = <?php echo ($mantra_options['mantra_sidebar']/1980)*100;?> ;
+ var leftwidth = <?php echo ($mantra_options['mantra_sidewidth']/1980)*100;?> ;
+ jQuery( "#barb" ).css('left',-18+leftwidth+percentage/2+"%");
+ jQuery( "#contentb" ).css('left',-8+leftwidth/2+"%");
+ jQuery( "#totalb" ).css('left',-20+(percentage+leftwidth)/2+"%");
+
+});
+
+jQuery(function() {
+
+ jQuery( "#slider-rangeRel" ).slider({
+ range: true,
+ step:1,
+ min: 0,
+ max: 100,
+ values: [ <?php echo $mantra_options['mantra_sidewidthRel'] ?>, <?php echo ($mantra_options['mantra_sidewidthRel']+$mantra_options['mantra_sidebarRel']); ?> ],
+ slide: function( event, ui ) {
+ range=ui.values[ 1 ] - ui.values[ 0 ];
+ if (ui.values[ 0 ]<40) {ui.values[ 0 ]=40; return false;};
+ if( range<20 || range>50 ){ ui.values[ 1 ] = <?php echo $mantra_options['mantra_sidebarRel']+$mantra_options['mantra_sidewidthRel'];?>; return false; };
+ jQuery( "#mantra_sidewidthRel" ).val( ui.values[ 0 ] );
+ jQuery( "#mantra_sidebarRel" ).val( ui.values[ 1 ] - ui.values[ 0 ] );
+ jQuery( "#totalsizeRel" ).html( ui.values[ 1 ]);
+ jQuery( "#contentsizeRel" ).html( ui.values[ 0 ]);jQuery( "#barsizeRel" ).html( ui.values[ 1 ]-ui.values[ 0 ]);
+ var percentageRel = parseInt( jQuery( "#slider-rangeRel .ui-slider-range" ).css('width') );
+ var leftwidthRel = parseInt( jQuery( "#slider-rangeRel .ui-slider-range" ).position().left );
+ jQuery( "#barbRel" ).css('left',-80+leftwidthRel+percentageRel/2+"px");
+ jQuery( "#contentbRel" ).css('left',-50+leftwidthRel/2+"px");
+ jQuery( "#totalbRel" ).css('left',-100+(percentageRel+leftwidthRel)/2+"px");
+ }
+ });
+
+ jQuery( "#mantra_sidewidthRel" ).val( <?php echo $mantra_options['mantra_sidewidthRel'];?> );
+ jQuery( "#mantra_sidebarRel" ).val( <?php echo $mantra_options['mantra_sidebarRel'];?> );
+ var percentageRel = <?php echo $mantra_options['mantra_sidebarRel'];?> ;
+ var leftwidthRel = <?php echo $mantra_options['mantra_sidewidthRel'];?> ;
+ jQuery( "#barbRel" ).css('left',-18+leftwidthRel+percentageRel/2+"%");
+ jQuery( "#contentbRel" ).css('left',-8+leftwidthRel/2+"%");
+ jQuery( "#totalbRel" ).css('left',-20+(percentageRel+leftwidthRel)/2+"%");
+});
+
+
+</script>
+
+<div id="absolutedim">
+
+ <b id="contentb" style="display:block;float:left;position:absolute;margin-top:-20px;"><?php _e("Content =","mantra");?> <span id="contentsize"><?php echo $mantra_options['mantra_sidewidth'];?></span>px</b>
+ <b id="barb" style="margin-left:40px;color:#F6A828;display:block;float:left;position:absolute;margin-top:-20px;" ><?php _e("Sidebar(s) =","mantra");?> <span id="barsize"><?php echo $mantra_options['mantra_sidebar'];?></span>px</b>
+ <b id="totalb" style="margin-left:40px;color:#999;display:block;float:left;position:absolute;margin-top:12px;" >^&mdash;&mdash;&mdash; <?php _e("Total width =","mantra");?> <span id="totalsize"><?php echo $mantra_options['mantra_sidewidth']+ $mantra_options['mantra_sidebar'];?></span>px &mdash;&mdash;&mdash;^</b>
+
+<p>
+ <?php echo "<input type='hidden' name='ma_options[mantra_sidewidth]' id='mantra_sidewidth' />";
+ echo "<input type='hidden' name='ma_options[mantra_sidebar]' id='mantra_sidebar' />";?>
+</p>
+<div id="slider-range"></div>
+
+ <?php
+ echo "<br><div><small>".__("Select the width of your <b>content</b> and <b>sidebar(s)</b>.
+ While the content cannot be less than 500px wide, the sidebar area is at least 220px and no more than 800px.<br />
+ If you went for a 3 column area ( with 2 sidebars) they will each have half the selected width.","mantra")."</small></div>"; ?>
+
+
+</div><!-- End absolutedim -->
+
+<div id="relativedim">
+
+ <b id="contentbRel" style="display:block;float:left;position:absolute;margin-top:-20px;"><?php _e("Content =","mantra");?> <span id="contentsizeRel"><?php echo $mantra_options['mantra_sidewidthRel'];?></span>%</b>
+ <b id="barbRel" style="margin-left:40px;color:#F6A828;display:block;float:left;position:absolute;margin-top:-20px;" ><?php _e("Sidebar(s) =","mantra");?> <span id="barsizeRel"><?php echo $mantra_options['mantra_sidebarRel'];?></span>%</b>
+ <b id="totalbRel" style="margin-left:40px;color:#999;display:block;float:left;position:absolute;margin-top:12px;" >^&mdash;&mdash;&mdash; <?php _e("Total width =","mantra");?> <span id="totalsizeRel"><?php echo $mantra_options['mantra_sidewidthRel']+$mantra_options['mantra_sidebarRel'];?></span>% &mdash;&mdash;&mdash;^</b>
+
+<p>
+ <?php echo "<input type='hidden' name='ma_options[mantra_sidewidthRel]' id='mantra_sidewidthRel' />";
+ echo "<input type='hidden' name='ma_options[mantra_sidebarRel]' id='mantra_sidebarRel' />";?>
+
+</p>
+<div id="slider-rangeRel"></div>
+ <?php
+ echo "<br><div><small>".__("Select the width of your <b>content</b> and <b>sidebar(s)</b>.
+ These are realtive dimmensions - relative to the user's browser. The total width is a percentage of the browser's width.<br />
+ While the content cannot be less than 40% wide, the sidebar area is at least 20% and no more than 50%.<br />
+ If you went for a 3 column area ( with 2 sidebars) they will each have half the selected width.","mantra")."</small></div>"; ?>
+</div><!-- End relativedim -->
+<?php
+
+ }
+
+
+//CHECKBOX - Name: ma_options[mobile]
+function cryout_setting_mobile_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_mobile' name='ma_options[mantra_mobile]'>";
+ foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_mobile'],$item);
+ echo ">$itemsare[$id]</option>";
+ }
+ echo "</select>";
+ $checkedClass = ($mantra_options['mantra_hcontain']=='1') ? ' checkedClass' : '';
+ echo "<div><small>".__("Enable to make Mantra fully responsive. The layout and general sizes of your blog will adjust depending on what device and what resolution it is viewed in.<br> Do not disable unless you have a good reason to.","mantra")."</small></div>";
+}
+
+
+
+////////////////////////////////
+//// PRESENTATION SETTINGS /////////////
+////////////////////////////////
+
+
+//CHECKBOX - Name: ma_options[frontpage]
+function cryout_setting_frontpage_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_frontpage' name='ma_options[mantra_frontpage]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_frontpage'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Enable the presentation front-page. This will become your new home page. It has a slider and columns for presentation
+ text and images.<br>If you have this enabled but don't see a Presentation page then go to <a href='options-reading.php'> Settings &raquo; Reading </a> and make sure you have selected <strong>Front Page Displays</strong> as <Strong>Your Latest Posts</strong>.","mantra")."</small></div>";
+
+}
+
+function cryout_setting_frontposts_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_frontposts' name='ma_options[mantra_frontposts]'>";
+ foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_frontposts'],$item);
+ echo ">$itemsare[$id]</option>";
+ }
+ echo "</select> ";
+ echo "<input type='text' id='mantra_frontpostscount' name='ma_options[mantra_frontpostscount]' size='3' value='";
+ echo $mantra_options['mantra_frontpostscount']."'> ".__('posts','mantra');
+ echo "<div><small>".__("Enable to display latest posts on the presentation page, below the columns. Sticky posts are always displayed and not counted.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[frontslider]
+function cryout_setting_frontslider_fn() {
+ global $mantra_options;
+
+
+ echo "<div class='slmini'><b>".__("Slider Dimensions:","mantra")."</b> ";
+ echo "<input id='mantra_fpsliderwidth' name='ma_options[mantra_fpsliderwidth]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_fpsliderwidth'] )."' /> px (".__("width","mantra").") <strong>X</strong> ";
+ echo "<input id='mantra_fpsliderheight' name='ma_options[mantra_fpsliderheight]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_fpsliderheight'] )."' /> px (".__("height","mantra").")";
+ echo "<small>".__("The dimensions of your slider. Make sure your images are of the same size.","mantra")."</small></div>";
+
+ echo "<div class='slmini'><b>".__("Animation:","mantra")."</b> ";
+ $items = array ("random" , "fold", "fade", "slideInRight", "slideInLeft", "sliceDown", "sliceDownLeft", "sliceUp", "sliceUpLeft", "sliceUpDown" , "sliceUpDownLeft", "boxRandom", "boxRain", "boxRainReverse", "boxRainGrow" , "boxRainGrowReverse");
+ $itemsare = array( __("Random","mantra"), __("Fold","mantra"), __("Fade","mantra"), __("SlideInRight","mantra"), __("SlideInLeft","mantra"), __("SliceDown","mantra"), __("SliceDownLeft","mantra"), __("SliceUp","mantra"), __("SliceUpLeft","mantra"), __("SliceUpDown","mantra"), __("SliceUpDownLeft","mantra"), __("BoxRandom","mantra"), __("BoxRain","mantra"), __("BoxRainReverse","mantra"), __("BoxRainGrow","mantra"), __("BoxRainGrowReverse","mantra"));
+ echo "<select id='mantra_fpslideranim' name='ma_options[mantra_fpslideranim]'>";
+ foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fpslideranim'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<small>".__("The transition effect your slider will have.","mantra")."</small></div>";
+
+ echo "<div class='slmini'><b>".__("Border Settings:","mantra")."</b> ";
+ echo __('Width' ,'mantra').": <input id='mantra_fpsliderborderwidth' name='ma_options[mantra_fpsliderborderwidth]' size='2' type='text' value='".esc_attr( $mantra_options['mantra_fpsliderborderwidth'] )."' /> px / ";
+ echo __('Color','mantra').': <input type="text" id="mantra_fpsliderbordercolor" name="ma_options[mantra_fpsliderbordercolor]" style="width:100px;" value="'.esc_attr( $mantra_options['mantra_fpsliderbordercolor'] ).'" />';
+ echo '<div id="mantra_fpsliderbordercolor2"></div>';
+ echo "<small>".__("The width and color of the slider's border.","mantra")."</small></div>";
+
+ echo "<div class='slmini'><b>".__("Animation Time:","mantra")."</b> ";
+ echo "<input id='mantra_fpslidertime' name='ma_options[mantra_fpslidertime]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_fpslidertime'] )."' /> ".__("milliseconds","mantra");
+ echo "<small>".__("The time in which the transition animation will take place.","mantra")."</small></div>";
+
+ echo "<div class='slmini'><b>".__("Pause Time:","mantra")."</b> ";
+ echo "<input id='mantra_fpsliderpause' name='ma_options[mantra_fpsliderpause]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_fpsliderpause'] )."' /> ".__("milliseconds","mantra");
+ echo "<small>".__("The time in which a slide will be still and visible.","mantra")."</small></div>";
+
+
+ echo "<div class='slmini'><b>".__("Slider navigation:","mantra")."</b> ";
+ $items = array ("Numbers" , "Bullets" ,"None");
+ $itemsare = array( __("Numbers","mantra"), __("Bullets","mantra"), __("None","mantra"));
+ echo "<select id='mantra_fpslidernav' name='ma_options[mantra_fpslidernav]'>";
+ foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fpslidernav'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<small>".__("Your slider navigation type. Shown under the slider.","mantra")."</small></div>";
+
+ echo "<div class='slmini'><b>".__("Slider arrows:","mantra")."</b> ";
+ $items = array ("Always Visible" , "Visible on Hover" ,"Hidden");
+ $itemsare = array( __("Always Visible","mantra"), __("Visible on Hover","mantra"), __("Hidden","mantra"));
+ echo "<select id='mantra_fpsliderarrows' name='ma_options[mantra_fpsliderarrows]'>";
+ foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fpsliderarrows'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<small>".__("The Left and Right arrows on your slider","mantra")."</small></div>";
+
+?>
+
+<script>
+var $categoryName;
+
+jQuery(document).ready(function(){
+ jQuery('#categ-dropdown').change(function(){
+ $categoryName=this.options[this.selectedIndex].value.replace(/\/category\/archives\//i,"");
+ doAjaxRequest();
+ });
+
+});
+function doAjaxRequest(){
+ // here is where the request will happen
+ jQuery.ajax({
+ url: ajaxurl,
+ data:{
+ 'action':'do_ajax',
+ 'fn':'get_latest_posts',
+ 'count':10,
+ 'categName':$categoryName
+ },
+ dataType: 'JSON',
+ success:function(data){
+ jQuery('#post-dropdown').html(data);
+
+
+ },
+ error: function(errorThrown){
+ alert('error');
+ console.log(errorThrown);
+ }
+
+ });
+
+}
+</script>
+<!--
+<select name="categ-dropdown" id="categ-dropdown" multiple='multiple' >
+ <option value=""><?php echo esc_attr(__('Select Category','mantra')); ?></option>
+ <?php
+ $categories= get_categories();
+ foreach ($categories as $category) {
+ $option = '<option value="/category/archives/'.$category->category_nicename.'">';
+ $option .= $category->cat_name;
+ $option .= ' ('.$category->category_count.')';
+ $option .= '</option>';
+ echo $option;
+ }
+ ?>
+</select>
+<select name="post-dropdown" id="post-dropdown">
+</select>
+-->
+
+<?php
+
+}
+
+//CHECKBOX - Name: ma_options[frontslider2]
+function cryout_setting_frontslider2_fn() {
+ global $mantra_options;
+?>
+
+<?php
+$items = array("Custom Slides", "Latest Posts", "Random Posts", "Sticky Posts", "Latest Posts from Category" , "Random Posts from Category", "Specific Posts");
+ $itemsare = array( __("Custom Slides","mantra"), __("Latest Posts","mantra"), __("Random Posts","mantra"),__("Sticky Posts","mantra"), __("Latest Posts from Category","mantra"), __("Random Posts from Category","mantra"), __("Specific Posts","mantra"));
+ echo "<strong> Select the content you want to load in your slides: </strong> ";
+ echo "<select id='mantra_slideType' name='ma_options[mantra_slideType]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_slideType'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Your slides' content. Only the image is required, all other fields are optional. Only the slides with an image selected will become acitve and visible in the live slider.","mantra")."</small></div>";
+
+?>
+
+<div id="sliderLatestPosts" class="slideDivs">
+<span><?php _e('Latest posts will be loaded into the slider.','mantra'); ?> </span>
+</div>
+
+<div id="sliderRandomPosts" class="slideDivs">
+<span><?php _e('Random posts will be loaded into the slider.','mantra'); ?> </span>
+</div>
+
+<div id="sliderLatestCateg" class="slideDivs">
+<span><?php _e('Latest posts from the category you choose will be loaded in the slider.','mantra'); ?> </span>
+
+</div>
+
+<div id="sliderRandomCateg" class="slideDivs">
+<span><?php _e('Random posts from the category you choose will be loaded into the slider.','mantra'); ?> </span>
+</div>
+
+<div id="sliderStickyPosts" class="slideDivs">
+<span><?php _e('Only sticky posts will be loaded into the slider.','mantra'); ?> </span>
+</div>
+
+<div id="sliderSpecificPosts" class="slideDivs">
+<span><?php _e('List the post IDs you want to display (separated by a comma): ','mantra'); ?> </span>
+ <input id='mantra_slideSpecific' name='ma_options[mantra_slideSpecific]' size='44' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slideSpecific'] ) ?>' />
+</div>
+
+<div id="slider-category">
+<span><?php _e('<br> Choose the cateogry: ','mantra'); ?> </span>
+<select id="mantra_slideCateg" name='ma_options[mantra_slideCateg]' >
+ <option value=""><?php echo esc_attr(__('Select Category','mantra')); ?></option>
+ <?php echo $mantra_options["mantra_slideCateg"];
+ $categories= get_categories();
+ foreach ($categories as $category) {
+ $option = '<option value="'.$category->category_nicename.'" ';
+ $option .= selected($mantra_options["mantra_slideCateg"], $category->category_nicename, false).' >';
+ $option .= $category->cat_name;
+ $option .= ' ('.$category->category_count.')';
+ $option .= '</option>';
+ echo $option;
+ }
+ ?>
+</select>
+</div>
+
+<span id="slider-post-number"><?php _e('Number of posts to show:','mantra'); ?>
+ <input id='mantra_slideNumber' name='ma_options[mantra_slideNumber]' size='3' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slideNumber'] ) ?>' />
+ </span>
+
+
+<div id="sliderCustomSlides" class="slideDivs">
+<div class="slidebox">
+<h4 class="slidetitle" ><?php _e("Slide 1","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_sliderimg1']); ?>" name="ma_options[mantra_sliderimg1]" id="mantra_sliderimg1" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_slidertitle1' name='ma_options[mantra_slidertitle1]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slidertitle1'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_slidertext1' name='ma_options[mantra_slidertext1]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_slidertext1']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_sliderlink1' name='ma_options[mantra_sliderlink1]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_sliderlink1'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("Slide 2","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_sliderimg2']); ?>" name="ma_options[mantra_sliderimg2]" id="mantra_sliderimg2" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_slidertitle2' name='ma_options[mantra_slidertitle2]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slidertitle2'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_slidertext2' name='ma_options[mantra_slidertext2]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_slidertext2']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_sliderlink2' name='ma_options[mantra_sliderlink2]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_sliderlink2'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("Slide 3","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_sliderimg3']); ?>" name="ma_options[mantra_sliderimg3]" id="mantra_sliderimg3" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_slidertitle3' name='ma_options[mantra_slidertitle3]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slidertitle3'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_slidertext3' name='ma_options[mantra_slidertext3]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_slidertext3']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_sliderlink3' name='ma_options[mantra_sliderlink3]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_sliderlink3'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("Slide 4","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_sliderimg4']); ?>" name="ma_options[mantra_sliderimg4]" id="mantra_sliderimg4" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_slidertitle4' name='ma_options[mantra_slidertitle4]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slidertitle4'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_slidertext4' name='ma_options[mantra_slidertext4]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_slidertext4']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_sliderlink4' name='ma_options[mantra_sliderlink4]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_sliderlink4'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("Slide 5","mantra");?></h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_sliderimg5']); ?>" name="ma_options[mantra_sliderimg5]" id="mantra_sliderimg5" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_slidertitle5' name='ma_options[mantra_slidertitle5]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_slidertitle5'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_slidertext5' name='ma_options[mantra_slidertext5]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_slidertext5']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_sliderlink5' name='ma_options[mantra_sliderlink5]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_sliderlink5'] ) ?>' />
+</div>
+</div>
+
+</div> <!-- customSlides -->
+<?php
+}
+
+//CHECKBOX - Name: ma_options[frontcolumns]
+function cryout_setting_frontcolumns_fn() {
+ global $mantra_options;
+
+echo "<div class='slmini'><b>".__("Number of columns:","mantra")."</b> ";
+ $items = array ("0" ,"1", "2" , "3" , "4");
+ echo "<select id='mantra_nrcolumns' name='ma_options[mantra_nrcolumns]'>";
+foreach($items as $item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_nrcolumns'],$item);
+ echo ">$item</option>";
+}
+ echo "</select></div>";
+
+echo "<div class='slmini'><b>".__("Image Height:","mantra")."</b> ";
+ echo "<input id='mantra_colimageheight' name='ma_options[mantra_colimageheight]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_colimageheight'] )."' /> px </div>";
+?>
+<div class='slmini'><b><?php _e("Read more text:","mantra");?></b>
+<input id='mantra_columnreadmore' name='ma_options[mantra_columnreadmore]' size='30' type='text' value='<?php echo esc_attr( $mantra_options['mantra_columnreadmore'] ) ?>' />
+<?php
+ echo "<small>".__("The linked text that appears at the bottom of all the columns. You can delete all text inside if you don't want it.","mantra")."</small></div>";
+
+?>
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("1st Column","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_columnimg1']); ?>" name="ma_options[mantra_columnimg1]" id="mantra_columnimg1" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_columntitle1' name='ma_options[mantra_columntitle1]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_columntitle1'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_columntext1' name='ma_options[mantra_columntext1]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_columntext1']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_columnlink1' name='ma_options[mantra_columnlink1]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_columnlink1'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("2nd Column","mantra");?></h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_columnimg2']); ?>" name="ma_options[mantra_columnimg2]" id="mantra_columnimg2" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_columntitle2' name='ma_options[mantra_columntitle2]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_columntitle2'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_columntext2' name='ma_options[mantra_columntext2]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_columntext2']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_columnlink2' name='ma_options[mantra_columnlink2]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_columnlink2'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("3rd Column","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_columnimg3']); ?>" name="ma_options[mantra_columnimg3]" id="mantra_columnimg3" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> Title </h5>
+<input id='mantra_columntitle3' name='ma_options[mantra_columntitle3]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_columntitle3'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_columntext3' name='ma_options[mantra_columntext3]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_columntext3']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_columnlink3' name='ma_options[mantra_columnlink3]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_columnlink3'] ) ?>' />
+</div>
+</div>
+
+<div class="slidebox">
+<h4 class="slidetitle" > <?php _e("4th Column","mantra");?> </h4>
+<div class="slidercontent">
+<h5><?php _e("Image","mantra");?></h5>
+<input type="text" value="<?php echo esc_url($mantra_options['mantra_columnimg4']); ?>" name="ma_options[mantra_columnimg4]" id="mantra_columnimg4" class="slideimages" />
+<span class="description"><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+<h5> <?php _e("Title","mantra");?> </h5>
+<input id='mantra_columntitle4' name='ma_options[mantra_columntitle4]' size='50' type='text' value='<?php echo esc_attr( $mantra_options['mantra_columntitle4'] ) ?>' />
+<h5> <?php _e("Text","mantra");?> </h5>
+<textarea id='mantra_columntext4' name='ma_options[mantra_columntext4]' rows='3' cols='50' type='textarea' ><?php echo esc_attr($mantra_options['mantra_columntext4']) ?></textarea>
+<h5> <?php _e("Link","mantra");?> </h5>
+<input id='mantra_columnlink4' name='ma_options[mantra_columnlink4]' size='50' type='text' value='<?php echo esc_url( $mantra_options['mantra_columnlink4'] ) ?>' />
+</div>
+</div>
+
+<?php
+}
+
+
+//CHECKBOX - Name: ma_options[fronttext]
+function cryout_setting_fronttext_fn() {
+ global $mantra_options;
+
+echo "<div class='slidebox'><h4 class='slidetitle'> ".__("Extra Text","mantra")." </h4><div class='slidercontent'> ";
+
+echo "<div style='width:100%;'><span>Text for the Presentation Page</span><small>".__("More text for your front page. The top title is above the slider, the second title between the slider and the columns and 2 more rows of text under the columns.
+ It's all optional so leave any input field empty if it's not required. ","mantra")."</small></div>";
+
+ echo "<h5>".__("Top Title","mantra")."</h5><br><input id='mantra_fronttext1' name='ma_options[mantra_fronttext1]' size='50' type='text' value='".esc_attr( $mantra_options['mantra_fronttext1'] )."' />";
+echo "<h5>".__("Second Title","mantra")."</h5> ";
+ echo "<input id='mantra_fronttext2' name='ma_options[mantra_fronttext2]' size='50' type='text' value='".esc_attr( $mantra_options['mantra_fronttext2'] )."' />";
+
+echo "<h5>".__("Title color","mantra")."</h5> ";
+ echo '<input type="text" id="mantra_fronttitlecolor" name="ma_options[mantra_fronttitlecolor]" style="width:100px;display:block;float:none;" value="'.esc_attr( $mantra_options['mantra_fronttitlecolor'] ).'" />';
+ echo '<div id="mantra_fronttitlecolor2"></div>';
+
+echo "<h5>".__("Bottom Text 1","mantra")."</h5> ";
+ echo "<textarea id='mantra_fronttext3' name='ma_options[mantra_fronttext3]' rows='3' cols='50' type='textarea' >".esc_attr($mantra_options['mantra_fronttext3'])." </textarea>";
+echo "<h5>".__("Bottom Text 2","mantra")." </h5> ";
+ echo "<textarea id='mantra_fronttext4' name='ma_options[mantra_fronttext4]' rows='3' cols='50' type='textarea' >".esc_attr($mantra_options['mantra_fronttext4'])." </textarea></div></div>";
+
+
+
+
+
+
+echo "<div class='slidebox'><h4 class='slidetitle'>".__("Hide areas","mantra")." </h4><div class='slidercontent'>";
+
+echo "<div style='width:100%;'>".__("Choose the areas to hide on the first page.","mantra")."</div>";
+
+ $items = array( "FronHeader", "FrontMenu", "FrontWidget" , "FrontFooter","FrontBack");
+
+ $checkedClass0 = ($mantra_options['mantra_fronthideheader']=='1') ? ' checkedClass0' : '';
+ $checkedClass1 = ($mantra_options['mantra_fronthidemenu']=='1') ? ' checkedClass1' : '';
+ $checkedClass2 = ($mantra_options['mantra_fronthidewidget']=='1') ? ' checkedClass2' : '';
+ $checkedClass3 = ($mantra_options['mantra_fronthidefooter']=='1') ? ' checkedClass3' : '';
+ $checkedClass4 = ($mantra_options['mantra_fronthideback']=='1') ? ' checkedClass4' : '';
+
+ echo " <label id='$items[0]' for='$items[0]$items[0]' class='hideareas $checkedClass0'><input ";
+ checked($mantra_options['mantra_fronthideheader'],'1');
+ echo "value='1' id='$items[0]$items[0]' name='ma_options[mantra_fronthideheader]' type='checkbox' /> ".__("Hide the header area (image or background color).","mantra")." </label>";
+
+ echo " <label id='$items[1]' for='$items[1]$items[1]' class='hideareas $checkedClass1'><input ";
+ checked($mantra_options['mantra_fronthidemenu'],'1');
+ echo "value='1' id='$items[1]$items[1]' name='ma_options[mantra_fronthidemenu]' type='checkbox' /> ".__("Hide the main menu (the top navigation tabs).","mantra")." </label>";
+
+ echo " <label id='$items[2]' for='$items[2]$items[2]' class='hideareas $checkedClass2'><input ";
+ checked($mantra_options['mantra_fronthidewidget'],'1');
+ echo "value='1' id='$items[2]$items[2]' name='ma_options[mantra_fronthidewidget]' type='checkbox' /> ".__("Hide the footer widgets. ","mantra")." </label>";
+
+ echo " <label id='$items[3]' for='$items[3]$items[3]' class='hideareas $checkedClass3'><input ";
+ checked($mantra_options['mantra_fronthidefooter'],'1');
+ echo "value='1' id='$items[3]$items[3]' name='ma_options[mantra_fronthidefooter]' type='checkbox' /> ".__("Hide the footer (copyright area).","mantra")." </label>";
+
+ echo " <label id='$items[4]' for='$items[4]$items[4]' class='hideareas $checkedClass4'><input ";
+ checked($mantra_options['mantra_fronthideback'],'1');
+ echo "value='1' id='$items[4]$items[4]' name='ma_options[mantra_fronthideback]' type='checkbox' /> ".__("Hide the white color. Only the background color remains.","mantra")." </label>";
+
+
+echo "</div></div>";
+
+
+}
+
+
+//////////////////////////////
+/////HEADER SETTINGS//////////
+/////////////////////////////
+
+ //SELECT - Name: ma_options[hheight]
+function cryout_setting_hheight_fn() {
+ global $mantra_options;?>
+<input id='mantra_hheight' name='ma_options[mantra_hheight]' size='4' type='text' value='<?php echo esc_attr( intval($mantra_options['mantra_hheight'] )) ?>' /> px
+<?php
+$totally = $mantra_options['mantra_sidebar']+$mantra_options['mantra_sidewidth']+50;
+
+echo "<div><small>".__("Select the header's height. After saving the settings make sure you reupload a new header image (if you're using one). The header's width will be = ","mantra").$totally."px.</small></div>";
+}
+
+function cryout_setting_himage_fn() {
+ global $mantra_options;
+ $checkedClass = ($mantra_options['mantra_hcenter']=='1') ? ' checkedClass' : '';
+ $checkedClass2 = ($mantra_options['mantra_hratio']=='1') ? ' checkedClass' : '';
+ echo "<a href=\"?page=custom-header\" class=\"button\" target=\"_blank\">".__('Define header image')."</a>";
+ echo "<div><small>".__("The header image should not be used to display logos.<br> Enable ratio preservation to force the header image aspect ratio. Keep in mind that short images will become very small on mobile devices.","mantra")."</small></div>";
+ echo "<br><label id='hcenter' for='mantra_hcenter' class='socialsdisplay $checkedClass'><input ";
+ checked($mantra_options['mantra_hcenter'],'1');
+ echo " value='1' id='mantra_hcenter' name='ma_options[mantra_hcenter]' type='checkbox'/> Center the header image horizontally </label>";
+
+ echo " <label id='hratio' for='mantra_hratio' class='socialsdisplay $checkedClass2'><input ";
+ checked($mantra_options['mantra_hratio'],'1');
+ echo " value='1' id='mantra_hratio' name='ma_options[mantra_hratio]' type='checkbox' style='margin-left:10px;'/> Keep header image aspect ratio </label>";
+
+}
+
+//CHECKBOX - Name: ma_options[menurounded]
+function cryout_setting_menurounded_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_menurounded' name='ma_options[mantra_menurounded]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_menurounded'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Enable or disable the round corners for the main menu items.","mantra")."</small></div>";
+
+}
+
+//CHECKBOX - Name: ma_options[linkheader]
+function cryout_setting_siteheader_fn() {
+ global $mantra_options;
+ $items = array ("Site Title and Description" , "Custom Logo" , "Clickable header image" , "Empty");
+ $itemsare = array( __("Site Title and Description","mantra"), __("Custom Logo","mantra"), __("Clickable header image","mantra"), __("Empty","mantra"));
+ echo "<select id='mantra_siteheader' name='ma_options[mantra_siteheader]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_siteheader'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Choose what to display inside your header area.","mantra")."</small></div>";
+}
+
+// TEXTBOX - Name: ma_options[favicon]
+function cryout_setting_logoupload_fn() {
+ global $mantra_options;
+ echo '<div>';
+?>
+ <img src='<?php echo ($mantra_options['mantra_logoupload']!='')? esc_url($mantra_options['mantra_logoupload']):get_template_directory_uri().'/admin/images/placeholder.gif'; ?>' class="imagebox" style="display:;max-height:60px" /><br>
+<input type="text" size='60' value="<?php echo esc_url($mantra_options['mantra_logoupload']); ?>" name="ma_options[mantra_logoupload]" id="mantra_logoupload" class="header_upload_inputs slideimages" />
+<?php echo "<div><small>".__("Custom Logo upload. The logo will appear over the heder image if you have used one.","mantra")."</small></div>"; ?>
+<span class="description"><br><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+</div>
+
+<?php
+}
+
+function cryout_setting_headermargin_fn() {
+ global $mantra_options;?>
+<input id='mantra_headermargintop' name='ma_options[mantra_headermargintop]' size='4' type='text' value='<?php echo esc_attr( intval($mantra_options['mantra_headermargintop'] )) ?>' /> px <?php echo __("top","mantra");?> &nbsp; &nbsp;
+<input id='mantra_headermarginleft' name='ma_options[mantra_headermarginleft]' size='4' type='text' value='<?php echo esc_attr( intval($mantra_options['mantra_headermarginleft'] )) ?>' /> px <?php echo __("left","mantra");?>
+<?php
+
+echo "<div><small>".__("Select the top spacing for the header. Use it to better position your site title and description or custom logo inside the header. ","mantra")."</small></div>";
+}
+
+// TEXTBOX - Name: ma_options[favicon]
+function cryout_setting_favicon_fn() {
+ global $mantra_options;
+ echo '<div>';
+?>
+ <img src='<?php echo ($mantra_options['mantra_favicon']!='')? esc_url($mantra_options['mantra_favicon']):get_template_directory_uri().'/admin/images/placeholder.gif'; ?>' class="imagebox" width="64" height="64"/><br>
+<input type="text" size='60' value="<?php echo esc_url($mantra_options['mantra_favicon']); ?>" name="ma_options[mantra_favicon]" id="mantra_favicon" class="header_upload_inputs slideimages" />
+<?php echo "<div><small>".__("Limitations: It has to be an image. It should be max 64x64 pixels in dimensions. Recommended file extensions .ico and .png. <br/><b>Note that some browsers do not display the changed favicon instantly.</b>","mantra")."</small></div>"; ?>
+<span class="description"><br><a href="#" class="upload_image_button button"><?php _e( 'Select / Upload Image', 'mantra' );?></a> </span>
+</div>
+
+<?php
+}
+
+
+////////////////////////////////
+//// TEXT SETTINGS /////////////
+////////////////////////////////
+
+//SELECT - Name: ma_options[fontsize]
+function cryout_setting_fontsize_fn() {
+ global $mantra_options;
+ $items =array ("12px", "13px" , "14px" , "15px" , "16px", "17px", "18px");
+ echo "<select id='mantra_fontsize' name='ma_options[mantra_fontsize]'>";
+ foreach($items as $item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fontsize'],$item);
+ echo ">$item</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Select the font size you'll use in your blog. Pages, posts and comments will be affected. Buttons, Headers and Side menus will remain the same.","mantra")."</small></div>";
+}
+
+
+//SELECT - Name: ma_options[fontfamily]
+function cryout_setting_fontfamily_fn() {
+ global $mantra_options;
+ global $fontSans, $fontSerif, $fontMono, $fontCursive;
+
+ echo "<select id='mantra_fontfamily' name='ma_options[mantra_fontfamily]'>";
+ echo "<optgroup label='Sans-Serif'>";
+foreach($fontSans as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontfamily'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Serif'>";
+foreach($fontSerif as $item) {
+
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontfamily'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='MonoSpace'>";
+foreach($fontMono as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontfamily'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Cursive'>";
+foreach($fontCursive as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontfamily'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+ echo "</select>";
+
+ echo "<div><small>".__("Select the font family you'll use in your blog. All content text will be affected (including menu buttons). ","mantra")."</small></div><br>";
+ echo '<input class="googlefonts" type="text" size="45" value="'.esc_attr($mantra_options['mantra_googlefont']).'" name="ma_options[mantra_googlefont]" id="mantra_googlefont" />';
+ echo "<div><small>".__("Or insert your Google Font below. Please only isert the <strong>name</strong> of the font.<br /> Ex: Marko One. Go to <a href='http://www.google.com/webfonts' > google fonts </a> for some font inspiration.","mantra")."</small></div>";
+
+
+}
+
+//SELECT - Name: ma_options[fonttitle]
+function cryout_setting_fonttitle_fn() {
+ global $mantra_options;
+ global $fontSans, $fontSerif, $fontMono, $fontCursive;
+
+ echo "<select id='mantra_fonttitle' name='ma_options[mantra_fonttitle]'>";
+ echo "<option value='Default'";
+ selected($mantra_options['mantra_fonttitle'],'Defaut');
+ echo ">Default</option>";
+ echo "<optgroup label='Sans-Serif'>";
+foreach($fontSans as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fonttitle'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Serif'>";
+foreach($fontSerif as $item) {
+
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fonttitle'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='MonoSpace'>";
+foreach($fontMono as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fonttitle'],$item);
+ echo ">$item";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Cursive'>";
+foreach($fontCursive as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fonttitle'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+ echo "</select>";
+ echo "<div><small>".__("Select the font family you want for your titles. It will affect post titles and page titles. Leave 'Default' and the general font you selected will be used.","mantra")."</small></div><br>";
+
+ echo '<input class="googlefonts" type="text" size="45" value="'.esc_attr($mantra_options['mantra_googlefonttitle']).'" name="ma_options[mantra_googlefonttitle]" id="mantra_googlefonttitle" />';
+ echo "<div><small>".__("Or insert your Google Font below. Please only isert the <strong>name</strong> of the font.<br /> Ex: Marko One. Go to <a href='http://www.google.com/webfonts' > google fonts </a> for some font inspiration.","mantra")."</small></div>";
+
+
+
+
+}
+
+//SELECT - Name: ma_options[fontside]
+function cryout_setting_fontside_fn() {
+ global $mantra_options;
+ global $fontSans, $fontSerif, $fontMono, $fontCursive;
+
+ echo "<select id='mantra_fontside' name='ma_options[mantra_fontside]'>";
+ echo "<option value='Default'";
+ selected($mantra_options['mantra_fonttitle'],'Defaut');
+ echo ">Default</option>";
+ echo "<optgroup label='Sans-Serif'>";
+foreach($fontSans as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontside'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Serif'>";
+foreach($fontSerif as $item) {
+
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontside'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='MonoSpace'>";
+foreach($fontMono as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontside'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Cursive'>";
+foreach($fontCursive as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontside'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+ echo "</select>";
+ echo "<div><small>".__("Select the font family you want your sidebar(s) to have. Text in sidebars will be affected, including any widgets. Leave 'Default' and the general font you selected will be used.","mantra")."</small></div><br>";
+ echo '<input class="googlefonts" type="text" size="45" value="'.esc_attr($mantra_options['mantra_googlefontside']).'" name="ma_options[mantra_googlefontside]" id="mantra_googlefontside" />';
+ echo "<div><small>".__("Or insert your Google Font below. Please only isert the <strong>name</strong> of the font.<br /> Ex: Marko One. Go to <a href='http://www.google.com/webfonts' > google fonts </a> for some font inspiration.","mantra")."</small></div>";
+
+
+
+}
+
+
+//SELECT - Name: ma_options[fontsubheader]
+function cryout_setting_fontsubheader_fn() {
+ global $mantra_options;
+ global $fontSans, $fontSerif, $fontMono, $fontCursive;
+
+ echo "<select id='mantra_fontsubheader' name='ma_options[mantra_fontsubheader]'>";
+ echo "<option value='Default'";
+ selected($mantra_options['mantra_fonttitle'],'Defaut');
+ echo ">Default</option>";
+ echo "<optgroup label='Sans-Serif'>";
+foreach($fontSans as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontsubheader'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Serif'>";
+foreach($fontSerif as $item) {
+
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontsubheader'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='MonoSpace'>";
+foreach($fontMono as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontsubheader'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+
+ echo "<optgroup label='Cursive'>";
+foreach($fontCursive as $item) {
+ echo "<option style='font-family:$item;' value='$item'";
+ selected($mantra_options['mantra_fontsubheader'],$item);
+ echo ">$item</option>";
+}
+ echo "</optgroup>";
+ echo "</select>";
+ echo "<div><small>".__("Select the font family you want your headings to have (h1 - h6 tags will be affected). Leave 'Default' and the general font you selected will be used.","mantra")."</small></div><br>";
+
+ echo '<input class="googlefonts" type="text" size="45" value="'.esc_attr($mantra_options['mantra_googlefontsubheader']).'" name="ma_options[mantra_googlefontsubheader]" id="mantra_googlefontsubheader" />';
+ echo "<div><small>".__("Or insert your Google Font below. Please only isert the <strong>name</strong> of the font.<br /> Ex: Marko One. Go to <a href='http://www.google.com/webfonts' > google fonts </a> for some font inspiration.","mantra")."</small></div>";
+
+
+}
+
+//SELECT - Name: ma_options[headfontsize]
+function cryout_setting_headfontsize_fn() {
+ global $mantra_options;
+ $items = array ("Default" , "14px" , "16px" , "18px" , "20px", "22px" , "24px" , "26px" , "28px" , "30px" , "32px" , "34px" , "36px", "38px" , "40px");
+ $itemsare = array( __("Default","mantra") ,"14px" , "16px" , "18px" , "20px", "22px" , "24px" , "26px" , "28px" , "30px" , "32px" , "34px" , "36px", "38px" , "40px");
+ echo "<select id='mantra_headfontsize' name='ma_options[mantra_headfontsize]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_headfontsize'],$item);
+ echo ">$item</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Post Header Font size. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[sidefontsize]
+function cryout_setting_sidefontsize_fn() {
+ global $mantra_options;
+ $items = array ("Default" , "8px" , "9px" , "10px" , "11px", "12px" , "13px" , "14px" , "15px" , "16px" , "17px" , "18px");
+ $itemsare = array( __("Default","mantra") , "8px" , "9px" , "10px" , "11px", "12px" , "13px" , "14px" , "15px" , "16px" , "17px" , "18px");
+ echo "<select id='mantra_sidefontsize' name='ma_options[mantra_sidefontsize]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_sidefontsize'],$item);
+ echo ">$item</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Sidebar Font size. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[textalign]
+function cryout_setting_textalign_fn() {
+ global $mantra_options;
+ $items = array ("Default" , "Left" , "Right" , "Justify" , "Center");
+ $itemsare = array( __("Default","mantra"), __("Left","mantra"), __("Right","mantra"), __("Justify","mantra"), __("Center","mantra"));
+ echo "<select id='mantra_textalign' name='ma_options[mantra_textalign]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_textalign'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("This overwrites the text alignment in posts and pages. Leave 'Default' for normal settings (alignment will remain as declared in posts, comments etc.).","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[parindent]
+function cryout_setting_parmargin_fn() {
+ global $mantra_options;
+ $items = array ("0.0em", "0.5em", "1.0em" , "1.1em" , "1.2em" , "1.3em" , "1.4em", "1.5em", "1.6em", "1.7em");
+ echo "<select id='mantra_parmargin' name='ma_options[mantra_parmargin]'>";
+foreach($items as $item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_parmargin'],$item);
+ echo ">$item</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Choose the spacing between paragraphs.","mantra")."</small></div>";
+}
+
+
+//SELECT - Name: ma_options[parindent]
+function cryout_setting_parindent_fn() {
+ global $mantra_options;
+ $items = array ("0px" , "5px" , "10px" , "15px" , "20px");
+ echo "<select id='mantra_parindent' name='ma_options[mantra_parindent]'>";
+foreach($items as $item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_parindent'],$item);
+ echo ">$item</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Choose the indent for your paragraphs.","mantra")."</small></div>";
+}
+
+
+//CHECKBOX - Name: ma_options[headerindent]
+function cryout_setting_headerindent_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_headerindent' name='ma_options[mantra_headerindent]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_headerindent'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Disable the default header and title indent (left margin).","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[lineheight]
+function cryout_setting_lineheight_fn() {
+ global $mantra_options;
+ $items = array ("Default" ,"0.8em" , "0.9em", "1.0em" , "1.1em" , "1.2em" , "1.3em", "1.4em" , "1.5em" , "1.6em" , "1.7em" , "1.8em" , "1.9em" , "2.0em");
+ $itemsare = array( __("Default","mantra"),"0.8em" , "0.9em", "1.0em" , "1.1em" , "1.2em" , "1.3em", "1.4em" , "1.5em" , "1.6em" , "1.7em" , "1.8em" , "1.9em" , "2.0em");
+ echo "<select id='mantra_lineheight' name='ma_options[mantra_lineheight]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_lineheight'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Text line height. The height between 2 rows of text. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[wordspace]
+function cryout_setting_wordspace_fn() {
+ global $mantra_options;
+ $items = array ("Default" ,"-3px" , "-2px", "-1px" , "0px" , "1px" , "2px", "3px" , "4px" , "5px" , "10px");
+ $itemsare = array( __("Default","mantra"),"-3px" , "-2px", "-1px" , "0px" , "1px" , "2px", "3px" , "4px" , "5px" , "10px");
+ echo "<select id='mantra_wordspace' name='ma_options[mantra_wordspace]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_wordspace'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("The space between <i>words</i>. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[letterspace]
+function cryout_setting_letterspace_fn() {
+ global $mantra_options;
+ $items = array ("Default" ,"-0.05em" , "-0.04em", "-0.03em" , "-0.02em" , "-0.01em" , "0.01em", "0.02em" , "0.03em" , "0.04em" , "0.05em");
+ $itemsare = array( __("Default","mantra"),"-0.05em" , "-0.04em", "-0.03em" , "-0.02em" , "-0.01em" , "0.01em", "0.02em" , "0.03em" , "0.04em" , "0.05em");
+ echo "<select id='mantra_letterspace' name='ma_options[mantra_letterspace]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_letterspace'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("The space between <i>letters</i>. Leave 'Default' for normal settings (size value will be as set in the CSS).","mantra")."</small></div>";
+}
+
+
+
+//CHECKBOX - Name: ma_options[textshadow]
+function cryout_setting_textshadow_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_textshadow' name='ma_options[mantra_textshadow]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_textshadow'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Disable the default text shadow on headers and titles.","mantra")."</small></div>";
+}
+
+////////////////////////////////
+//// APPEREANCE SETTINGS ///////
+////////////////////////////////
+
+function cryout_setting_sitebackground_fn() {
+ echo "<a href=\"?page=custom-background\" class=\"button\" target=\"_blank\">".__('Define background image')."</a>";
+} // cryout_setting_sitebackground_fn()
+
+
+//TEXT - Name: ma_options[backcolor]
+function cryout_setting_backcolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_backcolor" name="ma_options[mantra_backcolor]" value="'.esc_attr( $mantra_options['mantra_backcolor'] ).'" />';
+ echo '<div id="mantra_backcolor2"></div>';
+ echo "<div><small>".__("Background color (Default value is 444444).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[headercolor]
+function cryout_setting_headercolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_headercolor" name="ma_options[mantra_headercolor]" value="'.esc_attr( $mantra_options['mantra_headercolor'] ).'" />';
+ echo '<div id="mantra_headercolor2"></div>';
+ echo "<div><small>".__("Header background color (Default value is 333333). You can delete all inside text for no background color.","mantra")."</small></div>";
+}
+
+function cryout_setting_contentbg_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_contentbg" name="ma_options[mantra_contentbg]" value="'.esc_attr( $mantra_options['mantra_contentbg'] ).'" />';
+ echo '<div id="mantra_contentbg2"></div>';
+ echo "<div><small>".__("Content background color (Default value is FFFFFF). Works best with really light colors.","mantra")."</small></div>";
+}
+
+function cryout_setting_menubg_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_menubg" name="ma_options[mantra_menubg]" value="'.esc_attr( $mantra_options['mantra_menubg'] ).'" />';
+ echo '<div id="mantra_menubg2"></div>';
+ echo "<div><small>".__("Main menu background color (Default value is FAFAFA). Should be the same color as the content bg or something just as light.","mantra")."</small></div>";
+}
+
+function cryout_setting_first_sidebar_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_s1bg" name="ma_options[mantra_s1bg]" value="'.esc_attr( $mantra_options['mantra_s1bg'] ).'" />';
+ echo '<div id="mantra_s1bg2"></div>';
+ echo "<div><small>".__("First sidebar background color (Default is no color for a transparent sidebar).","mantra")."</small></div>";
+}
+
+function cryout_setting_second_sidebar_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_s2bg" name="ma_options[mantra_s2bg]" value="'.esc_attr( $mantra_options['mantra_s2bg'] ).'" />';
+ echo '<div id="mantra_s2bg2"></div>';
+ echo "<div><small>".__("Second sidebar background color (Default is no color for a transparent sidebar).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[prefootercolor]
+function cryout_setting_prefootercolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_prefootercolor" name="ma_options[mantra_prefootercolor]" value="'.esc_attr( $mantra_options['mantra_prefootercolor'] ).'" />';
+ echo '<div id="mantra_prefootercolor2"></div>';
+ echo "<div><small>".__("Footer widget-area background color. (Default value is 171717).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[footercolor]
+function cryout_setting_footercolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_footercolor" name="ma_options[mantra_footercolor]" value="'.esc_attr( $mantra_options['mantra_footercolor'] ).'" />';
+ echo '<div id="mantra_footercolor2"></div>';
+ echo "<div><small>".__("Footer background color (Default value is 222222).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[titlecolor]
+function cryout_setting_titlecolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_titlecolor" name="ma_options[mantra_titlecolor]" value="'.esc_attr( $mantra_options['mantra_titlecolor'] ).'" />';
+ echo '<div id="mantra_titlecolor2"></div>';
+ echo "<div><small>".__("Your blog's title color (Default value is 0D85CC).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[descriptioncolor]
+function cryout_setting_descriptioncolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_descriptioncolor" name="ma_options[mantra_descriptioncolor]" value="'.esc_attr( $mantra_options['mantra_descriptioncolor'] ).'" />';
+ echo '<div id="mantra_descriptioncolor2"></div>';
+ echo "<div><small>".__("Your blog's description color(Default value is 222222).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[contentcolor]
+function cryout_setting_contentcolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_contentcolor" name="ma_options[mantra_contentcolor]" value="'.esc_attr( $mantra_options['mantra_contentcolor'] ).'" />';
+ echo '<div id="mantra_contentcolor2"></div>';
+ echo "<div><small>".__("Content Text Color (Default value is 333333).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[linkscolor]
+function cryout_setting_linkscolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_linkscolor" name="ma_options[mantra_linkscolor]" value="'.esc_attr( $mantra_options['mantra_linkscolor'] ).'" />';
+ echo '<div id="mantra_linkscolor2"></div>';
+ echo "<div><small>".__("Links color (Default value is 0D85CC).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[hovercolor]
+function cryout_setting_hovercolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_hovercolor" name="ma_options[mantra_hovercolor]" value="'.esc_attr( $mantra_options['mantra_hovercolor'] ).'" />';
+ echo '<div id="mantra_hovercolor2"></div>';
+ echo "<div><small>".__("Links color on mouse over (Default value is 333333).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[headtextcolor]
+function cryout_setting_headtextcolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_headtextcolor" name="ma_options[mantra_headtextcolor]" value="'.esc_attr( $mantra_options['mantra_headtextcolor'] ).'" />';
+ echo '<div id="mantra_headtextcolor2"></div>';
+ echo "<div><small>".__("Post Header Text Color (Default value is 333333).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[headtexthover]
+function cryout_setting_headtexthover_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_headtexthover" name="ma_options[mantra_headtexthover]" value="'.esc_attr( $mantra_options['mantra_headtexthover'] ).'" />';
+ echo '<div id="mantra_headtexthover2"></div>';
+ echo "<div><small>".__("Post Header Text Color on Mouse over (Default value is 000000).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[sideheadbackcolor]
+function cryout_setting_sideheadbackcolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_sideheadbackcolor" name="ma_options[mantra_sideheadbackcolor]" value="'.esc_attr( $mantra_options['mantra_sideheadbackcolor'] ).'" />';
+ echo '<div id="mantra_sideheadbackcolor2"></div>';
+ echo "<div><small>".__("Sidebar Header Background color (Default value is 444444).","mantra")."</small></div>";
+
+}
+
+//TEXT - Name: ma_options[sideheadtextcolor]
+function cryout_setting_sideheadtextcolor_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_sideheadtextcolor" name="ma_options[mantra_sideheadtextcolor]" value="'.esc_attr( $mantra_options['mantra_sideheadtextcolor'] ).'" />';
+ echo '<div id="mantra_sideheadtextcolor2"></div>';
+ echo "<div><small>".__("Sidebar Header Text Color(Default value is 2EA5FD).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[footerheader]
+function cryout_setting_footerheader_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_footerheader" name="ma_options[mantra_footerheader]" value="'.esc_attr( $mantra_options['mantra_footerheader'] ).'" />';
+ echo '<div id="mantra_footerheader2"></div>';
+ echo "<div><small>".__("Footer Widget Text Color (Default value is 0D85CC).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[footertext]
+function cryout_setting_footertext_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_footertext" name="ma_options[mantra_footertext]" value="'.esc_attr( $mantra_options['mantra_footertext'] ).'" />';
+ echo '<div id="mantra_footertext2"></div>';
+ echo "<div><small>".__("Footer Widget Link Color (Default value is 666666).","mantra")."</small></div>";
+}
+
+//TEXT - Name: ma_options[footerhover]
+function cryout_setting_footerhover_fn() {
+ global $mantra_options;
+ echo '<input type="text" id="mantra_footerhover" name="ma_options[mantra_footerhover]" value="'.esc_attr( $mantra_options['mantra_footerhover'] ).'" />';
+ echo '<div id="mantra_footerhover2"></div>';
+ echo "<div><small>".__("Footer Widget Link Color on Mouse Over (Default value is 888888).","mantra")."</small></div>";
+}
+
+
+////////////////////////////////
+//// GRAPHICS SETTINGS /////////
+////////////////////////////////
+
+
+
+//CHECKBOX - Name: ma_options[breadcrumbs]
+function cryout_setting_breadcrumbs_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_breadcrumbs' name='ma_options[mantra_breadcrumbs]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_breadcrumbs'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Show breadcrumbs at the top of the content area. Breadcrumbs are a form of navigation that keeps track of your location withtin the site.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[pagination]
+function cryout_setting_pagination_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_pagination' name='ma_options[mantra_pagination]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_pagination'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Show numbered pagination. Where there is more than one page, instead of the bottom <b>Older Posts</b> and <b>Newer posts</b> links you have a numbered pagination. ","mantra")."</small></div>";
+}
+
+function cryout_setting_menualign_fn() {
+ global $mantra_options;
+ $items = array ("left", "center", "right");
+ $itemsare = array( __("Left","mantra"), __("Center","mantra"), __("Right","mantra"));
+ echo "<select id='mantra_menualign' name='ma_options[mantra_menualign]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_menualign'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Select the desired main menu items alignment. Center option is only valid for single line menus.","mantra")."</small></div>";
+}
+
+//SELECT - Name: ma_options[caption]
+function cryout_setting_caption_fn() {
+global $mantra_options;
+ $items = array ("White" , "Light" , "Light Gray" , "Gray" , "Dark Gray" , "Black");
+ $itemsare = array( __("White","mantra"), __("Light","mantra"), __("Light Gray","mantra"), __("Gray","mantra"), __("Dark Gray","mantra"), __("Black","mantra"));
+ echo "<select id='mantra_caption' name='ma_options[mantra_caption]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_caption'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("This setting changes the look of your captions. Images that are not inserted through captions will not be affected.","mantra")."</small></div>";
+}
+
+// RADIO-BUTTON - Name: ma_options[image]
+function cryout_setting_image_fn() {
+ global $mantra_options;
+ $items = array("None", "One", "Two", "Three" , "Four", "Five", "Six", "Seven");
+ foreach($items as $item) {
+
+ $checkedClass = ($mantra_options['mantra_image']==$item) ? ' checkedClass' : '';
+
+ echo " <label id='$item' for='$item$item' class='images $checkedClass'><input ";
+ checked($mantra_options['mantra_image'],$item);
+ echo "value='$item' id='$item$item' onClick=\"changeBorder('$item','images');\" name='ma_options[mantra_image]' type='radio' /><img id='image$item' src='".get_template_directory_uri()."/admin/images/testimg.png'/></label>";
+ }
+
+ echo "<div><small>".__("The border around your inserted images. ","mantra")."</small></div>";
+}
+
+// RADIO-BUTTON - Name: ma_options[pin]
+function cryout_setting_pin_fn() {
+global $mantra_options;
+ $items = array("mantra_dot", "Pin1", "Pin2", "Pin3" , "Pin4", "Pin5");
+ foreach($items as $item) {
+ $none='';
+ if ($item == 'mantra_dot') { $none='None'; }
+ $checkedClass = ($mantra_options['mantra_pin']==$item) ? ' checkedClass' : '';
+ echo "<label id='$item' class='pins $checkedClass'><input ";
+ checked($mantra_options['mantra_pin'],$item);
+ echo " value='$item' onClick=\"changeBorder('$item','pins');\" name='ma_options[mantra_pin]' type='radio' />$none<img style='margin-left:10px;margin-right:10px;' src='".get_template_directory_uri()."/images/pins/".$item.".png'/></label>";
+ }
+ echo "<div><small>".__("The image on top of your captions. ","mantra")."</small></div>";
+}
+
+// RADIO-BUTTON - Name: ma_options[sidebullet]
+function cryout_setting_sidebullet_fn() {
+ global $mantra_options;
+ $items = array("mantra_dot2", "arrow_black", "arrow_white", "bullet_dark" , "bullet_gray", "bullet_light", "square_dark", "square_white", "triangle_dark" , "triangle_gray", "triangle_white");
+ foreach($items as $item) {
+ $none='';
+ if ($item == 'mantra_dot2') { $none='None'; }
+ $checkedClass = ($mantra_options['mantra_sidebullet']==$item) ? ' checkedClass' : '';
+ echo "<label id='$item' class='sidebullets $checkedClass'><input ";
+ checked($mantra_options['mantra_sidebullet'],$item);
+ echo " value='$item' onClick=\"changeBorder('$item','sidebullets');\" name='ma_options[mantra_sidebullet]' type='radio' />$none<img style='margin-left:10px;margin-right:10px;' src='".get_template_directory_uri()."/images/bullets/".$item.".png'/></label>";
+ }
+ echo "<div><small>".__("The sidebar list bullets. ","mantra")."</small></div>";
+}
+
+
+
+//CHECKBOX - Name: ma_options[metaback]
+function cryout_setting_metaback_fn() {
+ global $mantra_options;
+ $items = array ("Gray" , "White", "None");
+ $itemsare = array( __("Gray","mantra"), __("White","mantra"), __("None","mantra"));
+ echo "<select id='mantra_metaback' name='ma_options[mantra_metaback]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_metaback'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("The background for your post-metas area (under your post tiltes). Gray by default.","mantra")."</small></div>";
+
+}
+
+//CHECKBOX - Name: ma_options[postseparator]
+function cryout_setting_postseparator_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postseparator' name='ma_options[mantra_postseparator]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postseparator'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show a horizontal rule to separate posts.","mantra")."</small></div>";
+
+}
+
+//CHECKBOX - Name: ma_options[contentlist]
+function cryout_setting_contentlist_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_contentlist' name='ma_options[mantra_contentlist]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_contentlist'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show bullets next to lists that are in your content area (posts, pages etc.).","mantra")."</small></div>";
+
+}
+
+
+//CHECKBOX - Name: ma_options[pagetitle]
+function cryout_setting_pagetitle_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_pagetitle' name='ma_options[mantra_pagetitle]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_pagetitle'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show Page titles on any <i>created</i> pages. ","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[categtitle]
+function cryout_setting_categtitle_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_categtitle' name='ma_options[mantra_categtitle]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_categtitle'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show Page titles on <i>Category</i> Pages. ","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[tables]
+function cryout_setting_tables_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_tables' name='ma_options[mantra_tables]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_tables'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide table borders and background color.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[comtext]
+function cryout_setting_comtext_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_comtext' name='ma_options[mantra_comtext]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_comtext'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the explanatory text under the comments form. (starts with <i>You may use these HTML tags and attributes:...</i>).","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[comclosed]
+function cryout_setting_comclosed_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide in posts", "Hide in pages", "Hide everywhere");
+ $itemsare = array( __("Show","mantra"), __("Hide in posts","mantra"), __("Hide in pages","mantra"), __("Hide everywhere","mantra"));
+ echo "<select id='mantra_comclosed' name='ma_options[mantra_comclosed]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_comclosed'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the <b>Comments are closed</b> text that by default shows up on pages or posts with the comments disabled.","mantra")."</small></div>";
+}
+
+
+//CHECKBOX - Name: ma_options[comoff]
+function cryout_setting_comoff_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_comoff' name='ma_options[mantra_comoff]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_comoff'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the <b>Comments off</b> text next to posts that have comments disabled.","mantra")."</small></div>";
+}
+
+
+//CHECKBOX - Name: ma_options[backtop]
+function cryout_setting_backtop_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_backtop' name='ma_options[mantra_backtop]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_backtop'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Enable the Back to Top button. The button appears after scrolling the page down.","mantra")."</small></div>";
+}
+
+
+////////////////////////////////
+//// POST SETTINGS /////////////
+////////////////////////////////
+
+//CHECKBOX - Name: ma_options[postdate]
+function cryout_setting_postcomlink_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postcomlink' name='ma_options[mantra_postcomlink]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postcomlink'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show the <strong>Leave a comment</strong> or <strong>x Comments</strong> next to posts or post excerpts.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[postdate]
+function cryout_setting_postdate_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postdate' name='ma_options[mantra_postdate]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postdate'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show the post date.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[posttime]
+function cryout_setting_posttime_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_posttime' name='ma_options[mantra_posttime]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_posttime'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Show the post time with the date. Time will not be visible if the Post Date is hidden.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[postauthor]
+function cryout_setting_postauthor_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postauthor' name='ma_options[mantra_postauthor]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postauthor'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide or show the post author.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[postcateg]
+function cryout_setting_postcateg_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postcateg' name='ma_options[mantra_postcateg]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postcateg'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the post category.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[postbook]
+function cryout_setting_postbook_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postbook' name='ma_options[mantra_postbook]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postbook'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the 'Bookmark permalink'.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[postmetas]
+function cryout_setting_postmetas_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_postmetas' name='ma_options[mantra_postmetas]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_postmetas'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the meta bar. All meta info in it will be hidden.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[posttag]
+function cryout_setting_posttag_fn() {
+ global $mantra_options;
+ $items = array ("Show" , "Hide");
+ $itemsare = array( __("Show","mantra"), __("Hide","mantra"));
+ echo "<select id='mantra_posttag' name='ma_options[mantra_posttag]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_posttag'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Hide the post tags.","mantra")."</small></div>";
+}
+
+
+////////////////////////////////
+//// EXCERPT SETTINGS /////////////
+////////////////////////////////
+
+
+//CHECKBOX - Name: ma_options[excerpthome]
+function cryout_setting_excerpthome_fn() {
+ global $mantra_options;
+ $items = array ("Excerpt" , "Full Post");
+ $itemsare = array( __("Excerpt","mantra"), __("Full Post","mantra"));
+ echo "<select id='mantra_excerpthome' name='ma_options[mantra_excerpthome]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_excerpthome'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Excerpts on the main page. Only standard posts will be affected. All other post formats (aside, image, chat, quote etc.) have their specific formating.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[excerptsticky]
+function cryout_setting_excerptsticky_fn() {
+ global $mantra_options;
+ $items = array ("Excerpt" , "Full Post");
+ $itemsare = array( __("Excerpt","mantra"), __("Full Post","mantra"));
+ echo "<select id='mantra_excerptsticky' name='ma_options[mantra_excerptsticky]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_excerptsticky'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Choose if you want the sticky posts on your home page to be visible in full or just the excerpts. ","mantra")."</small></div>";
+}
+
+
+//CHECKBOX - Name: ma_options[excerptarchive]
+function cryout_setting_excerptarchive_fn() {
+ global $mantra_options;
+ $items = array ("Excerpt" , "Full Post");
+ $itemsare = array( __("Excerpt","mantra"), __("Full Post","mantra"));
+ echo "<select id='mantra_excerptarchive' name='ma_options[mantra_excerptarchive]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_excerptarchive'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Excerpts on archive, categroy and search pages. Same as above, only standard posts will be affected.","mantra")."</small></div>";
+}
+
+
+// TEXTBOX - Name: ma_options[excerptwords]
+function cryout_setting_excerptwords_fn() {
+ global $mantra_options;
+ echo "<input id='mantra_excerptwords' name='ma_options[mantra_excerptwords]' size='6' type='text' value='".esc_attr( $mantra_options['mantra_excerptwords'] )."' />";
+ echo "<div><small>".__("The number of words an excerpt will have. When that number is reached the post will be interrupted by a <i>Continue reading</i> link that
+ will take the reader to the full post page.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[magazinelayout]
+function cryout_setting_magazinelayout_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_magazinelayout' name='ma_options[mantra_magazinelayout]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_magazinelayout'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Enable the Magazine Layout. This layout applies to pages with posts and shows 2 posts per row.","mantra")."</small></div>";
+}
+
+// TEXTBOX - Name: ma_options[excerptdots]
+function cryout_setting_excerptdots_fn() {
+ global $mantra_options;
+ echo "<input id='mantra_excerptdots' name='ma_options[mantra_excerptdots]' size='40' type='text' value='".esc_attr( $mantra_options['mantra_excerptdots'] )."' />";
+ echo "<div><small>".__("Replaces the three dots ('[...])' that are appended automatically to excerpts.","mantra")."</small></div>";
+}
+
+// TEXTBOX - Name: ma_options[excerptcont]
+function cryout_setting_excerptcont_fn() {
+ global $mantra_options;
+ echo "<input id='mantra_excerptcont' name='ma_options[mantra_excerptcont]' size='40' type='text' value='".esc_attr( $mantra_options['mantra_excerptcont'] )."' />";
+ echo "<div><small>".__("Edit the 'Continue Reading' link added to your post excerpts.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[excerpttags]
+function cryout_setting_excerpttags_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_excerpttags' name='ma_options[mantra_excerpttags]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_excerpttags'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("By default WordPress excerpts remove all HTML tags (".htmlspecialchars('<pre>, <a>, <b>')." and all others) and only clean text is left in the excerpt.
+Enabling this option allows HTML tags to remain in excerpts so all your default formating will be kept.<br /> <b>Just a warning: </b>If HTML tags are enabled, you have to make sure
+they are not left open. So if within your post you have an opened HTML tag but the except ends before that tag closes, the rest of the site will be contained in that HTML tag. -- Leave 'Disable' if unsure -- ","mantra")."</small></div>";
+}
+
+
+////////////////////////////////
+/// FEATURED IMAGE SETTINGS ////
+////////////////////////////////
+
+
+//CHECKBOX - Name: ma_options[fpost]
+function cryout_setting_fpost_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_fpost' name='ma_options[mantra_fpost]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fpost'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ $checkedClass = ($mantra_options['mantra_fpostlink']=='1') ? ' checkedClass' : '';
+
+
+ echo " <label style='border:none;margin-left:10px;' id='$items[0]' for='$items[0]$items[0]' class='socialsdisplay $checkedClass'><input type='hidden' name='ma_options[mantra_fpostlink]' value='0' /><input ";
+ checked($mantra_options['mantra_fpostlink'],'1');
+ echo "value='1' id='$items[0]$items[0]' name='ma_options[mantra_fpostlink]' type='checkbox' /> Link the thumbail to the post </label>";
+
+
+ echo "<div><small>".__("Show featured images as thumbnails on posts. The images must be selected for each post in the Featured Image section.","mantra")."</small></div>";
+}
+
+//CHECKBOX - Name: ma_options[fauto]
+function cryout_setting_fauto_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_fauto' name='ma_options[mantra_fauto]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fauto'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Show the first image that you inserted in a post as a thumbnail. If you enable this option, the first image in your post will be used even if you selected a Featured Image in you post.","mantra")."</small></div>";
+}
+
+
+//CHECKBOX - Name: ma_options[falign]
+function cryout_setting_falign_fn() {
+ global $mantra_options;
+ $items = array ("Left" , "Center", "Right");
+ $itemsare = array( __("Left","mantra"), __("Center","mantra"), __("Right","mantra"));
+ echo "<select id='mantra_falign' name='ma_options[mantra_falign]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_falign'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Thumbnail alignment.","mantra")."</small></div>";
+}
+
+
+// TEXTBOX - Name: ma_options[fwidth]
+function cryout_setting_fsize_fn() {
+ global $mantra_options;
+ echo "<input id='mantra_fwidth' name='ma_options[mantra_fwidth]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_fwidth'] )."' />px (width) <b>X</b> ";
+ echo "<input id='mantra_fheight' name='ma_options[mantra_fheight]' size='4' type='text' value='".esc_attr( $mantra_options['mantra_fheight'] )."' />px (height)";
+
+ $checkedClass = ($mantra_options['mantra_fcrop']=='1') ? ' checkedClass' : '';
+
+ echo " <label id='fcrop' for='mantra_fcrop' class='socialsdisplay $checkedClass'><input ";
+ checked($mantra_options['mantra_fcrop'],'1');
+ echo "value='1' id='mantra_fcrop' name='ma_options[mantra_fcrop]' type='checkbox' /> Crop images to exact size. </label>";
+
+
+ echo "<div><small>".__("The size you want the thumbnails to have (in pixels). By default imges will be scaled with aspect ratio kept. Choose to crop the images if you want the exact size.","mantra")."</small></div>";
+}
+
+
+//CHECKBOX - Name: ma_options[fheader]
+function cryout_setting_fheader_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_fheader' name='ma_options[mantra_fheader]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_fheader'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Show featured images on headers. The header will be replaced with a featured image if you selected it as a Featured Image in the post and
+ and if it is bigger or at least equal to the current header size.","mantra")."</small></div>";
+}
+
+
+////////////////////////
+/// SOCIAL SETTINGS ////
+////////////////////////
+
+// TEXTBOX - Name: ma_options[social1]
+
+
+
+function cryout_setting_social_master($i) {
+ $cryout_special_keys = array('Mail', 'Skype');
+ $cryout_social_small = array (
+ '',__('Select your desired Social network from the left dropdown menu and insert your corresponding address in the right input field. (ex: <i>http://www.facebook.com/yourname</i> )','mantra'),
+ '',__("You can insert up to 5 different social sites and addresses.",'mantra'),
+ '',__("There are a total of 27 social networks to choose from. ",'mantra'),
+ '',__("You can leave any number of inputs empty. " ,'mantra'),
+ '',__("You can choose the same social media any number of times. ",'mantra')
+ );
+ $j=$i+1;
+ global $mantra_options, $socialNetworks;
+ echo "<select id='mantra_social$i' name='ma_options[mantra_social$i]'>";
+ foreach($socialNetworks as $item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_social'.$i],$item);
+ echo ">$item</option>";
+ }
+ echo "</select><span class='address_span'> &raquo; </span>";
+
+ if (in_array($mantra_options['mantra_social'.$i],$cryout_special_keys)) :
+ $cryout_current_social = esc_html( $mantra_options['mantra_social'.$j] );
+ else :
+ $cryout_current_social = esc_url( $mantra_options['mantra_social'.$j] );
+ endif;
+
+ echo "<input id='mantra_social$j' name='ma_options[mantra_social$j]' size='32' type='text' value='$cryout_current_social' />";
+ echo "<div><small>".$cryout_social_small[$i]."</small></div>";
+}
+
+
+
+function cryout_setting_socials1_fn() {
+ cryout_setting_social_master(1);
+}
+
+function cryout_setting_socials2_fn() {
+ cryout_setting_social_master(3);
+}
+
+// TEXTBOX - Name: ma_options[social3]
+function cryout_setting_socials3_fn() {
+cryout_setting_social_master(5);
+}
+
+// TEXTBOX - Name: ma_options[social4]
+function cryout_setting_socials4_fn() {
+cryout_setting_social_master(7);
+}
+
+// TEXTBOX - Name: ma_options[social5]
+function cryout_setting_socials5_fn() {
+cryout_setting_social_master(9);
+}
+
+// TEXTBOX - Name: ma_options[socialsdisplay]
+function cryout_setting_socialsdisplay_fn() {
+global $mantra_options;
+ $items = array( "Header", "CLeft", "CRight" , "Footer");
+
+ $checkedClass0 = ($mantra_options['mantra_socialsdisplay0']=='1') ? ' checkedClass0' : '';
+ $checkedClass1 = ($mantra_options['mantra_socialsdisplay1']=='1') ? ' checkedClass1' : '';
+ $checkedClass2 = ($mantra_options['mantra_socialsdisplay2']=='1') ? ' checkedClass2' : '';
+ $checkedClass3 = ($mantra_options['mantra_socialsdisplay3']=='1') ? ' checkedClass3' : '';
+
+ echo " <label id='$items[0]' for='$items[0]$items[0]' class='socialsdisplay $checkedClass0'><input ";
+ checked($mantra_options['mantra_socialsdisplay0'],'1');
+ echo "value='1' id='$items[0]$items[0]' name='ma_options[mantra_socialsdisplay0]' type='checkbox' /> Top right corner of header </label>";
+
+ echo " <label id='$items[1]' for='$items[1]$items[1]' class='socialsdisplay $checkedClass1'><input ";
+ checked($mantra_options['mantra_socialsdisplay1'],'1');
+ echo "value='1' id='$items[1]$items[1]' name='ma_options[mantra_socialsdisplay1]' type='checkbox' /> Under menu - left side </label>";
+
+ echo " <label id='$items[2]' for='$items[2]$items[2]' class='socialsdisplay $checkedClass2'><input ";
+ checked($mantra_options['mantra_socialsdisplay2'],'1');
+ echo "value='1' id='$items[2]$items[2]' name='ma_options[mantra_socialsdisplay2]' type='checkbox' /> Under menu - right side </label>";
+
+ echo " <label id='$items[3]' for='$items[3]$items[3]' class='socialsdisplay $checkedClass3'><input ";
+ checked($mantra_options['mantra_socialsdisplay3'],'1');
+ echo "value='1' id='$items[3]$items[3]' name='ma_options[mantra_socialsdisplay3]' type='checkbox' /> In the footer (smaller icons) </label>";
+
+
+
+ echo "<div><p><small>".__("Choose the <b>areas</b> where to display the social icons.","mantra")."</small></p></div>";
+}
+
+
+////////////////////////
+/// MISC SETTINGS ////
+////////////////////////
+
+
+// TEXTBOX - Name: ma_options[copyright]
+function cryout_setting_copyright_fn() {
+ global $mantra_options;
+ echo "<textarea id='mantra_copyright' name='ma_options[mantra_copyright]' rows='3' cols='70' type='textarea' >".esc_textarea($mantra_options['mantra_copyright'])." </textarea>";
+ echo "<div><small>".__("Insert custom text or HTML code that will appear last in you footer. <br /> You can use HTML to insert links, images and special characters like &copy .","mantra")."</small></div>";
+}
+
+
+// TEXTBOX - Name: ma_options[customcss]
+function cryout_setting_customcss_fn() {
+ global $mantra_options;
+ echo "<textarea id='mantra_customcss' name='ma_options[mantra_customcss]' rows='8' cols='70' type='textarea' >".esc_textarea(htmlspecialchars_decode($mantra_options['mantra_customcss'], ENT_QUOTES))." </textarea>";
+ echo "<div><small>".__("Insert your custom CSS here. Any CSS declarations made here will overwrite Mantra's (even the custom options specified right here in the Mantra Settings page). <br> Your custom CSS will be preserved when updating the theme.<br> The &ltstyle&gt tags are not needed.","mantra")."</small></div>";
+}
+
+// TEXTBOX - Name: ma_options[customjs]
+function cryout_setting_customjs_fn() {
+ global $mantra_options;
+ echo "<textarea id='mantra_customjs' name='ma_options[mantra_customjs]' rows='8' cols='70' type='textarea' >".esc_textarea(htmlspecialchars_decode($mantra_options['mantra_customjs'], ENT_QUOTES))." </textarea>";
+ echo "<div><small>".__("Insert your custom Javascript code here. (Google Analytics and any other forms of Analytic software).<br> The &ltscript&gt tags are not needed.","mantra")."</small></div>";
+}
+function cryout_setting_seo_fn() {
+ global $mantra_options;
+ $items = array ("Enable" , "Disable");
+ $itemsare = array( __("Enable","mantra"), __("Disable","mantra"));
+ echo "<select id='mantra_seo' name='ma_options[mantra_seo]'>";
+foreach($items as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_seo'],$item);
+ echo ">$itemsare[$id]</option>";
+}
+ echo "</select>";
+ echo "<div><small>".__("Enable Mantra's Search Engine Optimization. This is enabled by default and should only be disabled if you are using a SEO plugin.","mantra")."</small></div>";
+ echo "<br><small> All title tags are handled automatically by Mantra. </small>";
+
+ echo "<div class='slmini'>";
+ echo "<b> Homepage Meta Description </b>";
+ echo "<textarea id='mantra_seo_home_desc' name='ma_options[mantra_seo_home_desc]' rows='2' cols=50' type='textarea' >{$mantra_options['mantra_seo_home_desc']} </textarea>";
+ echo "<small> This is unique and you should fill this in. Describe your site the best you can and try not to go over 160 characters. </small>";
+ echo "</div>";
+
+ echo "<div class='slmini'>";
+ echo "<b> Meta Descriptions for all other pages: </b>";
+ $moreitems = array ("Auto" , "Manual");
+ $moreitemsare = array( __("Auto","mantra"), __("Manual","mantra"));
+ echo "<select id='mantra_seo_gen_desc' name='ma_options[mantra_seo_gen_desc]'>";
+ foreach($moreitems as $id=>$item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_seo_gen_desc'],$item);
+ echo ">$moreitemsare[$id]</option>";
+ }
+ echo "</select>";
+ echo "<small> <u>Auto</u> - Mantra will automatically add post expcerpts to 'page' and 'post' meta descriptions.<br>
+ <u>Manual</u> - you will enable a new custom field in your post/page admin section where you can type the exact description you want for every post and page.</small>";
+ echo "</div>";
+
+ echo "<small>For category pages, the actual category descriptions will be used. Go to Posts > Categories and you can fill in a description for every category you have. </small>";
+
+ echo "<div class='slmini'>";
+ echo "<b>Post Author</b>";
+ $authors=wp_list_authors (array("echo"=>false,"html"=> false));
+ $authors_array = explode ("," , $authors);
+ array_unshift($authors_array,"Do not use");
+ echo "<select id='mantra_seo_author' name='ma_options[mantra_seo_author]'>";
+ foreach($authors_array as $item) {
+ echo "<option value='$item'";
+ selected($mantra_options['mantra_seo_author'],$item);
+ echo ">$item</option>";
+}
+ echo "</select>";
+
+
+ echo "<small> If you want to show an author in the meta tags. </small>";
+ echo "</div>";
+
+}
+?> \ No newline at end of file
diff --git a/themes/mantra/archive.php b/themes/mantra/archive.php
new file mode 100644
index 00000000..bd14c3e3
--- /dev/null
+++ b/themes/mantra/archive.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * The template for displaying Archive pages.
+ *
+ * Used to display archive-type pages if nothing more specific matches a query.
+ * For example, puts together date-based pages if no date.php file exists.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+
+get_header(); ?>
+
+ <section id="container">
+ <div id="content" role="main">
+
+ <?php cryout_before_content_hook(); ?>
+
+ <?php if ( have_posts() ) : ?>
+
+ <header class="page-header">
+ <h1 class="page-title">
+ <?php if ( is_day() ) : ?>
+ <?php printf( __( 'Daily Archives: %s', 'mantra' ), '<span>' . get_the_date() . '</span>' ); ?>
+ <?php elseif ( is_month() ) : ?>
+ <?php printf( __( 'Monthly Archives: %s', 'mantra' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'mantra' ) ) . '</span>' ); ?>
+ <?php elseif ( is_year() ) : ?>
+ <?php printf( __( 'Yearly Archives: %s', 'mantra' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'mantra' ) ) . '</span>' ); ?>
+ <?php else : ?>
+ <?php _e( 'Blog Archives', 'mantra' ); ?>
+ <?php endif; ?>
+ </h1>
+ </header>
+
+ <?php mantra_content_nav( 'nav-above' ); ?>
+
+ <?php /* Start the Loop */ ?>
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php
+ /* Include the Post-Format-specific template for the content.
+ * If you want to overload this in a child theme then include a file
+ * called content-___.php (where ___ is the Post Format name) and that will be used instead.
+ */
+ get_template_part( 'content', get_post_format() );
+ ?>
+
+ <?php endwhile; ?>
+
+ <?php if($mantra_pagination=="Enable") mantra_pagination(); else mantra_content_nav( 'nav-below' ); ?>
+
+ <?php else : ?>
+
+ <article id="post-0" class="post no-results not-found">
+ <header class="entry-header">
+ <h1 class="entry-title"><?php _e( 'Nothing Found', 'mantra' ); ?></h1>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mantra' ); ?></p>
+ <?php get_search_form(); ?>
+ </div><!-- .entry-content -->
+ </article><!-- #post-0 -->
+
+ <?php endif; ?>
+
+ <?php cryout_after_content_hook(); ?>
+ </div><!-- #content -->
+ <?php get_sidebar(); ?>
+ </section><!-- #primary -->
+
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/themes/mantra/attachment.php b/themes/mantra/attachment.php
new file mode 100644
index 00000000..865fc400
--- /dev/null
+++ b/themes/mantra/attachment.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * The template for displaying attachments.
+ *
+ * @package Cryout Creations
+ * @subpackage mantra
+ * @since mantra 0.5
+ */
+
+get_header(); ?>
+
+ <section id="container" class="single-attachment">
+ <div id="content" role="main">
+
+<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+ <?php if ( ! empty( $post->post_parent ) ) : ?>
+ <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'mantra' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
+ /* translators: %s - title of parent post */
+ printf( '<span class="meta-nav">&laquo;</span> %s', get_the_title( $post->post_parent ) );
+ ?></a></p>
+ <?php endif; ?>
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <h2 class="entry-title"><?php the_title(); ?></h2>
+
+ <div class="entry-meta">
+ <?php
+ printf('<span class="%1$s">'.__('By','mantra').'</span> %2$s',
+ 'meta-prep meta-prep-author',
+ sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
+ get_author_posts_url( get_the_author_meta( 'ID' ) ),
+ sprintf( esc_attr__( 'View all posts by %s', 'mantra' ), get_the_author() ),
+ get_the_author()
+ )
+ );
+ ?>
+ <span class="meta-sep">|</span>
+ <?php
+ printf( '<span class="%1$s">'.__('Published','mantra').'</span> %2$s',
+ 'meta-prep meta-prep-entry-date',
+ sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>',
+ esc_attr( get_the_time() ),
+ get_the_date()
+ )
+ );
+ if ( wp_attachment_is_image() ) {
+ echo ' <span class="meta-sep">|</span> ';
+ $metadata = wp_get_attachment_metadata();
+ printf( __( 'Full size is %s pixels', 'mantra'),
+ sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
+ wp_get_attachment_url(),
+ esc_attr( __('Link to full-size image', 'mantra') ),
+ $metadata['width'],
+ $metadata['height']
+ )
+ );
+ }
+ ?>
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-meta -->
+
+ <div class="entry-content">
+ <div class="entry-attachment">
+<?php if ( wp_attachment_is_image() ) :
+ $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
+ foreach ( $attachments as $k => $attachment ) {
+ if ( $attachment->ID == $post->ID )
+ break;
+ }
+ $k++;
+ // If there is more than 1 image attachment in a gallery
+ if ( count( $attachments ) > 1 ) {
+ if ( isset( $attachments[ $k ] ) )
+ // get the URL of the next image attachment
+ $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
+ else
+ // or get the URL of the first image attachment
+ $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
+ } else {
+ // or, if there's only 1 image attachment, get the URL of the image
+ $next_attachment_url = wp_get_attachment_url();
+ }
+?>
+ <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
+ $attachment_size = apply_filters( 'mantra_attachment_size', 900 );
+ echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
+ ?></a></p>
+
+ <div id="nav-below" class="navigation">
+ <div class="nav-previous">&laquo; <?php previous_image_link( false ); ?></div>
+ <div class="nav-next"><?php next_image_link( false ); ?> &raquo;</div>
+ </div><!-- #nav-below -->
+<?php else : ?>
+ <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
+<?php endif; ?>
+ </div><!-- .entry-attachment -->
+ <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
+
+<?php the_content( __( 'Continue reading','mantra').' <span class="meta-nav">&rarr;</span>' ); ?>
+<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'mantra' ), 'after' => '</div>' ) ); ?>
+
+ </div><!-- .entry-content -->
+
+ <div class="entry-utility">
+ <?php mantra_posted_in(); ?>
+ <?php edit_post_link( __( 'Edit', 'mantra' ), ' <span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-utility -->
+ </div><!-- #post-## -->
+
+<?php comments_template(); ?>
+
+<?php endwhile; ?>
+
+ </div><!-- #content -->
+ </section><!-- #container -->
+
+<?php get_footer(); ?>
diff --git a/themes/mantra/author.php b/themes/mantra/author.php
new file mode 100644
index 00000000..393a4297
--- /dev/null
+++ b/themes/mantra/author.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * The template for displaying Author Archive pages.
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+
+get_header(); ?>
+
+ <section id="container">
+ <div id="content" role="main">
+ <?php cryout_before_content_hook(); ?>
+
+ <?php if ( have_posts() ) : ?>
+
+ <?php
+ /* Queue the first post, that way we know
+ * what author we're dealing with (if that is the case).
+ *
+ * We reset this later so we can run the loop
+ * properly with a call to rewind_posts().
+ */
+ the_post();
+ ?>
+
+ <header class="page-header">
+ <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'mantra' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
+ </header>
+
+ <?php
+ /* Since we called the_post() above, we need to
+ * rewind the loop back to the beginning that way
+ * we can run the loop properly, in full.
+ */
+ rewind_posts();
+ ?>
+
+ <?php mantra_content_nav( 'nav-above' ); ?>
+
+ <?php
+ // If a user has filled out their description, show a bio on their entries.
+ if ( get_the_author_meta( 'description' ) ) : ?>
+ <div id="author-info">
+ <div id="author-avatar">
+ <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'mantra_author_bio_avatar_size', 60 ) ); ?>
+ </div><!-- #author-avatar -->
+ <div id="author-description">
+ <h2><?php printf( __( 'About %s', 'mantra' ), get_the_author() ); ?></h2>
+ <?php the_author_meta( 'description' ); ?>
+ </div><!-- #author-description -->
+ </div><!-- #entry-author-info -->
+ <?php endif; ?>
+
+ <?php /* Start the Loop */ ?>
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php
+ /* Include the Post-Format-specific template for the content.
+ * If you want to overload this in a child theme then include a file
+ * called content-___.php (where ___ is the Post Format name) and that will be used instead.
+ */
+ get_template_part( 'content', get_post_format() );
+ ?>
+
+ <?php endwhile; ?>
+
+ <?php if($mantra_pagination=="Enable") mantra_pagination(); else mantra_content_nav( 'nav-below' ); ?>
+
+ <?php else : ?>
+
+ <article id="post-0" class="post no-results not-found">
+ <header class="entry-header">
+ <h1 class="entry-title"><?php _e( 'Nothing Found', 'mantra' ); ?></h1>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mantra' ); ?></p>
+ <?php get_search_form(); ?>
+ </div><!-- .entry-content -->
+ </article><!-- #post-0 -->
+
+ <?php endif; ?>
+
+ <?php cryout_after_content_hook(); ?>
+ </div><!-- #content -->
+ <?php get_sidebar(); ?>
+ </section><!-- #primary -->
+
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/themes/mantra/category.php b/themes/mantra/category.php
new file mode 100644
index 00000000..efe03b6b
--- /dev/null
+++ b/themes/mantra/category.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * The template for displaying Category Archive pages.
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+
+get_header(); ?>
+
+ <section id="container">
+ <div id="content" role="main">
+ <?php cryout_before_content_hook(); ?>
+
+ <?php if ( have_posts() ) : ?>
+
+ <header class="page-header">
+ <h1 class="page-title"><?php
+ printf( __( 'Category Archives: %s', 'mantra' ), '<span>' . single_cat_title( '', false ) . '</span>' );
+ ?></h1>
+
+ <?php
+ $category_description = category_description();
+ if ( ! empty( $category_description ) )
+ echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
+ ?>
+ </header>
+
+ <?php mantra_content_nav( 'nav-above' ); ?>
+
+ <?php /* Start the Loop */ ?>
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php
+ /* Include the Post-Format-specific template for the content.
+ * If you want to overload this in a child theme then include a file
+ * called content-___.php (where ___ is the Post Format name) and that will be used instead.
+ */
+ get_template_part( 'content', get_post_format() );
+ ?>
+
+ <?php endwhile; ?>
+
+ <?php if($mantra_pagination=="Enable") mantra_pagination(); else mantra_content_nav( 'nav-below' ); ?>
+
+ <?php else : ?>
+
+ <article id="post-0" class="post no-results not-found">
+ <header class="entry-header">
+ <h1 class="entry-title"><?php _e( 'Nothing Found', 'mantra' ); ?></h1>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mantra' ); ?></p>
+ <?php get_search_form(); ?>
+ </div><!-- .entry-content -->
+ </article><!-- #post-0 -->
+
+ <?php endif; ?>
+
+ <?php cryout_after_content_hook(); ?>
+ </div><!-- #content -->
+ <?php get_sidebar(); ?>
+ </section><!-- #primary -->
+
+<?php get_footer(); ?>
diff --git a/themes/mantra/comments.php b/themes/mantra/comments.php
new file mode 100644
index 00000000..4459314c
--- /dev/null
+++ b/themes/mantra/comments.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * The template for displaying Comments.
+ *
+ * The area of the page that contains both current comments
+ * and the comment form. The actual display of comments is
+ * handled by a callback to mantra_comment which is
+ * located in the includes/theme-comments.php file.
+ *
+ * @package Cryout Creations
+ * @subpackage mantra
+ * @since mantra 0.5
+ */
+?>
+
+ <div id="comments">
+<?php if ( post_password_required() ) : ?>
+ <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'mantra' ); ?></p>
+ </div><!-- #comments -->
+<?php
+ /* Stop the rest of comments.php from being processed,
+ * but don't kill the script entirely -- we still have
+ * to fully load the template.
+ */
+ return;
+ endif;
+?>
+
+<?php
+ // You can start editing here -- including this comment!
+?>
+
+<?php if ( have_comments() ) :
+
+ cryout_before_comments_hook(); ?>
+
+ <ol class="commentlist">
+
+ <?php cryout_comments_hook(); ?>
+
+ </ol>
+
+ <?php cryout_after_comments_hook();
+
+?><?php else : // or, if we don't have comments:
+
+ cryout_nocomments_hook();
+
+ endif; // end have_comments() ?>
+
+<?php comment_form(); ?>
+
+</div><!-- #comments -->
diff --git a/themes/mantra/content-aside.php b/themes/mantra/content-aside.php
new file mode 100644
index 00000000..22ecf32c
--- /dev/null
+++ b/themes/mantra/content-aside.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * The template for displaying posts in the Aside Post Format on index and archive pages
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 0.5
+ */
+?>
+
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook(); ?>
+ <div class="entry-meta2">
+<h3 class="entry-format"><?php _e( 'Aside', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta2 -->
+
+ </header><!-- .entry-header -->
+ <?php cryout_post_before_content_hook();
+ ?><?php if ( is_search() ) : // Only display Excerpts for Search ?>
+ <div class="entry-summary">
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php else : ?>
+ <div class="entry-content">
+ <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'mantra' ) ); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php endif; ?><?php
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+ </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content-chat.php b/themes/mantra/content-chat.php
new file mode 100644
index 00000000..5b629ab4
--- /dev/null
+++ b/themes/mantra/content-chat.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * The template for displaying posts in the Link Post Format on index and archive pages
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+?>
+
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook(); ?>
+ <div class="entry-meta2">
+ <h3 class="entry-format"><?php _e( 'Chat', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta -->
+ </header><!-- .entry-header -->
+ <?php cryout_post_before_content_hook();
+ ?><?php if ( is_search() ) : // Only display Excerpts for Search ?>
+ <div class="entry-summary">
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php else : ?>
+ <div class="entry-content">
+ <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'mantra' ) ); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php endif; ?><?php
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+
+
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+ </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content-frontpage.php b/themes/mantra/content-frontpage.php
new file mode 100644
index 00000000..8360afa1
--- /dev/null
+++ b/themes/mantra/content-frontpage.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since 2.2
+ */
+
+global $mantra_options;
+?>
+ <section id="container">
+ <div id="content" role="main" style="width:96%;">
+ <?php if ( have_posts() ) : ?>
+
+ <?php $the_query = new WP_Query( array('posts_per_page'=>$mantra_options['mantra_frontpostscount']) ); ?>
+ <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
+
+ <?php get_template_part( 'content', get_post_format() ); ?>
+
+ <?php endwhile;
+ wp_reset_postdata(); ?>
+
+ <?php else : ?>
+ <article id="post-0" class="post no-results not-found">
+ <header class="entry-header">
+ <h1 class="entry-title"><?php _e( 'Nothing Found', 'mantra' ); ?></h1>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mantra' ); ?></p>
+ <?php get_search_form(); ?>
+ </div><!-- .entry-content -->
+ </article><!-- #post-0 -->
+ <?php endif; ?>
+ </div><!-- #content -->
+ <?php //get_sidebar(); ?>
+ </section><!-- #container --> \ No newline at end of file
diff --git a/themes/mantra/content-gallery.php b/themes/mantra/content-gallery.php
new file mode 100644
index 00000000..04046799
--- /dev/null
+++ b/themes/mantra/content-gallery.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * The template for displaying posts in the Gallery Post Format on index and archive pages
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+
+$options = mantra_get_theme_options();
+foreach ($options as $key => $value) { ${"$key"} = $value ; }
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook(); ?>
+ <div class="entry-meta">
+ <h3 class="entry-format"><?php _e( 'Gallery', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta -->
+ </header><!-- .entry-header -->
+ <?php cryout_post_before_content_hook();
+ ?><?php if ( is_search() ) : // Only display Excerpts for search pages ?>
+ <div class="entry-summary">
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php else : ?>
+ <div class="entry-content">
+ <?php
+ /* $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
+ if ( $images ) :
+ $total_images = count( $images );
+ $image = array_shift( $images );
+ $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );*/
+ $images = mantra_get_gallery_images();
+ if ( $images ) : $total_images = count( $images );
+ $image = array_shift( $images );
+
+ if (is_sticky() && $mantra_excerptsticky == "Full Post") $sticky_test=1; else $sticky_test=0;
+ if ($mantra_excerpthome != "Full Post" && $sticky_test==0):
+ /*?>
+
+ <figure class="gallery-thumb">
+ <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
+ </figure><!-- .gallery-thumb -->
+ */
+ mantra_set_featured_thumb();
+ ?>
+ <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'mantra' ),
+ 'href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
+ number_format_i18n( $total_images )
+ ); ?></em></p>
+ <?php
+ the_excerpt();
+ else:
+ the_content();
+ endif; ?>
+ <?php endif; ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php endif; ?><?php
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content-image.php b/themes/mantra/content-image.php
new file mode 100644
index 00000000..86bf5ca2
--- /dev/null
+++ b/themes/mantra/content-image.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * The template for displaying posts in the Image Post Format on index and archive pages
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+?>
+ <article id="post-<?php the_ID(); ?>" <?php post_class( 'indexed' ); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ <?php cryout_post_title_hook(); ?>
+ </hgroup>
+ <div class="entry-meta2">
+ <h3 class="entry-format"><?php _e( 'Image', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta -->
+
+ </header><!-- .entry-header -->
+<?php cryout_post_before_content_hook(); ?>
+ <div class="entry-content">
+ <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'mantra' ) ); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+<?php cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+ </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content-link.php b/themes/mantra/content-link.php
new file mode 100644
index 00000000..4b309f24
--- /dev/null
+++ b/themes/mantra/content-link.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * The template for displaying posts in the Link Post Format on index and archive pages
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+?>
+
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook(); ?>
+ <div class="entry-meta2">
+ <h3 class="entry-format"><?php _e( 'Link', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta -->
+ </header><!-- .entry-header -->
+ <?php cryout_post_before_content_hook();
+ ?><?php if ( is_search() ) : // Only display Excerpts for Search ?>
+ <div class="entry-summary">
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php else : ?>
+ <div class="entry-content">
+ <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'mantra' ) ); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php endif; ?><?php
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+
+
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+ </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content-page.php b/themes/mantra/content-page.php
new file mode 100644
index 00000000..85eaaae3
--- /dev/null
+++ b/themes/mantra/content-page.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ */
+
+if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <?php if ( is_front_page() ) { ?>
+ <h2 class="entry-title"><?php the_title(); ?></h2>
+ <?php } else { ?>
+ <h1 class="entry-title"><?php the_title(); ?></h1>
+ <?php } ?>
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'mantra' ), 'after' => '</div>' ) ); ?>
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-content -->
+ </div><!-- #post-## -->
+
+ <?php if ( comments_open() ) { comments_template( '', true );} else { ?>
+ <p class="nocomments2"><?php _e( 'Comments are closed.', 'mantra' ); ?></p>
+
+
+<?php } endwhile; ?>
diff --git a/themes/mantra/content-quote.php b/themes/mantra/content-quote.php
new file mode 100644
index 00000000..102f2911
--- /dev/null
+++ b/themes/mantra/content-quote.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * The default template for displaying posts in the Quote Post Format on index and archive pages
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+?>
+
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook(); ?>
+ <div class="entry-meta2">
+ <h3 class="entry-format"><?php _e( 'Quote', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta -->
+ </header><!-- .entry-header -->
+ <?php cryout_post_before_content_hook();
+ ?><?php if ( is_search() ) : // Only display Excerpts for Search ?>
+ <div class="entry-summary">
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php else : ?>
+ <div class="entry-content">
+ <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'mantra' ) ); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php endif; ?><?php
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+ </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content-status.php b/themes/mantra/content-status.php
new file mode 100644
index 00000000..45ee3f04
--- /dev/null
+++ b/themes/mantra/content-status.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * The template for displaying posts in the Status Post Format on index and archive pages
+ *
+ * Learn more: http://codex.wordpress.org/Post_Formats
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ */
+?>
+
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook(); ?>
+ </header><!-- .entry-header -->
+<?php cryout_post_before_content_hook();
+ ?><?php if ( is_search() ) : // Only display Excerpts for Search ?>
+ <div class="entry-summary">
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php else : ?>
+ <div class="entry-content">
+ <div class="avatar">
+ <?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'mantra_status_avatar', '65' ) ); ?>
+ </div>
+ <div class="entry-meta2">
+ <h3 class="entry-format"><?php _e( 'Status', 'mantra' ); ?></h3>
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?>
+ </div><!-- .entry-meta2 -->
+ <div class="status_content"> <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'mantra' ) ); ?> </div>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php endif; ?><?php
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta3">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+ </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/themes/mantra/content.php b/themes/mantra/content.php
new file mode 100644
index 00000000..b23e5ef2
--- /dev/null
+++ b/themes/mantra/content.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * The default template for displaying content
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ * @since Mantra 1.0
+ */
+
+$options= mantra_get_theme_options();
+foreach ($options as $key => $value) {
+ ${"$key"} = $value ;
+}
+
+?><?php cryout_before_article_hook(); ?>
+
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <header class="entry-header">
+ <hgroup>
+ <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'mantra' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
+ </hgroup>
+ <?php cryout_post_title_hook();
+ ?><?php if ( 'post' == get_post_type() ) : ?>
+ <div class="entry-meta">
+ <?php mantra_posted_on(); ?>
+ <?php /* if ( comments_open() && ! post_password_required() ) :*/ ?>
+ <div class="comments-link">
+ <?php mantra_comments_on(); ?>
+ </div>
+ <?php /* endif; */ ?><?php
+ cryout_post_meta_hook(); ?>
+ </div><!-- .entry-meta -->
+ <?php endif; ?>
+
+
+ </header><!-- .entry-header -->
+ <?php cryout_post_before_content_hook();
+ ?><?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
+
+ <?php if ($mantra_excerptarchive != "Full Post" ){ ?>
+ <div class="entry-summary">
+ <?php mantra_set_featured_thumb(); ?>
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php } else { ?>
+ <div class="entry-content">
+ <?php mantra_set_featured_thumb(); ?>
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php } ?>
+
+ <?php else :
+ if (is_sticky() && $mantra_excerptsticky == "Full Post") $sticky_test=1; else $sticky_test=0;
+ if ($mantra_excerpthome != "Full Post" && $sticky_test==0){ ?>
+
+
+ <div class="entry-summary">
+ <?php mantra_set_featured_thumb(); ?>
+ <?php the_excerpt(); ?>
+ </div><!-- .entry-summary -->
+ <?php } else { ?>
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mantra' ) . '</span>', 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+ <?php }
+
+ endif;
+ cryout_post_after_content_hook(); ?>
+ <footer class="entry-meta2">
+ <?php $tag_list = get_the_tag_list( '', ', ' );
+if ( $tag_list ) { ?>
+ <span class="bl_tagg"><?php _e( 'Tagged','mantra'); print ' '.$tag_list; ?></span>
+ <?php } ?>
+ <?php edit_post_link( __( 'Edit', 'mantra' ), '<span class="edit-link">', '</span>' ); ?><?php
+ cryout_post_footer_hook(); ?>
+ </footer><!-- #entry-meta -->
+
+ </article><!-- #post-<?php the_ID(); ?> -->
+
+
+<?php cryout_after_article_hook(); ?> \ No newline at end of file
diff --git a/themes/mantra/editor-style-rtl.css b/themes/mantra/editor-style-rtl.css
new file mode 100644
index 00000000..7dd138e3
--- /dev/null
+++ b/themes/mantra/editor-style-rtl.css
@@ -0,0 +1,56 @@
+/*
+Theme Name: Mantra
+*/
+/*
+Used to style the TinyMCE editor.
+*/
+html .mceContentBody{
+ direction:rtl;
+ unicode-bidi:embed;
+ float:right;
+}
+* {
+ font-family: Arial, Tahoma, sans-serif;
+}
+/* Text elements */
+ul {
+ margin: 0 -18px 18px 0;
+}
+ol {
+ margin: 0 -18px 18px 0;
+}
+dd {
+ margin-right: 0;
+}
+blockquote {
+ font-style: normal;
+}
+table {
+ text-align: right;
+ margin: 0 0 24px -1px;
+}
+html .mceContentBody{
+ direction:rtl;
+ unicode-bidi:embed;
+ float:right;
+}
+* {
+ font-family: Arial, Tahoma, sans-serif;
+}
+/* Text elements */
+ul {
+ margin: 0 -18px 18px 0;
+}
+ol {
+ margin: 0 -18px 18px 0;
+}
+dd {
+ margin-right: 0;
+}
+blockquote {
+ font-style: normal;
+}
+table {
+ text-align: right;
+ margin: 0 0 24px -1px;
+} \ No newline at end of file
diff --git a/themes/mantra/editor-style.css b/themes/mantra/editor-style.css
new file mode 100644
index 00000000..3277730a
--- /dev/null
+++ b/themes/mantra/editor-style.css
@@ -0,0 +1,289 @@
+/*
+Theme Name: Mantra
+*/
+/*
+Used to style the TinyMCE editor.
+*/
+html .mceContentBody {
+ max-width:640px;
+}
+* {
+ font-family: Georgia, "Bitstream Charter", serif;
+ color: #444;
+ line-height: 1.5;
+}
+p,
+dl,
+td,
+th,
+ul,
+ol,
+blockquote {
+ font-size: 16px;
+}
+tr th,
+thead th,
+label,
+tr th,
+thead th {
+ font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
+}
+pre {
+ font-family: "Courier 10 Pitch", Courier, monospace;
+}
+code, code var {
+ font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
+}
+body, input, textarea {
+ font-size: 12px;
+ line-height: 18px;
+}
+hr {
+ background-color: #e7e7e7;
+ border:0;
+ height: 1px;
+ margin-bottom: 18px;
+ clear:both;
+}
+/* Text elements */
+p {
+ margin-bottom: 18px;
+}
+ul {
+ list-style: square;
+ margin: 0 0 18px 1.5em;
+}
+ol {
+ list-style: decimal;
+ margin: 0 0 18px 1.5em;
+}
+ol ol {
+ list-style:upper-alpha;
+}
+ol ol ol {
+ list-style:lower-roman;
+}
+ol ol ol ol {
+ list-style:lower-alpha;
+}
+ul ul,
+ol ol,
+ul ol,
+ol ul {
+ margin-bottom:0;
+}
+dl {
+ margin:0 0 24px 0;
+}
+dt {
+ font-weight: bold;
+}
+dd {
+ margin-bottom: 18px;
+}
+strong {
+ font-weight: bold;
+ color: #000;
+}
+cite,
+em,
+i {
+ font-style: italic;
+ border: none;
+}
+big {
+ font-size: 131.25%;
+}
+ins {
+ background: #ffffcc;
+ border: none;
+ color: #333;
+}
+del {
+ text-decoration: line-through;
+ color: #555;
+}
+blockquote {
+ font-style: italic;
+ padding: 0 3em;
+}
+blockquote cite,
+blockquote em,
+blockquote i {
+ font-style: normal;
+}
+pre {
+ background: #f7f7f7;
+ color: #222;
+ line-height: 18px;
+ margin-bottom: 18px;
+ padding: 1.5em;
+}
+abbr,
+acronym {
+ border-bottom: 1px dotted #666;
+ cursor: help;
+}
+ins {
+ text-decoration: none;
+}
+sup,
+sub {
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ position: relative;
+ font-size: 10px;
+}
+sup {
+ bottom: 1ex;
+}
+sub {
+ top: .5ex;
+}
+a:link {
+ color:#0066cc;
+}
+a:visited {
+ color:#743399;
+}
+a:active,
+a:hover {
+ color: #ff4b33;
+}
+p,
+ul,
+ol,
+dd,
+pre,
+hr {
+ margin-bottom:24px;
+}
+ul ul,
+ol ol,
+ul ol,
+ol ul {
+ margin-bottom:0;
+}
+pre,
+kbd,
+tt,
+var {
+ font-size: 15px;
+ line-height: 21px;
+}
+code {
+ font-size: 13px;
+}
+strong,
+b,
+dt,
+th {
+ color: #000;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ color: #000;
+ margin: 0 0 20px 0;
+ line-height: 1.5em;
+ font-weight: normal;
+}
+h1 {
+ font-size: 2.4em;
+}
+h2 {
+ font-size: 1.8em;
+}
+h3 {
+ font-size: 1.4em;
+}
+h4 {
+ font-size: 1.2em;
+}
+h5 {
+ font-size: 1em;
+}
+h6 {
+ font-size: 0.9em;
+}
+table {
+ border: 1px solid #e7e7e7 !important;
+ text-align: left;
+ margin: 0 -1px 24px 0;
+ width: 100%;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+tr th,
+thead th {
+ border: none !important;
+ color: #888;
+ font-size: 12px;
+ font-weight: bold;
+ line-height: 18px;
+ padding: 9px 24px;
+}
+tr td {
+ border: none !important;
+ border-top: 1px solid #e7e7e7 !important;
+ padding: 6px 24px;
+}
+
+
+img {
+ margin: 0;
+ max-width: 640px;
+}
+.alignleft,
+img.alignleft {
+ display: inline;
+ float: left;
+ margin-right: 24px;
+ margin-top: 4px;
+}
+.alignright,
+img.alignright {
+ display: inline;
+ float: right;
+ margin-left: 24px;
+ margin-top: 4px;
+}
+.aligncenter,
+img.aligncenter {
+ clear: both;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+img.alignleft,
+img.alignright,
+img.aligncenter {
+ margin-bottom: 12px;
+}
+.wp-caption {
+ border: none;
+ background: #f1f1f1;
+ color: #888;
+ font-size: 12px;
+ line-height: 18px;
+ text-align: center;
+ margin-bottom: 20px;
+ padding: 4px;
+ -moz-border-radius: 0;
+ -khtml-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+}
+.wp-caption img {
+ margin: 5px;
+}
+.wp-caption p.wp-caption-text {
+ margin: 0 0 4px;
+}
+.wp-smiley {
+ margin:0;
+} \ No newline at end of file
diff --git a/themes/mantra/footer.php b/themes/mantra/footer.php
new file mode 100644
index 00000000..90b877c9
--- /dev/null
+++ b/themes/mantra/footer.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * The template for displaying the footer.
+ *
+ * Contains the closing of the id=main div and all content
+ * after. Calls sidebar-footer.php for bottom widgets.
+ *
+ * @package Cryout Creations
+ * @subpackage mantra
+ * @since mantra 0.5
+ */
+?> <div style="clear:both;"></div>
+
+ </div> <!-- #forbottom -->
+ </div><!-- #main -->
+
+
+ <footer id="footer" role="contentinfo">
+ <div id="colophon">
+
+ <?php get_sidebar( 'footer' );?>
+
+ </div><!-- #colophon -->
+
+ <div id="footer2">
+
+ <?php cryout_footer_hook(); ?>
+
+ </div><!-- #footer2 -->
+
+ </footer><!-- #footer -->
+
+</div><!-- #wrapper -->
+
+<?php wp_footer(); ?>
+
+</body>
+</html>
diff --git a/themes/mantra/functions.php b/themes/mantra/functions.php
new file mode 100644
index 00000000..1a9607b3
--- /dev/null
+++ b/themes/mantra/functions.php
@@ -0,0 +1,26 @@
+<?php
+/*
+ * Functions file
+ * Includes all necesary files
+ * PLEASE DO NOT EDIT THIS FILE IN ANY WAY
+ *
+ * @package mantra
+ */
+
+// Variable for theme version
+define ("MANTRA_VERSION","2.2.0");
+
+require_once(dirname(__FILE__) . "/admin/main.php"); // Load necessary admin files
+
+//Loading include fiels
+require_once(dirname(__FILE__) . "/includes/theme-setup.php"); //Setup and init theme
+require_once(dirname(__FILE__) . "/includes/theme-styles.php"); //Register and enqeue css styles and scripts
+require_once(dirname(__FILE__) . "/includes/theme-loop.php"); //Loop related fiels
+require_once(dirname(__FILE__) . "/includes/theme-seo.php"); //SEO related fiels
+require_once(dirname(__FILE__) . "/includes/theme-frontpage.php"); //Frontpage generation
+require_once(dirname(__FILE__) . "/includes/theme-comments.php"); //Theme comment functions
+require_once(dirname(__FILE__) . "/includes/theme-shortcodes.php"); //Theme shortcodes
+require_once(dirname(__FILE__) . "/includes/theme-functions.php"); //Theme misc functions
+require_once(dirname(__FILE__) . "/includes/theme-hooks.php"); //Theme hooks
+
+?> \ No newline at end of file
diff --git a/themes/mantra/header.php b/themes/mantra/header.php
new file mode 100644
index 00000000..abbe539d
--- /dev/null
+++ b/themes/mantra/header.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * The Header
+ *
+ * Displays all of the <head> section and everything up till <div id="main">
+ *
+ * @package Cryout Creations
+ * @subpackage mantra
+ * @since mantra 0.5
+ */
+ ?><!DOCTYPE html>
+<html <?php language_attributes(); ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" />
+<?php cryout_seo_hook(); ?>
+<link rel="profile" href="http://gmpg.org/xfn/11" />
+<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
+<?php
+ cryout_header_hook();
+ wp_head(); ?>
+</head>
+<body <?php body_class(); ?>>
+
+<?php cryout_body_hook(); ?>
+
+<div id="wrapper" class="hfeed">
+
+<?php cryout_wrapper_hook(); ?>
+
+<header id="header">
+
+ <div id="masthead">
+
+ <div id="branding" role="banner" >
+
+ <?php cryout_branding_hook();?>
+ <div style="clear:both;"></div>
+
+ </div><!-- #branding -->
+
+ <nav id="access" class="jssafe" role="navigation">
+
+ <?php cryout_access_hook();?>
+
+ </nav><!-- #access -->
+
+ </div><!-- #masthead -->
+
+ <div style="clear:both;"> </div>
+
+</header><!-- #header -->
+<div id="main">
+ <div id="forbottom" >
+ <?php cryout_forbottom_hook(); ?>
+
+ <div style="clear:both;"> </div>
+
+ <?php cryout_breadcrumbs_hook();?>
+ \ No newline at end of file
diff --git a/themes/mantra/images/back2top.png b/themes/mantra/images/back2top.png
new file mode 100644
index 00000000..64e246f3
--- /dev/null
+++ b/themes/mantra/images/back2top.png
Binary files differ
diff --git a/themes/mantra/images/bullet.png b/themes/mantra/images/bullet.png
new file mode 100644
index 00000000..39c7df90
--- /dev/null
+++ b/themes/mantra/images/bullet.png
Binary files differ
diff --git a/themes/mantra/images/bullets/arrow_black.png b/themes/mantra/images/bullets/arrow_black.png
new file mode 100644
index 00000000..8c06cc05
--- /dev/null
+++ b/themes/mantra/images/bullets/arrow_black.png
Binary files differ
diff --git a/themes/mantra/images/bullets/arrow_white.png b/themes/mantra/images/bullets/arrow_white.png
new file mode 100644
index 00000000..e5ded70b
--- /dev/null
+++ b/themes/mantra/images/bullets/arrow_white.png
Binary files differ
diff --git a/themes/mantra/images/bullets/bullet_dark.png b/themes/mantra/images/bullets/bullet_dark.png
new file mode 100644
index 00000000..53b959d4
--- /dev/null
+++ b/themes/mantra/images/bullets/bullet_dark.png
Binary files differ
diff --git a/themes/mantra/images/bullets/bullet_gray.png b/themes/mantra/images/bullets/bullet_gray.png
new file mode 100644
index 00000000..f71c645d
--- /dev/null
+++ b/themes/mantra/images/bullets/bullet_gray.png
Binary files differ
diff --git a/themes/mantra/images/bullets/bullet_light.png b/themes/mantra/images/bullets/bullet_light.png
new file mode 100644
index 00000000..b41a6023
--- /dev/null
+++ b/themes/mantra/images/bullets/bullet_light.png
Binary files differ
diff --git a/themes/mantra/images/bullets/mantra_dot2.png b/themes/mantra/images/bullets/mantra_dot2.png
new file mode 100644
index 00000000..4d20a004
--- /dev/null
+++ b/themes/mantra/images/bullets/mantra_dot2.png
Binary files differ
diff --git a/themes/mantra/images/bullets/square_dark.png b/themes/mantra/images/bullets/square_dark.png
new file mode 100644
index 00000000..471f894f
--- /dev/null
+++ b/themes/mantra/images/bullets/square_dark.png
Binary files differ
diff --git a/themes/mantra/images/bullets/square_white.png b/themes/mantra/images/bullets/square_white.png
new file mode 100644
index 00000000..c489c514
--- /dev/null
+++ b/themes/mantra/images/bullets/square_white.png
Binary files differ
diff --git a/themes/mantra/images/bullets/triangle_dark.png b/themes/mantra/images/bullets/triangle_dark.png
new file mode 100644
index 00000000..b4eb725c
--- /dev/null
+++ b/themes/mantra/images/bullets/triangle_dark.png
Binary files differ
diff --git a/themes/mantra/images/bullets/triangle_gray.png b/themes/mantra/images/bullets/triangle_gray.png
new file mode 100644
index 00000000..d0c8edd4
--- /dev/null
+++ b/themes/mantra/images/bullets/triangle_gray.png
Binary files differ
diff --git a/themes/mantra/images/bullets/triangle_white.png b/themes/mantra/images/bullets/triangle_white.png
new file mode 100644
index 00000000..2276d387
--- /dev/null
+++ b/themes/mantra/images/bullets/triangle_white.png
Binary files differ
diff --git a/themes/mantra/images/headers/mantra.png b/themes/mantra/images/headers/mantra.png
new file mode 100644
index 00000000..45e9bb0b
--- /dev/null
+++ b/themes/mantra/images/headers/mantra.png
Binary files differ
diff --git a/themes/mantra/images/headers/mantra_thumbnail.png b/themes/mantra/images/headers/mantra_thumbnail.png
new file mode 100644
index 00000000..c2342994
--- /dev/null
+++ b/themes/mantra/images/headers/mantra_thumbnail.png
Binary files differ
diff --git a/themes/mantra/images/icon-back.png b/themes/mantra/images/icon-back.png
new file mode 100644
index 00000000..74621e5c
--- /dev/null
+++ b/themes/mantra/images/icon-back.png
Binary files differ
diff --git a/themes/mantra/images/icon-featured.png b/themes/mantra/images/icon-featured.png
new file mode 100644
index 00000000..2b137b80
--- /dev/null
+++ b/themes/mantra/images/icon-featured.png
Binary files differ
diff --git a/themes/mantra/images/icon-tooltip.png b/themes/mantra/images/icon-tooltip.png
new file mode 100644
index 00000000..f925d33d
--- /dev/null
+++ b/themes/mantra/images/icon-tooltip.png
Binary files differ
diff --git a/themes/mantra/images/nivoslider/arrows.png b/themes/mantra/images/nivoslider/arrows.png
new file mode 100644
index 00000000..8f562bd8
--- /dev/null
+++ b/themes/mantra/images/nivoslider/arrows.png
Binary files differ
diff --git a/themes/mantra/images/nivoslider/bullets.png b/themes/mantra/images/nivoslider/bullets.png
new file mode 100644
index 00000000..a84c9c0b
--- /dev/null
+++ b/themes/mantra/images/nivoslider/bullets.png
Binary files differ
diff --git a/themes/mantra/images/nivoslider/loading.gif b/themes/mantra/images/nivoslider/loading.gif
new file mode 100644
index 00000000..1560b646
--- /dev/null
+++ b/themes/mantra/images/nivoslider/loading.gif
Binary files differ
diff --git a/themes/mantra/images/pins/Pin1.png b/themes/mantra/images/pins/Pin1.png
new file mode 100644
index 00000000..a08ae4c3
--- /dev/null
+++ b/themes/mantra/images/pins/Pin1.png
Binary files differ
diff --git a/themes/mantra/images/pins/Pin2.png b/themes/mantra/images/pins/Pin2.png
new file mode 100644
index 00000000..3de309a5
--- /dev/null
+++ b/themes/mantra/images/pins/Pin2.png
Binary files differ
diff --git a/themes/mantra/images/pins/Pin3.png b/themes/mantra/images/pins/Pin3.png
new file mode 100644
index 00000000..43fc6b66
--- /dev/null
+++ b/themes/mantra/images/pins/Pin3.png
Binary files differ
diff --git a/themes/mantra/images/pins/Pin4.png b/themes/mantra/images/pins/Pin4.png
new file mode 100644
index 00000000..c6d92807
--- /dev/null
+++ b/themes/mantra/images/pins/Pin4.png
Binary files differ
diff --git a/themes/mantra/images/pins/Pin5.png b/themes/mantra/images/pins/Pin5.png
new file mode 100644
index 00000000..8927b6b8
--- /dev/null
+++ b/themes/mantra/images/pins/Pin5.png
Binary files differ
diff --git a/themes/mantra/images/pins/mantra_dot.png b/themes/mantra/images/pins/mantra_dot.png
new file mode 100644
index 00000000..4d20a004
--- /dev/null
+++ b/themes/mantra/images/pins/mantra_dot.png
Binary files differ
diff --git a/themes/mantra/images/post-formats/brackets.png b/themes/mantra/images/post-formats/brackets.png
new file mode 100644
index 00000000..95c8a3a9
--- /dev/null
+++ b/themes/mantra/images/post-formats/brackets.png
Binary files differ
diff --git a/themes/mantra/images/post-formats/brackets2.png b/themes/mantra/images/post-formats/brackets2.png
new file mode 100644
index 00000000..130783c9
--- /dev/null
+++ b/themes/mantra/images/post-formats/brackets2.png
Binary files differ
diff --git a/themes/mantra/images/post-formats/bubble.png b/themes/mantra/images/post-formats/bubble.png
new file mode 100644
index 00000000..0d1a1a56
--- /dev/null
+++ b/themes/mantra/images/post-formats/bubble.png
Binary files differ
diff --git a/themes/mantra/images/post-formats/link.png b/themes/mantra/images/post-formats/link.png
new file mode 100644
index 00000000..189e463d
--- /dev/null
+++ b/themes/mantra/images/post-formats/link.png
Binary files differ
diff --git a/themes/mantra/images/post-formats/picture.png b/themes/mantra/images/post-formats/picture.png
new file mode 100644
index 00000000..ae07e735
--- /dev/null
+++ b/themes/mantra/images/post-formats/picture.png
Binary files differ
diff --git a/themes/mantra/images/post-formats/quotes.png b/themes/mantra/images/post-formats/quotes.png
new file mode 100644
index 00000000..4fa4e7fd
--- /dev/null
+++ b/themes/mantra/images/post-formats/quotes.png
Binary files differ
diff --git a/themes/mantra/images/slider/mantra-column.jpg b/themes/mantra/images/slider/mantra-column.jpg
new file mode 100644
index 00000000..dfbf186e
--- /dev/null
+++ b/themes/mantra/images/slider/mantra-column.jpg
Binary files differ
diff --git a/themes/mantra/images/slider/mantra-slide1.jpg b/themes/mantra/images/slider/mantra-slide1.jpg
new file mode 100644
index 00000000..76d82d6c
--- /dev/null
+++ b/themes/mantra/images/slider/mantra-slide1.jpg
Binary files differ
diff --git a/themes/mantra/images/slider/mantra-slide2.jpg b/themes/mantra/images/slider/mantra-slide2.jpg
new file mode 100644
index 00000000..5c1c800a
--- /dev/null
+++ b/themes/mantra/images/slider/mantra-slide2.jpg
Binary files differ
diff --git a/themes/mantra/images/socials/Amazon.png b/themes/mantra/images/socials/Amazon.png
new file mode 100644
index 00000000..f6a79c62
--- /dev/null
+++ b/themes/mantra/images/socials/Amazon.png
Binary files differ
diff --git a/themes/mantra/images/socials/Delicious.png b/themes/mantra/images/socials/Delicious.png
new file mode 100644
index 00000000..271aa3a0
--- /dev/null
+++ b/themes/mantra/images/socials/Delicious.png
Binary files differ
diff --git a/themes/mantra/images/socials/DeviantArt.png b/themes/mantra/images/socials/DeviantArt.png
new file mode 100644
index 00000000..43ac9292
--- /dev/null
+++ b/themes/mantra/images/socials/DeviantArt.png
Binary files differ
diff --git a/themes/mantra/images/socials/Digg.png b/themes/mantra/images/socials/Digg.png
new file mode 100644
index 00000000..d8a69565
--- /dev/null
+++ b/themes/mantra/images/socials/Digg.png
Binary files differ
diff --git a/themes/mantra/images/socials/Etsy.png b/themes/mantra/images/socials/Etsy.png
new file mode 100644
index 00000000..57e610be
--- /dev/null
+++ b/themes/mantra/images/socials/Etsy.png
Binary files differ
diff --git a/themes/mantra/images/socials/Facebook.png b/themes/mantra/images/socials/Facebook.png
new file mode 100644
index 00000000..947a6af0
--- /dev/null
+++ b/themes/mantra/images/socials/Facebook.png
Binary files differ
diff --git a/themes/mantra/images/socials/Flickr.png b/themes/mantra/images/socials/Flickr.png
new file mode 100644
index 00000000..f955aee1
--- /dev/null
+++ b/themes/mantra/images/socials/Flickr.png
Binary files differ
diff --git a/themes/mantra/images/socials/GoodReads.png b/themes/mantra/images/socials/GoodReads.png
new file mode 100644
index 00000000..a889d384
--- /dev/null
+++ b/themes/mantra/images/socials/GoodReads.png
Binary files differ
diff --git a/themes/mantra/images/socials/Google.png b/themes/mantra/images/socials/Google.png
new file mode 100644
index 00000000..fb3a9bab
--- /dev/null
+++ b/themes/mantra/images/socials/Google.png
Binary files differ
diff --git a/themes/mantra/images/socials/GooglePlus.png b/themes/mantra/images/socials/GooglePlus.png
new file mode 100644
index 00000000..cc45e40e
--- /dev/null
+++ b/themes/mantra/images/socials/GooglePlus.png
Binary files differ
diff --git a/themes/mantra/images/socials/IMDb.png b/themes/mantra/images/socials/IMDb.png
new file mode 100644
index 00000000..858a802a
--- /dev/null
+++ b/themes/mantra/images/socials/IMDb.png
Binary files differ
diff --git a/themes/mantra/images/socials/Instagram.png b/themes/mantra/images/socials/Instagram.png
new file mode 100644
index 00000000..b203e1bf
--- /dev/null
+++ b/themes/mantra/images/socials/Instagram.png
Binary files differ
diff --git a/themes/mantra/images/socials/LastFM.png b/themes/mantra/images/socials/LastFM.png
new file mode 100644
index 00000000..5e0ab2b9
--- /dev/null
+++ b/themes/mantra/images/socials/LastFM.png
Binary files differ
diff --git a/themes/mantra/images/socials/LinkedIn.png b/themes/mantra/images/socials/LinkedIn.png
new file mode 100644
index 00000000..a4e20d15
--- /dev/null
+++ b/themes/mantra/images/socials/LinkedIn.png
Binary files differ
diff --git a/themes/mantra/images/socials/Mail.png b/themes/mantra/images/socials/Mail.png
new file mode 100644
index 00000000..8dfa3ebd
--- /dev/null
+++ b/themes/mantra/images/socials/Mail.png
Binary files differ
diff --git a/themes/mantra/images/socials/MySpace.png b/themes/mantra/images/socials/MySpace.png
new file mode 100644
index 00000000..93e457f6
--- /dev/null
+++ b/themes/mantra/images/socials/MySpace.png
Binary files differ
diff --git a/themes/mantra/images/socials/Picasa.png b/themes/mantra/images/socials/Picasa.png
new file mode 100644
index 00000000..9d2bc3ba
--- /dev/null
+++ b/themes/mantra/images/socials/Picasa.png
Binary files differ
diff --git a/themes/mantra/images/socials/Pinterest.png b/themes/mantra/images/socials/Pinterest.png
new file mode 100644
index 00000000..cd0294a2
--- /dev/null
+++ b/themes/mantra/images/socials/Pinterest.png
Binary files differ
diff --git a/themes/mantra/images/socials/RSS.png b/themes/mantra/images/socials/RSS.png
new file mode 100644
index 00000000..beae9d0d
--- /dev/null
+++ b/themes/mantra/images/socials/RSS.png
Binary files differ
diff --git a/themes/mantra/images/socials/Reddit.png b/themes/mantra/images/socials/Reddit.png
new file mode 100644
index 00000000..45f6874f
--- /dev/null
+++ b/themes/mantra/images/socials/Reddit.png
Binary files differ
diff --git a/themes/mantra/images/socials/Skype.png b/themes/mantra/images/socials/Skype.png
new file mode 100644
index 00000000..edf9284f
--- /dev/null
+++ b/themes/mantra/images/socials/Skype.png
Binary files differ
diff --git a/themes/mantra/images/socials/SoundCloud.png b/themes/mantra/images/socials/SoundCloud.png
new file mode 100644
index 00000000..645fc269
--- /dev/null
+++ b/themes/mantra/images/socials/SoundCloud.png
Binary files differ
diff --git a/themes/mantra/images/socials/StumbleUpon.png b/themes/mantra/images/socials/StumbleUpon.png
new file mode 100644
index 00000000..356448ac
--- /dev/null
+++ b/themes/mantra/images/socials/StumbleUpon.png
Binary files differ
diff --git a/themes/mantra/images/socials/Technorati.png b/themes/mantra/images/socials/Technorati.png
new file mode 100644
index 00000000..8b457739
--- /dev/null
+++ b/themes/mantra/images/socials/Technorati.png
Binary files differ
diff --git a/themes/mantra/images/socials/Tumblr.png b/themes/mantra/images/socials/Tumblr.png
new file mode 100644
index 00000000..e6e7f4d5
--- /dev/null
+++ b/themes/mantra/images/socials/Tumblr.png
Binary files differ
diff --git a/themes/mantra/images/socials/Twitch.png b/themes/mantra/images/socials/Twitch.png
new file mode 100644
index 00000000..9c641a45
--- /dev/null
+++ b/themes/mantra/images/socials/Twitch.png
Binary files differ
diff --git a/themes/mantra/images/socials/Twitter.png b/themes/mantra/images/socials/Twitter.png
new file mode 100644
index 00000000..41efa998
--- /dev/null
+++ b/themes/mantra/images/socials/Twitter.png
Binary files differ
diff --git a/themes/mantra/images/socials/VK.png b/themes/mantra/images/socials/VK.png
new file mode 100644
index 00000000..9341f73a
--- /dev/null
+++ b/themes/mantra/images/socials/VK.png
Binary files differ
diff --git a/themes/mantra/images/socials/Vimeo.png b/themes/mantra/images/socials/Vimeo.png
new file mode 100644
index 00000000..99396a59
--- /dev/null
+++ b/themes/mantra/images/socials/Vimeo.png
Binary files differ
diff --git a/themes/mantra/images/socials/WordPress.png b/themes/mantra/images/socials/WordPress.png
new file mode 100644
index 00000000..60ced4f6
--- /dev/null
+++ b/themes/mantra/images/socials/WordPress.png
Binary files differ
diff --git a/themes/mantra/images/socials/Xing.png b/themes/mantra/images/socials/Xing.png
new file mode 100644
index 00000000..62d0959f
--- /dev/null
+++ b/themes/mantra/images/socials/Xing.png
Binary files differ
diff --git a/themes/mantra/images/socials/Yahoo.png b/themes/mantra/images/socials/Yahoo.png
new file mode 100644
index 00000000..b73ddae2
--- /dev/null
+++ b/themes/mantra/images/socials/Yahoo.png
Binary files differ
diff --git a/themes/mantra/images/socials/Yelp.png b/themes/mantra/images/socials/Yelp.png
new file mode 100644
index 00000000..d23d8289
--- /dev/null
+++ b/themes/mantra/images/socials/Yelp.png
Binary files differ
diff --git a/themes/mantra/images/socials/YouTube.png b/themes/mantra/images/socials/YouTube.png
new file mode 100644
index 00000000..2f50f362
--- /dev/null
+++ b/themes/mantra/images/socials/YouTube.png
Binary files differ
diff --git a/themes/mantra/includes/theme-comments.php b/themes/mantra/includes/theme-comments.php
new file mode 100644
index 00000000..11604462
--- /dev/null
+++ b/themes/mantra/includes/theme-comments.php
@@ -0,0 +1,143 @@
+<?php /*
+ * Comments related functions - comments.php
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+if ( ! function_exists( 'mantra_comment' ) ) :
+/**
+ * Template for comments and pingbacks.
+ *
+ * To override this walker in a child theme without modifying the comments template
+ * simply create your own mantra_comment(), and that function will be used instead.
+ *
+ * Used as a callback by wp_list_comments() for displaying the comments.
+ *
+ * @since mantra 0.5
+ */
+function mantra_comment( $comment, $args, $depth ) {
+ $GLOBALS['comment'] = $comment;
+ switch ( $comment->comment_type ) :
+ case '' :
+ ?>
+ <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
+ <div id="comment-<?php comment_ID(); ?>">
+ <div class="comment-author vcard">
+ <?php echo get_avatar( $comment, 40 );
+ ?><?php printf( '%s <span class="says">'.__('says:', 'mantra' ).'</span>', sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
+
+
+
+ </div><!-- .comment-author .vcard -->
+ <?php if ( $comment->comment_approved == '0' ) : ?>
+ <em><?php _e( 'Your comment is awaiting moderation.', 'mantra' ); ?></em>
+ <br />
+ <?php endif; ?>
+
+ <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
+ <?php
+ /* translators: 1: date, 2: time */
+ printf( '%1$s '.__('at', 'mantra' ).' %2$s', get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'mantra' ), ' ' );
+ ?>
+ </div><!-- .comment-meta .commentmetadata -->
+
+ <div class="comment-body"><?php comment_text(); ?></div>
+
+ <div class="reply">
+ <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
+ </div><!-- .reply -->
+ </div><!-- #comment-## -->
+
+ <?php
+ break;
+ case 'pingback' :
+ case 'trackback' :
+ ?>
+ <li class="post pingback">
+ <p><?php _e( 'Pingback: ', 'mantra' ); ?><?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'mantra'), ' ' ); ?></p>
+ <?php
+ break;
+ endswitch;
+}
+endif;
+
+/**
+ * Removes the default styles that are packaged with the Recent Comments widget.
+ *
+ * To override this in a child theme, remove the filter and optionally add your own
+ * function tied to the widgets_init action hook.
+ *
+ * @since mantra 0.5
+ */
+function mantra_remove_recent_comments_style() {
+ global $wp_widget_factory;
+ remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
+}
+
+add_action( 'widgets_init', 'mantra_remove_recent_comments_style' );
+
+if ( ! function_exists( 'mantra_comments_on' ) ) :
+/**
+ * Number of comments on loop post if comments are enabled.
+ */
+function mantra_comments_on() {
+printf ( comments_popup_link( __( 'Leave a comment', 'mantra' ), __( '<b>1</b> Comment', 'mantra' ), __( '<b>%</b> Comments', 'mantra' ) ));
+}
+endif;
+
+/**
+ * The number of comments title
+ */
+function mantra_number_comments() { ?>
+ <h3 id="comments-title">
+ <?php printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'mantra' ),
+ number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' ); ?>
+ </h3>
+<?php }
+
+add_action('cryout_before_comments_hook','mantra_number_comments');
+
+/**
+ * The comments navigation in case of comments on multiple pages (both top and bottom)
+ */
+function mantra_comments_navigation() {
+if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
+ <div class="navigation">
+ <div class="nav-previous"><?php previous_comments_link( '<span class="meta-nav">&larr;</span>'.__('Older Comments', 'mantra' ) ); ?></div>
+ <div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'mantra' ).' <span class="meta-nav">&rarr;</span>' ); ?></div>
+ </div> <!-- .navigation -->
+<?php endif; // check for comment navigation
+}
+
+add_action('cryout_before_comments_hook','mantra_comments_navigation');
+add_action('cryout_after_comments_hook','mantra_comments_navigation');
+
+/*
+* Listing the actual comments
+*
+* Loop through and list the comments. Tell wp_list_comments()
+* to use mantra_comment() to format the comments.
+* If you want to overload this in a child theme then you can
+* define mantra_comment() and that will be used instead.
+* See mantra_comment() in mantra/functions.php for more.
+ */
+function mantra_list_comments() {
+ wp_list_comments( array( 'callback' => 'mantra_comment' ) );
+ }
+
+add_action('cryout_comments_hook','mantra_list_comments');
+
+/*
+ * If there are no comments and comments are closed
+ */
+function mantra_comments_off() {
+if ( ! comments_open() ) : ?>
+ <p class="nocomments"><?php _e( 'Comments are closed.', 'mantra' ); ?></p>
+<?php endif; // end ! comments_open()
+}
+
+
+add_action('cryout_nocomments_hook','mantra_comments_off');
+
+?> \ No newline at end of file
diff --git a/themes/mantra/includes/theme-frontpage.php b/themes/mantra/includes/theme-frontpage.php
new file mode 100644
index 00000000..c832d49a
--- /dev/null
+++ b/themes/mantra/includes/theme-frontpage.php
@@ -0,0 +1,284 @@
+<?php
+/**
+ * Frontpage generation functions
+ * Creates the slider, the columns, the titles and the extra text
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+
+ if ( ! function_exists( 'mantra_frontpage_generator' ) ) :
+// Front page generator
+function mantra_frontpage_generator() {
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+}
+?>
+
+<script type="text/javascript">
+
+ // Flash animation for columns
+
+
+ jQuery(document).ready(function() {
+ // Slider creation
+ jQuery('#slider').nivoSlider({
+
+ effect: '<?php echo $mantra_fpslideranim; ?>',
+ animSpeed: <?php echo $mantra_fpslidertime ?>,
+ <?php if($mantra_fpsliderarrows=="Hidden") { ?> directionNav: false, <?php }
+ if($mantra_fpsliderarrows=="Always Visible") { ?> directionNavHide: false, <?php } ?>
+ pauseTime: <?php echo $mantra_fpsliderpause ?>
+
+ });
+
+ jQuery('#front-columns > div img').hover( function() {
+ jQuery(this)
+ .stop()
+ .animate({opacity: 0.5}, 100)
+ .fadeOut(100)
+ .fadeIn(100)
+ .animate({opacity: 0.999}, 100) ;
+ }, function() {jQuery(this).stop();} )
+
+ });
+ </script>
+
+<style type="text/css">
+
+<?php if ($mantra_fronthideheader) {?> #branding {display:none;} <?php }
+ if ($mantra_fronthidemenu) {?> #access {display:none;} <?php }
+ if ($mantra_fronthidewidget) {?> #colophon {display:none;} <?php }
+ if ($mantra_fronthidefooter) {?> #footer2 {display:none;} <?php }
+ if ($mantra_fronthideback) {?> #main {background:none;} <?php } ?>
+
+.slider-wrapper {
+display:block;
+float:none;
+width:100%;
+margin:0 auto;
+}
+
+#slider{
+ max-width:<?php echo $mantra_fpsliderwidth ?>px ;
+ height:<?php echo $mantra_fpsliderheight ?>px ;
+ margin:30px auto 20px;
+ display:block;
+ float:none;
+ border:<?php echo $mantra_fpsliderborderwidth.'px solid '.$mantra_fpsliderbordercolor; ?>;
+}
+
+#front-text1 h1, #front-text2 h1{
+ display:block;
+ float:none;
+ margin:35px auto;
+ text-align:center;
+ font-size:32px;
+ clear:both;
+ line-height:32px;
+ font-weight:bold;
+ color:<?php echo $mantra_fronttitlecolor; ?>;
+}
+
+ #front-text2 h1{
+ font-size:28px;
+ line-height:28px;
+ margin-top:0px;
+ margin-bottom:25px;
+}
+
+#frontpage blockquote {
+ width:88% ;
+ max-width:88% !important;
+ margin-bottom:20px;
+ font-size:16px;
+ line-height:22px;
+ color:#444;
+}
+
+#frontpage #front-text4 blockquote {
+ font-size:14px;
+ line-height:18px;
+ color:#666;
+}
+
+#frontpage blockquote:before, #frontpage blockquote:after {
+ content:none;
+}
+
+#front-columns > div {
+display:block;
+width:<?php
+switch ($mantra_nrcolumns) {
+ case 0:
+ break;
+ case 1:
+ echo "95";
+ break;
+ case 2:
+ echo "45";
+ break;
+ case 3:
+ echo "29";
+ break;
+ case 4:
+ echo "21";
+ break;
+} ?>%;
+height:auto;
+margin-left:2%;margin-right:2%;
+margin-bottom:10px;
+float:left;
+}
+
+.column-image {
+ height:<?php echo $mantra_colimageheight ?>px;
+ border:3px solid #eee;
+}
+
+.theme-default .nivo-controlNav {margin-left:0;}
+
+<?php if ($mantra_fpslidernav!="Bullets") {
+ if ($mantra_fpslidernav=="Numbers") {?>
+
+.theme-default .nivo-controlNav {bottom:-40px;}
+.theme-default .nivo-controlNav a {
+ background: none;
+ text-decoration:underline;
+ text-indent:0;
+}
+<?php } else if ($mantra_fpslidernav=="None") {?>
+.theme-default .nivo-controlNav {display:none;}
+
+<?php } } ?>
+</style>
+<div id="frontpage">
+<?php
+
+// First FrontPage Title
+if($mantra_fronttext1) {?><div id="front-text1"> <h1><?php echo esc_attr($mantra_fronttext1) ?> </h1></div><?php }
+
+// When a post query has been selected from the Slider type in the admin area
+if ($mantra_slideType != 'Custom Slides') {
+global $post;
+// Initiating query
+$custom_query = new WP_query();
+
+// Switch for Query type
+switch ($mantra_slideType) {
+
+ case 'Latest Posts' :
+$custom_query->query('showposts='.$mantra_slideNumber.'&ignore_sticky_posts=1');
+break;
+
+ case 'Random Posts' :
+$custom_query->query('showposts='.$mantra_slideNumber.'&orderby=rand&ignore_sticky_posts=1');
+break;
+
+ case 'Latest Posts from Category' :
+$custom_query->query('showposts='.$mantra_slideNumber.'&category_name='.$mantra_slideCateg.'&ignore_sticky_posts=1');
+break;
+
+ case 'Random Posts from Category' :
+$custom_query->query('showposts='.$mantra_slideNumber.'&category_name='.$mantra_slideCateg.'&orderby=rand&ignore_sticky_posts=1');
+break;
+
+ case 'Sticky Posts' :
+$custom_query->query(array('post__in' => get_option( 'sticky_posts' ), 'showposts' =>$mantra_slideNumber,'ignore_sticky_posts' => 1));
+break;
+
+ case 'Specific Posts' :
+ // Transofm string separated by commas into array
+$pieces_array = explode(",", $mantra_slideSpecific);
+$custom_query->query(array( 'post_type' => 'any', 'post__in' => $pieces_array, 'ignore_sticky_posts' => 1,'orderby' => 'post__in' ));
+break;
+
+}
+ // Variables i and j for matching slider number with caption number
+$i=0; $j=0;?>
+ <div class="slider-wrapper theme-default">
+ <div class="ribbon"></div>
+ <div id="slider" class="nivoSlider">
+
+ <?php
+ // Loop for creating the slides
+ if ( $custom_query->have_posts() ) while ( $custom_query->have_posts()) : $custom_query->the_post();
+
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),'slider');
+ $i++; ?>
+ <a href="<?php the_permalink(); ?>"><img src="<?php echo $image[0]; ?>" alt="" title="#caption<?php echo $i;?>" /></a>
+
+ <?php endwhile; // end of the loop.
+?>
+</div>
+ <?php
+ // Loop for creating the captions
+ if ($custom_query->have_posts() ) while ( $custom_query->have_posts() ) : $custom_query->the_post();
+ $j++; ?>
+
+ <div id="caption<?php echo $j;?>" class="nivo-html-caption">
+ <?php the_title("<h2>","</h2>");the_excerpt(); ?>
+ </div>
+
+ <?php endwhile; // end of the loop. ?>
+
+ </div>
+
+<?php } else {
+
+// If Custom Slides have been selected
+?>
+ <div class="slider-wrapper theme-default">
+ <div class="ribbon"></div>
+ <div id="slider" class="nivoSlider">
+ <?php for ($i=1;$i<=5;$i++)
+ if(${"mantra_sliderimg$i"}) {?> <a href='<?php echo esc_url(${"mantra_sliderlink$i"}) ?>'><img src='<?php echo esc_url(${"mantra_sliderimg$i"}) ?>' alt="" <?php if (${"mantra_slidertitle$i"} || ${"mantra_slidertext$i"} ) { ?>title="#caption<?php echo $i;?>" <?php }?> /></a><?php } ?>
+ </div>
+ <?php for ($i=1;$i<=5;$i++) { ?>
+ <div id="caption<?php echo $i;?>" class="nivo-html-caption">
+ <?php echo '<h2>'.${"mantra_slidertitle$i"}.'</h2>'.${"mantra_slidertext$i"} ?>
+ </div>
+ <?php } ?>
+</div>
+<?php }
+
+// Second FrontPage title
+ if($mantra_fronttext2) {?><div id="front-text2"> <h1><?php echo esc_attr($mantra_fronttext2) ?> </h1></div><?php }
+
+// Frontpage columns
+ if($mantra_nrcolumns) { ?>
+<div id="front-columns">
+ <div id="column1">
+ <a href="<?php echo esc_url($mantra_columnlink1) ?>"> <div class="column-image" ><img src="<?php echo esc_url($mantra_columnimg1) ?>" id="columnImage1" alt="" /> </div> <h3><?php echo $mantra_columntitle1 ?></h3> </a><div class="column-text"><?php echo do_shortcode ($mantra_columntext1 ); ?></div>
+ <?php if($mantra_columnreadmore) {?> <div class="columnmore"> <a href="<?php echo esc_url($mantra_columnlink1) ?>"><?php echo esc_attr($mantra_columnreadmore) ?> &raquo;</a> </div><?php } ?>
+ </div>
+<?php if($mantra_nrcolumns != '1') { ?>
+ <div id="column2">
+ <a href="<?php echo esc_url($mantra_columnlink2) ?>"> <div class="column-image" ><img src="<?php echo esc_url($mantra_columnimg2) ?>" id="columnImage2" alt="" /> </div> <h3><?php echo $mantra_columntitle2 ?></h3> </a><div class="column-text"><?php echo do_shortcode ( $mantra_columntext2 );?></div>
+ <?php if($mantra_columnreadmore) {?> <div class="columnmore"> <a href="<?php echo esc_url($mantra_columnlink2) ?>"><?php echo esc_attr($mantra_columnreadmore) ?> &raquo;</a> </div><?php } ?>
+ </div>
+<?php if($mantra_nrcolumns != '2') { ?>
+ <div id="column3">
+ <a href="<?php echo esc_url($mantra_columnlink3) ?>"> <div class="column-image" ><img src="<?php echo esc_url($mantra_columnimg3) ?>" id="columnImage3" alt="" /> </div> <h3><?php echo $mantra_columntitle3 ?></h3> </a><div class="column-text"><?php echo do_shortcode ( $mantra_columntext3 );?></div>
+ <?php if($mantra_columnreadmore) {?> <div class="columnmore"> <a href="<?php echo esc_url($mantra_columnlink3) ?>"><?php echo esc_attr($mantra_columnreadmore) ?> &raquo;</a> </div><?php } ?>
+ </div>
+<?php if($mantra_nrcolumns == '4') { ?>
+ <div id="column4">
+ <a href="<?php echo esc_url($mantra_columnlink4) ?>"> <div class="column-image" ><img src="<?php echo esc_url($mantra_columnimg4) ?>" id="columnImage4" alt="" /> </div> <h3><?php echo $mantra_columntitle4 ?></h3> </a><div class="column-text"><?php echo do_shortcode ( $mantra_columntext4 ); ?></div>
+ <?php if($mantra_columnreadmore) {?> <div class="columnmore"> <a href="<?php echo esc_url($mantra_columnlink4) ?>"><?php echo esc_attr($mantra_columnreadmore) ?> &raquo;</a> </div><?php } ?>
+ </div>
+<?php } } }?>
+</div>
+<?php }
+
+ // Frontpage text areas
+ if($mantra_fronttext3) {?><div id="front-text3"> <blockquote><?php echo do_shortcode( $mantra_fronttext3 ) ?> </blockquote></div><?php }
+ if($mantra_fronttext4) {?><div id="front-text4"> <blockquote><?php echo do_shortcode( $mantra_fronttext4 ) ?> </blockquote></div><?php }
+
+ ?>
+</div> <!-- frontpage -->
+ <?php } // End of mantra_frontpage_generator
+endif;
+?>
diff --git a/themes/mantra/includes/theme-functions.php b/themes/mantra/includes/theme-functions.php
new file mode 100644
index 00000000..3cdc2fe3
--- /dev/null
+++ b/themes/mantra/includes/theme-functions.php
@@ -0,0 +1,445 @@
+<?php
+/**
+ * Misc functions breadcrumbs / pagination / transient data /back to top button
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+
+ /**
+ * Loads necessary scripts
+ * Adds HTML5 tags for IE8
+ * Used in header.php
+*/
+ function mantra_header_scripts() {
+ $mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+}
+?>
+<!--[if lt IE 9]>
+<script>
+document.createElement('header');
+document.createElement('nav');
+document.createElement('section');
+document.createElement('article');
+document.createElement('aside');
+document.createElement('footer');
+document.createElement('hgroup');
+</script>
+<![endif]-->
+<script type="text/javascript">
+function makeDoubleDelegate(function1, function2) {
+// concatenate functions
+ return function() { if (function1) function1(); if (function2) function2(); }
+}
+
+function mantra_onload() {
+
+<?php if ($mantra_mobile=="Enable") { // If mobile view is enabled ?>
+
+ // Add responsive videos
+ if (jQuery(window).width() < 800) jQuery(".entry-content").fitVids();
+<?php }
+if (($mantra_s1bg || $mantra_s2bg) ) { ?>
+ // Check if sidebars have user colors and if so equalize their heights
+ equalizeHeights();<?php } ?>
+}; // mantra_onload
+
+
+jQuery(document).ready(function(){
+ // Add custom borders to images
+ jQuery("img.alignnone, img.alignleft, img.aligncenter, img.alignright").addClass("<?php echo 'image'.$mantra_image;?>");
+<?php if ($mantra_mobile=="Enable") { // If mobile view is enabled ?>
+
+ // Add select navigation to small screens
+ jQuery("#access > .menu > ul").tinyNav({
+ header: ' = <?php _e('Menu','mantra'); ?> = '
+ });
+<?php } ?>
+});
+
+// make sure not to lose previous onload events
+window.onload = makeDoubleDelegate(window.onload, mantra_onload );
+</script>
+<?php
+}
+
+add_action('wp_head','mantra_header_scripts',100);
+
+ /**
+ * Adds title and description to heaer
+ * Used in header.php
+*/
+function mantra_title_and_description() {
+ $mantra_options = mantra_get_theme_options();
+ foreach ($mantra_options as $key => $value) { ${"$key"} = $value; }
+
+ // Header styling and image loading
+ // Check if this is a post or page, if it has a thumbnail, and if it's a big one
+
+ global $post;
+
+ if (get_header_image() != '') { $himgsrc = get_header_image(); }
+ if ( is_singular() && has_post_thumbnail( $post->ID ) && ($mantra_fheader == "Enable") && ($image = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'header' ) ) && ($image[1] >= HEADER_IMAGE_WIDTH) ):
+ $himgsrc = $image[0];
+ endif;
+
+ if (isset($himgsrc) && ($himgsrc != '')) : echo '<img id="bg_image" alt="" title="" src="'.$himgsrc.'" />'; endif;
+
+?>
+
+ <div id="header-container">
+
+
+<?php
+ switch ($mantra_siteheader) {
+
+ case 'Site Title and Description':
+ echo '<div>';
+ $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div';
+ echo '<'.$heading_tag.' id="site-title">';
+ echo '<span> <a href="'.esc_url( home_url( '/' ) ).'" title="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'" rel="home">'.get_bloginfo( 'name' ).'</a> </span>';
+ echo '</'.$heading_tag.'>';
+ echo '<div id="site-description" >'.get_bloginfo( 'description' ).'</div></div>';
+ break;
+
+ case 'Clickable header image' :
+ echo '<a href="'.esc_url( home_url( '/' ) ).'" id="linky"></a>' ;
+ break;
+
+ case 'Custom Logo' :
+ if (isset($mantra_logoupload) && ($mantra_logoupload != '')) : echo '<div><a id="logo" href="'.esc_url( home_url( '/' ) ).'" ><img title="" alt="" src="'.$mantra_logoupload.'" /></a></div>'; endif;
+ break;
+
+ case 'Empty' :
+ // nothing to do here
+ break;
+ }
+
+ if ($mantra_socialsdisplay0): mantra_header_socials(); endif;
+ echo '</div>';
+
+} // mantra_title_and_description()
+
+
+add_action ('cryout_branding_hook','mantra_title_and_description');
+
+ /**
+ * Add social icons in header / undermneu left / undermenu right / footer
+ * Used in header.php and footer.php
+*/
+ function mantra_header_socials() {
+ mantra_set_social_icons('sheader');
+ }
+
+ function mantra_smenul_socials() {
+ mantra_set_social_icons('smenul');
+ }
+
+ function mantra_smenur_socials() {
+ mantra_set_social_icons('smenur');
+ }
+
+ function mantra_footer_socials() {
+ mantra_set_social_icons('sfooter');
+ }
+
+//if($mantra_socialsdisplay0) add_action('cryout_branding_hook', 'mantra_header_socials');
+if($mantra_socialsdisplay1) add_action('cryout_forbottom_hook', 'mantra_smenul_socials');
+if($mantra_socialsdisplay2) add_action('cryout_forbottom_hook', 'mantra_smenur_socials');
+if($mantra_socialsdisplay3) add_action('cryout_footer_hook', 'mantra_footer_socials',13);
+
+
+if ( ! function_exists( 'mantra_set_social_icons' ) ) :
+/**
+ * Social icons function
+ */
+function mantra_set_social_icons($id) {
+ $cryout_special_keys = array('Mail', 'Skype');
+ global $mantra_options;
+ foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+ }
+ echo '<div class="socials" id="'.$id.'">';
+ for ($i=1; $i<=9; $i+=2) {
+ $j=$i+1;
+ if ( ${"mantra_social$j"} ) {
+ if (in_array(${"mantra_social$i"},$cryout_special_keys)) :
+ $cryout_current_social = esc_html( ${"mantra_social$j"} );
+ else :
+ $cryout_current_social = esc_url( ${"mantra_social$j"} );
+ endif; ?>
+
+ <a target="_blank" rel="nofollow" href="<?php echo $cryout_current_social; ?>" class="socialicons social-<?php echo esc_attr(${"mantra_social$i"}); ?>" title="<?php echo esc_attr(${"mantra_social$i"}); ?>"><img alt="<?php echo esc_attr(${"mantra_social$i"}); ?>" src="<?php echo get_template_directory_uri().'/images/socials/'.${"mantra_social$i"}.'.png'; ?>" /></a><?php
+ }
+ }
+ echo '</div>';
+}
+endif;
+
+
+
+ /**
+ * Replaces header image with featured image if there is one for single pages
+ * Used in header.php
+*/
+
+/* // Moved to custom-styles.php
+
+function mantra_header_featured_image() {
+global $post;
+global $mantra_options;
+foreach ($mantra_options as $key => $value) {
+${"$key"} = $value ;
+}
+// Check if this is a post or page, if it has a thumbnail, and if it's a big one
+if ( is_singular() && has_post_thumbnail( $post->ID ) && $mantra_fheader == "Enable" &&
+ ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
+ $image[1] >= HEADER_IMAGE_WIDTH ) :
+ // Houston, we have a new header image!
+ //echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array(HEADER_IMAGE_WIDTH,HEADER_IMAGE_HEIGHT) );
+endif;
+}
+
+
+
+*/
+
+/**
+ * Mantra back to top button
+ * Creates div for js
+*/
+function mantra_back_top() {
+ echo '<div id="toTop"> </div>';
+ }
+
+
+if ($mantra_backtop=="Enable") add_action ('cryout_body_hook','mantra_back_top');
+
+
+
+ /**
+ * Creates breadcrumns with page sublevels and category sublevels.
+ */
+function mantra_breadcrumbs() {
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) { ${"$key"} = $value; }
+global $post;
+echo '<div class="breadcrumbs">';
+if (is_page() && !is_front_page() || is_single() || is_category() || is_archive()) {
+ echo '<a href="'.get_bloginfo('url').'">'.get_bloginfo('name').' &raquo; </a>';
+
+ if (is_page()) {
+ $ancestors = get_post_ancestors($post);
+
+ if ($ancestors) {
+ $ancestors = array_reverse($ancestors);
+
+ foreach ($ancestors as $crumb) {
+ echo '<a href="'.get_permalink($crumb).'">'.get_the_title($crumb).' &raquo; </a>';
+ }
+ }
+ }
+
+ if (is_single()) {
+ if(has_category()) { $category = get_the_category();
+ echo '<a href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.' &raquo; </a>';
+ }
+ }
+
+ if (is_category()) {
+ $category = get_the_category();
+ echo ''.$category[0]->cat_name.'';
+ }
+
+
+
+ // Current page
+ if (is_page() || is_single()) {
+ echo ''.get_the_title().'';
+ }
+ echo '';
+ } elseif (is_home() && $mantra_frontpage!="Enable" ) {
+ // Front page
+ echo '';
+ echo '<a href="'.get_bloginfo('url').'">'.get_bloginfo('name').'</a> '."&raquo; ";
+ _e('Home Page','mantra');
+ echo '';
+ }
+echo '</div>';
+}
+
+if($mantra_breadcrumbs=="Enable") add_action ('cryout_before_content_hook','mantra_breadcrumbs',0);
+
+
+if ( ! function_exists( 'mantra_pagination' ) ) :
+/**
+ * Creates pagination for blog pages.
+ */
+function mantra_pagination($pages = '', $range = 2, $prefix ='')
+{
+ $showitems = ($range * 2)+1;
+
+ global $paged;
+ if(empty($paged)) $paged = 1;
+
+ if($pages == '')
+ {
+ global $wp_query;
+ $pages = $wp_query->max_num_pages;
+ if(!$pages)
+ {
+ $pages = 1;
+ }
+ }
+
+ if(1 != $pages)
+ {
+ echo "<div class='pagination_container'><nav class='pagination'>";
+ if ($prefix) {echo "<span id='paginationPrefix'>$prefix </span>";}
+ if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo;</a>";
+ if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo;</a>";
+
+ for ($i=1; $i <= $pages; $i++)
+ {
+ if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
+ {
+ echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
+ }
+ }
+
+ if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>&rsaquo;</a>";
+ if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>&raquo;</a>";
+ echo "</nav></div>\n";
+ }
+}
+endif;
+
+
+/**
+ * Site info
+ */
+function mantra_site_info() {
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+} ?>
+ <div style="text-align:center;clear:both;padding-top:4px;" >
+ <a href="<?php echo esc_url( home_url( '/' ) ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
+ <?php bloginfo( 'name' ); ?></a> | <?php _e('Powered by','mantra')?> <a target="_blank" href="<?php echo 'http://www.cryoutcreations.eu';?>" title="<?php echo 'Mantra Theme by '.
+ 'Cryout Creations';?>"><?php echo 'Mantra' ?></a> &amp; <a target="_blank" href="<?php echo esc_url('http://wordpress.org/' ); ?>"
+ title="<?php esc_attr_e('Semantic Personal Publishing Platform', 'mantra'); ?>"> <?php printf(' %s.', 'WordPress' ); ?>
+ </a>
+ </div><!-- #site-info -->
+<?php }
+
+add_action('cryout_footer_hook','mantra_site_info',12);
+
+
+/**
+ * Copyright text
+ */
+function mantra_copyright() {
+$mantra_options= mantra_get_theme_options();
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+ }
+ echo '<div id="site-copyright">'.$mantra_copyright.'</div>';
+}
+
+
+if ($mantra_copyright != '') add_action('cryout_footer_hook','mantra_copyright',11);
+
+add_action('wp_ajax_nopriv_do_ajax', 'mantra_ajax_function');
+add_action('wp_ajax_do_ajax', 'mantra_ajax_function');
+
+
+/**
+* Retrieves the IDs for images in a gallery.
+* @since mantra 2.1.1
+* @return array List of image IDs from the post gallery.
+*/
+function mantra_get_gallery_images() {
+ $images = array();
+
+ if ( function_exists( 'get_post_galleries' ) ) {
+ $galleries = get_post_galleries( get_the_ID(), false );
+ if ( isset( $galleries[0]['ids'] ) )
+ $images = explode( ',', $galleries[0]['ids'] );
+ } else {
+ $pattern = get_shortcode_regex();
+ preg_match( "/$pattern/s", get_the_content(), $match );
+ $atts = shortcode_parse_atts( $match[3] );
+ if ( isset( $atts['ids'] ) )
+ $images = explode( ',', $atts['ids'] );
+ }
+
+ if ( ! $images ) {
+ $images = get_posts( array(
+ 'fields' => 'ids',
+ 'numberposts' => 999,
+ 'order' => 'ASC',
+ 'orderby' => 'menu_order',
+ 'post_mime_type' => 'image',
+ 'post_parent' => get_the_ID(),
+ 'post_type' => 'attachment',
+ ) );
+ }
+
+ return $images;
+} // mantra_get_gallery_images()
+
+
+if ( ! function_exists( 'mantra_ajax_function' ) ) :
+
+function mantra_ajax_function(){
+ob_clean();
+
+ // the first part is a SWTICHBOARD that fires specific functions
+ // according to the value of Query Var 'fn'
+
+ switch($_REQUEST['fn']){
+ case 'get_latest_posts':
+ $output = mantra_ajax_get_latest_posts($_REQUEST['count'],$_REQUEST['categName']);
+ break;
+ default:
+ $output = 'No function specified, check your jQuery.ajax() call';
+ break;
+
+ }
+
+ // at this point, $output contains some sort of valuable data!
+ // Now, convert $output to JSON and echo it to the browser
+ // That way, we can recapture it with jQuery and run our success function
+
+ $output=json_encode($output);
+ if(is_array($output)){
+ print_r($output);
+ }
+ else{
+ echo $output;
+ }
+ die;
+}
+endif;
+
+if ( ! function_exists( 'mantra_ajax_get_latest_posts' ) ) :
+function mantra_ajax_get_latest_posts($count,$categName){
+ $testVar='';
+ // The Query
+ query_posts( 'category_name='.$categName);
+ // The Loop
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
+ $testVar .=the_title("<option>","</option>",0);
+ endwhile; else: endif;
+
+ // Reset Query
+ wp_reset_query();
+
+ return $testVar;
+}
+endif;
+?> \ No newline at end of file
diff --git a/themes/mantra/includes/theme-hooks.php b/themes/mantra/includes/theme-hooks.php
new file mode 100644
index 00000000..14ca3bbe
--- /dev/null
+++ b/themes/mantra/includes/theme-hooks.php
@@ -0,0 +1,159 @@
+<?php
+/*
+ * Theme hooks
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+/**
+ * HEADER.PHP HOOKS
+*/
+
+// Before wp_head hook
+function cryout_header_hook() {
+ do_action('cryout_header_hook');
+}
+// SEO hook
+function cryout_seo_hook() {
+ do_action('cryout_seo_hook');
+}
+
+// Before wrapper
+function cryout_body_hook() {
+ do_action('cryout_body_hook');
+}
+
+// Inside wrapper
+function cryout_wrapper_hook() {
+ do_action('cryout_wrapper_hook');
+}
+
+// Inside branding
+function cryout_branding_hook() {
+ do_action('cryout_branding_hook');
+}
+
+// Inside access
+function cryout_access_hook() {
+ do_action('cryout_access_hook');
+}
+
+// Inside forbottom
+function cryout_forbottom_hook() {
+ do_action('cryout_forbottom_hook');
+}
+
+// Breadcrumbs
+function cryout_breadcrumbs_hook() {
+ do_action('cryout_breadcrumbs_hook');
+}
+
+/**
+ * FOOTER.PHP HOOKS
+*/
+
+// Footer hook
+function cryout_footer_hook() {
+ do_action('cryout_footer_hook');
+}
+
+
+/**
+ * COMMENTS.PHP HOOKS
+*/
+
+// Before comments hook
+function cryout_before_comments_hook() {
+ do_action('cryout_before_comments_hook');
+}
+
+// Actual comments hook
+function cryout_comments_hook() {
+ do_action('cryout_comments_hook');
+}
+
+// After comments hook
+function cryout_after_comments_hook() {
+ do_action('cryout_after_comments_hook');
+}
+
+// No comments hook
+function cryout_nocomments_hook() {
+ do_action('cryout_nocomments_hook');
+}
+
+
+/**
+ * SIDEBAR.PHP HOOKS
+*/
+
+// No comments hook
+function cryout_before_primary_widgets_hook() {
+ do_action('cryout_before_primary_widgets_hook');
+}
+
+// No comments hook
+function cryout_after_primary_widgets_hook() {
+ do_action('cryout_after_primary_widgets_hook');
+}
+
+// No comments hook
+function cryout_before_secondary_widgets_hook() {
+ do_action('cryout_before_secondary_widgets_hook');
+}
+
+// No comments hook
+function cryout_after_secondary_widgets_hook() {
+ do_action('cryout_after_secondary_widgets_hook');
+}
+
+/**
+ * LOOP.PHP HOOKS
+*/
+
+// Before each article hook
+function cryout_before_article_hook() {
+ do_action('cryout_before_article_hook');
+}
+
+// After each article hook
+function cryout_after_article_hook() {
+ do_action('cryout_after_article_hook');
+}
+
+// After each article title
+function cryout_post_title_hook() {
+ do_action('cryout_post_title_hook');
+}
+
+// After each post meta
+function cryout_post_meta_hook() {
+ do_action('cryout_post_meta_hook');
+}
+
+// Before the actual post content
+function cryout_post_before_content_hook() {
+ do_action('cryout_post_before_content_hook');
+}
+
+// After the actual post content
+function cryout_post_after_content_hook() {
+ do_action('cryout_post_after_content_hook');
+}
+
+// After the actual post content
+function cryout_post_footer_hook() {
+ do_action('cryout_post_footer_hook');
+}
+
+//Content hooks
+
+function cryout_before_content_hook() {
+ do_action('cryout_before_content_hook');
+}
+
+function cryout_after_content_hook() {
+ do_action('cryout_after_content_hook');
+}
+?>
diff --git a/themes/mantra/includes/theme-loop.php b/themes/mantra/includes/theme-loop.php
new file mode 100644
index 00000000..909858ec
--- /dev/null
+++ b/themes/mantra/includes/theme-loop.php
@@ -0,0 +1,306 @@
+<?php /*
+ * Main loop related functions
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+
+ /**
+ * Sets the post excerpt length to 40 characters.
+ *
+ * To override this length in a child theme, remove the filter and add your own
+ * function tied to the excerpt_length filter hook.
+ *
+ * @since Mantra 1.0
+ * @return int
+ */
+function mantra_excerpt_length( $length ) {
+ global $mantra_excerptwords;
+ return $mantra_excerptwords;
+}
+add_filter( 'excerpt_length', 'mantra_excerpt_length' );
+
+/**
+ * Returns a "Continue Reading" link for excerpts
+ *
+ * @since mantra 0.5
+ * @return string "Continue Reading" link
+ */
+function mantra_continue_reading_link() {
+ global $mantra_excerptcont;
+ return ' <a href="'. get_permalink() . '">' .$mantra_excerptcont.' <span class="meta-nav">&rarr; </span>' . '</a>';
+}
+
+/**
+ * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and mantra_continue_reading_link().
+ *
+ * To override this in a child theme, remove the filter and add your own
+ * function tied to the excerpt_more filter hook.
+ *
+ * @since mantra 0.5
+ * @return string An ellipsis
+ */
+function mantra_auto_excerpt_more( $more ) {
+ global $mantra_excerptdots;
+ return $mantra_excerptdots. mantra_continue_reading_link();
+}
+add_filter( 'excerpt_more', 'mantra_auto_excerpt_more' );
+
+
+/**
+ * Adds a pretty "Continue Reading" link to custom post excerpts.
+ *
+ * To override this link in a child theme, remove the filter and add your own
+ * function tied to the get_the_excerpt filter hook.
+ *
+ * @since mantra 0.5
+ * @return string Excerpt with a pretty "Continue Reading" link
+ */
+function mantra_custom_excerpt_more( $output ) {
+ if ( has_excerpt() && ! is_attachment() ) {
+ $output .= mantra_continue_reading_link();
+ }
+ return $output;
+}
+
+add_filter( 'get_the_excerpt', 'mantra_custom_excerpt_more' );
+
+/**
+ * Adds a "Continue Reading" link to post excerpts created using the <!--more--> tag.
+ *
+ * To override this link in a child theme, remove the filter and add your own
+ * function tied to the the_content_more_link filter hook.
+ *
+ * @since mantra 2.1
+ * @return string Excerpt with a pretty "Continue Reading" link
+ */
+function mantra_more_link($more_link, $more_link_text) {
+ global $mantra_excerptcont;
+ $new_link_text = $mantra_excerptcont;
+ if (preg_match("/custom=(.*)/",$more_link_text,$m) ) {
+ $new_link_text = $m[1];
+ };
+ $more_link = str_replace($more_link_text, $new_link_text.' <span class="meta-nav">&rarr; </span>', $more_link);
+ $more_link = str_replace('more-link', 'continue-reading-link', $more_link);
+ return $more_link;
+}
+add_filter('the_content_more_link', 'mantra_more_link',10,2);
+
+/**
+ * Allows post excerpts to contain HTML tags
+ * @since mantra 1.8.7
+ * @return string Excerpt with most HTML tags intact
+ */
+
+function mantra_trim_excerpt($text) {
+global $mantra_excerptwords;
+global $mantra_excerptcont;
+global $mantra_excerptdots;
+$raw_excerpt = $text;
+if ( '' == $text ) {
+ //Retrieve the post content.
+ $text = get_the_content('');
+
+ //Delete all shortcode tags from the content.
+ $text = strip_shortcodes( $text );
+
+ $text = apply_filters('the_content', $text);
+ $text = str_replace(']]>', ']]&gt;', $text);
+
+ $allowed_tags = '<a>,<img>,<b>,<strong>,<ul>,<li>,<i>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<pre>,<code>,<em>,<u>,<br>,<p>';
+ $text = strip_tags($text, $allowed_tags);
+
+ $words = preg_split("/[\n\r\t ]+/", $text, $mantra_excerptwords + 1, PREG_SPLIT_NO_EMPTY);
+ if ( count($words) > $mantra_excerptwords ) {
+ array_pop($words);
+ $text = implode(' ', $words);
+ $text = $text .' '.$mantra_excerptdots. ' <a href="'. get_permalink() . '">' .$mantra_excerptcont.' <span class="meta-nav">&rarr; </span>' . '</a>';
+ } else {
+ $text = implode(' ', $words);
+ }
+}
+return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
+}
+
+
+
+
+if ($mantra_excerpttags=='Enable') {
+remove_filter('get_the_excerpt', 'wp_trim_excerpt');
+add_filter('get_the_excerpt', 'mantra_trim_excerpt');
+}
+
+
+/**
+ * Remove inline styles printed when the gallery shortcode is used.
+ *
+ * Galleries are styled by the theme in Mantra's style.css.
+ *
+ * @since mantra 0.5
+ * @return string The gallery style filter, with the styles themselves removed.
+ */
+function mantra_remove_gallery_css( $css ) {
+ return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
+}
+add_filter( 'gallery_style', 'mantra_remove_gallery_css' );
+
+
+if ( ! function_exists( 'mantra_posted_on' ) ) :
+/**
+ * Prints HTML with meta information for the current post—date/time and author.
+ *
+ * @since mantra 0.5
+ */
+function mantra_posted_on() {
+global $mantra_options;
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+}
+
+// If date is hidden don't give it a value
+$date_string='<span class="onDate"> %3$s <span class="bl_sep">|</span> </span>';
+if ($mantra_postdate == "Hide") $date_string='';
+
+// If author is hidden don't give it a value
+$author_string = sprintf( '<span class="author vcard" >'.__( 'By ','mantra'). ' <a class="url fn n" href="%1$s" title="%2$s">%3$s</a> <span class="bl_sep">|</span></span>',
+ get_author_posts_url( get_the_author_meta( 'ID' ) ),
+ sprintf( esc_attr__( 'View all posts by %s', 'mantra' ), get_the_author() ),
+ get_the_author()
+ ) ;
+if ($mantra_postauthor == "Hide") $author_string='';
+
+// Print the meta data
+ printf( '&nbsp; %4$s '.$date_string.' <span class="bl_categ"> %2$s </span> ',
+ 'meta-prep meta-prep-author',
+ get_the_category_list( ', ' ),
+ sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span> <span class="entry-time"> - %2$s</span></a>',
+ get_permalink(),
+ esc_attr( get_the_time() ),
+ get_the_date()
+ ), $author_string
+
+ );
+}
+endif;
+
+// Remove category from rel in categry tags.
+add_filter( 'the_category', 'mantra_remove_category_tag' );
+add_filter( 'get_the_category_list', 'mantra_remove_category_tag' );
+
+function mantra_remove_category_tag( $text ) {
+$text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text;
+}
+
+
+if ( ! function_exists( 'mantra_posted_in' ) ) :
+/**
+ * Prints HTML with meta information for the current post (category, tags and permalink).
+ *
+ * @since mantra 0.5
+ */
+function mantra_posted_in() {
+ // Retrieves tag list of current post, separated by commas.
+ $tag_list = get_the_tag_list( '', ', ' );
+ if ( $tag_list ) {
+ $posted_in = '<span class="bl_posted">'.__( 'Tagged','mantra').' %2$s.</span><span class="bl_bookmark">'.__(' Bookmark the ','mantra').' <a href="%3$s" title="'.__('Permalink to','mantra').' %4$s" rel="bookmark"> '.__('permalink','mantra').'</a>.</span>';
+ } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
+ $posted_in = '<span class="bl_bookmark">'.__( 'Bookmark the ','mantra'). ' <a href="%3$s" title="'.__('Permalink to','mantra').' %4$s" rel="bookmark">'.__('permalink','mantra').'</a>. </span>';
+ } else {
+ $posted_in = '<span class="bl_bookmark">'.__( 'Bookmark the ','mantra'). ' <a href="%3$s" title="'.__('Permalink to','mantra').' %4$s" rel="bookmark">'.__('permalink','mantra').'</a>. </span>';
+ }
+ // Prints the string, replacing the placeholders.
+ printf(
+ $posted_in,
+ get_the_category_list( ', ' ),
+ $tag_list,
+ get_permalink(),
+ the_title_attribute( 'echo=0' )
+ );
+}
+endif;
+
+if ( ! function_exists( 'mantra_content_nav' ) ) :
+/**
+ * Display navigation to next/previous pages when applicable
+ */
+function mantra_content_nav( $nav_id ) {
+ global $wp_query;
+
+ if ( $wp_query->max_num_pages > 1 ) : ?>
+ <nav id="<?php echo $nav_id; ?>" class="navigation">
+ <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&laquo;</span> Older posts', 'mantra' ) ); ?></div>
+ <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&raquo;</span>', 'mantra' ) ); ?></div>
+ </nav><!-- #nav-above -->
+ <?php endif;
+}
+endif; // mantra_content_nav
+
+// Custom image size for use with post thumbnails
+if($mantra_fcrop)
+add_image_size( 'custom', $mantra_fwidth, $mantra_fheight, true );
+else
+add_image_size( 'custom', $mantra_fwidth, $mantra_fheight );
+
+
+function cryout_echo_first_image ($postID)
+{
+ $args = array(
+ 'numberposts' => 1,
+ 'order'=> 'ASC',
+ 'post_mime_type' => 'image',
+ 'post_parent' => $postID,
+ 'post_status' => 'any',
+ 'post_type' => 'any'
+ );
+
+ $attachments = get_children( $args );
+ //print_r($attachments);
+
+ if ($attachments) {
+ foreach($attachments as $attachment) {
+ $image_attributes = wp_get_attachment_image_src( $attachment->ID, 'custom' ) ? wp_get_attachment_image_src( $attachment->ID, 'custom' ) : wp_get_attachment_image_src( $attachment->ID, 'custom' );
+
+ return $image_attributes[0];
+
+ }
+ }
+}
+
+if ( ! function_exists( 'mantra_set_featured_thumb' ) ) :
+/**
+ * Adds a post thumbnail and if one doesn't exist the first image from the post is used.
+ */
+
+function mantra_set_featured_thumb() {
+ global $mantra_options;
+ foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+}
+global $post;
+$image_src = cryout_echo_first_image($post->ID);
+
+ if ( function_exists("has_post_thumbnail") && has_post_thumbnail() && $mantra_fpost=='Enable')
+ the_post_thumbnail( 'custom', array("class" => "align".strtolower($mantra_falign)." post_thumbnail" ) );
+
+ else if ($mantra_fpost=='Enable' && $mantra_fauto=="Enable" && $image_src && ($mantra_excerptarchive != "Full Post" || $mantra_excerpthome != "Full Post"))
+ echo '<a title="'.the_title_attribute('echo=0').'" href="'.get_permalink().'" ><img title="" alt="" class="align'.strtolower($mantra_falign).' post_thumbnail" src="'.$image_src.'"></a>' ;
+
+ }
+endif; // mantra_set_featured_thumb
+
+
+
+if ($mantra_fpost=='Enable' && $mantra_fpostlink) add_filter( 'post_thumbnail_html', 'mantra_thumbnail_link', 10, 3 );
+
+/**
+ * The thumbnail gets a link to the post's page
+ */
+
+function mantra_thumbnail_link( $html, $post_id, $post_image_id ) {
+
+ $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '" alt="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
+ return $html;
+
+}
+?> \ No newline at end of file
diff --git a/themes/mantra/includes/theme-seo.php b/themes/mantra/includes/theme-seo.php
new file mode 100644
index 00000000..11899bbe
--- /dev/null
+++ b/themes/mantra/includes/theme-seo.php
@@ -0,0 +1,201 @@
+<?php /*
+ * SEO related functions
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+/**
+ * Filter for page meta title.
+ */
+function mantra_filter_wp_title( $title ) {
+ // Get the Site Name
+ $site_name = get_bloginfo( 'name' );
+ // Prepend name
+ $filtered_title = $title.' - '.$site_name;
+ // Get the Site Description
+ $site_description = get_bloginfo( 'description' );
+ // If site front page, append description
+ if ( (is_home() || is_front_page()) && $site_description ) {
+ // Append Site Description to title
+ $filtered_title =$site_name. " | ".$site_description;
+ }
+ // Add pagination if that's the case
+ global $page, $paged;
+ if ( $paged >= 2 || $page >= 2 )
+ $filtered_title .= ' | ' . sprintf( __( 'Page %s', 'mantra' ), max( $paged, $page ) );
+
+ // Return the modified title
+ return $filtered_title;
+}
+
+function mantra_filter_wp_title_rss($title) {
+return ' ';
+}
+add_filter( 'wp_title', 'mantra_filter_wp_title' );
+add_filter('wp_title_rss','mantra_filter_wp_title_rss');
+
+ /**
+ * Meta description
+ */
+function mantra_seo_description() {
+ global $mantra_options;
+ foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;}
+
+ if ( (is_home() && $mantra_seo_home_desc) || (is_page_template('template-blog.php') && $mantra_seo_home_desc) ) {
+ echo PHP_EOL.'<meta name="description" content="';
+ echo $mantra_seo_home_desc;
+ echo '" />'; }
+ else if ((is_single() || is_page()) && !is_404()) {
+ if ($mantra_seo_gen_desc =="Auto") {
+ global $post;
+ $content_post = get_post($post->ID);
+ $content = strip_shortcodes($content_post->post_content);
+ $content = preg_replace(array('/\s{2,}/', '/[\t\n]/'), ' ', $content);
+ $content = strip_tags($content);
+ $content = str_replace('"','',$content);
+ $content = preg_replace('/((\w+\W+\'*){'.(33).'}(\w+))(.*)/', '${1}', $content);
+ }
+ else if ($mantra_seo_gen_desc=="Manual") {
+ global $post,$mantra_meta_box_description;
+ $content = get_post_meta($post->ID,'SEOdescription_value',true);
+ }
+
+ echo PHP_EOL.'<meta name="description" content="';
+ echo $content;
+ echo '" />'; }
+ else if (is_category() && category_description() != "") {
+ echo PHP_EOL.'<meta name="description" content="';
+ echo trim(strip_tags(category_description()));
+ echo '" />'; }
+
+}
+
+ /**
+ * Meta author
+ */
+function mantra_seo_name() {
+ global $mantra_options;
+ foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;}
+echo '<meta name="author" content="'.$mantra_seo_author.'" />';
+}
+ /**
+ * Meta Theme
+ */
+function mantra_seo_template() {
+echo PHP_EOL.'<meta property="template" content="mantra" />'.PHP_EOL;
+}
+/**
+ * Meta Title
+ */
+function mantra_seo_title() {
+echo "<title>".wp_title( '', false, 'right' )."</title>".PHP_EOL;
+echo '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />';
+}
+
+
+// Mantra main seo function
+function mantra_seo_generator() {
+global $mantra_options;
+foreach ($mantra_options as $key => $value) {
+${"$key"} = $value ;}
+add_action ('cryout_seo_hook','mantra_seo_title');
+add_action ('cryout_seo_hook','mantra_seo_description');
+
+if($mantra_seo_author && $mantra_seo_author!="Do not use")
+ add_action ('cryout_seo_hook','mantra_seo_name');
+
+add_action ('cryout_seo_hook','mantra_seo_template');
+}
+if($mantra_seo=="Enable") mantra_seo_generator() ;
+ else add_action ('cryout_seo_hook','mantra_seo_title',0);
+
+// Mantra favicon
+function mantra_fav_icon() {
+global $mantra_options;
+foreach ($mantra_options as $key => $value) {
+${"$key"} = $value ;}
+ echo '<link rel="shortcut icon" href="'.esc_url($mantra_options['mantra_favicon']).'" />';
+ echo '<link rel="apple-touch-icon" href="'.esc_url($mantra_options['mantra_favicon']).'" />';
+ }
+
+if ($mantra_options['mantra_favicon']) add_action ('cryout_header_hook','mantra_fav_icon');
+
+
+/*
+Plugin Name: Custom Write Panel
+Plugin URI: http://wefunction.com/2008/10/tutorial-create-custom-write-panels-in-wordpress
+Description: Allows custom fields to be added to the WordPress Post Page
+Version: 1.0
+Author: Spencer
+Author URI: http://wefunction.com
+/* ----------------------------------------------*/
+
+$mantra_meta_box_description =
+array(
+"image" => array(
+"name" => "SEOdescription",
+"std" => "",
+"title" => "Input the SEO description for this post/page here (about 160 characters): ",
+"description" => "This description is for SEO purposes only. It will be used as a meta in your HTML header. It won't be vislbe anywhere else.<br> More SEO options in the Mantra Settings Page >> Misc Options >> SEO.")
+);
+
+function mantra_meta_box_description() {
+global $post, $mantra_meta_box_description;
+
+foreach($mantra_meta_box_description as $meta_box) {
+$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
+
+if($meta_box_value == "")
+$meta_box_value = $meta_box['std'];
+
+echo '<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
+
+echo '<p>'.$meta_box['title'].'</p>';
+
+echo '<textarea rows="5" cols="150" name="'.$meta_box['name'].'_value" size="55" >'.$meta_box_value.'</textarea><br>';
+
+echo '<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
+}
+}
+
+function mantra_create_meta_box() {
+global $theme_name;
+add_meta_box( 'new-meta-boxes', 'Mantra SEO - Description', 'mantra_meta_box_description', 'post', 'normal', 'high' );
+add_meta_box( 'new-meta-boxes', 'Mantra SEO - Description', 'mantra_meta_box_description', 'page', 'normal', 'high' );
+}
+
+function mantra_save_postdata( $post_id ) {
+global $post, $mantra_meta_box_description;
+
+foreach($mantra_meta_box_description as $meta_box) {
+// Verify
+if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
+return $post_id;
+}
+
+if ( 'page' == $_POST['post_type'] ) {
+if ( !current_user_can( 'edit_page', $post_id ))
+return $post_id;
+} else {
+if ( !current_user_can( 'edit_post', $post_id ))
+return $post_id;
+}
+
+$data = $_POST[$meta_box['name'].'_value'];
+
+if(get_post_meta($post_id, $meta_box['name'].'_value') == "")
+add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
+elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))
+update_post_meta($post_id, $meta_box['name'].'_value', $data);
+elseif($data == "")
+delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
+}
+}
+if ($mantra_seo_gen_desc=="Manual") {
+ add_action('admin_menu', 'mantra_create_meta_box');
+ add_action('save_post', 'mantra_save_postdata');
+}
+?> \ No newline at end of file
diff --git a/themes/mantra/includes/theme-setup.php b/themes/mantra/includes/theme-setup.php
new file mode 100644
index 00000000..3f2ad3da
--- /dev/null
+++ b/themes/mantra/includes/theme-setup.php
@@ -0,0 +1,383 @@
+<?php
+/*
+ * Theme setup functions. Theme initialization, theme support , widgets , navigation
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+// Bringing up Mantra Settings page after install
+
+if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {
+ wp_redirect( 'themes.php?page=mantra-page' );
+}
+
+ $mantra_totalSize = $mantra_sidebar + $mantra_sidewidth+50;
+
+ /**
+
+ *
+ * @package Cryout Creations
+ * @subpackage mantra
+ * @since mantra 0.5
+ */
+
+/**
+ * Set the content width based on the theme's design and stylesheet.
+ *
+ * Used to set the width of images and content. Should be equal to the width the theme
+ * is designed for, generally via the style.css stylesheet.
+ */
+if ( ! isset( $content_width ) )
+ $content_width = $mantra_sidewidth;
+
+/** Tell WordPress to run mantra_setup() when the 'after_setup_theme' hook is run. */
+add_action( 'after_setup_theme', 'mantra_setup' );
+
+if ( ! function_exists( 'mantra_setup' ) ):
+/**
+ * Sets up theme defaults and registers support for various WordPress features.
+ *
+ * Note that this function is hooked into the after_setup_theme hook, which runs
+ * before the init hook. The init hook is too late for some features, such as indicating
+ * support post thumbnails.
+ *
+ * To override mantra_setup() in a child theme, add your own mantra_setup to your child theme's
+ * functions.php file.
+ *
+ * @uses add_theme_support() To add support for post thumbnails and automatic feed links.
+ * @uses register_nav_menus() To add support for navigation menus.
+ * @uses add_custom_background() To add support for a custom background.
+ * @uses add_editor_style() To style the visual editor.
+ * @uses load_theme_textdomain() For translation/localization support.
+ * @uses add_custom_image_header() To add support for a custom header.
+ * @uses register_default_headers() To register the default custom header images provided with the theme.
+ * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
+ *
+ * @since mantra 0.5
+ */
+function mantra_setup() {
+
+ // This theme styles the visual editor with editor-style.css to match the theme style.
+ add_editor_style();
+
+ // This theme uses post thumbnails
+ add_theme_support( 'post-thumbnails' );
+ set_post_thumbnail_size( 150, 150 ); // default Post Thumbnail dimensions (cropped)
+
+ // Add default posts and comments RSS feed links to head
+
+ add_theme_support( 'automatic-feed-links' );
+ add_theme_support('post-formats', array( 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status'));
+
+ // Make theme available for translation
+ // Translations can be filed in the /languages/ directory
+/**
+ * Make theme available for translation
+ * Translations can be filed in the /languages/ directory
+ */
+load_theme_textdomain( 'mantra', get_template_directory() . '/languages' );
+
+$locale = get_locale();
+$locale_file = get_template_directory() . "/languages/$locale.php";
+ if ( is_readable( $locale_file ) )
+ require_once( $locale_file );
+
+
+
+ // This theme uses wp_nav_menu() in 3 locations.
+ register_nav_menus( array(
+ 'primary' => __( 'Primary Navigation', 'mantra' ),
+ 'top' => __( 'Top Navigation', 'mantra' ),
+ 'footer' => __( 'Footer Navigation', 'mantra' ),
+ ) );
+
+ // This theme allows users to set a custom background
+ add_theme_support( 'custom-background' );
+
+ // We'll be using post thumbnails for custom header images on posts and pages.
+ // We want them to be the same size as the header.
+ // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
+ global $mantra_hheight;
+ $mantra_hheight=(int)$mantra_hheight;
+ global $mantra_totalSize;
+ define( 'HEADER_IMAGE_WIDTH', apply_filters( 'mantra_header_image_width', $mantra_totalSize ) );
+ define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'mantra_header_image_height', $mantra_hheight) );
+ //set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
+ add_image_size('header',HEADER_IMAGE_WIDTH,HEADER_IMAGE_HEIGHT,true);
+
+ global $mantra_fpsliderwidth;
+ global $mantra_fpsliderheight;
+ add_image_size('slider',$mantra_fpsliderwidth,$mantra_fpsliderheight,true);
+ // Add a way for the custom header to be styled in the admin panel that controls
+ // custom headers. See mantra_admin_header_style(), below.
+ define( 'NO_HEADER_TEXT', true );
+ add_theme_support( 'custom-header' );
+
+ // ... and thus ends the changeable header business.
+
+
+// Backwards compatibility with pre 3.4 versions for custom background and header
+
+ // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
+ register_default_headers( array(
+ 'mantra' => array(
+ 'url' => '%s/images/headers/mantra.png',
+ 'thumbnail_url' => '%s/images/headers/mantra-thumbnail.png',
+ // translators: header image description
+ 'description' => __( 'mantra', 'mantra' )
+ ),
+ ) );
+}
+endif;
+
+if ( ! function_exists( 'mantra_admin_header_style' ) ) :
+/**
+ * Styles the header image displayed on the Appearance > Header admin panel.
+ *
+ * Referenced via add_custom_image_header() in mantra_setup().
+ *
+ * @since mantra 0.5
+ */
+function mantra_admin_header_style() {
+?>
+<style type="text/css">
+/* Shows the same border as on front end */
+#headimg {
+ border-bottom: 1px solid #000;
+ border-top: 4px solid #000;
+}
+/* If NO_HEADER_TEXT is false, you would style the text with these selectors:
+ #headimg #name { }
+ #headimg #desc { }
+*/
+</style>
+<?php
+}
+endif;
+
+/**
+ * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
+ *
+ * To override this in a child theme, remove the filter and optionally add
+ * your own function tied to the wp_page_menu_args filter hook.
+ *
+ * @since mantra 0.5
+ */
+function mantra_page_menu_args( $args ) {
+ $args['show_home'] = true;
+ return $args;
+}
+add_filter( 'wp_page_menu_args', 'mantra_page_menu_args' );
+
+/**
+ * Create menus
+ */
+
+// TOP MENU
+function mantra_top_menu() {
+ if ( has_nav_menu( 'top' ) ) wp_nav_menu( array( 'container' => 'nav', 'container_class' => 'topmenu', 'theme_location' => 'top', 'depth' => 1 ) );
+ }
+
+ add_action ('cryout_wrapper_hook','mantra_top_menu');
+
+ // MAIN MENU
+ function mantra_main_menu() {
+ /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
+<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'mantra' ); ?>"><?php _e( 'Skip to content', 'mantra' ); ?></a></div>
+<?php /* Main navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */
+wp_nav_menu( array( 'container_class' => 'menu', 'menu_id' =>'prime_nav', 'theme_location' => 'primary' ) );
+}
+
+add_action ('cryout_access_hook','mantra_main_menu');
+
+// FOOTER MENU
+ function mantra_footer_menu() {
+ if ( has_nav_menu( 'footer' ) ) wp_nav_menu( array( 'container' => 'nav', 'container_class' => 'footermenu', 'theme_location' => 'footer', 'depth' => 1 ) );
+ }
+
+ add_action ('cryout_footer_hook','mantra_footer_menu',10);
+
+
+/**
+ * Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
+ *
+ * To override mantra_widgets_init() in a child theme, remove the action hook and add your own
+ * function tied to the init hook.
+ *
+ * @since mantra 0.5
+ * @uses register_sidebar
+ */
+function mantra_widgets_init() {
+ // Area 1, located at the top of the sidebar.
+ register_sidebar( array(
+ 'name' => __( 'Primary Widget Area - Sidebar 1', 'mantra' ),
+ 'id' => 'primary-widget-area',
+ 'description' => __( 'Primary widget area - Sidebar 1', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Secondary Widget Area - Sidebar 1', 'mantra' ),
+ 'id' => 'secondary-widget-area',
+ 'description' => __( 'Secondary widget area - Sidebar 1', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 3 for the second sidebar. Empty be default
+ register_sidebar( array(
+ 'name' => __( 'Third Widget Area - Sidebar 2', 'mantra' ),
+ 'id' => 'third-widget-area',
+ 'description' => __( 'Third widget area - Sidebar 2', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 4, located below the Third Widget Area in the second sidebar. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Fourth Widget Area - Sidebar 2', 'mantra' ),
+ 'id' => 'fourth-widget-area',
+ 'description' => __( 'Fourth widget area - Sidebar 2', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 5, located in the footer. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'First Footer Widget Area', 'mantra' ),
+ 'id' => 'first-footer-widget-area',
+ 'description' => __( 'First footer widget area', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 6, located in the footer. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Second Footer Widget Area', 'mantra' ),
+ 'id' => 'second-footer-widget-area',
+ 'description' => __( 'Second footer widget area', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 7, located in the footer. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Third Footer Widget Area', 'mantra' ),
+ 'id' => 'third-footer-widget-area',
+ 'description' => __( 'The third footer widget area', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 8, located in the footer. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Fourth Footer Widget Area', 'mantra' ),
+ 'id' => 'fourth-footer-widget-area',
+ 'description' => __( 'The fourth footer widget area', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 9, located above the content area. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Above content Widget Area', 'mantra' ),
+ 'id' => 'above-content-widget-area',
+ 'description' => __( 'Above content Widget Area', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+
+ // Area 10, located below the content area. Empty by default.
+ register_sidebar( array(
+ 'name' => __( 'Below Content Widget Area', 'mantra' ),
+ 'id' => 'below-content-widget-area',
+ 'description' => __( 'Below Content Widget Area', 'mantra' ),
+ 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
+ ) );
+}
+/** Register sidebars by running mantra_widgets_init() on the widgets_init hook. */
+add_action( 'widgets_init', 'mantra_widgets_init' );
+
+
+/**
+ * Creates different class names for footer widgets depending on their number.
+ * This way they can fit the footer area.
+ */
+
+function mantra_footer_sidebar_class() {
+ $count = 0;
+
+ if ( is_active_sidebar( 'first-footer-widget-area' ) )
+ $count++;
+
+ if ( is_active_sidebar( 'second-footer-widget-area' ) )
+ $count++;
+
+ if ( is_active_sidebar( 'third-footer-widget-area' ) )
+ $count++;
+
+ if ( is_active_sidebar( 'fourth-footer-widget-area' ) )
+ $count++;
+
+ $class = '';
+
+ switch ( $count ) {
+ case '1':
+ $class = 'one';
+ break;
+ case '2':
+ $class = 'two';
+ break;
+ case '3':
+ $class = 'three';
+ break;
+ case '4':
+ $class = 'four';
+ break;
+ }
+
+ if ( $class )
+ echo 'class="footer' . $class . '"';
+}
+
+
+ function mantra_above_widget() {
+ if ( is_active_sidebar( 'above-content-widget-area' )) { ?>
+ <ul class="yoyo">
+ <?php dynamic_sidebar( 'above-content-widget-area' ); ?>
+ </ul>
+ <?php } }
+
+function mantra_below_widget() {
+ if ( is_active_sidebar( 'below-content-widget-area' )) { ?>
+ <ul class="yoyo">
+ <?php dynamic_sidebar( 'below-content-widget-area' ); ?>
+ </ul>
+ <?php } }
+
+add_action ('cryout_before_content_hook','mantra_above_widget');
+add_action ('cryout_after_content_hook','mantra_below_widget'); ?> \ No newline at end of file
diff --git a/themes/mantra/includes/theme-shortcodes.php b/themes/mantra/includes/theme-shortcodes.php
new file mode 100644
index 00000000..63b4a543
--- /dev/null
+++ b/themes/mantra/includes/theme-shortcodes.php
@@ -0,0 +1,293 @@
+<?php
+/**
+ * The shortcodes and corresponding functions
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+add_shortcode('mantra-site', 'mantra_site_link_fn');
+add_shortcode('mantra-author', 'mantra_the_author_fn');
+add_shortcode('mantra-tag-cloud', 'mantra_tag_cloud_fn');
+add_shortcode('mantra-multi', 'mantra_multi_column_fn');
+add_shortcode('mantra-column', 'mantra_column_fn');
+add_shortcode( 'mantra-pullquote', 'mantra_pullquote_fn' );
+add_shortcode( 'mantra-button-light', 'mantra_button_light_fn' );
+add_shortcode( 'mantra-button-dark', 'mantra_button_dark_fn' );
+add_shortcode( 'mantra-button-color', 'mantra_button_color_fn' );
+
+/**
+ * Returns a link to the current site
+ * No attributes
+ */
+
+function mantra_site_fn() {
+ return '<a class="site-link" href="'.get_bloginfo('url').'" title="'.esc_attr(get_bloginfo('name')).'" rel="home">'.get_bloginfo('name').'</a>';
+}
+/**
+ * Returns current user information
+ * Example of use:
+ * [mantra-author display='attr'] where attr can be author / description / login / first-name / last-name / nickname / id / url / link / aim / yim / posts / posts-url
+ * Attributes:
+ * "display" - optional
+ */
+function mantra_the_author_fn($attr) {
+ global $mantra_social_networks;
+ $id = get_the_author_meta('ID');
+ if ($id) {
+ if (isset($attr['display'])) {
+ $display = $attr['display'];
+ switch ($display) {
+ case 'author':
+ return get_the_author();
+ case 'description':
+ return get_the_author_meta('description', $id);
+ case 'login':
+ return get_the_author_meta('user_login', $id);
+ case 'first-name':
+ return get_the_author_meta('first_name', $id);
+ case 'last-name':
+ return get_the_author_meta('last_name', $id);
+ case 'nickname':
+ return get_the_author_meta('nickname', $id);
+ case 'id':
+ return $id;
+ case 'url':
+ return get_the_author_meta('user_url', $id);
+ case 'email':
+ return get_the_author_meta('user_email', $id);
+ case 'link':
+ if (get_the_author_meta('user_url', $id)) {
+ return '<a href="'.get_the_author_meta('user_url', $id).'" title="'.esc_attr(get_the_author()).'" rel="external">'.get_the_author().'</a>';
+ }
+ else {
+ return get_the_author();
+ }
+ case 'aim':
+ return get_the_author_meta('aim', $id);
+ case 'yim':
+ return get_the_author_meta('yim', $id);
+ case 'posts':
+ return get_the_author_posts();
+ case 'posts-url':
+ return get_author_posts_url(get_the_author_meta('ID'));
+ }
+
+ }
+ else {
+ return get_the_author();
+ }
+ }
+}
+
+
+/**
+ * Echos a tag could
+ * Example of use:
+ * [mantra-tag-cloud min=10 max=15 number=5] where min and max are the minimum and the maximum font sizes and count is the number of tags to show in the cloud
+ * Attributes:
+ * "min" - optional
+ * "max" - optional
+ * "count" - optional
+ */
+function mantra_tag_cloud_fn($attr) {
+ if (isset($attr['min'])) $attr['min'] = (int)$attr['min'];
+ if (isset($attr['max'])) $attr['max'] = (int)$attr['max'];
+ if (isset($attr['count'])) $attr['count'] = (int)$attr['count'];
+ $attr['echo'] = false;
+ return wp_tag_cloud($attr);
+}
+
+
+/**
+ * Creates the container for multi-column content, corresponding to the short code [mantra-multic].
+ * No attributes are used. Should always be used to incapsulate [mantra-column] tags
+ * No attributes
+ */
+function mantra_multi_column_fn($attr, $content = null) {
+ $content = do_shortcode($content);
+ return "<div class='multi-colum'>".$content."</div>";
+}
+
+/**
+ * Multiple columns
+ * Uses [mantra-column] to create multiple columns
+ * It should be used inside [mantra-multic] short codes.
+ * Attributes:
+ * "width" - can take values 1, 1/2, 1/3, 1/4, 1/6, 1/8, 2/3, 3/4, 5/6 The default value is 1.
+ * "class" - optional - can be whatever you like for furter CSS editing
+ * Example of use
+ * [mantra-multi]
+ * [mantra-column width='1/2']This is a half column[/mantra-column]
+ * [mantra-column width='1/2']This is another half column[/mantra-column]
+ * [/mantra-multi]
+ * Or:
+ * [mantra-multi]
+ * [mantra-column width='1/3']This is a one third column[/mantra-column]
+ * [mantra-column width='2/3']This is a two thirds column[/mantra-column]
+ * [/mantra-multi]
+ * Or:
+ * [mantra-multi]
+ * [mantra-column width='1/4']This is a quarter column[/mantra-column]
+ * [mantra-column width='1/2']This is a half column [/mantra-column]
+ * [mantra-column width='1/4']And this is another quarter column[/mantra-column]
+ * [/mantra-multi]
+ * Make sure the widths do not go over 100% ( ex: 1/4 + 1/2 + 1/4 = 1 =100%)
+ *
+
+ */
+function mantra_column_fn($attr, $content = null) {
+ $content = do_shortcode($content);
+ $width = isset($attr['width']) ? $attr['width'] : "1";
+ $class = isset($attr['class']) ? $attr['class'] : "";
+ $main_class = "column-1";
+ switch ($width) {
+
+ case "1/2":
+ $main_class = "column-12";
+ break;
+
+ case "1/3":
+ $main_class = "column-13";
+ break;
+
+ case "1/4":
+ $main_class = "column-14";
+ break;
+
+ case "1/6":
+ $main_class = "column-16";
+ break;
+
+ case "2/3":
+ $main_class = "column-23";
+ break;
+
+ case "3/4":
+ $main_class = "column-34";
+ break;
+
+ case "5/6":
+ $main_class = "column-56";
+ break;
+
+ case "1":
+ default:
+ $main_class = "column-1";
+ break;
+ }
+ return "<div class='short-columns $main_class $class'>".$content."</div>";
+}
+
+/**
+ * Pullquotes
+ * Uses [mantra-pullquote] to create pullquotes
+ * Attributes:
+ * "align" - optional - alignment of the pullquote itself - values: left / center /right
+ * "width" - optional - whatever you want it to be in percenatage (ex:50%)
+ * "textalign" - optional - alignment of text inside the pullquote - values: left / center / right
+ * Example of use:
+ * [mantra-pullquote align="right" width="40%" textalign="center"] Look at this beautiful text right here [/mantra-pullquote]
+ */
+
+function mantra_pullquote_fn( $atts, $content = NULL, $code = '' ) {
+ if ( ! $content ) return;
+
+ $style = array();
+
+ $class = array( 'pullquote', 'align' => 'alignleft' );
+
+ if ( $atts ) {
+ if ( array_key_exists( 'align', $atts ) ) {
+ if ( in_array( $atts['align'], array( 'left', 'center', 'right' ) ) )
+ $class['align'] = 'align' . $atts['align'];
+ if ( $atts['align'] == 'center' ) $style['text-align'] = 'center';
+ }
+
+ if ( array_key_exists( 'width', $atts ) ) {
+ if ( $atts['width'] ) $style['width'] = trim( $atts['width'] );
+ }
+
+ if ( array_key_exists( 'textalign', $atts ) ) {
+ if ( in_array( $atts['textalign'], array( 'left', 'center', 'right' ) ) )
+ $style['text-align'] = $atts['textalign'];
+ }
+ }
+
+ $style_attr = '';
+ if ( $style ) {
+ foreach ( $style as $prop => $val ) {
+ $style_attr .= $prop . ':' . $val . ';';
+ }
+ if ( $style_attr ) $style_attr = ' style="' . $style_attr . '"';
+ }
+
+ $attr = 'class="' . implode( ' ', $class ) . '"' . $style_attr;
+
+ return '<div ' . $attr . '>' . wpautop( do_shortcode( $content ) ) . '</div>';
+}
+
+
+/**
+ * Buttons
+ * Uses [mantra-button-light], [mantra-button-dark] and [mantra-button-color] to create buttons.
+ * Attributes:
+ * "url" - optional - the link the button will send you to.
+ * "color" - optional - only for the color button. The hexadecimal value of the color you need.
+ * Example of use:
+ * [mantra-button-light url="http://www.google.com"] More info [/mantra-button-light]
+ * Or:
+ * [mantra-button-color url="http://www.google.com" color="32F43A"] Color info [/mantra-button-color]
+ */
+
+function mantra_button_light_fn($attr ,$content) {
+ if (!isset($attr['url'])) $attr['url'] = '#';
+ if (!isset($attr['target'])) $attr['target'] = "_blank";
+ return '<a class="short-button-light" target="'.$attr['target'].'" href="'.$attr['url'].'" title="'.$content.'" >'.$content.'</a>';
+}
+
+function mantra_button_dark_fn($attr ,$content) {
+ if (!isset($attr['url'])) $attr['url'] = '#';
+ if (!isset($attr['target'])) $attr['target'] = "_blank";
+ return '<a class="short-button-dark" target="'.$attr['target'].'" href="'.$attr['url'].'" title="'.$content.'" >'.$content.'</a>';
+}
+
+function mantra_button_color_fn($attr ,$content) {
+ if (!isset($attr['url'])) $attr['url'] = '#';
+ if (!isset($attr['target'])) $attr['target'] = "_blank";
+ $style="";
+ if (isset($attr["color"])) { $style=' style="background-color:'.$attr["color"].'"'; }
+ return '<a class="short-button-color" target="'.$attr['target'].'"'.$style.' href="'.$attr['url'].'" title="'.$content.'" >'.$content.'</a>';
+}
+
+/**
+ * Hooking the shortcode buttons to the TinyMCE editor
+ */
+class mantra_shortcodes_buttons{
+
+ function mantra_shortcodes_buttons(){
+ if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
+ add_filter( 'mce_external_plugins', array(&$this, 'mantra_add_plugin' ) );
+ add_filter( 'mce_buttons_2', array(&$this, 'mantra_add_button' ) );
+ }
+ }
+
+ function mantra_add_button( $buttons ){
+ array_push( $buttons, "separator", "button-light", "button-dark", "button-color", "separator", "pullquote", "separator", "multi-column");
+ return $buttons;
+ }
+
+ function mantra_add_plugin( $plugin_array ){
+ $plugin_array['mantrashortcodes'] = get_template_directory_uri() . '/js/mce-shortcodes.js';
+ return $plugin_array;
+ }
+}
+add_action( 'init', 'mantra_shortcodes_buttons' );
+
+function mantra_shortcodes_buttons(){
+ global $mantra_shortcodes_buttons;
+ $mantra_shortcodes_buttons = new mantra_shortcodes_buttons();
+}
+
+
+?> \ No newline at end of file
diff --git a/themes/mantra/includes/theme-styles.php b/themes/mantra/includes/theme-styles.php
new file mode 100644
index 00000000..998dd80e
--- /dev/null
+++ b/themes/mantra/includes/theme-styles.php
@@ -0,0 +1,133 @@
+<?php
+/*
+ * Styles and scripts registration and enqueuing
+ *
+ * @package mantra
+ * @subpackage Functions
+ */
+
+// Adding the viewport meta if the mobile view has been enabled
+
+function mantra_mobile_meta() {
+global $mantra_options;
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+ }
+ return '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">';
+}
+
+
+function mantra_register_styles() {
+ global $mantra_options;
+ foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;}
+
+ wp_register_style( 'mantras', get_stylesheet_uri() );
+
+ if($mantra_mobile=="Enable") { wp_register_style( 'mantra-mobile', get_template_directory_uri() . '/style-mobile.css' );}
+
+ wp_register_style( 'mantra_googlefont', esc_attr($mantra_googlefont2 ));
+ wp_register_style( 'mantra_googlefonttitle', esc_attr($mantra_googlefonttitle2 ));
+ wp_register_style( 'mantra_googlefontside',esc_attr($mantra_googlefontside2) );
+ wp_register_style( 'mantra_googlefontsubheader', esc_attr($mantra_googlefontsubheader2) );
+
+}
+
+add_action('init', 'mantra_register_styles' );
+
+
+function mantra_enqueue_styles() {
+ global $mantra_options;
+ foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;}
+
+ wp_enqueue_style( 'mantras');
+
+ wp_enqueue_style( 'mantra_googlefont');
+ wp_enqueue_style( 'mantra_googlefonttitle');
+ wp_enqueue_style( 'mantra_googlefontside');
+ wp_enqueue_style( 'mantra_googlefontsubheader');
+
+
+}
+
+add_action('wp_enqueue_scripts', 'mantra_enqueue_styles' );
+
+function mantra_styles_echo() {
+ global $mantra_options;
+
+ foreach ($mantra_options as $key => $value) { ${"$key"} = $value ;}
+
+ echo mantra_custom_styles();
+ if($mantra_mobile=="Enable") {wp_enqueue_style( 'mantra-mobile'); echo mantra_mobile_meta();}
+ echo mantra_customcss();
+}
+
+add_action('wp_head', 'mantra_styles_echo');
+
+
+// JS loading and hook into wp_enque_scripts
+
+ add_action('wp_head', 'mantra_customjs' );
+
+
+
+
+// Scripts loading and hook into wp_enque_scripts
+
+function mantra_scripts_method() {
+global $mantra_options;
+foreach ($mantra_options as $key => $value) {
+ ${"$key"} = $value ;
+ }
+
+// If frontend - load the js for the menu and the social icons animations
+ if ( !is_admin() ) {
+ wp_register_script('cryout-frontend',get_template_directory_uri() . '/js/frontend.js', array('jquery') );
+ wp_enqueue_script('cryout-frontend');
+ // If mantra from page is enabled and the current page is home page - load the nivo slider js
+ if($mantra_frontpage == "Enable" && is_front_page()) {
+ wp_register_script('cryout-nivoSlider',get_template_directory_uri() . '/js/nivo-slider.js', array('jquery'));
+ wp_enqueue_script('cryout-nivoSlider');
+ }
+ }
+
+
+ /* We add some JavaScript to pages with the comment form
+ * to support sites with threaded comments (when in use).
+ */
+ if ( is_singular() && get_option( 'thread_comments' ) )
+ wp_enqueue_script( 'comment-reply' );
+}
+
+add_action('wp_enqueue_scripts', 'mantra_scripts_method');
+
+/**
+ * Adding CSS3 PIE behavior to elements that need it
+ */
+function mantra_ie_pie() {
+ echo '
+<!--[if lte IE 8]>
+<style type="text/css" media="screen">
+ #access ul li,
+.edit-link a ,
+ #footer-widget-area .widget-title, .entry-meta,.entry-meta .comments-link,
+.short-button-light, .short-button-dark ,.short-button-color ,blockquote {
+ position:relative;
+ behavior: url('.get_template_directory_uri().'/js/PIE/PIE.php);
+ }
+
+#access ul ul {
+-pie-box-shadow:0px 5px 5px #999;
+}
+
+#access ul li.current_page_item, #access ul li.current-menu-item ,
+#access ul li ,#access ul ul ,#access ul ul li, .commentlist li.comment ,.commentlist .avatar,
+ .nivo-caption, .theme-default .nivoSlider {
+ behavior: url('.get_template_directory_uri().'/js/PIE/PIE.php);
+ }
+</style>
+<![endif]-->
+';
+}
+add_action('wp_head', 'mantra_ie_pie', 10);
+
+?>
diff --git a/themes/mantra/index.php b/themes/mantra/index.php
new file mode 100644
index 00000000..4cd42e77
--- /dev/null
+++ b/themes/mantra/index.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * The main template file.
+ *
+ * This is the most generic template file in a WordPress theme
+ * and one of the two required files for a theme (the other being style.css).
+ * It is used to display a page when nothing more specific matches a query.
+ * E.g., it puts together the home page when no home.php file exists.
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package Cryout Creations
+ * @subpackage Mantra
+ */
+get_header();
+if ($mantra_frontpage=="Enable" && is_front_page() ):
+ mantra_frontpage_generator();
+ if ($mantra_frontposts=="Enable"): get_template_part('content','frontpage'); endif;
+else:
+?>
+ <section id="container">
+
+ <div id="content" role="main">
+
+<?php cryout_before_content_hook(); ?><?php if ( have_posts() ) : ?>
+
+ <?php mantra_content_nav( 'nav-above' ); ?>
+
+ <?php /* Start the Loop */ ?>
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php get_template_part( 'content', get_post_format() ); ?>
+
+ <?php endwhile; ?>
+
+ <?php if($mantra_pagination=="Enable") mantra_pagination(); else mantra_content_nav( 'nav-below' ); ?>
+
+ <?php else : ?>
+
+ <article id="post-0" class="post no-results not-found">
+ <header class="entry-header">
+ <h1 class="entry-title"><?php _e( 'Nothing Found', 'mantra' ); ?></h1>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mantra' ); ?></p>
+ <?php get_search_form(); ?>
+ </div><!-- .entry-content -->
+ </article><!-- #post-0 -->
+
+ <?php endif; ?><?php cryout_after_content_hook(); ?>
+
+ </div><!-- #content -->
+ <?php get_sidebar(); ?>
+ </section><!-- #container -->
+<?php
+endif;
+get_footer(); ?> \ No newline at end of file
diff --git a/themes/mantra/js/PIE/PIE.htc b/themes/mantra/js/PIE/PIE.htc
new file mode 100644
index 00000000..ca3b5470
--- /dev/null
+++ b/themes/mantra/js/PIE/PIE.htc
@@ -0,0 +1,96 @@
+<!--
+PIE: CSS3 rendering for IE
+Version 1.0.0
+http://css3pie.com
+Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
+-->
+<PUBLIC:COMPONENT lightWeight="true">
+<!-- saved from url=(0014)about:internet -->
+<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" />
+<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" />
+<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
+
+<script type="text/javascript">
+var doc = element.document;var f=window.PIE;
+if(!f){f=window.PIE={F:"-pie-",nb:"Pie",La:"pie_",Ac:{TD:1,TH:1},cc:{TABLE:1,THEAD:1,TBODY:1,TFOOT:1,TR:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,IMG:1,HR:1},fc:{A:1,INPUT:1,TEXTAREA:1,SELECT:1,BUTTON:1},Gd:{submit:1,button:1,reset:1},aa:function(){}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(aa){}for(var ba=4,Z=doc.createElement("div"),ca=Z.getElementsByTagName("i"),ga;Z.innerHTML="<!--[if gt IE "+ ++ba+"]><i></i><![endif]--\>",ca[0];);f.O=ba;if(ba===6)f.F=f.F.replace(/^-/,"");f.ja=
+doc.documentMode||f.O;Z.innerHTML='<v:shape adj="1"/>';ga=Z.firstChild;ga.style.behavior="url(#default#VML)";f.zc=typeof ga.adj==="object";(function(){var a,b=0,c={};f.p={Za:function(d){if(!a){a=doc.createDocumentFragment();a.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return a.createElement("css3vml:"+d)},Ba:function(d){return d&&d._pieId||(d._pieId="_"+ ++b)},Eb:function(d){var e,g,j,i,h=arguments;e=1;for(g=h.length;e<g;e++){i=h[e];for(j in i)if(i.hasOwnProperty(j))d[j]=i[j]}return d},
+Rb:function(d,e,g){var j=c[d],i,h;if(j)Object.prototype.toString.call(j)==="[object Array]"?j.push([e,g]):e.call(g,j);else{h=c[d]=[[e,g]];i=new Image;i.onload=function(){j=c[d]={h:i.width,f:i.height};for(var k=0,n=h.length;k<n;k++)h[k][0].call(h[k][1],j);i.onload=null};i.src=d}}}})();f.Na={gc:function(a,b,c,d){function e(){k=j>=90&&j<270?b:0;n=j<180?c:0;m=b-k;p=c-n}function g(){for(;j<0;)j+=360;j%=360}var j=d.sa;d=d.zb;var i,h,k,n,m,p,r,t;if(d){d=d.coords(a,b,c);i=d.x;h=d.y}if(j){j=j.jd();g();e();
+if(!d){i=k;h=n}d=f.Na.tc(i,h,j,m,p);a=d[0];d=d[1]}else if(d){a=b-i;d=c-h}else{i=h=a=0;d=c}r=a-i;t=d-h;if(j===void 0){j=!r?t<0?90:270:!t?r<0?180:0:-Math.atan2(t,r)/Math.PI*180;g();e()}return{sa:j,xc:i,yc:h,td:a,ud:d,Wd:k,Xd:n,rd:m,sd:p,kd:r,ld:t,rc:f.Na.dc(i,h,a,d)}},tc:function(a,b,c,d,e){if(c===0||c===180)return[d,b];else if(c===90||c===270)return[a,e];else{c=Math.tan(-c*Math.PI/180);a=c*a-b;b=-1/c;d=b*d-e;e=b-c;return[(d-a)/e,(c*d-b*a)/e]}},dc:function(a,b,c,d){a=c-a;b=d-b;return Math.abs(a===0?
+b:b===0?a:Math.sqrt(a*a+b*b))}};f.ea=function(){this.Gb=[];this.oc={}};f.ea.prototype={ba:function(a){var b=f.p.Ba(a),c=this.oc,d=this.Gb;if(!(b in c)){c[b]=d.length;d.push(a)}},Ha:function(a){a=f.p.Ba(a);var b=this.oc;if(a&&a in b){delete this.Gb[b[a]];delete b[a]}},xa:function(){for(var a=this.Gb,b=a.length;b--;)a[b]&&a[b]()}};f.Oa=new f.ea;f.Oa.Rd=function(){var a=this,b;if(!a.Sd){b=doc.documentElement.currentStyle.getAttribute(f.F+"poll-interval")||250;(function c(){a.xa();setTimeout(c,b)})();
+a.Sd=1}};(function(){function a(){f.L.xa();window.detachEvent("onunload",a);window.PIE=null}f.L=new f.ea;window.attachEvent("onunload",a);f.L.ta=function(b,c,d){b.attachEvent(c,d);this.ba(function(){b.detachEvent(c,d)})}})();f.Qa=new f.ea;f.L.ta(window,"onresize",function(){f.Qa.xa()});(function(){function a(){f.mb.xa()}f.mb=new f.ea;f.L.ta(window,"onscroll",a);f.Qa.ba(a)})();(function(){function a(){c=f.kb.md()}function b(){if(c){for(var d=0,e=c.length;d<e;d++)f.attach(c[d]);c=0}}var c;if(f.ja<9){f.L.ta(window,
+"onbeforeprint",a);f.L.ta(window,"onafterprint",b)}})();f.lb=new f.ea;f.L.ta(doc,"onmouseup",function(){f.lb.xa()});f.he=function(){function a(h){this.Y=h}var b=doc.createElement("length-calc"),c=doc.body||doc.documentElement,d=b.style,e={},g=["mm","cm","in","pt","pc"],j=g.length,i={};d.position="absolute";d.top=d.left="-9999px";for(c.appendChild(b);j--;){d.width="100"+g[j];e[g[j]]=b.offsetWidth/100}c.removeChild(b);d.width="1em";a.prototype={Kb:/(px|em|ex|mm|cm|in|pt|pc|%)$/,ic:function(){var h=
+this.Jd;if(h===void 0)h=this.Jd=parseFloat(this.Y);return h},yb:function(){var h=this.ae;if(!h)h=this.ae=(h=this.Y.match(this.Kb))&&h[0]||"px";return h},a:function(h,k){var n=this.ic(),m=this.yb();switch(m){case "px":return n;case "%":return n*(typeof k==="function"?k():k)/100;case "em":return n*this.xb(h);case "ex":return n*this.xb(h)/2;default:return n*e[m]}},xb:function(h){var k=h.currentStyle.fontSize,n,m;if(k.indexOf("px")>0)return parseFloat(k);else if(h.tagName in f.cc){m=this;n=h.parentNode;
+return f.n(k).a(n,function(){return m.xb(n)})}else{h.appendChild(b);k=b.offsetWidth;b.parentNode===h&&h.removeChild(b);return k}}};f.n=function(h){return i[h]||(i[h]=new a(h))};return a}();f.Ja=function(){function a(e){this.X=e}var b=f.n("50%"),c={top:1,center:1,bottom:1},d={left:1,center:1,right:1};a.prototype={zd:function(){if(!this.ac){var e=this.X,g=e.length,j=f.v,i=j.qa,h=f.n("0");i=i.na;h=["left",h,"top",h];if(g===1){e.push(new j.ob(i,"center"));g++}if(g===2){i&(e[0].k|e[1].k)&&e[0].d in c&&
+e[1].d in d&&e.push(e.shift());if(e[0].k&i)if(e[0].d==="center")h[1]=b;else h[0]=e[0].d;else if(e[0].W())h[1]=f.n(e[0].d);if(e[1].k&i)if(e[1].d==="center")h[3]=b;else h[2]=e[1].d;else if(e[1].W())h[3]=f.n(e[1].d)}this.ac=h}return this.ac},coords:function(e,g,j){var i=this.zd(),h=i[1].a(e,g);e=i[3].a(e,j);return{x:i[0]==="right"?g-h:h,y:i[2]==="bottom"?j-e:e}}};return a}();f.Ka=function(){function a(b,c){this.h=b;this.f=c}a.prototype={a:function(b,c,d,e,g){var j=this.h,i=this.f,h=c/d;e=e/g;if(j===
+"contain"){j=e>h?c:d*e;i=e>h?c/e:d}else if(j==="cover"){j=e<h?c:d*e;i=e<h?c/e:d}else if(j==="auto"){i=i==="auto"?g:i.a(b,d);j=i*e}else{j=j.a(b,c);i=i==="auto"?j/e:i.a(b,d)}return{h:j,f:i}}};a.Kc=new a("auto","auto");return a}();f.Ec=function(){function a(b){this.Y=b}a.prototype={Kb:/[a-z]+$/i,yb:function(){return this.ad||(this.ad=this.Y.match(this.Kb)[0].toLowerCase())},jd:function(){var b=this.Vc,c;if(b===undefined){b=this.yb();c=parseFloat(this.Y,10);b=this.Vc=b==="deg"?c:b==="rad"?c/Math.PI*180:
+b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();f.Jc=function(){function a(c){this.Y=c}var b={};a.Qd=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.Fb={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",
+cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",
+forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightsalmon:"FFA07A",
+lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"0F0",limegreen:"32CD32",linen:"FAF0E6",magenta:"F0F",maroon:"800000",mediumauqamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",
+navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"688E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",
+slateblue:"6A5ACD",slategray:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFF",whitesmoke:"F5F5F5",yellow:"FF0",yellowgreen:"9ACD32"};a.prototype={parse:function(){if(!this.Ua){var c=this.Y,d;if(d=c.match(a.Qd)){this.Ua="rgb("+d[1]+","+d[2]+","+d[3]+")";this.Yb=parseFloat(d[4])}else{if((d=c.toLowerCase())in a.Fb)c="#"+a.Fb[d];this.Ua=c;this.Yb=c==="transparent"?0:
+1}}},U:function(c){this.parse();return this.Ua==="currentColor"?c.currentStyle.color:this.Ua},fa:function(){this.parse();return this.Yb}};f.ha=function(c){return b[c]||(b[c]=new a(c))};return a}();f.v=function(){function a(c){this.$a=c;this.ch=0;this.X=[];this.Ga=0}var b=a.qa={Ia:1,Wb:2,z:4,Lc:8,Xb:16,na:32,K:64,oa:128,pa:256,Ra:512,Tc:1024,URL:2048};a.ob=function(c,d){this.k=c;this.d=d};a.ob.prototype={Ca:function(){return this.k&b.K||this.k&b.oa&&this.d==="0"},W:function(){return this.Ca()||this.k&
+b.Ra}};a.prototype={de:/\s/,Kd:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,nc:/^\-?[_a-z][\w-]*/i,Yd:/^("([^"]*)"|'([^']*)')/,Bd:/^#([\da-f]{6}|[\da-f]{3})/i,be:{px:b.K,em:b.K,ex:b.K,mm:b.K,cm:b.K,"in":b.K,pt:b.K,pc:b.K,deg:b.Ia,rad:b.Ia,grad:b.Ia},fd:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function d(p,r){p=new a.ob(p,r);if(!c){k.X.push(p);k.Ga++}return p}function e(){k.Ga++;return null}var g,j,i,h,k=this;if(this.Ga<this.X.length)return this.X[this.Ga++];for(;this.de.test(this.$a.charAt(this.ch));)this.ch++;
+if(this.ch>=this.$a.length)return e();j=this.ch;g=this.$a.substring(this.ch);i=g.charAt(0);switch(i){case "#":if(h=g.match(this.Bd)){this.ch+=h[0].length;return d(b.z,h[0])}break;case '"':case "'":if(h=g.match(this.Yd)){this.ch+=h[0].length;return d(b.Tc,h[2]||h[3]||"")}break;case "/":case ",":this.ch++;return d(b.pa,i);case "u":if(h=g.match(this.url)){this.ch+=h[0].length;return d(b.URL,h[2]||h[3]||h[4]||"")}}if(h=g.match(this.Kd)){i=h[0];this.ch+=i.length;if(g.charAt(i.length)==="%"){this.ch++;
+return d(b.Ra,i+"%")}if(h=g.substring(i.length).match(this.nc)){i+=h[0];this.ch+=h[0].length;return d(this.be[h[0].toLowerCase()]||b.Lc,i)}return d(b.oa,i)}if(h=g.match(this.nc)){i=h[0];this.ch+=i.length;if(i.toLowerCase()in f.Jc.Fb||i==="currentColor"||i==="transparent")return d(b.z,i);if(g.charAt(i.length)==="("){this.ch++;if(i.toLowerCase()in this.fd){g=function(p){return p&&p.k&b.oa};h=function(p){return p&&p.k&(b.oa|b.Ra)};var n=function(p,r){return p&&p.d===r},m=function(){return k.next(1)};
+if((i.charAt(0)==="r"?h(m()):g(m()))&&n(m(),",")&&h(m())&&n(m(),",")&&h(m())&&(i==="rgb"||i==="hsa"||n(m(),",")&&g(m()))&&n(m(),")"))return d(b.z,this.$a.substring(j,this.ch));return e()}return d(b.Xb,i)}return d(b.na,i)}this.ch++;return d(b.Wb,i)},D:function(){return this.X[this.Ga-- -2]},all:function(){for(;this.next(););return this.X},ma:function(c,d){for(var e=[],g,j;g=this.next();){if(c(g)){j=true;this.D();break}e.push(g)}return d&&!j?null:e}};return a}();var ha=function(a){this.e=a};ha.prototype=
+{Z:0,Od:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.x!==b.x||a.y!==b.y)},Td:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.h!==b.h||a.f!==b.f)},hc:function(){var a=this.e,b=a.getBoundingClientRect(),c=f.ja===9,d=f.O===7,e=b.right-b.left;return{x:b.left,y:b.top,h:c||d?a.offsetWidth:e,f:c||d?a.offsetHeight:b.bottom-b.top,Hd:d&&e?a.offsetWidth/e:1}},o:function(){return this.Z?this.Va||(this.Va=this.hc()):this.hc()},Ad:function(){return!!this.qb},cb:function(){++this.Z},hb:function(){if(!--this.Z){if(this.Va)this.qb=
+this.Va;this.Va=null}}};(function(){function a(b){var c=f.p.Ba(b);return function(){if(this.Z){var d=this.$b||(this.$b={});return c in d?d[c]:(d[c]=b.call(this))}else return b.call(this)}}f.B={Z:0,ka:function(b){function c(d){this.e=d;this.Zb=this.ia()}f.p.Eb(c.prototype,f.B,b);c.$c={};return c},j:function(){var b=this.ia(),c=this.constructor.$c;return b?b in c?c[b]:(c[b]=this.la(b)):null},ia:a(function(){var b=this.e,c=this.constructor,d=b.style;b=b.currentStyle;var e=this.wa,g=this.Fa,j=c.Yc||(c.Yc=
+f.F+e);c=c.Zc||(c.Zc=f.nb+g.charAt(0).toUpperCase()+g.substring(1));return d[c]||b.getAttribute(j)||d[g]||b.getAttribute(e)}),i:a(function(){return!!this.j()}),H:a(function(){var b=this.ia(),c=b!==this.Zb;this.Zb=b;return c}),va:a,cb:function(){++this.Z},hb:function(){--this.Z||delete this.$b}}})();f.Sb=f.B.ka({wa:f.F+"background",Fa:f.nb+"Background",cd:{scroll:1,fixed:1,local:1},fb:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},sc:{"padding-box":1,"border-box":1,"content-box":1},Pd:{top:1,right:1,
+bottom:1,left:1,center:1},Ud:{contain:1,cover:1},eb:{Ma:"backgroundClip",z:"backgroundColor",da:"backgroundImage",Pa:"backgroundOrigin",S:"backgroundPosition",T:"backgroundRepeat",Sa:"backgroundSize"},la:function(a){function b(s){return s&&s.W()||s.k&k&&s.d in t}function c(s){return s&&(s.W()&&f.n(s.d)||s.d==="auto"&&"auto")}var d=this.e.currentStyle,e,g,j,i=f.v.qa,h=i.pa,k=i.na,n=i.z,m,p,r=0,t=this.Pd,v,l,q={M:[]};if(this.wb()){e=new f.v(a);for(j={};g=e.next();){m=g.k;p=g.d;if(!j.P&&m&i.Xb&&p===
+"linear-gradient"){v={ca:[],P:p};for(l={};g=e.next();){m=g.k;p=g.d;if(m&i.Wb&&p===")"){l.color&&v.ca.push(l);v.ca.length>1&&f.p.Eb(j,v);break}if(m&n){if(v.sa||v.zb){g=e.D();if(g.k!==h)break;e.next()}l={color:f.ha(p)};g=e.next();if(g.W())l.db=f.n(g.d);else e.D()}else if(m&i.Ia&&!v.sa&&!l.color&&!v.ca.length)v.sa=new f.Ec(g.d);else if(b(g)&&!v.zb&&!l.color&&!v.ca.length){e.D();v.zb=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&h&&p===","){if(l.color){v.ca.push(l);l={}}}else break}}else if(!j.P&&
+m&i.URL){j.Ab=p;j.P="image"}else if(b(g)&&!j.$){e.D();j.$=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&k)if(p in this.fb&&!j.bb)j.bb=p;else if(p in this.sc&&!j.Wa){j.Wa=p;if((g=e.next())&&g.k&k&&g.d in this.sc)j.ub=g.d;else{j.ub=p;e.D()}}else if(p in this.cd&&!j.bc)j.bc=p;else return null;else if(m&n&&!q.color)q.color=f.ha(p);else if(m&h&&p==="/"&&!j.Xa&&j.$){g=e.next();if(g.k&k&&g.d in this.Ud)j.Xa=new f.Ka(g.d);else if(g=c(g)){m=c(e.next());if(!m){m=g;e.D()}j.Xa=new f.Ka(g,m)}else return null}else if(m&
+h&&p===","&&j.P){j.Hb=a.substring(r,e.ch-1);r=e.ch;q.M.push(j);j={}}else return null}if(j.P){j.Hb=a.substring(r);q.M.push(j)}}else this.Bc(f.ja<9?function(){var s=this.eb,o=d[s.S+"X"],u=d[s.S+"Y"],x=d[s.da],y=d[s.z];if(y!=="transparent")q.color=f.ha(y);if(x!=="none")q.M=[{P:"image",Ab:(new f.v(x)).next().d,bb:d[s.T],$:new f.Ja((new f.v(o+" "+u)).all())}]}:function(){var s=this.eb,o=/\s*,\s*/,u=d[s.da].split(o),x=d[s.z],y,z,B,E,D,C;if(x!=="transparent")q.color=f.ha(x);if((E=u.length)&&u[0]!=="none"){x=
+d[s.T].split(o);y=d[s.S].split(o);z=d[s.Pa].split(o);B=d[s.Ma].split(o);s=d[s.Sa].split(o);q.M=[];for(o=0;o<E;o++)if((D=u[o])&&D!=="none"){C=s[o].split(" ");q.M.push({Hb:D+" "+x[o]+" "+y[o]+" / "+s[o]+" "+z[o]+" "+B[o],P:"image",Ab:(new f.v(D)).next().d,bb:x[o],$:new f.Ja((new f.v(y[o])).all()),Wa:z[o],ub:B[o],Xa:new f.Ka(C[0],C[1])})}}});return q.color||q.M[0]?q:null},Bc:function(a){var b=f.ja>8,c=this.eb,d=this.e.runtimeStyle,e=d[c.da],g=d[c.z],j=d[c.T],i,h,k,n;if(e)d[c.da]="";if(g)d[c.z]="";if(j)d[c.T]=
+"";if(b){i=d[c.Ma];h=d[c.Pa];n=d[c.S];k=d[c.Sa];if(i)d[c.Ma]="";if(h)d[c.Pa]="";if(n)d[c.S]="";if(k)d[c.Sa]=""}a=a.call(this);if(e)d[c.da]=e;if(g)d[c.z]=g;if(j)d[c.T]=j;if(b){if(i)d[c.Ma]=i;if(h)d[c.Pa]=h;if(n)d[c.S]=n;if(k)d[c.Sa]=k}return a},ia:f.B.va(function(){return this.wb()||this.Bc(function(){var a=this.e.currentStyle,b=this.eb;return a[b.z]+" "+a[b.da]+" "+a[b.T]+" "+a[b.S+"X"]+" "+a[b.S+"Y"]})}),wb:f.B.va(function(){var a=this.e;return a.style[this.Fa]||a.currentStyle.getAttribute(this.wa)}),
+qc:function(){var a=0;if(f.O<7){a=this.e;a=""+(a.style[f.nb+"PngFix"]||a.currentStyle.getAttribute(f.F+"png-fix"))==="true"}return a},i:f.B.va(function(){return(this.wb()||this.qc())&&!!this.j()})});f.Vb=f.B.ka({wc:["Top","Right","Bottom","Left"],Id:{thin:"1px",medium:"3px",thick:"5px"},la:function(){var a={},b={},c={},d=false,e=true,g=true,j=true;this.Cc(function(){for(var i=this.e.currentStyle,h=0,k,n,m,p,r,t,v;h<4;h++){m=this.wc[h];v=m.charAt(0).toLowerCase();k=b[v]=i["border"+m+"Style"];n=i["border"+
+m+"Color"];m=i["border"+m+"Width"];if(h>0){if(k!==p)g=false;if(n!==r)e=false;if(m!==t)j=false}p=k;r=n;t=m;c[v]=f.ha(n);m=a[v]=f.n(b[v]==="none"?"0":this.Id[m]||m);if(m.a(this.e)>0)d=true}});return d?{J:a,Zd:b,gd:c,ee:j,hd:e,$d:g}:null},ia:f.B.va(function(){var a=this.e,b=a.currentStyle,c;a.tagName in f.Ac&&a.offsetParent.currentStyle.borderCollapse==="collapse"||this.Cc(function(){c=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor});return c}),Cc:function(a){var b=this.e.runtimeStyle,c=b.borderWidth,
+d=b.borderColor;if(c)b.borderWidth="";if(d)b.borderColor="";a=a.call(this);if(c)b.borderWidth=c;if(d)b.borderColor=d;return a}});(function(){f.jb=f.B.ka({wa:"border-radius",Fa:"borderRadius",la:function(b){var c=null,d,e,g,j,i=false;if(b){e=new f.v(b);var h=function(){for(var k=[],n;(g=e.next())&&g.W();){j=f.n(g.d);n=j.ic();if(n<0)return null;if(n>0)i=true;k.push(j)}return k.length>0&&k.length<5?{tl:k[0],tr:k[1]||k[0],br:k[2]||k[0],bl:k[3]||k[1]||k[0]}:null};if(b=h()){if(g){if(g.k&f.v.qa.pa&&g.d===
+"/")d=h()}else d=b;if(i&&b&&d)c={x:b,y:d}}}return c}});var a=f.n("0");a={tl:a,tr:a,br:a,bl:a};f.jb.Dc={x:a,y:a}})();f.Ub=f.B.ka({wa:"border-image",Fa:"borderImage",fb:{stretch:1,round:1,repeat:1,space:1},la:function(a){var b=null,c,d,e,g,j,i,h=0,k=f.v.qa,n=k.na,m=k.oa,p=k.Ra;if(a){c=new f.v(a);b={};for(var r=function(l){return l&&l.k&k.pa&&l.d==="/"},t=function(l){return l&&l.k&n&&l.d==="fill"},v=function(){g=c.ma(function(l){return!(l.k&(m|p))});if(t(c.next())&&!b.fill)b.fill=true;else c.D();if(r(c.next())){h++;
+j=c.ma(function(l){return!l.W()&&!(l.k&n&&l.d==="auto")});if(r(c.next())){h++;i=c.ma(function(l){return!l.Ca()})}}else c.D()};a=c.next();){d=a.k;e=a.d;if(d&(m|p)&&!g){c.D();v()}else if(t(a)&&!b.fill){b.fill=true;v()}else if(d&n&&this.fb[e]&&!b.repeat){b.repeat={f:e};if(a=c.next())if(a.k&n&&this.fb[a.d])b.repeat.Ob=a.d;else c.D()}else if(d&k.URL&&!b.src)b.src=e;else return null}if(!b.src||!g||g.length<1||g.length>4||j&&j.length>4||h===1&&j.length<1||i&&i.length>4||h===2&&i.length<1)return null;if(!b.repeat)b.repeat=
+{f:"stretch"};if(!b.repeat.Ob)b.repeat.Ob=b.repeat.f;a=function(l,q){return{t:q(l[0]),r:q(l[1]||l[0]),b:q(l[2]||l[0]),l:q(l[3]||l[1]||l[0])}};b.slice=a(g,function(l){return f.n(l.k&m?l.d+"px":l.d)});if(j&&j[0])b.J=a(j,function(l){return l.W()?f.n(l.d):l.d});if(i&&i[0])b.Da=a(i,function(l){return l.Ca()?f.n(l.d):l.d})}return b}});f.Ic=f.B.ka({wa:"box-shadow",Fa:"boxShadow",la:function(a){var b,c=f.n,d=f.v.qa,e;if(a){e=new f.v(a);b={Da:[],Bb:[]};for(a=function(){for(var g,j,i,h,k,n;g=e.next();){i=g.d;
+j=g.k;if(j&d.pa&&i===",")break;else if(g.Ca()&&!k){e.D();k=e.ma(function(m){return!m.Ca()})}else if(j&d.z&&!h)h=i;else if(j&d.na&&i==="inset"&&!n)n=true;else return false}g=k&&k.length;if(g>1&&g<5){(n?b.Bb:b.Da).push({fe:c(k[0].d),ge:c(k[1].d),blur:c(k[2]?k[2].d:"0"),Vd:c(k[3]?k[3].d:"0"),color:f.ha(h||"currentColor")});return true}return false};a(););}return b&&(b.Bb.length||b.Da.length)?b:null}});f.Uc=f.B.ka({ia:f.B.va(function(){var a=this.e.currentStyle;return a.visibility+"|"+a.display}),la:function(){var a=
+this.e,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,d;b.visibility="";d=a.visibility;b.visibility=c;return{ce:d!=="hidden",nd:a.display!=="none"}},i:function(){return false}});f.u={R:function(a){function b(c,d,e,g){this.e=c;this.s=d;this.g=e;this.parent=g}f.p.Eb(b.prototype,f.u,a);return b},Cb:false,Q:function(){return false},Ea:f.aa,Lb:function(){this.m();this.i()&&this.V()},ib:function(){this.Cb=true},Mb:function(){this.i()?this.V():this.m()},sb:function(a,b){this.vc(a);for(var c=this.ra||
+(this.ra=[]),d=a+1,e=c.length,g;d<e;d++)if(g=c[d])break;c[a]=b;this.I().insertBefore(b,g||null)},za:function(a){var b=this.ra;return b&&b[a]||null},vc:function(a){var b=this.za(a),c=this.Ta;if(b&&c){c.removeChild(b);this.ra[a]=null}},Aa:function(a,b,c,d){var e=this.rb||(this.rb={}),g=e[a];if(!g){g=e[a]=f.p.Za("shape");if(b)g.appendChild(g[b]=f.p.Za(b));if(d){c=this.za(d);if(!c){this.sb(d,doc.createElement("group"+d));c=this.za(d)}}c.appendChild(g);a=g.style;a.position="absolute";a.left=a.top=0;a.behavior=
+"url(#default#VML)"}return g},vb:function(a){var b=this.rb,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},kc:function(a){var b=this.e,c=this.s.o(),d=c.h,e=c.f,g,j,i,h,k,n;c=a.x.tl.a(b,d);g=a.y.tl.a(b,e);j=a.x.tr.a(b,d);i=a.y.tr.a(b,e);h=a.x.br.a(b,d);k=a.y.br.a(b,e);n=a.x.bl.a(b,d);a=a.y.bl.a(b,e);d=Math.min(d/(c+j),e/(i+k),d/(n+h),e/(g+a));if(d<1){c*=d;g*=d;j*=d;i*=d;h*=d;k*=d;n*=d;a*=d}return{x:{tl:c,tr:j,br:h,bl:n},y:{tl:g,tr:i,br:k,bl:a}}},ya:function(a,b,c){b=b||1;var d,e,
+g=this.s.o();e=g.h*b;g=g.f*b;var j=this.g.G,i=Math.floor,h=Math.ceil,k=a?a.Jb*b:0,n=a?a.Ib*b:0,m=a?a.tb*b:0;a=a?a.Db*b:0;var p,r,t,v,l;if(c||j.i()){d=this.kc(c||j.j());c=d.x.tl*b;j=d.y.tl*b;p=d.x.tr*b;r=d.y.tr*b;t=d.x.br*b;v=d.y.br*b;l=d.x.bl*b;b=d.y.bl*b;e="m"+i(a)+","+i(j)+"qy"+i(c)+","+i(k)+"l"+h(e-p)+","+i(k)+"qx"+h(e-n)+","+i(r)+"l"+h(e-n)+","+h(g-v)+"qy"+h(e-t)+","+h(g-m)+"l"+i(l)+","+h(g-m)+"qx"+i(a)+","+h(g-b)+" x e"}else e="m"+i(a)+","+i(k)+"l"+h(e-n)+","+i(k)+"l"+h(e-n)+","+h(g-m)+"l"+i(a)+
+","+h(g-m)+"xe";return e},I:function(){var a=this.parent.za(this.N),b;if(!a){a=doc.createElement(this.Ya);b=a.style;b.position="absolute";b.top=b.left=0;this.parent.sb(this.N,a)}return a},mc:function(){var a=this.e,b=a.currentStyle,c=a.runtimeStyle,d=a.tagName,e=f.O===6,g;if(e&&(d in f.cc||d==="FIELDSET")||d==="BUTTON"||d==="INPUT"&&a.type in f.Gd){c.borderWidth="";d=this.g.w.wc;for(g=d.length;g--;){e=d[g];c["padding"+e]="";c["padding"+e]=f.n(b["padding"+e]).a(a)+f.n(b["border"+e+"Width"]).a(a)+(f.O!==
+8&&g%2?1:0)}c.borderWidth=0}else if(e){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){b=doc.createElement("ie6-mask");d=b.style;d.visibility="visible";for(d.zoom=1;d=a.firstChild;)b.appendChild(d);a.appendChild(b);c.visibility="hidden"}}else c.borderColor="transparent"},ie:function(){},m:function(){this.parent.vc(this.N);delete this.rb;delete this.ra}};f.Rc=f.u.R({i:function(){var a=this.ed;for(var b in a)if(a.hasOwnProperty(b)&&a[b].i())return true;return false},Q:function(){return this.g.Pb.H()},
+ib:function(){if(this.i()){var a=this.jc(),b=a,c;a=a.currentStyle;var d=a.position,e=this.I().style,g=0,j=0;j=this.s.o();var i=j.Hd;if(d==="fixed"&&f.O>6){g=j.x*i;j=j.y*i;b=d}else{do b=b.offsetParent;while(b&&b.currentStyle.position==="static");if(b){c=b.getBoundingClientRect();b=b.currentStyle;g=(j.x-c.left)*i-(parseFloat(b.borderLeftWidth)||0);j=(j.y-c.top)*i-(parseFloat(b.borderTopWidth)||0)}else{b=doc.documentElement;g=(j.x+b.scrollLeft-b.clientLeft)*i;j=(j.y+b.scrollTop-b.clientTop)*i}b="absolute"}e.position=
+b;e.left=g;e.top=j;e.zIndex=d==="static"?-1:a.zIndex;this.Cb=true}},Mb:f.aa,Nb:function(){var a=this.g.Pb.j();this.I().style.display=a.ce&&a.nd?"":"none"},Lb:function(){this.i()?this.Nb():this.m()},jc:function(){var a=this.e;return a.tagName in f.Ac?a.offsetParent:a},I:function(){var a=this.Ta,b;if(!a){b=this.jc();a=this.Ta=doc.createElement("css3-container");a.style.direction="ltr";this.Nb();b.parentNode.insertBefore(a,b)}return a},ab:f.aa,m:function(){var a=this.Ta,b;if(a&&(b=a.parentNode))b.removeChild(a);
+delete this.Ta;delete this.ra}});f.Fc=f.u.R({N:2,Ya:"background",Q:function(){var a=this.g;return a.C.H()||a.G.H()},i:function(){var a=this.g;return a.q.i()||a.G.i()||a.C.i()||a.ga.i()&&a.ga.j().Bb},V:function(){var a=this.s.o();if(a.h&&a.f){this.od();this.pd()}},od:function(){var a=this.g.C.j(),b=this.s.o(),c=this.e,d=a&&a.color,e,g;if(d&&d.fa()>0){this.lc();a=this.Aa("bgColor","fill",this.I(),1);e=b.h;b=b.f;a.stroked=false;a.coordsize=e*2+","+b*2;a.coordorigin="1,1";a.path=this.ya(null,2);g=a.style;
+g.width=e;g.height=b;a.fill.color=d.U(c);c=d.fa();if(c<1)a.fill.opacity=c}else this.vb("bgColor")},pd:function(){var a=this.g.C.j(),b=this.s.o();a=a&&a.M;var c,d,e,g,j;if(a){this.lc();d=b.h;e=b.f;for(j=a.length;j--;){b=a[j];c=this.Aa("bgImage"+j,"fill",this.I(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=d*2+","+e*2;c.coordorigin="1,1";c.path=this.ya(0,2);g=c.style;g.width=d;g.height=e;if(b.P==="linear-gradient")this.bd(c,b);else{c.fill.src=b.Ab;this.Nd(c,j)}}}for(j=a?a.length:
+0;this.vb("bgImage"+j++););},Nd:function(a,b){var c=this;f.p.Rb(a.fill.src,function(d){var e=c.e,g=c.s.o(),j=g.h;g=g.f;if(j&&g){var i=a.fill,h=c.g,k=h.w.j(),n=k&&k.J;k=n?n.t.a(e):0;var m=n?n.r.a(e):0,p=n?n.b.a(e):0;n=n?n.l.a(e):0;h=h.C.j().M[b];e=h.$?h.$.coords(e,j-d.h-n-m,g-d.f-k-p):{x:0,y:0};h=h.bb;p=m=0;var r=j+1,t=g+1,v=f.O===8?0:1;n=Math.round(e.x)+n+0.5;k=Math.round(e.y)+k+0.5;i.position=n/j+","+k/g;i.size.x=1;i.size=d.h+"px,"+d.f+"px";if(h&&h!=="repeat"){if(h==="repeat-x"||h==="no-repeat"){m=
+k+1;t=k+d.f+v}if(h==="repeat-y"||h==="no-repeat"){p=n+1;r=n+d.h+v}a.style.clip="rect("+m+"px,"+r+"px,"+t+"px,"+p+"px)"}}})},bd:function(a,b){var c=this.e,d=this.s.o(),e=d.h,g=d.f;a=a.fill;d=b.ca;var j=d.length,i=Math.PI,h=f.Na,k=h.tc,n=h.dc;b=h.gc(c,e,g,b);h=b.sa;var m=b.xc,p=b.yc,r=b.Wd,t=b.Xd,v=b.rd,l=b.sd,q=b.kd,s=b.ld;b=b.rc;e=h%90?Math.atan2(q*e/g,s)/i*180:h+90;e+=180;e%=360;v=k(r,t,h,v,l);g=n(r,t,v[0],v[1]);i=[];v=k(m,p,h,r,t);n=n(m,p,v[0],v[1])/g*100;k=[];for(h=0;h<j;h++)k.push(d[h].db?d[h].db.a(c,
+b):h===0?0:h===j-1?b:null);for(h=1;h<j;h++){if(k[h]===null){m=k[h-1];b=h;do p=k[++b];while(p===null);k[h]=m+(p-m)/(b-h+1)}k[h]=Math.max(k[h],k[h-1])}for(h=0;h<j;h++)i.push(n+k[h]/g*100+"% "+d[h].color.U(c));a.angle=e;a.type="gradient";a.method="sigma";a.color=d[0].color.U(c);a.color2=d[j-1].color.U(c);if(a.colors)a.colors.value=i.join(",");else a.colors=i.join(",")},lc:function(){var a=this.e.runtimeStyle;a.backgroundImage="url(about:blank)";a.backgroundColor="transparent"},m:function(){f.u.m.call(this);
+var a=this.e.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});f.Gc=f.u.R({N:4,Ya:"border",Q:function(){var a=this.g;return a.w.H()||a.G.H()},i:function(){var a=this.g;return a.G.i()&&!a.q.i()&&a.w.i()},V:function(){var a=this.e,b=this.g.w.j(),c=this.s.o(),d=c.h;c=c.f;var e,g,j,i,h;if(b){this.mc();b=this.wd(2);i=0;for(h=b.length;i<h;i++){j=b[i];e=this.Aa("borderPiece"+i,j.stroke?"stroke":"fill",this.I());e.coordsize=d*2+","+c*2;e.coordorigin="1,1";e.path=j.path;g=e.style;g.width=d;g.height=c;
+e.filled=!!j.fill;e.stroked=!!j.stroke;if(j.stroke){e=e.stroke;e.weight=j.Qb+"px";e.color=j.color.U(a);e.dashstyle=j.stroke==="dashed"?"2 2":j.stroke==="dotted"?"1 1":"solid";e.linestyle=j.stroke==="double"&&j.Qb>2?"ThinThin":"Single"}else e.fill.color=j.fill.U(a)}for(;this.vb("borderPiece"+i++););}},wd:function(a){var b=this.e,c,d,e,g=this.g.w,j=[],i,h,k,n,m=Math.round,p,r,t;if(g.i()){c=g.j();g=c.J;r=c.Zd;t=c.gd;if(c.ee&&c.$d&&c.hd){if(t.t.fa()>0){c=g.t.a(b);k=c/2;j.push({path:this.ya({Jb:k,Ib:k,
+tb:k,Db:k},a),stroke:r.t,color:t.t,Qb:c})}}else{a=a||1;c=this.s.o();d=c.h;e=c.f;c=m(g.t.a(b));k=m(g.r.a(b));n=m(g.b.a(b));b=m(g.l.a(b));var v={t:c,r:k,b:n,l:b};b=this.g.G;if(b.i())p=this.kc(b.j());i=Math.floor;h=Math.ceil;var l=function(o,u){return p?p[o][u]:0},q=function(o,u,x,y,z,B){var E=l("x",o),D=l("y",o),C=o.charAt(1)==="r";o=o.charAt(0)==="b";return E>0&&D>0?(B?"al":"ae")+(C?h(d-E):i(E))*a+","+(o?h(e-D):i(D))*a+","+(i(E)-u)*a+","+(i(D)-x)*a+","+y*65535+","+2949075*(z?1:-1):(B?"m":"l")+(C?d-
+u:u)*a+","+(o?e-x:x)*a},s=function(o,u,x,y){var z=o==="t"?i(l("x","tl"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+i(l("y","tr"))*a:o==="b"?h(d-l("x","br"))*a+","+i(e-u)*a:i(u)*a+","+h(e-l("y","bl"))*a;o=o==="t"?h(d-l("x","tr"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+h(e-l("y","br"))*a:o==="b"?i(l("x","bl"))*a+","+i(e-u)*a:i(u)*a+","+i(l("y","tl"))*a;return x?(y?"m"+o:"")+"l"+z:(y?"m"+z:"")+"l"+o};b=function(o,u,x,y,z,B){var E=o==="l"||o==="r",D=v[o],C,F;if(D>0&&r[o]!=="none"&&t[o].fa()>0){C=v[E?o:u];u=v[E?u:
+o];F=v[E?o:x];x=v[E?x:o];if(r[o]==="dashed"||r[o]==="dotted"){j.push({path:q(y,C,u,B+45,0,1)+q(y,0,0,B,1,0),fill:t[o]});j.push({path:s(o,D/2,0,1),stroke:r[o],Qb:D,color:t[o]});j.push({path:q(z,F,x,B,0,1)+q(z,0,0,B-45,1,0),fill:t[o]})}else j.push({path:q(y,C,u,B+45,0,1)+s(o,D,0,0)+q(z,F,x,B,0,0)+(r[o]==="double"&&D>2?q(z,F-i(F/3),x-i(x/3),B-45,1,0)+s(o,h(D/3*2),1,0)+q(y,C-i(C/3),u-i(u/3),B,1,0)+"x "+q(y,i(C/3),i(u/3),B+45,0,1)+s(o,i(D/3),1,0)+q(z,i(F/3),i(x/3),B,0,0):"")+q(z,0,0,B-45,1,0)+s(o,0,1,
+0)+q(y,0,0,B,1,0),fill:t[o]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return j},m:function(){if(this.ec||!this.g.q.i())this.e.runtimeStyle.borderColor="";f.u.m.call(this)}});f.Tb=f.u.R({N:5,Md:["t","tr","r","br","b","bl","l","tl","c"],Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){this.I();var a=this.g.q.j(),b=this.g.w.j(),c=this.s.o(),d=this.e,e=this.uc;f.p.Rb(a.src,function(g){function j(s,
+o,u,x,y){s=e[s].style;var z=Math.max;s.width=z(o,0);s.height=z(u,0);s.left=x;s.top=y}function i(s,o,u){for(var x=0,y=s.length;x<y;x++)e[s[x]].imagedata[o]=u}var h=c.h,k=c.f,n=f.n("0"),m=a.J||(b?b.J:{t:n,r:n,b:n,l:n});n=m.t.a(d);var p=m.r.a(d),r=m.b.a(d);m=m.l.a(d);var t=a.slice,v=t.t.a(d),l=t.r.a(d),q=t.b.a(d);t=t.l.a(d);j("tl",m,n,0,0);j("t",h-m-p,n,m,0);j("tr",p,n,h-p,0);j("r",p,k-n-r,h-p,n);j("br",p,r,h-p,k-r);j("b",h-m-p,r,m,k-r);j("bl",m,r,0,k-r);j("l",m,k-n-r,0,n);j("c",h-m-p,k-n-r,m,n);i(["tl",
+"t","tr"],"cropBottom",(g.f-v)/g.f);i(["tl","l","bl"],"cropRight",(g.h-t)/g.h);i(["bl","b","br"],"cropTop",(g.f-q)/g.f);i(["tr","r","br"],"cropLeft",(g.h-l)/g.h);i(["l","r","c"],"cropTop",v/g.f);i(["l","r","c"],"cropBottom",q/g.f);i(["t","b","c"],"cropLeft",t/g.h);i(["t","b","c"],"cropRight",l/g.h);e.c.style.display=a.fill?"":"none"},this)},I:function(){var a=this.parent.za(this.N),b,c,d,e=this.Md,g=e.length;if(!a){a=doc.createElement("border-image");b=a.style;b.position="absolute";this.uc={};for(d=
+0;d<g;d++){c=this.uc[e[d]]=f.p.Za("rect");c.appendChild(f.p.Za("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.g.q.j().src;c.stroked=false;c.filled=false;a.appendChild(c)}this.parent.sb(this.N,a)}return a},Ea:function(){if(this.i()){var a=this.e,b=a.runtimeStyle,c=this.g.q.j().J;b.borderStyle="solid";if(c){b.borderTopWidth=c.t.a(a)+"px";b.borderRightWidth=c.r.a(a)+"px";b.borderBottomWidth=c.b.a(a)+"px";b.borderLeftWidth=c.l.a(a)+"px"}this.mc()}},
+m:function(){var a=this.e.runtimeStyle;a.borderStyle="";if(this.ec||!this.g.w.i())a.borderColor=a.borderWidth="";f.u.m.call(this)}});f.Hc=f.u.R({N:1,Ya:"outset-box-shadow",Q:function(){var a=this.g;return a.ga.H()||a.G.H()},i:function(){var a=this.g.ga;return a.i()&&a.j().Da[0]},V:function(){function a(C,F,O,H,M,P,I){C=b.Aa("shadow"+C+F,"fill",d,j-C);F=C.fill;C.coordsize=n*2+","+m*2;C.coordorigin="1,1";C.stroked=false;C.filled=true;F.color=M.U(c);if(P){F.type="gradienttitle";F.color2=F.color;F.opacity=
+0}C.path=I;l=C.style;l.left=O;l.top=H;l.width=n;l.height=m;return C}var b=this,c=this.e,d=this.I(),e=this.g,g=e.ga.j().Da;e=e.G.j();var j=g.length,i=j,h,k=this.s.o(),n=k.h,m=k.f;k=f.O===8?1:0;for(var p=["tl","tr","br","bl"],r,t,v,l,q,s,o,u,x,y,z,B,E,D;i--;){t=g[i];q=t.fe.a(c);s=t.ge.a(c);h=t.Vd.a(c);o=t.blur.a(c);t=t.color;u=-h-o;if(!e&&o)e=f.jb.Dc;u=this.ya({Jb:u,Ib:u,tb:u,Db:u},2,e);if(o){x=(h+o)*2+n;y=(h+o)*2+m;z=x?o*2/x:0;B=y?o*2/y:0;if(o-h>n/2||o-h>m/2)for(h=4;h--;){r=p[h];E=r.charAt(0)==="b";
+D=r.charAt(1)==="r";r=a(i,r,q,s,t,o,u);v=r.fill;v.focusposition=(D?1-z:z)+","+(E?1-B:B);v.focussize="0,0";r.style.clip="rect("+((E?y/2:0)+k)+"px,"+(D?x:x/2)+"px,"+(E?y:y/2)+"px,"+((D?x/2:0)+k)+"px)"}else{r=a(i,"",q,s,t,o,u);v=r.fill;v.focusposition=z+","+B;v.focussize=1-z*2+","+(1-B*2)}}else{r=a(i,"",q,s,t,o,u);q=t.fa();if(q<1)r.fill.opacity=q}}}});f.Pc=f.u.R({N:6,Ya:"imgEl",Q:function(){var a=this.g;return this.e.src!==this.Xc||a.G.H()},i:function(){var a=this.g;return a.G.i()||a.C.qc()},V:function(){this.Xc=
+j;this.Cd();var a=this.Aa("img","fill",this.I()),b=a.fill,c=this.s.o(),d=c.h;c=c.f;var e=this.g.w.j(),g=e&&e.J;e=this.e;var j=e.src,i=Math.round,h=e.currentStyle,k=f.n;if(!g||f.O<7){g=f.n("0");g={t:g,r:g,b:g,l:g}}a.stroked=false;b.type="frame";b.src=j;b.position=(d?0.5/d:0)+","+(c?0.5/c:0);a.coordsize=d*2+","+c*2;a.coordorigin="1,1";a.path=this.ya({Jb:i(g.t.a(e)+k(h.paddingTop).a(e)),Ib:i(g.r.a(e)+k(h.paddingRight).a(e)),tb:i(g.b.a(e)+k(h.paddingBottom).a(e)),Db:i(g.l.a(e)+k(h.paddingLeft).a(e))},
+2);a=a.style;a.width=d;a.height=c},Cd:function(){this.e.runtimeStyle.filter="alpha(opacity=0)"},m:function(){f.u.m.call(this);this.e.runtimeStyle.filter=""}});f.Oc=f.u.R({ib:f.aa,Mb:f.aa,Nb:f.aa,Lb:f.aa,Ld:/^,+|,+$/g,Fd:/,+/g,gb:function(a,b){(this.pb||(this.pb=[]))[a]=b||void 0},ab:function(){var a=this.pb,b;if(a&&(b=a.join(",").replace(this.Ld,"").replace(this.Fd,","))!==this.Wc)this.Wc=this.e.runtimeStyle.background=b},m:function(){this.e.runtimeStyle.background="";delete this.pb}});f.Mc=f.u.R({ua:1,
+Q:function(){return this.g.C.H()},i:function(){var a=this.g;return a.C.i()||a.q.i()},V:function(){var a=this.g.C.j(),b,c,d=0,e,g;if(a){b=[];if(c=a.M)for(;e=c[d++];)if(e.P==="linear-gradient"){g=this.vd(e.Wa);g=(e.Xa||f.Ka.Kc).a(this.e,g.h,g.f,g.h,g.f);b.push("url(data:image/svg+xml,"+escape(this.xd(e,g.h,g.f))+") "+this.dd(e.$)+" / "+g.h+"px "+g.f+"px "+(e.bc||"")+" "+(e.Wa||"")+" "+(e.ub||""))}else b.push(e.Hb);a.color&&b.push(a.color.Y);this.parent.gb(this.ua,b.join(","))}},dd:function(a){return a?
+a.X.map(function(b){return b.d}).join(" "):"0 0"},vd:function(a){var b=this.e,c=this.s.o(),d=c.h;c=c.f;var e;if(a!=="border-box")if((e=this.g.w.j())&&(e=e.J)){d-=e.l.a(b)+e.l.a(b);c-=e.t.a(b)+e.b.a(b)}if(a==="content-box"){a=f.n;e=b.currentStyle;d-=a(e.paddingLeft).a(b)+a(e.paddingRight).a(b);c-=a(e.paddingTop).a(b)+a(e.paddingBottom).a(b)}return{h:d,f:c}},xd:function(a,b,c){var d=this.e,e=a.ca,g=e.length,j=f.Na.gc(d,b,c,a);a=j.xc;var i=j.yc,h=j.td,k=j.ud;j=j.rc;var n,m,p,r,t;n=[];for(m=0;m<g;m++)n.push(e[m].db?
+e[m].db.a(d,j):m===0?0:m===g-1?j:null);for(m=1;m<g;m++)if(n[m]===null){r=n[m-1];p=m;do t=n[++p];while(t===null);n[m]=r+(t-r)/(p-m+1)}b=['<svg width="'+b+'" height="'+c+'" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="'+a/b*100+'%" y1="'+i/c*100+'%" x2="'+h/b*100+'%" y2="'+k/c*100+'%">'];for(m=0;m<g;m++)b.push('<stop offset="'+n[m]/j+'" stop-color="'+e[m].color.U(d)+'" stop-opacity="'+e[m].color.fa()+'"/>');b.push('</linearGradient></defs><rect width="100%" height="100%" fill="url(#g)"/></svg>');
+return b.join("")},m:function(){this.parent.gb(this.ua)}});f.Nc=f.u.R({T:"repeat",Sc:"stretch",Qc:"round",ua:0,Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){var a=this,b=a.g.q.j(),c=a.g.w.j(),d=a.s.o(),e=b.repeat,g=e.f,j=e.Ob,i=a.e,h=0;f.p.Rb(b.src,function(k){function n(Q,R,U,V,W,Y,X,S,w,A){K.push('<pattern patternUnits="userSpaceOnUse" id="pattern'+G+'" x="'+(g===l?Q+U/2-w/2:Q)+'" y="'+(j===l?R+V/2-A/2:R)+'" width="'+w+'" height="'+A+'"><svg width="'+w+'" height="'+
+A+'" viewBox="'+W+" "+Y+" "+X+" "+S+'" preserveAspectRatio="none"><image xlink:href="'+v+'" x="0" y="0" width="'+r+'" height="'+t+'" /></svg></pattern>');J.push('<rect x="'+Q+'" y="'+R+'" width="'+U+'" height="'+V+'" fill="url(#pattern'+G+')" />');G++}var m=d.h,p=d.f,r=k.h,t=k.f,v=a.Dd(b.src,r,t),l=a.T,q=a.Sc;k=a.Qc;var s=Math.ceil,o=f.n("0"),u=b.J||(c?c.J:{t:o,r:o,b:o,l:o});o=u.t.a(i);var x=u.r.a(i),y=u.b.a(i);u=u.l.a(i);var z=b.slice,B=z.t.a(i),E=z.r.a(i),D=z.b.a(i);z=z.l.a(i);var C=m-u-x,F=p-o-
+y,O=r-z-E,H=t-B-D,M=g===q?C:O*o/B,P=j===q?F:H*x/E,I=g===q?C:O*y/D;q=j===q?F:H*u/z;var K=[],J=[],G=0;if(g===k){M-=(M-(C%M||M))/s(C/M);I-=(I-(C%I||I))/s(C/I)}if(j===k){P-=(P-(F%P||P))/s(F/P);q-=(q-(F%q||q))/s(F/q)}k=['<svg width="'+m+'" height="'+p+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'];n(0,0,u,o,0,0,z,B,u,o);n(u,0,C,o,z,0,O,B,M,o);n(m-x,0,x,o,r-E,0,E,B,x,o);n(0,o,u,F,0,B,z,H,u,q);if(b.fill)n(u,o,C,F,z,B,O,H,M||I||O,q||P||H);n(m-x,o,x,F,r-E,B,E,H,x,P);n(0,
+p-y,u,y,0,t-D,z,D,u,y);n(u,p-y,C,y,z,t-D,O,D,I,y);n(m-x,p-y,x,y,r-E,t-D,E,D,x,y);k.push("<defs>"+K.join("\n")+"</defs>"+J.join("\n")+"</svg>");a.parent.gb(a.ua,"url(data:image/svg+xml,"+escape(k.join(""))+") no-repeat border-box border-box");h&&a.parent.ab()},a);h=1},Dd:function(){var a={};return function(b,c,d){var e=a[b],g;if(!e){e=new Image;g=doc.createElement("canvas");e.src=b;g.width=c;g.height=d;g.getContext("2d").drawImage(e,0,0);e=a[b]=g.toDataURL()}return e}}(),Ea:f.Tb.prototype.Ea,m:function(){var a=
+this.e.runtimeStyle;this.parent.gb(this.ua);a.borderColor=a.borderStyle=a.borderWidth=""}});f.kb=function(){function a(l,q){l.className+=" "+q}function b(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;)a(l,q[s])},0)}function c(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;){var o=q[s];o=t[o]||(t[o]=new RegExp("\\b"+o+"\\b","g"));l.className=l.className.replace(o,"")}},0)}function d(l){function q(){if(!U){var w,A,L=f.ja,T=l.currentStyle,
+N=T.getAttribute(g)==="true",da=T.getAttribute(i)!=="false",ea=T.getAttribute(h)!=="false";S=T.getAttribute(j);S=L>7?S!=="false":S==="true";if(!R){R=1;l.runtimeStyle.zoom=1;T=l;for(var fa=1;T=T.previousSibling;)if(T.nodeType===1){fa=0;break}fa&&a(l,p)}J.cb();if(N&&(A=J.o())&&(w=doc.documentElement||doc.body)&&(A.y>w.clientHeight||A.x>w.clientWidth||A.y+A.f<0||A.x+A.h<0)){if(!Y){Y=1;f.mb.ba(q)}}else{U=1;Y=R=0;f.mb.Ha(q);if(L===9){G={C:new f.Sb(l),q:new f.Ub(l),w:new f.Vb(l)};Q=[G.C,G.q];K=new f.Oc(l,
+J,G);w=[new f.Mc(l,J,G,K),new f.Nc(l,J,G,K)]}else{G={C:new f.Sb(l),w:new f.Vb(l),q:new f.Ub(l),G:new f.jb(l),ga:new f.Ic(l),Pb:new f.Uc(l)};Q=[G.C,G.w,G.q,G.G,G.ga,G.Pb];K=new f.Rc(l,J,G);w=[new f.Hc(l,J,G,K),new f.Fc(l,J,G,K),new f.Gc(l,J,G,K),new f.Tb(l,J,G,K)];l.tagName==="IMG"&&w.push(new f.Pc(l,J,G,K));K.ed=w}I=[K].concat(w);if(w=l.currentStyle.getAttribute(f.F+"watch-ancestors")){w=parseInt(w,10);A=0;for(N=l.parentNode;N&&(w==="NaN"||A++<w);){H(N,"onpropertychange",C);H(N,"onmouseenter",x);
+H(N,"onmouseleave",y);H(N,"onmousedown",z);if(N.tagName in f.fc){H(N,"onfocus",E);H(N,"onblur",D)}N=N.parentNode}}if(S){f.Oa.ba(o);f.Oa.Rd()}o(1)}if(!V){V=1;L<9&&H(l,"onmove",s);H(l,"onresize",s);H(l,"onpropertychange",u);ea&&H(l,"onmouseenter",x);if(ea||da)H(l,"onmouseleave",y);da&&H(l,"onmousedown",z);if(l.tagName in f.fc){H(l,"onfocus",E);H(l,"onblur",D)}f.Qa.ba(s);f.L.ba(M)}J.hb()}}function s(){J&&J.Ad()&&o()}function o(w){if(!X)if(U){var A,L=I.length;F();for(A=0;A<L;A++)I[A].Ea();if(w||J.Od())for(A=
+0;A<L;A++)I[A].ib();if(w||J.Td())for(A=0;A<L;A++)I[A].Mb();K.ab();O()}else R||q()}function u(){var w,A=I.length,L;w=event;if(!X&&!(w&&w.propertyName in r))if(U){F();for(w=0;w<A;w++)I[w].Ea();for(w=0;w<A;w++){L=I[w];L.Cb||L.ib();L.Q()&&L.Lb()}K.ab();O()}else R||q()}function x(){b(l,k)}function y(){c(l,k,n)}function z(){b(l,n);f.lb.ba(B)}function B(){c(l,n);f.lb.Ha(B)}function E(){b(l,m)}function D(){c(l,m)}function C(){var w=event.propertyName;if(w==="className"||w==="id")u()}function F(){J.cb();for(var w=
+Q.length;w--;)Q[w].cb()}function O(){for(var w=Q.length;w--;)Q[w].hb();J.hb()}function H(w,A,L){w.attachEvent(A,L);W.push([w,A,L])}function M(){if(V){for(var w=W.length,A;w--;){A=W[w];A[0].detachEvent(A[1],A[2])}f.L.Ha(M);V=0;W=[]}}function P(){if(!X){var w,A;M();X=1;if(I){w=0;for(A=I.length;w<A;w++){I[w].ec=1;I[w].m()}}S&&f.Oa.Ha(o);f.Qa.Ha(o);I=J=G=Q=l=null}}var I,K,J=new ha(l),G,Q,R,U,V,W=[],Y,X,S;this.Ed=q;this.update=o;this.m=P;this.qd=l}var e={},g=f.F+"lazy-init",j=f.F+"poll",i=f.F+"track-active",
+h=f.F+"track-hover",k=f.La+"hover",n=f.La+"active",m=f.La+"focus",p=f.La+"first-child",r={background:1,bgColor:1,display:1},t={},v=[];d.yd=function(l){var q=f.p.Ba(l);return e[q]||(e[q]=new d(l))};d.m=function(l){l=f.p.Ba(l);var q=e[l];if(q){q.m();delete e[l]}};d.md=function(){var l=[],q;if(e){for(var s in e)if(e.hasOwnProperty(s)){q=e[s];l.push(q.qd);q.m()}e={}}return l};return d}();f.supportsVML=f.zc;f.attach=function(a){f.ja<10&&f.zc&&f.kb.yd(a).Ed()};f.detach=function(a){f.kb.m(a)}};
+var $=element;function init(){if(doc.media!=="print"){var a=window.PIE;a&&a.attach($)}}function cleanup(){if(doc.media!=="print"){var a=window.PIE;if(a){a.detach($);$=0}}}$.readyState==="complete"&&init();
+</script>
+</PUBLIC:COMPONENT>
diff --git a/themes/mantra/js/PIE/PIE.js b/themes/mantra/js/PIE/PIE.js
new file mode 100644
index 00000000..72165b2a
--- /dev/null
+++ b/themes/mantra/js/PIE/PIE.js
@@ -0,0 +1,88 @@
+/*
+PIE: CSS3 rendering for IE
+Version 1.0.0
+http://css3pie.com
+Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
+*/
+(function(){
+var doc = document;var f=window.PIE;
+if(!f){f=window.PIE={F:"-pie-",nb:"Pie",La:"pie_",Ac:{TD:1,TH:1},cc:{TABLE:1,THEAD:1,TBODY:1,TFOOT:1,TR:1,INPUT:1,TEXTAREA:1,SELECT:1,OPTION:1,IMG:1,HR:1},fc:{A:1,INPUT:1,TEXTAREA:1,SELECT:1,BUTTON:1},Gd:{submit:1,button:1,reset:1},aa:function(){}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(aa){}for(var ba=4,Z=doc.createElement("div"),ca=Z.getElementsByTagName("i"),ga;Z.innerHTML="<!--[if gt IE "+ ++ba+"]><i></i><![endif]--\>",ca[0];);f.O=ba;if(ba===6)f.F=f.F.replace(/^-/,"");f.ja=
+doc.documentMode||f.O;Z.innerHTML='<v:shape adj="1"/>';ga=Z.firstChild;ga.style.behavior="url(#default#VML)";f.zc=typeof ga.adj==="object";(function(){var a,b=0,c={};f.p={Za:function(d){if(!a){a=doc.createDocumentFragment();a.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return a.createElement("css3vml:"+d)},Ba:function(d){return d&&d._pieId||(d._pieId="_"+ ++b)},Eb:function(d){var e,g,j,i,h=arguments;e=1;for(g=h.length;e<g;e++){i=h[e];for(j in i)if(i.hasOwnProperty(j))d[j]=i[j]}return d},
+Rb:function(d,e,g){var j=c[d],i,h;if(j)Object.prototype.toString.call(j)==="[object Array]"?j.push([e,g]):e.call(g,j);else{h=c[d]=[[e,g]];i=new Image;i.onload=function(){j=c[d]={h:i.width,f:i.height};for(var k=0,n=h.length;k<n;k++)h[k][0].call(h[k][1],j);i.onload=null};i.src=d}}}})();f.Na={gc:function(a,b,c,d){function e(){k=j>=90&&j<270?b:0;n=j<180?c:0;m=b-k;p=c-n}function g(){for(;j<0;)j+=360;j%=360}var j=d.sa;d=d.zb;var i,h,k,n,m,p,r,t;if(d){d=d.coords(a,b,c);i=d.x;h=d.y}if(j){j=j.jd();g();e();
+if(!d){i=k;h=n}d=f.Na.tc(i,h,j,m,p);a=d[0];d=d[1]}else if(d){a=b-i;d=c-h}else{i=h=a=0;d=c}r=a-i;t=d-h;if(j===void 0){j=!r?t<0?90:270:!t?r<0?180:0:-Math.atan2(t,r)/Math.PI*180;g();e()}return{sa:j,xc:i,yc:h,td:a,ud:d,Wd:k,Xd:n,rd:m,sd:p,kd:r,ld:t,rc:f.Na.dc(i,h,a,d)}},tc:function(a,b,c,d,e){if(c===0||c===180)return[d,b];else if(c===90||c===270)return[a,e];else{c=Math.tan(-c*Math.PI/180);a=c*a-b;b=-1/c;d=b*d-e;e=b-c;return[(d-a)/e,(c*d-b*a)/e]}},dc:function(a,b,c,d){a=c-a;b=d-b;return Math.abs(a===0?
+b:b===0?a:Math.sqrt(a*a+b*b))}};f.ea=function(){this.Gb=[];this.oc={}};f.ea.prototype={ba:function(a){var b=f.p.Ba(a),c=this.oc,d=this.Gb;if(!(b in c)){c[b]=d.length;d.push(a)}},Ha:function(a){a=f.p.Ba(a);var b=this.oc;if(a&&a in b){delete this.Gb[b[a]];delete b[a]}},xa:function(){for(var a=this.Gb,b=a.length;b--;)a[b]&&a[b]()}};f.Oa=new f.ea;f.Oa.Rd=function(){var a=this,b;if(!a.Sd){b=doc.documentElement.currentStyle.getAttribute(f.F+"poll-interval")||250;(function c(){a.xa();setTimeout(c,b)})();
+a.Sd=1}};(function(){function a(){f.L.xa();window.detachEvent("onunload",a);window.PIE=null}f.L=new f.ea;window.attachEvent("onunload",a);f.L.ta=function(b,c,d){b.attachEvent(c,d);this.ba(function(){b.detachEvent(c,d)})}})();f.Qa=new f.ea;f.L.ta(window,"onresize",function(){f.Qa.xa()});(function(){function a(){f.mb.xa()}f.mb=new f.ea;f.L.ta(window,"onscroll",a);f.Qa.ba(a)})();(function(){function a(){c=f.kb.md()}function b(){if(c){for(var d=0,e=c.length;d<e;d++)f.attach(c[d]);c=0}}var c;if(f.ja<9){f.L.ta(window,
+"onbeforeprint",a);f.L.ta(window,"onafterprint",b)}})();f.lb=new f.ea;f.L.ta(doc,"onmouseup",function(){f.lb.xa()});f.he=function(){function a(h){this.Y=h}var b=doc.createElement("length-calc"),c=doc.body||doc.documentElement,d=b.style,e={},g=["mm","cm","in","pt","pc"],j=g.length,i={};d.position="absolute";d.top=d.left="-9999px";for(c.appendChild(b);j--;){d.width="100"+g[j];e[g[j]]=b.offsetWidth/100}c.removeChild(b);d.width="1em";a.prototype={Kb:/(px|em|ex|mm|cm|in|pt|pc|%)$/,ic:function(){var h=
+this.Jd;if(h===void 0)h=this.Jd=parseFloat(this.Y);return h},yb:function(){var h=this.ae;if(!h)h=this.ae=(h=this.Y.match(this.Kb))&&h[0]||"px";return h},a:function(h,k){var n=this.ic(),m=this.yb();switch(m){case "px":return n;case "%":return n*(typeof k==="function"?k():k)/100;case "em":return n*this.xb(h);case "ex":return n*this.xb(h)/2;default:return n*e[m]}},xb:function(h){var k=h.currentStyle.fontSize,n,m;if(k.indexOf("px")>0)return parseFloat(k);else if(h.tagName in f.cc){m=this;n=h.parentNode;
+return f.n(k).a(n,function(){return m.xb(n)})}else{h.appendChild(b);k=b.offsetWidth;b.parentNode===h&&h.removeChild(b);return k}}};f.n=function(h){return i[h]||(i[h]=new a(h))};return a}();f.Ja=function(){function a(e){this.X=e}var b=f.n("50%"),c={top:1,center:1,bottom:1},d={left:1,center:1,right:1};a.prototype={zd:function(){if(!this.ac){var e=this.X,g=e.length,j=f.v,i=j.qa,h=f.n("0");i=i.na;h=["left",h,"top",h];if(g===1){e.push(new j.ob(i,"center"));g++}if(g===2){i&(e[0].k|e[1].k)&&e[0].d in c&&
+e[1].d in d&&e.push(e.shift());if(e[0].k&i)if(e[0].d==="center")h[1]=b;else h[0]=e[0].d;else if(e[0].W())h[1]=f.n(e[0].d);if(e[1].k&i)if(e[1].d==="center")h[3]=b;else h[2]=e[1].d;else if(e[1].W())h[3]=f.n(e[1].d)}this.ac=h}return this.ac},coords:function(e,g,j){var i=this.zd(),h=i[1].a(e,g);e=i[3].a(e,j);return{x:i[0]==="right"?g-h:h,y:i[2]==="bottom"?j-e:e}}};return a}();f.Ka=function(){function a(b,c){this.h=b;this.f=c}a.prototype={a:function(b,c,d,e,g){var j=this.h,i=this.f,h=c/d;e=e/g;if(j===
+"contain"){j=e>h?c:d*e;i=e>h?c/e:d}else if(j==="cover"){j=e<h?c:d*e;i=e<h?c/e:d}else if(j==="auto"){i=i==="auto"?g:i.a(b,d);j=i*e}else{j=j.a(b,c);i=i==="auto"?j/e:i.a(b,d)}return{h:j,f:i}}};a.Kc=new a("auto","auto");return a}();f.Ec=function(){function a(b){this.Y=b}a.prototype={Kb:/[a-z]+$/i,yb:function(){return this.ad||(this.ad=this.Y.match(this.Kb)[0].toLowerCase())},jd:function(){var b=this.Vc,c;if(b===undefined){b=this.yb();c=parseFloat(this.Y,10);b=this.Vc=b==="deg"?c:b==="rad"?c/Math.PI*180:
+b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();f.Jc=function(){function a(c){this.Y=c}var b={};a.Qd=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.Fb={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",
+cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",
+forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightsalmon:"FFA07A",
+lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"0F0",limegreen:"32CD32",linen:"FAF0E6",magenta:"F0F",maroon:"800000",mediumauqamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",
+navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"688E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",
+slateblue:"6A5ACD",slategray:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFF",whitesmoke:"F5F5F5",yellow:"FF0",yellowgreen:"9ACD32"};a.prototype={parse:function(){if(!this.Ua){var c=this.Y,d;if(d=c.match(a.Qd)){this.Ua="rgb("+d[1]+","+d[2]+","+d[3]+")";this.Yb=parseFloat(d[4])}else{if((d=c.toLowerCase())in a.Fb)c="#"+a.Fb[d];this.Ua=c;this.Yb=c==="transparent"?0:
+1}}},U:function(c){this.parse();return this.Ua==="currentColor"?c.currentStyle.color:this.Ua},fa:function(){this.parse();return this.Yb}};f.ha=function(c){return b[c]||(b[c]=new a(c))};return a}();f.v=function(){function a(c){this.$a=c;this.ch=0;this.X=[];this.Ga=0}var b=a.qa={Ia:1,Wb:2,z:4,Lc:8,Xb:16,na:32,K:64,oa:128,pa:256,Ra:512,Tc:1024,URL:2048};a.ob=function(c,d){this.k=c;this.d=d};a.ob.prototype={Ca:function(){return this.k&b.K||this.k&b.oa&&this.d==="0"},W:function(){return this.Ca()||this.k&
+b.Ra}};a.prototype={de:/\s/,Kd:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,nc:/^\-?[_a-z][\w-]*/i,Yd:/^("([^"]*)"|'([^']*)')/,Bd:/^#([\da-f]{6}|[\da-f]{3})/i,be:{px:b.K,em:b.K,ex:b.K,mm:b.K,cm:b.K,"in":b.K,pt:b.K,pc:b.K,deg:b.Ia,rad:b.Ia,grad:b.Ia},fd:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function d(p,r){p=new a.ob(p,r);if(!c){k.X.push(p);k.Ga++}return p}function e(){k.Ga++;return null}var g,j,i,h,k=this;if(this.Ga<this.X.length)return this.X[this.Ga++];for(;this.de.test(this.$a.charAt(this.ch));)this.ch++;
+if(this.ch>=this.$a.length)return e();j=this.ch;g=this.$a.substring(this.ch);i=g.charAt(0);switch(i){case "#":if(h=g.match(this.Bd)){this.ch+=h[0].length;return d(b.z,h[0])}break;case '"':case "'":if(h=g.match(this.Yd)){this.ch+=h[0].length;return d(b.Tc,h[2]||h[3]||"")}break;case "/":case ",":this.ch++;return d(b.pa,i);case "u":if(h=g.match(this.url)){this.ch+=h[0].length;return d(b.URL,h[2]||h[3]||h[4]||"")}}if(h=g.match(this.Kd)){i=h[0];this.ch+=i.length;if(g.charAt(i.length)==="%"){this.ch++;
+return d(b.Ra,i+"%")}if(h=g.substring(i.length).match(this.nc)){i+=h[0];this.ch+=h[0].length;return d(this.be[h[0].toLowerCase()]||b.Lc,i)}return d(b.oa,i)}if(h=g.match(this.nc)){i=h[0];this.ch+=i.length;if(i.toLowerCase()in f.Jc.Fb||i==="currentColor"||i==="transparent")return d(b.z,i);if(g.charAt(i.length)==="("){this.ch++;if(i.toLowerCase()in this.fd){g=function(p){return p&&p.k&b.oa};h=function(p){return p&&p.k&(b.oa|b.Ra)};var n=function(p,r){return p&&p.d===r},m=function(){return k.next(1)};
+if((i.charAt(0)==="r"?h(m()):g(m()))&&n(m(),",")&&h(m())&&n(m(),",")&&h(m())&&(i==="rgb"||i==="hsa"||n(m(),",")&&g(m()))&&n(m(),")"))return d(b.z,this.$a.substring(j,this.ch));return e()}return d(b.Xb,i)}return d(b.na,i)}this.ch++;return d(b.Wb,i)},D:function(){return this.X[this.Ga-- -2]},all:function(){for(;this.next(););return this.X},ma:function(c,d){for(var e=[],g,j;g=this.next();){if(c(g)){j=true;this.D();break}e.push(g)}return d&&!j?null:e}};return a}();var ha=function(a){this.e=a};ha.prototype=
+{Z:0,Od:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.x!==b.x||a.y!==b.y)},Td:function(){var a=this.qb,b;return!a||(b=this.o())&&(a.h!==b.h||a.f!==b.f)},hc:function(){var a=this.e,b=a.getBoundingClientRect(),c=f.ja===9,d=f.O===7,e=b.right-b.left;return{x:b.left,y:b.top,h:c||d?a.offsetWidth:e,f:c||d?a.offsetHeight:b.bottom-b.top,Hd:d&&e?a.offsetWidth/e:1}},o:function(){return this.Z?this.Va||(this.Va=this.hc()):this.hc()},Ad:function(){return!!this.qb},cb:function(){++this.Z},hb:function(){if(!--this.Z){if(this.Va)this.qb=
+this.Va;this.Va=null}}};(function(){function a(b){var c=f.p.Ba(b);return function(){if(this.Z){var d=this.$b||(this.$b={});return c in d?d[c]:(d[c]=b.call(this))}else return b.call(this)}}f.B={Z:0,ka:function(b){function c(d){this.e=d;this.Zb=this.ia()}f.p.Eb(c.prototype,f.B,b);c.$c={};return c},j:function(){var b=this.ia(),c=this.constructor.$c;return b?b in c?c[b]:(c[b]=this.la(b)):null},ia:a(function(){var b=this.e,c=this.constructor,d=b.style;b=b.currentStyle;var e=this.wa,g=this.Fa,j=c.Yc||(c.Yc=
+f.F+e);c=c.Zc||(c.Zc=f.nb+g.charAt(0).toUpperCase()+g.substring(1));return d[c]||b.getAttribute(j)||d[g]||b.getAttribute(e)}),i:a(function(){return!!this.j()}),H:a(function(){var b=this.ia(),c=b!==this.Zb;this.Zb=b;return c}),va:a,cb:function(){++this.Z},hb:function(){--this.Z||delete this.$b}}})();f.Sb=f.B.ka({wa:f.F+"background",Fa:f.nb+"Background",cd:{scroll:1,fixed:1,local:1},fb:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},sc:{"padding-box":1,"border-box":1,"content-box":1},Pd:{top:1,right:1,
+bottom:1,left:1,center:1},Ud:{contain:1,cover:1},eb:{Ma:"backgroundClip",z:"backgroundColor",da:"backgroundImage",Pa:"backgroundOrigin",S:"backgroundPosition",T:"backgroundRepeat",Sa:"backgroundSize"},la:function(a){function b(s){return s&&s.W()||s.k&k&&s.d in t}function c(s){return s&&(s.W()&&f.n(s.d)||s.d==="auto"&&"auto")}var d=this.e.currentStyle,e,g,j,i=f.v.qa,h=i.pa,k=i.na,n=i.z,m,p,r=0,t=this.Pd,v,l,q={M:[]};if(this.wb()){e=new f.v(a);for(j={};g=e.next();){m=g.k;p=g.d;if(!j.P&&m&i.Xb&&p===
+"linear-gradient"){v={ca:[],P:p};for(l={};g=e.next();){m=g.k;p=g.d;if(m&i.Wb&&p===")"){l.color&&v.ca.push(l);v.ca.length>1&&f.p.Eb(j,v);break}if(m&n){if(v.sa||v.zb){g=e.D();if(g.k!==h)break;e.next()}l={color:f.ha(p)};g=e.next();if(g.W())l.db=f.n(g.d);else e.D()}else if(m&i.Ia&&!v.sa&&!l.color&&!v.ca.length)v.sa=new f.Ec(g.d);else if(b(g)&&!v.zb&&!l.color&&!v.ca.length){e.D();v.zb=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&h&&p===","){if(l.color){v.ca.push(l);l={}}}else break}}else if(!j.P&&
+m&i.URL){j.Ab=p;j.P="image"}else if(b(g)&&!j.$){e.D();j.$=new f.Ja(e.ma(function(s){return!b(s)},false))}else if(m&k)if(p in this.fb&&!j.bb)j.bb=p;else if(p in this.sc&&!j.Wa){j.Wa=p;if((g=e.next())&&g.k&k&&g.d in this.sc)j.ub=g.d;else{j.ub=p;e.D()}}else if(p in this.cd&&!j.bc)j.bc=p;else return null;else if(m&n&&!q.color)q.color=f.ha(p);else if(m&h&&p==="/"&&!j.Xa&&j.$){g=e.next();if(g.k&k&&g.d in this.Ud)j.Xa=new f.Ka(g.d);else if(g=c(g)){m=c(e.next());if(!m){m=g;e.D()}j.Xa=new f.Ka(g,m)}else return null}else if(m&
+h&&p===","&&j.P){j.Hb=a.substring(r,e.ch-1);r=e.ch;q.M.push(j);j={}}else return null}if(j.P){j.Hb=a.substring(r);q.M.push(j)}}else this.Bc(f.ja<9?function(){var s=this.eb,o=d[s.S+"X"],u=d[s.S+"Y"],x=d[s.da],y=d[s.z];if(y!=="transparent")q.color=f.ha(y);if(x!=="none")q.M=[{P:"image",Ab:(new f.v(x)).next().d,bb:d[s.T],$:new f.Ja((new f.v(o+" "+u)).all())}]}:function(){var s=this.eb,o=/\s*,\s*/,u=d[s.da].split(o),x=d[s.z],y,z,B,E,D,C;if(x!=="transparent")q.color=f.ha(x);if((E=u.length)&&u[0]!=="none"){x=
+d[s.T].split(o);y=d[s.S].split(o);z=d[s.Pa].split(o);B=d[s.Ma].split(o);s=d[s.Sa].split(o);q.M=[];for(o=0;o<E;o++)if((D=u[o])&&D!=="none"){C=s[o].split(" ");q.M.push({Hb:D+" "+x[o]+" "+y[o]+" / "+s[o]+" "+z[o]+" "+B[o],P:"image",Ab:(new f.v(D)).next().d,bb:x[o],$:new f.Ja((new f.v(y[o])).all()),Wa:z[o],ub:B[o],Xa:new f.Ka(C[0],C[1])})}}});return q.color||q.M[0]?q:null},Bc:function(a){var b=f.ja>8,c=this.eb,d=this.e.runtimeStyle,e=d[c.da],g=d[c.z],j=d[c.T],i,h,k,n;if(e)d[c.da]="";if(g)d[c.z]="";if(j)d[c.T]=
+"";if(b){i=d[c.Ma];h=d[c.Pa];n=d[c.S];k=d[c.Sa];if(i)d[c.Ma]="";if(h)d[c.Pa]="";if(n)d[c.S]="";if(k)d[c.Sa]=""}a=a.call(this);if(e)d[c.da]=e;if(g)d[c.z]=g;if(j)d[c.T]=j;if(b){if(i)d[c.Ma]=i;if(h)d[c.Pa]=h;if(n)d[c.S]=n;if(k)d[c.Sa]=k}return a},ia:f.B.va(function(){return this.wb()||this.Bc(function(){var a=this.e.currentStyle,b=this.eb;return a[b.z]+" "+a[b.da]+" "+a[b.T]+" "+a[b.S+"X"]+" "+a[b.S+"Y"]})}),wb:f.B.va(function(){var a=this.e;return a.style[this.Fa]||a.currentStyle.getAttribute(this.wa)}),
+qc:function(){var a=0;if(f.O<7){a=this.e;a=""+(a.style[f.nb+"PngFix"]||a.currentStyle.getAttribute(f.F+"png-fix"))==="true"}return a},i:f.B.va(function(){return(this.wb()||this.qc())&&!!this.j()})});f.Vb=f.B.ka({wc:["Top","Right","Bottom","Left"],Id:{thin:"1px",medium:"3px",thick:"5px"},la:function(){var a={},b={},c={},d=false,e=true,g=true,j=true;this.Cc(function(){for(var i=this.e.currentStyle,h=0,k,n,m,p,r,t,v;h<4;h++){m=this.wc[h];v=m.charAt(0).toLowerCase();k=b[v]=i["border"+m+"Style"];n=i["border"+
+m+"Color"];m=i["border"+m+"Width"];if(h>0){if(k!==p)g=false;if(n!==r)e=false;if(m!==t)j=false}p=k;r=n;t=m;c[v]=f.ha(n);m=a[v]=f.n(b[v]==="none"?"0":this.Id[m]||m);if(m.a(this.e)>0)d=true}});return d?{J:a,Zd:b,gd:c,ee:j,hd:e,$d:g}:null},ia:f.B.va(function(){var a=this.e,b=a.currentStyle,c;a.tagName in f.Ac&&a.offsetParent.currentStyle.borderCollapse==="collapse"||this.Cc(function(){c=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor});return c}),Cc:function(a){var b=this.e.runtimeStyle,c=b.borderWidth,
+d=b.borderColor;if(c)b.borderWidth="";if(d)b.borderColor="";a=a.call(this);if(c)b.borderWidth=c;if(d)b.borderColor=d;return a}});(function(){f.jb=f.B.ka({wa:"border-radius",Fa:"borderRadius",la:function(b){var c=null,d,e,g,j,i=false;if(b){e=new f.v(b);var h=function(){for(var k=[],n;(g=e.next())&&g.W();){j=f.n(g.d);n=j.ic();if(n<0)return null;if(n>0)i=true;k.push(j)}return k.length>0&&k.length<5?{tl:k[0],tr:k[1]||k[0],br:k[2]||k[0],bl:k[3]||k[1]||k[0]}:null};if(b=h()){if(g){if(g.k&f.v.qa.pa&&g.d===
+"/")d=h()}else d=b;if(i&&b&&d)c={x:b,y:d}}}return c}});var a=f.n("0");a={tl:a,tr:a,br:a,bl:a};f.jb.Dc={x:a,y:a}})();f.Ub=f.B.ka({wa:"border-image",Fa:"borderImage",fb:{stretch:1,round:1,repeat:1,space:1},la:function(a){var b=null,c,d,e,g,j,i,h=0,k=f.v.qa,n=k.na,m=k.oa,p=k.Ra;if(a){c=new f.v(a);b={};for(var r=function(l){return l&&l.k&k.pa&&l.d==="/"},t=function(l){return l&&l.k&n&&l.d==="fill"},v=function(){g=c.ma(function(l){return!(l.k&(m|p))});if(t(c.next())&&!b.fill)b.fill=true;else c.D();if(r(c.next())){h++;
+j=c.ma(function(l){return!l.W()&&!(l.k&n&&l.d==="auto")});if(r(c.next())){h++;i=c.ma(function(l){return!l.Ca()})}}else c.D()};a=c.next();){d=a.k;e=a.d;if(d&(m|p)&&!g){c.D();v()}else if(t(a)&&!b.fill){b.fill=true;v()}else if(d&n&&this.fb[e]&&!b.repeat){b.repeat={f:e};if(a=c.next())if(a.k&n&&this.fb[a.d])b.repeat.Ob=a.d;else c.D()}else if(d&k.URL&&!b.src)b.src=e;else return null}if(!b.src||!g||g.length<1||g.length>4||j&&j.length>4||h===1&&j.length<1||i&&i.length>4||h===2&&i.length<1)return null;if(!b.repeat)b.repeat=
+{f:"stretch"};if(!b.repeat.Ob)b.repeat.Ob=b.repeat.f;a=function(l,q){return{t:q(l[0]),r:q(l[1]||l[0]),b:q(l[2]||l[0]),l:q(l[3]||l[1]||l[0])}};b.slice=a(g,function(l){return f.n(l.k&m?l.d+"px":l.d)});if(j&&j[0])b.J=a(j,function(l){return l.W()?f.n(l.d):l.d});if(i&&i[0])b.Da=a(i,function(l){return l.Ca()?f.n(l.d):l.d})}return b}});f.Ic=f.B.ka({wa:"box-shadow",Fa:"boxShadow",la:function(a){var b,c=f.n,d=f.v.qa,e;if(a){e=new f.v(a);b={Da:[],Bb:[]};for(a=function(){for(var g,j,i,h,k,n;g=e.next();){i=g.d;
+j=g.k;if(j&d.pa&&i===",")break;else if(g.Ca()&&!k){e.D();k=e.ma(function(m){return!m.Ca()})}else if(j&d.z&&!h)h=i;else if(j&d.na&&i==="inset"&&!n)n=true;else return false}g=k&&k.length;if(g>1&&g<5){(n?b.Bb:b.Da).push({fe:c(k[0].d),ge:c(k[1].d),blur:c(k[2]?k[2].d:"0"),Vd:c(k[3]?k[3].d:"0"),color:f.ha(h||"currentColor")});return true}return false};a(););}return b&&(b.Bb.length||b.Da.length)?b:null}});f.Uc=f.B.ka({ia:f.B.va(function(){var a=this.e.currentStyle;return a.visibility+"|"+a.display}),la:function(){var a=
+this.e,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,d;b.visibility="";d=a.visibility;b.visibility=c;return{ce:d!=="hidden",nd:a.display!=="none"}},i:function(){return false}});f.u={R:function(a){function b(c,d,e,g){this.e=c;this.s=d;this.g=e;this.parent=g}f.p.Eb(b.prototype,f.u,a);return b},Cb:false,Q:function(){return false},Ea:f.aa,Lb:function(){this.m();this.i()&&this.V()},ib:function(){this.Cb=true},Mb:function(){this.i()?this.V():this.m()},sb:function(a,b){this.vc(a);for(var c=this.ra||
+(this.ra=[]),d=a+1,e=c.length,g;d<e;d++)if(g=c[d])break;c[a]=b;this.I().insertBefore(b,g||null)},za:function(a){var b=this.ra;return b&&b[a]||null},vc:function(a){var b=this.za(a),c=this.Ta;if(b&&c){c.removeChild(b);this.ra[a]=null}},Aa:function(a,b,c,d){var e=this.rb||(this.rb={}),g=e[a];if(!g){g=e[a]=f.p.Za("shape");if(b)g.appendChild(g[b]=f.p.Za(b));if(d){c=this.za(d);if(!c){this.sb(d,doc.createElement("group"+d));c=this.za(d)}}c.appendChild(g);a=g.style;a.position="absolute";a.left=a.top=0;a.behavior=
+"url(#default#VML)"}return g},vb:function(a){var b=this.rb,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},kc:function(a){var b=this.e,c=this.s.o(),d=c.h,e=c.f,g,j,i,h,k,n;c=a.x.tl.a(b,d);g=a.y.tl.a(b,e);j=a.x.tr.a(b,d);i=a.y.tr.a(b,e);h=a.x.br.a(b,d);k=a.y.br.a(b,e);n=a.x.bl.a(b,d);a=a.y.bl.a(b,e);d=Math.min(d/(c+j),e/(i+k),d/(n+h),e/(g+a));if(d<1){c*=d;g*=d;j*=d;i*=d;h*=d;k*=d;n*=d;a*=d}return{x:{tl:c,tr:j,br:h,bl:n},y:{tl:g,tr:i,br:k,bl:a}}},ya:function(a,b,c){b=b||1;var d,e,
+g=this.s.o();e=g.h*b;g=g.f*b;var j=this.g.G,i=Math.floor,h=Math.ceil,k=a?a.Jb*b:0,n=a?a.Ib*b:0,m=a?a.tb*b:0;a=a?a.Db*b:0;var p,r,t,v,l;if(c||j.i()){d=this.kc(c||j.j());c=d.x.tl*b;j=d.y.tl*b;p=d.x.tr*b;r=d.y.tr*b;t=d.x.br*b;v=d.y.br*b;l=d.x.bl*b;b=d.y.bl*b;e="m"+i(a)+","+i(j)+"qy"+i(c)+","+i(k)+"l"+h(e-p)+","+i(k)+"qx"+h(e-n)+","+i(r)+"l"+h(e-n)+","+h(g-v)+"qy"+h(e-t)+","+h(g-m)+"l"+i(l)+","+h(g-m)+"qx"+i(a)+","+h(g-b)+" x e"}else e="m"+i(a)+","+i(k)+"l"+h(e-n)+","+i(k)+"l"+h(e-n)+","+h(g-m)+"l"+i(a)+
+","+h(g-m)+"xe";return e},I:function(){var a=this.parent.za(this.N),b;if(!a){a=doc.createElement(this.Ya);b=a.style;b.position="absolute";b.top=b.left=0;this.parent.sb(this.N,a)}return a},mc:function(){var a=this.e,b=a.currentStyle,c=a.runtimeStyle,d=a.tagName,e=f.O===6,g;if(e&&(d in f.cc||d==="FIELDSET")||d==="BUTTON"||d==="INPUT"&&a.type in f.Gd){c.borderWidth="";d=this.g.w.wc;for(g=d.length;g--;){e=d[g];c["padding"+e]="";c["padding"+e]=f.n(b["padding"+e]).a(a)+f.n(b["border"+e+"Width"]).a(a)+(f.O!==
+8&&g%2?1:0)}c.borderWidth=0}else if(e){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){b=doc.createElement("ie6-mask");d=b.style;d.visibility="visible";for(d.zoom=1;d=a.firstChild;)b.appendChild(d);a.appendChild(b);c.visibility="hidden"}}else c.borderColor="transparent"},ie:function(){},m:function(){this.parent.vc(this.N);delete this.rb;delete this.ra}};f.Rc=f.u.R({i:function(){var a=this.ed;for(var b in a)if(a.hasOwnProperty(b)&&a[b].i())return true;return false},Q:function(){return this.g.Pb.H()},
+ib:function(){if(this.i()){var a=this.jc(),b=a,c;a=a.currentStyle;var d=a.position,e=this.I().style,g=0,j=0;j=this.s.o();var i=j.Hd;if(d==="fixed"&&f.O>6){g=j.x*i;j=j.y*i;b=d}else{do b=b.offsetParent;while(b&&b.currentStyle.position==="static");if(b){c=b.getBoundingClientRect();b=b.currentStyle;g=(j.x-c.left)*i-(parseFloat(b.borderLeftWidth)||0);j=(j.y-c.top)*i-(parseFloat(b.borderTopWidth)||0)}else{b=doc.documentElement;g=(j.x+b.scrollLeft-b.clientLeft)*i;j=(j.y+b.scrollTop-b.clientTop)*i}b="absolute"}e.position=
+b;e.left=g;e.top=j;e.zIndex=d==="static"?-1:a.zIndex;this.Cb=true}},Mb:f.aa,Nb:function(){var a=this.g.Pb.j();this.I().style.display=a.ce&&a.nd?"":"none"},Lb:function(){this.i()?this.Nb():this.m()},jc:function(){var a=this.e;return a.tagName in f.Ac?a.offsetParent:a},I:function(){var a=this.Ta,b;if(!a){b=this.jc();a=this.Ta=doc.createElement("css3-container");a.style.direction="ltr";this.Nb();b.parentNode.insertBefore(a,b)}return a},ab:f.aa,m:function(){var a=this.Ta,b;if(a&&(b=a.parentNode))b.removeChild(a);
+delete this.Ta;delete this.ra}});f.Fc=f.u.R({N:2,Ya:"background",Q:function(){var a=this.g;return a.C.H()||a.G.H()},i:function(){var a=this.g;return a.q.i()||a.G.i()||a.C.i()||a.ga.i()&&a.ga.j().Bb},V:function(){var a=this.s.o();if(a.h&&a.f){this.od();this.pd()}},od:function(){var a=this.g.C.j(),b=this.s.o(),c=this.e,d=a&&a.color,e,g;if(d&&d.fa()>0){this.lc();a=this.Aa("bgColor","fill",this.I(),1);e=b.h;b=b.f;a.stroked=false;a.coordsize=e*2+","+b*2;a.coordorigin="1,1";a.path=this.ya(null,2);g=a.style;
+g.width=e;g.height=b;a.fill.color=d.U(c);c=d.fa();if(c<1)a.fill.opacity=c}else this.vb("bgColor")},pd:function(){var a=this.g.C.j(),b=this.s.o();a=a&&a.M;var c,d,e,g,j;if(a){this.lc();d=b.h;e=b.f;for(j=a.length;j--;){b=a[j];c=this.Aa("bgImage"+j,"fill",this.I(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=d*2+","+e*2;c.coordorigin="1,1";c.path=this.ya(0,2);g=c.style;g.width=d;g.height=e;if(b.P==="linear-gradient")this.bd(c,b);else{c.fill.src=b.Ab;this.Nd(c,j)}}}for(j=a?a.length:
+0;this.vb("bgImage"+j++););},Nd:function(a,b){var c=this;f.p.Rb(a.fill.src,function(d){var e=c.e,g=c.s.o(),j=g.h;g=g.f;if(j&&g){var i=a.fill,h=c.g,k=h.w.j(),n=k&&k.J;k=n?n.t.a(e):0;var m=n?n.r.a(e):0,p=n?n.b.a(e):0;n=n?n.l.a(e):0;h=h.C.j().M[b];e=h.$?h.$.coords(e,j-d.h-n-m,g-d.f-k-p):{x:0,y:0};h=h.bb;p=m=0;var r=j+1,t=g+1,v=f.O===8?0:1;n=Math.round(e.x)+n+0.5;k=Math.round(e.y)+k+0.5;i.position=n/j+","+k/g;i.size.x=1;i.size=d.h+"px,"+d.f+"px";if(h&&h!=="repeat"){if(h==="repeat-x"||h==="no-repeat"){m=
+k+1;t=k+d.f+v}if(h==="repeat-y"||h==="no-repeat"){p=n+1;r=n+d.h+v}a.style.clip="rect("+m+"px,"+r+"px,"+t+"px,"+p+"px)"}}})},bd:function(a,b){var c=this.e,d=this.s.o(),e=d.h,g=d.f;a=a.fill;d=b.ca;var j=d.length,i=Math.PI,h=f.Na,k=h.tc,n=h.dc;b=h.gc(c,e,g,b);h=b.sa;var m=b.xc,p=b.yc,r=b.Wd,t=b.Xd,v=b.rd,l=b.sd,q=b.kd,s=b.ld;b=b.rc;e=h%90?Math.atan2(q*e/g,s)/i*180:h+90;e+=180;e%=360;v=k(r,t,h,v,l);g=n(r,t,v[0],v[1]);i=[];v=k(m,p,h,r,t);n=n(m,p,v[0],v[1])/g*100;k=[];for(h=0;h<j;h++)k.push(d[h].db?d[h].db.a(c,
+b):h===0?0:h===j-1?b:null);for(h=1;h<j;h++){if(k[h]===null){m=k[h-1];b=h;do p=k[++b];while(p===null);k[h]=m+(p-m)/(b-h+1)}k[h]=Math.max(k[h],k[h-1])}for(h=0;h<j;h++)i.push(n+k[h]/g*100+"% "+d[h].color.U(c));a.angle=e;a.type="gradient";a.method="sigma";a.color=d[0].color.U(c);a.color2=d[j-1].color.U(c);if(a.colors)a.colors.value=i.join(",");else a.colors=i.join(",")},lc:function(){var a=this.e.runtimeStyle;a.backgroundImage="url(about:blank)";a.backgroundColor="transparent"},m:function(){f.u.m.call(this);
+var a=this.e.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});f.Gc=f.u.R({N:4,Ya:"border",Q:function(){var a=this.g;return a.w.H()||a.G.H()},i:function(){var a=this.g;return a.G.i()&&!a.q.i()&&a.w.i()},V:function(){var a=this.e,b=this.g.w.j(),c=this.s.o(),d=c.h;c=c.f;var e,g,j,i,h;if(b){this.mc();b=this.wd(2);i=0;for(h=b.length;i<h;i++){j=b[i];e=this.Aa("borderPiece"+i,j.stroke?"stroke":"fill",this.I());e.coordsize=d*2+","+c*2;e.coordorigin="1,1";e.path=j.path;g=e.style;g.width=d;g.height=c;
+e.filled=!!j.fill;e.stroked=!!j.stroke;if(j.stroke){e=e.stroke;e.weight=j.Qb+"px";e.color=j.color.U(a);e.dashstyle=j.stroke==="dashed"?"2 2":j.stroke==="dotted"?"1 1":"solid";e.linestyle=j.stroke==="double"&&j.Qb>2?"ThinThin":"Single"}else e.fill.color=j.fill.U(a)}for(;this.vb("borderPiece"+i++););}},wd:function(a){var b=this.e,c,d,e,g=this.g.w,j=[],i,h,k,n,m=Math.round,p,r,t;if(g.i()){c=g.j();g=c.J;r=c.Zd;t=c.gd;if(c.ee&&c.$d&&c.hd){if(t.t.fa()>0){c=g.t.a(b);k=c/2;j.push({path:this.ya({Jb:k,Ib:k,
+tb:k,Db:k},a),stroke:r.t,color:t.t,Qb:c})}}else{a=a||1;c=this.s.o();d=c.h;e=c.f;c=m(g.t.a(b));k=m(g.r.a(b));n=m(g.b.a(b));b=m(g.l.a(b));var v={t:c,r:k,b:n,l:b};b=this.g.G;if(b.i())p=this.kc(b.j());i=Math.floor;h=Math.ceil;var l=function(o,u){return p?p[o][u]:0},q=function(o,u,x,y,z,B){var E=l("x",o),D=l("y",o),C=o.charAt(1)==="r";o=o.charAt(0)==="b";return E>0&&D>0?(B?"al":"ae")+(C?h(d-E):i(E))*a+","+(o?h(e-D):i(D))*a+","+(i(E)-u)*a+","+(i(D)-x)*a+","+y*65535+","+2949075*(z?1:-1):(B?"m":"l")+(C?d-
+u:u)*a+","+(o?e-x:x)*a},s=function(o,u,x,y){var z=o==="t"?i(l("x","tl"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+i(l("y","tr"))*a:o==="b"?h(d-l("x","br"))*a+","+i(e-u)*a:i(u)*a+","+h(e-l("y","bl"))*a;o=o==="t"?h(d-l("x","tr"))*a+","+h(u)*a:o==="r"?h(d-u)*a+","+h(e-l("y","br"))*a:o==="b"?i(l("x","bl"))*a+","+i(e-u)*a:i(u)*a+","+i(l("y","tl"))*a;return x?(y?"m"+o:"")+"l"+z:(y?"m"+z:"")+"l"+o};b=function(o,u,x,y,z,B){var E=o==="l"||o==="r",D=v[o],C,F;if(D>0&&r[o]!=="none"&&t[o].fa()>0){C=v[E?o:u];u=v[E?u:
+o];F=v[E?o:x];x=v[E?x:o];if(r[o]==="dashed"||r[o]==="dotted"){j.push({path:q(y,C,u,B+45,0,1)+q(y,0,0,B,1,0),fill:t[o]});j.push({path:s(o,D/2,0,1),stroke:r[o],Qb:D,color:t[o]});j.push({path:q(z,F,x,B,0,1)+q(z,0,0,B-45,1,0),fill:t[o]})}else j.push({path:q(y,C,u,B+45,0,1)+s(o,D,0,0)+q(z,F,x,B,0,0)+(r[o]==="double"&&D>2?q(z,F-i(F/3),x-i(x/3),B-45,1,0)+s(o,h(D/3*2),1,0)+q(y,C-i(C/3),u-i(u/3),B,1,0)+"x "+q(y,i(C/3),i(u/3),B+45,0,1)+s(o,i(D/3),1,0)+q(z,i(F/3),i(x/3),B,0,0):"")+q(z,0,0,B-45,1,0)+s(o,0,1,
+0)+q(y,0,0,B,1,0),fill:t[o]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return j},m:function(){if(this.ec||!this.g.q.i())this.e.runtimeStyle.borderColor="";f.u.m.call(this)}});f.Tb=f.u.R({N:5,Md:["t","tr","r","br","b","bl","l","tl","c"],Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){this.I();var a=this.g.q.j(),b=this.g.w.j(),c=this.s.o(),d=this.e,e=this.uc;f.p.Rb(a.src,function(g){function j(s,
+o,u,x,y){s=e[s].style;var z=Math.max;s.width=z(o,0);s.height=z(u,0);s.left=x;s.top=y}function i(s,o,u){for(var x=0,y=s.length;x<y;x++)e[s[x]].imagedata[o]=u}var h=c.h,k=c.f,n=f.n("0"),m=a.J||(b?b.J:{t:n,r:n,b:n,l:n});n=m.t.a(d);var p=m.r.a(d),r=m.b.a(d);m=m.l.a(d);var t=a.slice,v=t.t.a(d),l=t.r.a(d),q=t.b.a(d);t=t.l.a(d);j("tl",m,n,0,0);j("t",h-m-p,n,m,0);j("tr",p,n,h-p,0);j("r",p,k-n-r,h-p,n);j("br",p,r,h-p,k-r);j("b",h-m-p,r,m,k-r);j("bl",m,r,0,k-r);j("l",m,k-n-r,0,n);j("c",h-m-p,k-n-r,m,n);i(["tl",
+"t","tr"],"cropBottom",(g.f-v)/g.f);i(["tl","l","bl"],"cropRight",(g.h-t)/g.h);i(["bl","b","br"],"cropTop",(g.f-q)/g.f);i(["tr","r","br"],"cropLeft",(g.h-l)/g.h);i(["l","r","c"],"cropTop",v/g.f);i(["l","r","c"],"cropBottom",q/g.f);i(["t","b","c"],"cropLeft",t/g.h);i(["t","b","c"],"cropRight",l/g.h);e.c.style.display=a.fill?"":"none"},this)},I:function(){var a=this.parent.za(this.N),b,c,d,e=this.Md,g=e.length;if(!a){a=doc.createElement("border-image");b=a.style;b.position="absolute";this.uc={};for(d=
+0;d<g;d++){c=this.uc[e[d]]=f.p.Za("rect");c.appendChild(f.p.Za("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.g.q.j().src;c.stroked=false;c.filled=false;a.appendChild(c)}this.parent.sb(this.N,a)}return a},Ea:function(){if(this.i()){var a=this.e,b=a.runtimeStyle,c=this.g.q.j().J;b.borderStyle="solid";if(c){b.borderTopWidth=c.t.a(a)+"px";b.borderRightWidth=c.r.a(a)+"px";b.borderBottomWidth=c.b.a(a)+"px";b.borderLeftWidth=c.l.a(a)+"px"}this.mc()}},
+m:function(){var a=this.e.runtimeStyle;a.borderStyle="";if(this.ec||!this.g.w.i())a.borderColor=a.borderWidth="";f.u.m.call(this)}});f.Hc=f.u.R({N:1,Ya:"outset-box-shadow",Q:function(){var a=this.g;return a.ga.H()||a.G.H()},i:function(){var a=this.g.ga;return a.i()&&a.j().Da[0]},V:function(){function a(C,F,O,H,M,P,I){C=b.Aa("shadow"+C+F,"fill",d,j-C);F=C.fill;C.coordsize=n*2+","+m*2;C.coordorigin="1,1";C.stroked=false;C.filled=true;F.color=M.U(c);if(P){F.type="gradienttitle";F.color2=F.color;F.opacity=
+0}C.path=I;l=C.style;l.left=O;l.top=H;l.width=n;l.height=m;return C}var b=this,c=this.e,d=this.I(),e=this.g,g=e.ga.j().Da;e=e.G.j();var j=g.length,i=j,h,k=this.s.o(),n=k.h,m=k.f;k=f.O===8?1:0;for(var p=["tl","tr","br","bl"],r,t,v,l,q,s,o,u,x,y,z,B,E,D;i--;){t=g[i];q=t.fe.a(c);s=t.ge.a(c);h=t.Vd.a(c);o=t.blur.a(c);t=t.color;u=-h-o;if(!e&&o)e=f.jb.Dc;u=this.ya({Jb:u,Ib:u,tb:u,Db:u},2,e);if(o){x=(h+o)*2+n;y=(h+o)*2+m;z=x?o*2/x:0;B=y?o*2/y:0;if(o-h>n/2||o-h>m/2)for(h=4;h--;){r=p[h];E=r.charAt(0)==="b";
+D=r.charAt(1)==="r";r=a(i,r,q,s,t,o,u);v=r.fill;v.focusposition=(D?1-z:z)+","+(E?1-B:B);v.focussize="0,0";r.style.clip="rect("+((E?y/2:0)+k)+"px,"+(D?x:x/2)+"px,"+(E?y:y/2)+"px,"+((D?x/2:0)+k)+"px)"}else{r=a(i,"",q,s,t,o,u);v=r.fill;v.focusposition=z+","+B;v.focussize=1-z*2+","+(1-B*2)}}else{r=a(i,"",q,s,t,o,u);q=t.fa();if(q<1)r.fill.opacity=q}}}});f.Pc=f.u.R({N:6,Ya:"imgEl",Q:function(){var a=this.g;return this.e.src!==this.Xc||a.G.H()},i:function(){var a=this.g;return a.G.i()||a.C.qc()},V:function(){this.Xc=
+j;this.Cd();var a=this.Aa("img","fill",this.I()),b=a.fill,c=this.s.o(),d=c.h;c=c.f;var e=this.g.w.j(),g=e&&e.J;e=this.e;var j=e.src,i=Math.round,h=e.currentStyle,k=f.n;if(!g||f.O<7){g=f.n("0");g={t:g,r:g,b:g,l:g}}a.stroked=false;b.type="frame";b.src=j;b.position=(d?0.5/d:0)+","+(c?0.5/c:0);a.coordsize=d*2+","+c*2;a.coordorigin="1,1";a.path=this.ya({Jb:i(g.t.a(e)+k(h.paddingTop).a(e)),Ib:i(g.r.a(e)+k(h.paddingRight).a(e)),tb:i(g.b.a(e)+k(h.paddingBottom).a(e)),Db:i(g.l.a(e)+k(h.paddingLeft).a(e))},
+2);a=a.style;a.width=d;a.height=c},Cd:function(){this.e.runtimeStyle.filter="alpha(opacity=0)"},m:function(){f.u.m.call(this);this.e.runtimeStyle.filter=""}});f.Oc=f.u.R({ib:f.aa,Mb:f.aa,Nb:f.aa,Lb:f.aa,Ld:/^,+|,+$/g,Fd:/,+/g,gb:function(a,b){(this.pb||(this.pb=[]))[a]=b||void 0},ab:function(){var a=this.pb,b;if(a&&(b=a.join(",").replace(this.Ld,"").replace(this.Fd,","))!==this.Wc)this.Wc=this.e.runtimeStyle.background=b},m:function(){this.e.runtimeStyle.background="";delete this.pb}});f.Mc=f.u.R({ua:1,
+Q:function(){return this.g.C.H()},i:function(){var a=this.g;return a.C.i()||a.q.i()},V:function(){var a=this.g.C.j(),b,c,d=0,e,g;if(a){b=[];if(c=a.M)for(;e=c[d++];)if(e.P==="linear-gradient"){g=this.vd(e.Wa);g=(e.Xa||f.Ka.Kc).a(this.e,g.h,g.f,g.h,g.f);b.push("url(data:image/svg+xml,"+escape(this.xd(e,g.h,g.f))+") "+this.dd(e.$)+" / "+g.h+"px "+g.f+"px "+(e.bc||"")+" "+(e.Wa||"")+" "+(e.ub||""))}else b.push(e.Hb);a.color&&b.push(a.color.Y);this.parent.gb(this.ua,b.join(","))}},dd:function(a){return a?
+a.X.map(function(b){return b.d}).join(" "):"0 0"},vd:function(a){var b=this.e,c=this.s.o(),d=c.h;c=c.f;var e;if(a!=="border-box")if((e=this.g.w.j())&&(e=e.J)){d-=e.l.a(b)+e.l.a(b);c-=e.t.a(b)+e.b.a(b)}if(a==="content-box"){a=f.n;e=b.currentStyle;d-=a(e.paddingLeft).a(b)+a(e.paddingRight).a(b);c-=a(e.paddingTop).a(b)+a(e.paddingBottom).a(b)}return{h:d,f:c}},xd:function(a,b,c){var d=this.e,e=a.ca,g=e.length,j=f.Na.gc(d,b,c,a);a=j.xc;var i=j.yc,h=j.td,k=j.ud;j=j.rc;var n,m,p,r,t;n=[];for(m=0;m<g;m++)n.push(e[m].db?
+e[m].db.a(d,j):m===0?0:m===g-1?j:null);for(m=1;m<g;m++)if(n[m]===null){r=n[m-1];p=m;do t=n[++p];while(t===null);n[m]=r+(t-r)/(p-m+1)}b=['<svg width="'+b+'" height="'+c+'" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="g" gradientUnits="userSpaceOnUse" x1="'+a/b*100+'%" y1="'+i/c*100+'%" x2="'+h/b*100+'%" y2="'+k/c*100+'%">'];for(m=0;m<g;m++)b.push('<stop offset="'+n[m]/j+'" stop-color="'+e[m].color.U(d)+'" stop-opacity="'+e[m].color.fa()+'"/>');b.push('</linearGradient></defs><rect width="100%" height="100%" fill="url(#g)"/></svg>');
+return b.join("")},m:function(){this.parent.gb(this.ua)}});f.Nc=f.u.R({T:"repeat",Sc:"stretch",Qc:"round",ua:0,Q:function(){return this.g.q.H()},i:function(){return this.g.q.i()},V:function(){var a=this,b=a.g.q.j(),c=a.g.w.j(),d=a.s.o(),e=b.repeat,g=e.f,j=e.Ob,i=a.e,h=0;f.p.Rb(b.src,function(k){function n(Q,R,U,V,W,Y,X,S,w,A){K.push('<pattern patternUnits="userSpaceOnUse" id="pattern'+G+'" x="'+(g===l?Q+U/2-w/2:Q)+'" y="'+(j===l?R+V/2-A/2:R)+'" width="'+w+'" height="'+A+'"><svg width="'+w+'" height="'+
+A+'" viewBox="'+W+" "+Y+" "+X+" "+S+'" preserveAspectRatio="none"><image xlink:href="'+v+'" x="0" y="0" width="'+r+'" height="'+t+'" /></svg></pattern>');J.push('<rect x="'+Q+'" y="'+R+'" width="'+U+'" height="'+V+'" fill="url(#pattern'+G+')" />');G++}var m=d.h,p=d.f,r=k.h,t=k.f,v=a.Dd(b.src,r,t),l=a.T,q=a.Sc;k=a.Qc;var s=Math.ceil,o=f.n("0"),u=b.J||(c?c.J:{t:o,r:o,b:o,l:o});o=u.t.a(i);var x=u.r.a(i),y=u.b.a(i);u=u.l.a(i);var z=b.slice,B=z.t.a(i),E=z.r.a(i),D=z.b.a(i);z=z.l.a(i);var C=m-u-x,F=p-o-
+y,O=r-z-E,H=t-B-D,M=g===q?C:O*o/B,P=j===q?F:H*x/E,I=g===q?C:O*y/D;q=j===q?F:H*u/z;var K=[],J=[],G=0;if(g===k){M-=(M-(C%M||M))/s(C/M);I-=(I-(C%I||I))/s(C/I)}if(j===k){P-=(P-(F%P||P))/s(F/P);q-=(q-(F%q||q))/s(F/q)}k=['<svg width="'+m+'" height="'+p+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'];n(0,0,u,o,0,0,z,B,u,o);n(u,0,C,o,z,0,O,B,M,o);n(m-x,0,x,o,r-E,0,E,B,x,o);n(0,o,u,F,0,B,z,H,u,q);if(b.fill)n(u,o,C,F,z,B,O,H,M||I||O,q||P||H);n(m-x,o,x,F,r-E,B,E,H,x,P);n(0,
+p-y,u,y,0,t-D,z,D,u,y);n(u,p-y,C,y,z,t-D,O,D,I,y);n(m-x,p-y,x,y,r-E,t-D,E,D,x,y);k.push("<defs>"+K.join("\n")+"</defs>"+J.join("\n")+"</svg>");a.parent.gb(a.ua,"url(data:image/svg+xml,"+escape(k.join(""))+") no-repeat border-box border-box");h&&a.parent.ab()},a);h=1},Dd:function(){var a={};return function(b,c,d){var e=a[b],g;if(!e){e=new Image;g=doc.createElement("canvas");e.src=b;g.width=c;g.height=d;g.getContext("2d").drawImage(e,0,0);e=a[b]=g.toDataURL()}return e}}(),Ea:f.Tb.prototype.Ea,m:function(){var a=
+this.e.runtimeStyle;this.parent.gb(this.ua);a.borderColor=a.borderStyle=a.borderWidth=""}});f.kb=function(){function a(l,q){l.className+=" "+q}function b(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;)a(l,q[s])},0)}function c(l){var q=v.slice.call(arguments,1),s=q.length;setTimeout(function(){if(l)for(;s--;){var o=q[s];o=t[o]||(t[o]=new RegExp("\\b"+o+"\\b","g"));l.className=l.className.replace(o,"")}},0)}function d(l){function q(){if(!U){var w,A,L=f.ja,T=l.currentStyle,
+N=T.getAttribute(g)==="true",da=T.getAttribute(i)!=="false",ea=T.getAttribute(h)!=="false";S=T.getAttribute(j);S=L>7?S!=="false":S==="true";if(!R){R=1;l.runtimeStyle.zoom=1;T=l;for(var fa=1;T=T.previousSibling;)if(T.nodeType===1){fa=0;break}fa&&a(l,p)}J.cb();if(N&&(A=J.o())&&(w=doc.documentElement||doc.body)&&(A.y>w.clientHeight||A.x>w.clientWidth||A.y+A.f<0||A.x+A.h<0)){if(!Y){Y=1;f.mb.ba(q)}}else{U=1;Y=R=0;f.mb.Ha(q);if(L===9){G={C:new f.Sb(l),q:new f.Ub(l),w:new f.Vb(l)};Q=[G.C,G.q];K=new f.Oc(l,
+J,G);w=[new f.Mc(l,J,G,K),new f.Nc(l,J,G,K)]}else{G={C:new f.Sb(l),w:new f.Vb(l),q:new f.Ub(l),G:new f.jb(l),ga:new f.Ic(l),Pb:new f.Uc(l)};Q=[G.C,G.w,G.q,G.G,G.ga,G.Pb];K=new f.Rc(l,J,G);w=[new f.Hc(l,J,G,K),new f.Fc(l,J,G,K),new f.Gc(l,J,G,K),new f.Tb(l,J,G,K)];l.tagName==="IMG"&&w.push(new f.Pc(l,J,G,K));K.ed=w}I=[K].concat(w);if(w=l.currentStyle.getAttribute(f.F+"watch-ancestors")){w=parseInt(w,10);A=0;for(N=l.parentNode;N&&(w==="NaN"||A++<w);){H(N,"onpropertychange",C);H(N,"onmouseenter",x);
+H(N,"onmouseleave",y);H(N,"onmousedown",z);if(N.tagName in f.fc){H(N,"onfocus",E);H(N,"onblur",D)}N=N.parentNode}}if(S){f.Oa.ba(o);f.Oa.Rd()}o(1)}if(!V){V=1;L<9&&H(l,"onmove",s);H(l,"onresize",s);H(l,"onpropertychange",u);ea&&H(l,"onmouseenter",x);if(ea||da)H(l,"onmouseleave",y);da&&H(l,"onmousedown",z);if(l.tagName in f.fc){H(l,"onfocus",E);H(l,"onblur",D)}f.Qa.ba(s);f.L.ba(M)}J.hb()}}function s(){J&&J.Ad()&&o()}function o(w){if(!X)if(U){var A,L=I.length;F();for(A=0;A<L;A++)I[A].Ea();if(w||J.Od())for(A=
+0;A<L;A++)I[A].ib();if(w||J.Td())for(A=0;A<L;A++)I[A].Mb();K.ab();O()}else R||q()}function u(){var w,A=I.length,L;w=event;if(!X&&!(w&&w.propertyName in r))if(U){F();for(w=0;w<A;w++)I[w].Ea();for(w=0;w<A;w++){L=I[w];L.Cb||L.ib();L.Q()&&L.Lb()}K.ab();O()}else R||q()}function x(){b(l,k)}function y(){c(l,k,n)}function z(){b(l,n);f.lb.ba(B)}function B(){c(l,n);f.lb.Ha(B)}function E(){b(l,m)}function D(){c(l,m)}function C(){var w=event.propertyName;if(w==="className"||w==="id")u()}function F(){J.cb();for(var w=
+Q.length;w--;)Q[w].cb()}function O(){for(var w=Q.length;w--;)Q[w].hb();J.hb()}function H(w,A,L){w.attachEvent(A,L);W.push([w,A,L])}function M(){if(V){for(var w=W.length,A;w--;){A=W[w];A[0].detachEvent(A[1],A[2])}f.L.Ha(M);V=0;W=[]}}function P(){if(!X){var w,A;M();X=1;if(I){w=0;for(A=I.length;w<A;w++){I[w].ec=1;I[w].m()}}S&&f.Oa.Ha(o);f.Qa.Ha(o);I=J=G=Q=l=null}}var I,K,J=new ha(l),G,Q,R,U,V,W=[],Y,X,S;this.Ed=q;this.update=o;this.m=P;this.qd=l}var e={},g=f.F+"lazy-init",j=f.F+"poll",i=f.F+"track-active",
+h=f.F+"track-hover",k=f.La+"hover",n=f.La+"active",m=f.La+"focus",p=f.La+"first-child",r={background:1,bgColor:1,display:1},t={},v=[];d.yd=function(l){var q=f.p.Ba(l);return e[q]||(e[q]=new d(l))};d.m=function(l){l=f.p.Ba(l);var q=e[l];if(q){q.m();delete e[l]}};d.md=function(){var l=[],q;if(e){for(var s in e)if(e.hasOwnProperty(s)){q=e[s];l.push(q.qd);q.m()}e={}}return l};return d}();f.supportsVML=f.zc;f.attach=function(a){f.ja<10&&f.zc&&f.kb.yd(a).Ed()};f.detach=function(a){f.kb.m(a)}};
+})(); \ No newline at end of file
diff --git a/themes/mantra/js/PIE/PIE.php b/themes/mantra/js/PIE/PIE.php
new file mode 100644
index 00000000..9280626b
--- /dev/null
+++ b/themes/mantra/js/PIE/PIE.php
@@ -0,0 +1,19 @@
+<?php
+/*
+This file is a wrapper, for use in PHP environments, which serves PIE.htc using the
+correct content-type, so that IE will recognize it as a behavior. Simply specify the
+behavior property to fetch this .php file instead of the .htc directly:
+
+.myElement {
+ [ ...css3 properties... ]
+ behavior: url(PIE.php);
+}
+
+This is only necessary when the web server is not configured to serve .htc files with
+the text/x-component content-type, and cannot easily be configured to do so (as is the
+case with some shared hosting providers).
+*/
+
+header( 'Content-type: text/x-component' );
+include( 'PIE.htc' );
+?> \ No newline at end of file
diff --git a/themes/mantra/js/PIE/PIE_uncompressed.htc b/themes/mantra/js/PIE/PIE_uncompressed.htc
new file mode 100644
index 00000000..bf1a010b
--- /dev/null
+++ b/themes/mantra/js/PIE/PIE_uncompressed.htc
@@ -0,0 +1,4505 @@
+<!--
+PIE: CSS3 rendering for IE
+Version 1.0.0
+http://css3pie.com
+Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
+-->
+<PUBLIC:COMPONENT lightWeight="true">
+<!-- saved from url=(0014)about:internet -->
+<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" />
+<PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" />
+<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
+
+<script type="text/javascript">
+var doc = element.document;var PIE = window['PIE'];
+
+if( !PIE ) {
+ PIE = window['PIE'] = {
+ CSS_PREFIX: '-pie-',
+ STYLE_PREFIX: 'Pie',
+ CLASS_PREFIX: 'pie_',
+ tableCellTags: {
+ 'TD': 1,
+ 'TH': 1
+ },
+
+ /**
+ * Lookup table of elements which cannot take custom children.
+ */
+ childlessElements: {
+ 'TABLE':1,
+ 'THEAD':1,
+ 'TBODY':1,
+ 'TFOOT':1,
+ 'TR':1,
+ 'INPUT':1,
+ 'TEXTAREA':1,
+ 'SELECT':1,
+ 'OPTION':1,
+ 'IMG':1,
+ 'HR':1
+ },
+
+ /**
+ * Elements that can receive user focus
+ */
+ focusableElements: {
+ 'A':1,
+ 'INPUT':1,
+ 'TEXTAREA':1,
+ 'SELECT':1,
+ 'BUTTON':1
+ },
+
+ /**
+ * Values of the type attribute for input elements displayed as buttons
+ */
+ inputButtonTypes: {
+ 'submit':1,
+ 'button':1,
+ 'reset':1
+ },
+
+ emptyFn: function() {}
+ };
+
+ // Force the background cache to be used. No reason it shouldn't be.
+ try {
+ doc.execCommand( 'BackgroundImageCache', false, true );
+ } catch(e) {}
+
+ (function() {
+ /*
+ * IE version detection approach by James Padolsey, with modifications -- from
+ * http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/
+ */
+ var ieVersion = 4,
+ div = doc.createElement('div'),
+ all = div.getElementsByTagName('i'),
+ shape;
+ while (
+ div.innerHTML = '<!--[if gt IE ' + (++ieVersion) + ']><i></i><![endif]-->',
+ all[0]
+ ) {}
+ PIE.ieVersion = ieVersion;
+
+ // Detect IE6
+ if( ieVersion === 6 ) {
+ // IE6 can't access properties with leading dash, but can without it.
+ PIE.CSS_PREFIX = PIE.CSS_PREFIX.replace( /^-/, '' );
+ }
+
+ PIE.ieDocMode = doc.documentMode || PIE.ieVersion;
+
+ // Detect VML support (a small number of IE installs don't have a working VML engine)
+ div.innerHTML = '<v:shape adj="1"/>';
+ shape = div.firstChild;
+ shape.style['behavior'] = 'url(#default#VML)';
+ PIE.supportsVML = (typeof shape['adj'] === "object");
+ }());
+/**
+ * Utility functions
+ */
+(function() {
+ var vmlCreatorDoc,
+ idNum = 0,
+ imageSizes = {};
+
+
+ PIE.Util = {
+
+ /**
+ * To create a VML element, it must be created by a Document which has the VML
+ * namespace set. Unfortunately, if you try to add the namespace programatically
+ * into the main document, you will get an "Unspecified error" when trying to
+ * access document.namespaces before the document is finished loading. To get
+ * around this, we create a DocumentFragment, which in IE land is apparently a
+ * full-fledged Document. It allows adding namespaces immediately, so we add the
+ * namespace there and then have it create the VML element.
+ * @param {string} tag The tag name for the VML element
+ * @return {Element} The new VML element
+ */
+ createVmlElement: function( tag ) {
+ var vmlPrefix = 'css3vml';
+ if( !vmlCreatorDoc ) {
+ vmlCreatorDoc = doc.createDocumentFragment();
+ vmlCreatorDoc.namespaces.add( vmlPrefix, 'urn:schemas-microsoft-com:vml' );
+ }
+ return vmlCreatorDoc.createElement( vmlPrefix + ':' + tag );
+ },
+
+
+ /**
+ * Generate and return a unique ID for a given object. The generated ID is stored
+ * as a property of the object for future reuse.
+ * @param {Object} obj
+ */
+ getUID: function( obj ) {
+ return obj && obj[ '_pieId' ] || ( obj[ '_pieId' ] = '_' + ++idNum );
+ },
+
+
+ /**
+ * Simple utility for merging objects
+ * @param {Object} obj1 The main object into which all others will be merged
+ * @param {...Object} var_args Other objects which will be merged into the first, in order
+ */
+ merge: function( obj1 ) {
+ var i, len, p, objN, args = arguments;
+ for( i = 1, len = args.length; i < len; i++ ) {
+ objN = args[i];
+ for( p in objN ) {
+ if( objN.hasOwnProperty( p ) ) {
+ obj1[ p ] = objN[ p ];
+ }
+ }
+ }
+ return obj1;
+ },
+
+
+ /**
+ * Execute a callback function, passing it the dimensions of a given image once
+ * they are known.
+ * @param {string} src The source URL of the image
+ * @param {function({w:number, h:number})} func The callback function to be called once the image dimensions are known
+ * @param {Object} ctx A context object which will be used as the 'this' value within the executed callback function
+ */
+ withImageSize: function( src, func, ctx ) {
+ var size = imageSizes[ src ], img, queue;
+ if( size ) {
+ // If we have a queue, add to it
+ if( Object.prototype.toString.call( size ) === '[object Array]' ) {
+ size.push( [ func, ctx ] );
+ }
+ // Already have the size cached, call func right away
+ else {
+ func.call( ctx, size );
+ }
+ } else {
+ queue = imageSizes[ src ] = [ [ func, ctx ] ]; //create queue
+ img = new Image();
+ img.onload = function() {
+ size = imageSizes[ src ] = { w: img.width, h: img.height };
+ for( var i = 0, len = queue.length; i < len; i++ ) {
+ queue[ i ][ 0 ].call( queue[ i ][ 1 ], size );
+ }
+ img.onload = null;
+ };
+ img.src = src;
+ }
+ }
+ };
+})();/**
+ * Utility functions for handling gradients
+ */
+PIE.GradientUtil = {
+
+ getGradientMetrics: function( el, width, height, gradientInfo ) {
+ var angle = gradientInfo.angle,
+ startPos = gradientInfo.gradientStart,
+ startX, startY,
+ endX, endY,
+ startCornerX, startCornerY,
+ endCornerX, endCornerY,
+ deltaX, deltaY,
+ p, UNDEF;
+
+ // Find the "start" and "end" corners; these are the corners furthest along the gradient line.
+ // This is used below to find the start/end positions of the CSS3 gradient-line, and also in finding
+ // the total length of the VML rendered gradient-line corner to corner.
+ function findCorners() {
+ startCornerX = ( angle >= 90 && angle < 270 ) ? width : 0;
+ startCornerY = angle < 180 ? height : 0;
+ endCornerX = width - startCornerX;
+ endCornerY = height - startCornerY;
+ }
+
+ // Normalize the angle to a value between [0, 360)
+ function normalizeAngle() {
+ while( angle < 0 ) {
+ angle += 360;
+ }
+ angle = angle % 360;
+ }
+
+ // Find the start and end points of the gradient
+ if( startPos ) {
+ startPos = startPos.coords( el, width, height );
+ startX = startPos.x;
+ startY = startPos.y;
+ }
+ if( angle ) {
+ angle = angle.degrees();
+
+ normalizeAngle();
+ findCorners();
+
+ // If no start position was specified, then choose a corner as the starting point.
+ if( !startPos ) {
+ startX = startCornerX;
+ startY = startCornerY;
+ }
+
+ // Find the end position by extending a perpendicular line from the gradient-line which
+ // intersects the corner opposite from the starting corner.
+ p = PIE.GradientUtil.perpendicularIntersect( startX, startY, angle, endCornerX, endCornerY );
+ endX = p[0];
+ endY = p[1];
+ }
+ else if( startPos ) {
+ // Start position but no angle specified: find the end point by rotating 180deg around the center
+ endX = width - startX;
+ endY = height - startY;
+ }
+ else {
+ // Neither position nor angle specified; create vertical gradient from top to bottom
+ startX = startY = endX = 0;
+ endY = height;
+ }
+ deltaX = endX - startX;
+ deltaY = endY - startY;
+
+ if( angle === UNDEF ) {
+ // Get the angle based on the change in x/y from start to end point. Checks first for horizontal
+ // or vertical angles so they get exact whole numbers rather than what atan2 gives.
+ angle = ( !deltaX ? ( deltaY < 0 ? 90 : 270 ) :
+ ( !deltaY ? ( deltaX < 0 ? 180 : 0 ) :
+ -Math.atan2( deltaY, deltaX ) / Math.PI * 180
+ )
+ );
+ normalizeAngle();
+ findCorners();
+ }
+
+ return {
+ angle: angle,
+ startX: startX,
+ startY: startY,
+ endX: endX,
+ endY: endY,
+ startCornerX: startCornerX,
+ startCornerY: startCornerY,
+ endCornerX: endCornerX,
+ endCornerY: endCornerY,
+ deltaX: deltaX,
+ deltaY: deltaY,
+ lineLength: PIE.GradientUtil.distance( startX, startY, endX, endY )
+ }
+ },
+
+ /**
+ * Find the point along a given line (defined by a starting point and an angle), at which
+ * that line is intersected by a perpendicular line extending through another point.
+ * @param x1 - x coord of the starting point
+ * @param y1 - y coord of the starting point
+ * @param angle - angle of the line extending from the starting point (in degrees)
+ * @param x2 - x coord of point along the perpendicular line
+ * @param y2 - y coord of point along the perpendicular line
+ * @return [ x, y ]
+ */
+ perpendicularIntersect: function( x1, y1, angle, x2, y2 ) {
+ // Handle straight vertical and horizontal angles, for performance and to avoid
+ // divide-by-zero errors.
+ if( angle === 0 || angle === 180 ) {
+ return [ x2, y1 ];
+ }
+ else if( angle === 90 || angle === 270 ) {
+ return [ x1, y2 ];
+ }
+ else {
+ // General approach: determine the Ax+By=C formula for each line (the slope of the second
+ // line is the negative inverse of the first) and then solve for where both formulas have
+ // the same x/y values.
+ var a1 = Math.tan( -angle * Math.PI / 180 ),
+ c1 = a1 * x1 - y1,
+ a2 = -1 / a1,
+ c2 = a2 * x2 - y2,
+ d = a2 - a1,
+ endX = ( c2 - c1 ) / d,
+ endY = ( a1 * c2 - a2 * c1 ) / d;
+ return [ endX, endY ];
+ }
+ },
+
+ /**
+ * Find the distance between two points
+ * @param {Number} p1x
+ * @param {Number} p1y
+ * @param {Number} p2x
+ * @param {Number} p2y
+ * @return {Number} the distance
+ */
+ distance: function( p1x, p1y, p2x, p2y ) {
+ var dx = p2x - p1x,
+ dy = p2y - p1y;
+ return Math.abs(
+ dx === 0 ? dy :
+ dy === 0 ? dx :
+ Math.sqrt( dx * dx + dy * dy )
+ );
+ }
+
+};/**
+ *
+ */
+PIE.Observable = function() {
+ /**
+ * List of registered observer functions
+ */
+ this.observers = [];
+
+ /**
+ * Hash of function ids to their position in the observers list, for fast lookup
+ */
+ this.indexes = {};
+};
+PIE.Observable.prototype = {
+
+ observe: function( fn ) {
+ var id = PIE.Util.getUID( fn ),
+ indexes = this.indexes,
+ observers = this.observers;
+ if( !( id in indexes ) ) {
+ indexes[ id ] = observers.length;
+ observers.push( fn );
+ }
+ },
+
+ unobserve: function( fn ) {
+ var id = PIE.Util.getUID( fn ),
+ indexes = this.indexes;
+ if( id && id in indexes ) {
+ delete this.observers[ indexes[ id ] ];
+ delete indexes[ id ];
+ }
+ },
+
+ fire: function() {
+ var o = this.observers,
+ i = o.length;
+ while( i-- ) {
+ o[ i ] && o[ i ]();
+ }
+ }
+
+};/*
+ * Simple heartbeat timer - this is a brute-force workaround for syncing issues caused by IE not
+ * always firing the onmove and onresize events when elements are moved or resized. We check a few
+ * times every second to make sure the elements have the correct position and size. See Element.js
+ * which adds heartbeat listeners based on the custom -pie-poll flag, which defaults to true in IE8-9
+ * and false elsewhere.
+ */
+
+PIE.Heartbeat = new PIE.Observable();
+PIE.Heartbeat.run = function() {
+ var me = this,
+ interval;
+ if( !me.running ) {
+ interval = doc.documentElement.currentStyle.getAttribute( PIE.CSS_PREFIX + 'poll-interval' ) || 250;
+ (function beat() {
+ me.fire();
+ setTimeout(beat, interval);
+ })();
+ me.running = 1;
+ }
+};
+/**
+ * Create an observable listener for the onunload event
+ */
+(function() {
+ PIE.OnUnload = new PIE.Observable();
+
+ function handleUnload() {
+ PIE.OnUnload.fire();
+ window.detachEvent( 'onunload', handleUnload );
+ window[ 'PIE' ] = null;
+ }
+
+ window.attachEvent( 'onunload', handleUnload );
+
+ /**
+ * Attach an event which automatically gets detached onunload
+ */
+ PIE.OnUnload.attachManagedEvent = function( target, name, handler ) {
+ target.attachEvent( name, handler );
+ this.observe( function() {
+ target.detachEvent( name, handler );
+ } );
+ };
+})()/**
+ * Create a single observable listener for window resize events.
+ */
+PIE.OnResize = new PIE.Observable();
+
+PIE.OnUnload.attachManagedEvent( window, 'onresize', function() { PIE.OnResize.fire(); } );
+/**
+ * Create a single observable listener for scroll events. Used for lazy loading based
+ * on the viewport, and for fixed position backgrounds.
+ */
+(function() {
+ PIE.OnScroll = new PIE.Observable();
+
+ function scrolled() {
+ PIE.OnScroll.fire();
+ }
+
+ PIE.OnUnload.attachManagedEvent( window, 'onscroll', scrolled );
+
+ PIE.OnResize.observe( scrolled );
+})();
+/**
+ * Listen for printing events, destroy all active PIE instances when printing, and
+ * restore them afterward.
+ */
+(function() {
+
+ var elements;
+
+ function beforePrint() {
+ elements = PIE.Element.destroyAll();
+ }
+
+ function afterPrint() {
+ if( elements ) {
+ for( var i = 0, len = elements.length; i < len; i++ ) {
+ PIE[ 'attach' ]( elements[i] );
+ }
+ elements = 0;
+ }
+ }
+
+ if( PIE.ieDocMode < 9 ) {
+ PIE.OnUnload.attachManagedEvent( window, 'onbeforeprint', beforePrint );
+ PIE.OnUnload.attachManagedEvent( window, 'onafterprint', afterPrint );
+ }
+
+})();/**
+ * Create a single observable listener for document mouseup events.
+ */
+PIE.OnMouseup = new PIE.Observable();
+
+PIE.OnUnload.attachManagedEvent( doc, 'onmouseup', function() { PIE.OnMouseup.fire(); } );
+/**
+ * Wrapper for length and percentage style values. The value is immutable. A singleton instance per unique
+ * value is returned from PIE.getLength() - always use that instead of instantiating directly.
+ * @constructor
+ * @param {string} val The CSS string representing the length. It is assumed that this will already have
+ * been validated as a valid length or percentage syntax.
+ */
+PIE.Length = (function() {
+ var lengthCalcEl = doc.createElement( 'length-calc' ),
+ parent = doc.body || doc.documentElement,
+ s = lengthCalcEl.style,
+ conversions = {},
+ units = [ 'mm', 'cm', 'in', 'pt', 'pc' ],
+ i = units.length,
+ instances = {};
+
+ s.position = 'absolute';
+ s.top = s.left = '-9999px';
+
+ parent.appendChild( lengthCalcEl );
+ while( i-- ) {
+ s.width = '100' + units[i];
+ conversions[ units[i] ] = lengthCalcEl.offsetWidth / 100;
+ }
+ parent.removeChild( lengthCalcEl );
+
+ // All calcs from here on will use 1em
+ s.width = '1em';
+
+
+ function Length( val ) {
+ this.val = val;
+ }
+ Length.prototype = {
+ /**
+ * Regular expression for matching the length unit
+ * @private
+ */
+ unitRE: /(px|em|ex|mm|cm|in|pt|pc|%)$/,
+
+ /**
+ * Get the numeric value of the length
+ * @return {number} The value
+ */
+ getNumber: function() {
+ var num = this.num,
+ UNDEF;
+ if( num === UNDEF ) {
+ num = this.num = parseFloat( this.val );
+ }
+ return num;
+ },
+
+ /**
+ * Get the unit of the length
+ * @return {string} The unit
+ */
+ getUnit: function() {
+ var unit = this.unit,
+ m;
+ if( !unit ) {
+ m = this.val.match( this.unitRE );
+ unit = this.unit = ( m && m[0] ) || 'px';
+ }
+ return unit;
+ },
+
+ /**
+ * Determine whether this is a percentage length value
+ * @return {boolean}
+ */
+ isPercentage: function() {
+ return this.getUnit() === '%';
+ },
+
+ /**
+ * Resolve this length into a number of pixels.
+ * @param {Element} el - the context element, used to resolve font-relative values
+ * @param {(function():number|number)=} pct100 - the number of pixels that equal a 100% percentage. This can be either a number or a
+ * function which will be called to return the number.
+ */
+ pixels: function( el, pct100 ) {
+ var num = this.getNumber(),
+ unit = this.getUnit();
+ switch( unit ) {
+ case "px":
+ return num;
+ case "%":
+ return num * ( typeof pct100 === 'function' ? pct100() : pct100 ) / 100;
+ case "em":
+ return num * this.getEmPixels( el );
+ case "ex":
+ return num * this.getEmPixels( el ) / 2;
+ default:
+ return num * conversions[ unit ];
+ }
+ },
+
+ /**
+ * The em and ex units are relative to the font-size of the current element,
+ * however if the font-size is set using non-pixel units then we get that value
+ * rather than a pixel conversion. To get around this, we keep a floating element
+ * with width:1em which we insert into the target element and then read its offsetWidth.
+ * For elements that won't accept a child we insert into the parent node and perform
+ * additional calculation. If the font-size *is* specified in pixels, then we use that
+ * directly to avoid the expensive DOM manipulation.
+ * @param {Element} el
+ * @return {number}
+ */
+ getEmPixels: function( el ) {
+ var fs = el.currentStyle.fontSize,
+ px, parent, me;
+
+ if( fs.indexOf( 'px' ) > 0 ) {
+ return parseFloat( fs );
+ }
+ else if( el.tagName in PIE.childlessElements ) {
+ me = this;
+ parent = el.parentNode;
+ return PIE.getLength( fs ).pixels( parent, function() {
+ return me.getEmPixels( parent );
+ } );
+ }
+ else {
+ el.appendChild( lengthCalcEl );
+ px = lengthCalcEl.offsetWidth;
+ if( lengthCalcEl.parentNode === el ) { //not sure how this could be false but it sometimes is
+ el.removeChild( lengthCalcEl );
+ }
+ return px;
+ }
+ }
+ };
+
+
+ /**
+ * Retrieve a PIE.Length instance for the given value. A shared singleton instance is returned for each unique value.
+ * @param {string} val The CSS string representing the length. It is assumed that this will already have
+ * been validated as a valid length or percentage syntax.
+ */
+ PIE.getLength = function( val ) {
+ return instances[ val ] || ( instances[ val ] = new Length( val ) );
+ };
+
+ return Length;
+})();
+/**
+ * Wrapper for a CSS3 bg-position value. Takes up to 2 position keywords and 2 lengths/percentages.
+ * @constructor
+ * @param {Array.<PIE.Tokenizer.Token>} tokens The tokens making up the background position value.
+ */
+PIE.BgPosition = (function() {
+
+ var length_fifty = PIE.getLength( '50%' ),
+ vert_idents = { 'top': 1, 'center': 1, 'bottom': 1 },
+ horiz_idents = { 'left': 1, 'center': 1, 'right': 1 };
+
+
+ function BgPosition( tokens ) {
+ this.tokens = tokens;
+ }
+ BgPosition.prototype = {
+ /**
+ * Normalize the values into the form:
+ * [ xOffsetSide, xOffsetLength, yOffsetSide, yOffsetLength ]
+ * where: xOffsetSide is either 'left' or 'right',
+ * yOffsetSide is either 'top' or 'bottom',
+ * and x/yOffsetLength are both PIE.Length objects.
+ * @return {Array}
+ */
+ getValues: function() {
+ if( !this._values ) {
+ var tokens = this.tokens,
+ len = tokens.length,
+ Tokenizer = PIE.Tokenizer,
+ identType = Tokenizer.Type,
+ length_zero = PIE.getLength( '0' ),
+ type_ident = identType.IDENT,
+ type_length = identType.LENGTH,
+ type_percent = identType.PERCENT,
+ type, value,
+ vals = [ 'left', length_zero, 'top', length_zero ];
+
+ // If only one value, the second is assumed to be 'center'
+ if( len === 1 ) {
+ tokens.push( new Tokenizer.Token( type_ident, 'center' ) );
+ len++;
+ }
+
+ // Two values - CSS2
+ if( len === 2 ) {
+ // If both idents, they can appear in either order, so switch them if needed
+ if( type_ident & ( tokens[0].tokenType | tokens[1].tokenType ) &&
+ tokens[0].tokenValue in vert_idents && tokens[1].tokenValue in horiz_idents ) {
+ tokens.push( tokens.shift() );
+ }
+ if( tokens[0].tokenType & type_ident ) {
+ if( tokens[0].tokenValue === 'center' ) {
+ vals[1] = length_fifty;
+ } else {
+ vals[0] = tokens[0].tokenValue;
+ }
+ }
+ else if( tokens[0].isLengthOrPercent() ) {
+ vals[1] = PIE.getLength( tokens[0].tokenValue );
+ }
+ if( tokens[1].tokenType & type_ident ) {
+ if( tokens[1].tokenValue === 'center' ) {
+ vals[3] = length_fifty;
+ } else {
+ vals[2] = tokens[1].tokenValue;
+ }
+ }
+ else if( tokens[1].isLengthOrPercent() ) {
+ vals[3] = PIE.getLength( tokens[1].tokenValue );
+ }
+ }
+
+ // Three or four values - CSS3
+ else {
+ // TODO
+ }
+
+ this._values = vals;
+ }
+ return this._values;
+ },
+
+ /**
+ * Find the coordinates of the background image from the upper-left corner of the background area.
+ * Note that these coordinate values are not rounded.
+ * @param {Element} el
+ * @param {number} width - the width for percentages (background area width minus image width)
+ * @param {number} height - the height for percentages (background area height minus image height)
+ * @return {Object} { x: Number, y: Number }
+ */
+ coords: function( el, width, height ) {
+ var vals = this.getValues(),
+ pxX = vals[1].pixels( el, width ),
+ pxY = vals[3].pixels( el, height );
+
+ return {
+ x: vals[0] === 'right' ? width - pxX : pxX,
+ y: vals[2] === 'bottom' ? height - pxY : pxY
+ };
+ }
+ };
+
+ return BgPosition;
+})();
+/**
+ * Wrapper for a CSS3 background-size value.
+ * @constructor
+ * @param {String|PIE.Length} w The width parameter
+ * @param {String|PIE.Length} h The height parameter, if any
+ */
+PIE.BgSize = (function() {
+
+ var CONTAIN = 'contain',
+ COVER = 'cover',
+ AUTO = 'auto';
+
+
+ function BgSize( w, h ) {
+ this.w = w;
+ this.h = h;
+ }
+ BgSize.prototype = {
+
+ pixels: function( el, areaW, areaH, imgW, imgH ) {
+ var me = this,
+ w = me.w,
+ h = me.h,
+ areaRatio = areaW / areaH,
+ imgRatio = imgW / imgH;
+
+ if ( w === CONTAIN ) {
+ w = imgRatio > areaRatio ? areaW : areaH * imgRatio;
+ h = imgRatio > areaRatio ? areaW / imgRatio : areaH;
+ }
+ else if ( w === COVER ) {
+ w = imgRatio < areaRatio ? areaW : areaH * imgRatio;
+ h = imgRatio < areaRatio ? areaW / imgRatio : areaH;
+ }
+ else if ( w === AUTO ) {
+ h = ( h === AUTO ? imgH : h.pixels( el, areaH ) );
+ w = h * imgRatio;
+ }
+ else {
+ w = w.pixels( el, areaW );
+ h = ( h === AUTO ? w / imgRatio : h.pixels( el, areaH ) );
+ }
+
+ return { w: w, h: h };
+ }
+
+ };
+
+ BgSize.DEFAULT = new BgSize( AUTO, AUTO );
+
+ return BgSize;
+})();
+/**
+ * Wrapper for angle values; handles conversion to degrees from all allowed angle units
+ * @constructor
+ * @param {string} val The raw CSS value for the angle. It is assumed it has been pre-validated.
+ */
+PIE.Angle = (function() {
+ function Angle( val ) {
+ this.val = val;
+ }
+ Angle.prototype = {
+ unitRE: /[a-z]+$/i,
+
+ /**
+ * @return {string} The unit of the angle value
+ */
+ getUnit: function() {
+ return this._unit || ( this._unit = this.val.match( this.unitRE )[0].toLowerCase() );
+ },
+
+ /**
+ * Get the numeric value of the angle in degrees.
+ * @return {number} The degrees value
+ */
+ degrees: function() {
+ var deg = this._deg, u, n;
+ if( deg === undefined ) {
+ u = this.getUnit();
+ n = parseFloat( this.val, 10 );
+ deg = this._deg = ( u === 'deg' ? n : u === 'rad' ? n / Math.PI * 180 : u === 'grad' ? n / 400 * 360 : u === 'turn' ? n * 360 : 0 );
+ }
+ return deg;
+ }
+ };
+
+ return Angle;
+})();/**
+ * Abstraction for colors values. Allows detection of rgba values. A singleton instance per unique
+ * value is returned from PIE.getColor() - always use that instead of instantiating directly.
+ * @constructor
+ * @param {string} val The raw CSS string value for the color
+ */
+PIE.Color = (function() {
+ var instances = {};
+
+ function Color( val ) {
+ this.val = val;
+ }
+
+ /**
+ * Regular expression for matching rgba colors and extracting their components
+ * @type {RegExp}
+ */
+ Color.rgbaRE = /\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;
+
+ Color.names = {
+ "aliceblue":"F0F8FF", "antiquewhite":"FAEBD7", "aqua":"0FF",
+ "aquamarine":"7FFFD4", "azure":"F0FFFF", "beige":"F5F5DC",
+ "bisque":"FFE4C4", "black":"000", "blanchedalmond":"FFEBCD",
+ "blue":"00F", "blueviolet":"8A2BE2", "brown":"A52A2A",
+ "burlywood":"DEB887", "cadetblue":"5F9EA0", "chartreuse":"7FFF00",
+ "chocolate":"D2691E", "coral":"FF7F50", "cornflowerblue":"6495ED",
+ "cornsilk":"FFF8DC", "crimson":"DC143C", "cyan":"0FF",
+ "darkblue":"00008B", "darkcyan":"008B8B", "darkgoldenrod":"B8860B",
+ "darkgray":"A9A9A9", "darkgreen":"006400", "darkkhaki":"BDB76B",
+ "darkmagenta":"8B008B", "darkolivegreen":"556B2F", "darkorange":"FF8C00",
+ "darkorchid":"9932CC", "darkred":"8B0000", "darksalmon":"E9967A",
+ "darkseagreen":"8FBC8F", "darkslateblue":"483D8B", "darkslategray":"2F4F4F",
+ "darkturquoise":"00CED1", "darkviolet":"9400D3", "deeppink":"FF1493",
+ "deepskyblue":"00BFFF", "dimgray":"696969", "dodgerblue":"1E90FF",
+ "firebrick":"B22222", "floralwhite":"FFFAF0", "forestgreen":"228B22",
+ "fuchsia":"F0F", "gainsboro":"DCDCDC", "ghostwhite":"F8F8FF",
+ "gold":"FFD700", "goldenrod":"DAA520", "gray":"808080",
+ "green":"008000", "greenyellow":"ADFF2F", "honeydew":"F0FFF0",
+ "hotpink":"FF69B4", "indianred":"CD5C5C", "indigo":"4B0082",
+ "ivory":"FFFFF0", "khaki":"F0E68C", "lavender":"E6E6FA",
+ "lavenderblush":"FFF0F5", "lawngreen":"7CFC00", "lemonchiffon":"FFFACD",
+ "lightblue":"ADD8E6", "lightcoral":"F08080", "lightcyan":"E0FFFF",
+ "lightgoldenrodyellow":"FAFAD2", "lightgreen":"90EE90", "lightgrey":"D3D3D3",
+ "lightpink":"FFB6C1", "lightsalmon":"FFA07A", "lightseagreen":"20B2AA",
+ "lightskyblue":"87CEFA", "lightslategray":"789", "lightsteelblue":"B0C4DE",
+ "lightyellow":"FFFFE0", "lime":"0F0", "limegreen":"32CD32",
+ "linen":"FAF0E6", "magenta":"F0F", "maroon":"800000",
+ "mediumauqamarine":"66CDAA", "mediumblue":"0000CD", "mediumorchid":"BA55D3",
+ "mediumpurple":"9370D8", "mediumseagreen":"3CB371", "mediumslateblue":"7B68EE",
+ "mediumspringgreen":"00FA9A", "mediumturquoise":"48D1CC", "mediumvioletred":"C71585",
+ "midnightblue":"191970", "mintcream":"F5FFFA", "mistyrose":"FFE4E1",
+ "moccasin":"FFE4B5", "navajowhite":"FFDEAD", "navy":"000080",
+ "oldlace":"FDF5E6", "olive":"808000", "olivedrab":"688E23",
+ "orange":"FFA500", "orangered":"FF4500", "orchid":"DA70D6",
+ "palegoldenrod":"EEE8AA", "palegreen":"98FB98", "paleturquoise":"AFEEEE",
+ "palevioletred":"D87093", "papayawhip":"FFEFD5", "peachpuff":"FFDAB9",
+ "peru":"CD853F", "pink":"FFC0CB", "plum":"DDA0DD",
+ "powderblue":"B0E0E6", "purple":"800080", "red":"F00",
+ "rosybrown":"BC8F8F", "royalblue":"4169E1", "saddlebrown":"8B4513",
+ "salmon":"FA8072", "sandybrown":"F4A460", "seagreen":"2E8B57",
+ "seashell":"FFF5EE", "sienna":"A0522D", "silver":"C0C0C0",
+ "skyblue":"87CEEB", "slateblue":"6A5ACD", "slategray":"708090",
+ "snow":"FFFAFA", "springgreen":"00FF7F", "steelblue":"4682B4",
+ "tan":"D2B48C", "teal":"008080", "thistle":"D8BFD8",
+ "tomato":"FF6347", "turquoise":"40E0D0", "violet":"EE82EE",
+ "wheat":"F5DEB3", "white":"FFF", "whitesmoke":"F5F5F5",
+ "yellow":"FF0", "yellowgreen":"9ACD32"
+ };
+
+ Color.prototype = {
+ /**
+ * @private
+ */
+ parse: function() {
+ if( !this._color ) {
+ var me = this,
+ v = me.val,
+ vLower,
+ m = v.match( Color.rgbaRE );
+ if( m ) {
+ me._color = 'rgb(' + m[1] + ',' + m[2] + ',' + m[3] + ')';
+ me._alpha = parseFloat( m[4] );
+ }
+ else {
+ if( ( vLower = v.toLowerCase() ) in Color.names ) {
+ v = '#' + Color.names[vLower];
+ }
+ me._color = v;
+ me._alpha = ( v === 'transparent' ? 0 : 1 );
+ }
+ }
+ },
+
+ /**
+ * Retrieve the value of the color in a format usable by IE natively. This will be the same as
+ * the raw input value, except for rgba values which will be converted to an rgb value.
+ * @param {Element} el The context element, used to get 'currentColor' keyword value.
+ * @return {string} Color value
+ */
+ colorValue: function( el ) {
+ this.parse();
+ return this._color === 'currentColor' ? el.currentStyle.color : this._color;
+ },
+
+ /**
+ * Retrieve the alpha value of the color. Will be 1 for all values except for rgba values
+ * with an alpha component.
+ * @return {number} The alpha value, from 0 to 1.
+ */
+ alpha: function() {
+ this.parse();
+ return this._alpha;
+ }
+ };
+
+
+ /**
+ * Retrieve a PIE.Color instance for the given value. A shared singleton instance is returned for each unique value.
+ * @param {string} val The CSS string representing the color. It is assumed that this will already have
+ * been validated as a valid color syntax.
+ */
+ PIE.getColor = function(val) {
+ return instances[ val ] || ( instances[ val ] = new Color( val ) );
+ };
+
+ return Color;
+})();/**
+ * A tokenizer for CSS value strings.
+ * @constructor
+ * @param {string} css The CSS value string
+ */
+PIE.Tokenizer = (function() {
+ function Tokenizer( css ) {
+ this.css = css;
+ this.ch = 0;
+ this.tokens = [];
+ this.tokenIndex = 0;
+ }
+
+ /**
+ * Enumeration of token type constants.
+ * @enum {number}
+ */
+ var Type = Tokenizer.Type = {
+ ANGLE: 1,
+ CHARACTER: 2,
+ COLOR: 4,
+ DIMEN: 8,
+ FUNCTION: 16,
+ IDENT: 32,
+ LENGTH: 64,
+ NUMBER: 128,
+ OPERATOR: 256,
+ PERCENT: 512,
+ STRING: 1024,
+ URL: 2048
+ };
+
+ /**
+ * A single token
+ * @constructor
+ * @param {number} type The type of the token - see PIE.Tokenizer.Type
+ * @param {string} value The value of the token
+ */
+ Tokenizer.Token = function( type, value ) {
+ this.tokenType = type;
+ this.tokenValue = value;
+ };
+ Tokenizer.Token.prototype = {
+ isLength: function() {
+ return this.tokenType & Type.LENGTH || ( this.tokenType & Type.NUMBER && this.tokenValue === '0' );
+ },
+ isLengthOrPercent: function() {
+ return this.isLength() || this.tokenType & Type.PERCENT;
+ }
+ };
+
+ Tokenizer.prototype = {
+ whitespace: /\s/,
+ number: /^[\+\-]?(\d*\.)?\d+/,
+ url: /^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,
+ ident: /^\-?[_a-z][\w-]*/i,
+ string: /^("([^"]*)"|'([^']*)')/,
+ operator: /^[\/,]/,
+ hash: /^#[\w]+/,
+ hashColor: /^#([\da-f]{6}|[\da-f]{3})/i,
+
+ unitTypes: {
+ 'px': Type.LENGTH, 'em': Type.LENGTH, 'ex': Type.LENGTH,
+ 'mm': Type.LENGTH, 'cm': Type.LENGTH, 'in': Type.LENGTH,
+ 'pt': Type.LENGTH, 'pc': Type.LENGTH,
+ 'deg': Type.ANGLE, 'rad': Type.ANGLE, 'grad': Type.ANGLE
+ },
+
+ colorFunctions: {
+ 'rgb': 1, 'rgba': 1, 'hsl': 1, 'hsla': 1
+ },
+
+
+ /**
+ * Advance to and return the next token in the CSS string. If the end of the CSS string has
+ * been reached, null will be returned.
+ * @param {boolean} forget - if true, the token will not be stored for the purposes of backtracking with prev().
+ * @return {PIE.Tokenizer.Token}
+ */
+ next: function( forget ) {
+ var css, ch, firstChar, match, val,
+ me = this;
+
+ function newToken( type, value ) {
+ var tok = new Tokenizer.Token( type, value );
+ if( !forget ) {
+ me.tokens.push( tok );
+ me.tokenIndex++;
+ }
+ return tok;
+ }
+ function failure() {
+ me.tokenIndex++;
+ return null;
+ }
+
+ // In case we previously backed up, return the stored token in the next slot
+ if( this.tokenIndex < this.tokens.length ) {
+ return this.tokens[ this.tokenIndex++ ];
+ }
+
+ // Move past leading whitespace characters
+ while( this.whitespace.test( this.css.charAt( this.ch ) ) ) {
+ this.ch++;
+ }
+ if( this.ch >= this.css.length ) {
+ return failure();
+ }
+
+ ch = this.ch;
+ css = this.css.substring( this.ch );
+ firstChar = css.charAt( 0 );
+ switch( firstChar ) {
+ case '#':
+ if( match = css.match( this.hashColor ) ) {
+ this.ch += match[0].length;
+ return newToken( Type.COLOR, match[0] );
+ }
+ break;
+
+ case '"':
+ case "'":
+ if( match = css.match( this.string ) ) {
+ this.ch += match[0].length;
+ return newToken( Type.STRING, match[2] || match[3] || '' );
+ }
+ break;
+
+ case "/":
+ case ",":
+ this.ch++;
+ return newToken( Type.OPERATOR, firstChar );
+
+ case 'u':
+ if( match = css.match( this.url ) ) {
+ this.ch += match[0].length;
+ return newToken( Type.URL, match[2] || match[3] || match[4] || '' );
+ }
+ }
+
+ // Numbers and values starting with numbers
+ if( match = css.match( this.number ) ) {
+ val = match[0];
+ this.ch += val.length;
+
+ // Check if it is followed by a unit
+ if( css.charAt( val.length ) === '%' ) {
+ this.ch++;
+ return newToken( Type.PERCENT, val + '%' );
+ }
+ if( match = css.substring( val.length ).match( this.ident ) ) {
+ val += match[0];
+ this.ch += match[0].length;
+ return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val );
+ }
+
+ // Plain ol' number
+ return newToken( Type.NUMBER, val );
+ }
+
+ // Identifiers
+ if( match = css.match( this.ident ) ) {
+ val = match[0];
+ this.ch += val.length;
+
+ // Named colors
+ if( val.toLowerCase() in PIE.Color.names || val === 'currentColor' || val === 'transparent' ) {
+ return newToken( Type.COLOR, val );
+ }
+
+ // Functions
+ if( css.charAt( val.length ) === '(' ) {
+ this.ch++;
+
+ // Color values in function format: rgb, rgba, hsl, hsla
+ if( val.toLowerCase() in this.colorFunctions ) {
+ function isNum( tok ) {
+ return tok && tok.tokenType & Type.NUMBER;
+ }
+ function isNumOrPct( tok ) {
+ return tok && ( tok.tokenType & ( Type.NUMBER | Type.PERCENT ) );
+ }
+ function isValue( tok, val ) {
+ return tok && tok.tokenValue === val;
+ }
+ function next() {
+ return me.next( 1 );
+ }
+
+ if( ( val.charAt(0) === 'r' ? isNumOrPct( next() ) : isNum( next() ) ) &&
+ isValue( next(), ',' ) &&
+ isNumOrPct( next() ) &&
+ isValue( next(), ',' ) &&
+ isNumOrPct( next() ) &&
+ ( val === 'rgb' || val === 'hsa' || (
+ isValue( next(), ',' ) &&
+ isNum( next() )
+ ) ) &&
+ isValue( next(), ')' ) ) {
+ return newToken( Type.COLOR, this.css.substring( ch, this.ch ) );
+ }
+ return failure();
+ }
+
+ return newToken( Type.FUNCTION, val );
+ }
+
+ // Other identifier
+ return newToken( Type.IDENT, val );
+ }
+
+ // Standalone character
+ this.ch++;
+ return newToken( Type.CHARACTER, firstChar );
+ },
+
+ /**
+ * Determine whether there is another token
+ * @return {boolean}
+ */
+ hasNext: function() {
+ var next = this.next();
+ this.prev();
+ return !!next;
+ },
+
+ /**
+ * Back up and return the previous token
+ * @return {PIE.Tokenizer.Token}
+ */
+ prev: function() {
+ return this.tokens[ this.tokenIndex-- - 2 ];
+ },
+
+ /**
+ * Retrieve all the tokens in the CSS string
+ * @return {Array.<PIE.Tokenizer.Token>}
+ */
+ all: function() {
+ while( this.next() ) {}
+ return this.tokens;
+ },
+
+ /**
+ * Return a list of tokens from the current position until the given function returns
+ * true. The final token will not be included in the list.
+ * @param {function():boolean} func - test function
+ * @param {boolean} require - if true, then if the end of the CSS string is reached
+ * before the test function returns true, null will be returned instead of the
+ * tokens that have been found so far.
+ * @return {Array.<PIE.Tokenizer.Token>}
+ */
+ until: function( func, require ) {
+ var list = [], t, hit;
+ while( t = this.next() ) {
+ if( func( t ) ) {
+ hit = true;
+ this.prev();
+ break;
+ }
+ list.push( t );
+ }
+ return require && !hit ? null : list;
+ }
+ };
+
+ return Tokenizer;
+})();/**
+ * Handles calculating, caching, and detecting changes to size and position of the element.
+ * @constructor
+ * @param {Element} el the target element
+ */
+PIE.BoundsInfo = function( el ) {
+ this.targetElement = el;
+};
+PIE.BoundsInfo.prototype = {
+
+ _locked: 0,
+
+ positionChanged: function() {
+ var last = this._lastBounds,
+ bounds;
+ return !last || ( ( bounds = this.getBounds() ) && ( last.x !== bounds.x || last.y !== bounds.y ) );
+ },
+
+ sizeChanged: function() {
+ var last = this._lastBounds,
+ bounds;
+ return !last || ( ( bounds = this.getBounds() ) && ( last.w !== bounds.w || last.h !== bounds.h ) );
+ },
+
+ getLiveBounds: function() {
+ var el = this.targetElement,
+ rect = el.getBoundingClientRect(),
+ isIE9 = PIE.ieDocMode === 9,
+ isIE7 = PIE.ieVersion === 7,
+ width = rect.right - rect.left;
+ return {
+ x: rect.left,
+ y: rect.top,
+ // In some cases scrolling the page will cause IE9 to report incorrect dimensions
+ // in the rect returned by getBoundingClientRect, so we must query offsetWidth/Height
+ // instead. Also IE7 is inconsistent in using logical vs. device pixels in measurements
+ // so we must calculate the ratio and use it in certain places as a position adjustment.
+ w: isIE9 || isIE7 ? el.offsetWidth : width,
+ h: isIE9 || isIE7 ? el.offsetHeight : rect.bottom - rect.top,
+ logicalZoomRatio: ( isIE7 && width ) ? el.offsetWidth / width : 1
+ };
+ },
+
+ getBounds: function() {
+ return this._locked ?
+ ( this._lockedBounds || ( this._lockedBounds = this.getLiveBounds() ) ) :
+ this.getLiveBounds();
+ },
+
+ hasBeenQueried: function() {
+ return !!this._lastBounds;
+ },
+
+ lock: function() {
+ ++this._locked;
+ },
+
+ unlock: function() {
+ if( !--this._locked ) {
+ if( this._lockedBounds ) this._lastBounds = this._lockedBounds;
+ this._lockedBounds = null;
+ }
+ }
+
+};
+(function() {
+
+function cacheWhenLocked( fn ) {
+ var uid = PIE.Util.getUID( fn );
+ return function() {
+ if( this._locked ) {
+ var cache = this._lockedValues || ( this._lockedValues = {} );
+ return ( uid in cache ) ? cache[ uid ] : ( cache[ uid ] = fn.call( this ) );
+ } else {
+ return fn.call( this );
+ }
+ }
+}
+
+
+PIE.StyleInfoBase = {
+
+ _locked: 0,
+
+ /**
+ * Create a new StyleInfo class, with the standard constructor, and augmented by
+ * the StyleInfoBase's members.
+ * @param proto
+ */
+ newStyleInfo: function( proto ) {
+ function StyleInfo( el ) {
+ this.targetElement = el;
+ this._lastCss = this.getCss();
+ }
+ PIE.Util.merge( StyleInfo.prototype, PIE.StyleInfoBase, proto );
+ StyleInfo._propsCache = {};
+ return StyleInfo;
+ },
+
+ /**
+ * Get an object representation of the target CSS style, caching it for each unique
+ * CSS value string.
+ * @return {Object}
+ */
+ getProps: function() {
+ var css = this.getCss(),
+ cache = this.constructor._propsCache;
+ return css ? ( css in cache ? cache[ css ] : ( cache[ css ] = this.parseCss( css ) ) ) : null;
+ },
+
+ /**
+ * Get the raw CSS value for the target style
+ * @return {string}
+ */
+ getCss: cacheWhenLocked( function() {
+ var el = this.targetElement,
+ ctor = this.constructor,
+ s = el.style,
+ cs = el.currentStyle,
+ cssProp = this.cssProperty,
+ styleProp = this.styleProperty,
+ prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ),
+ prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) );
+ return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp );
+ } ),
+
+ /**
+ * Determine whether the target CSS style is active.
+ * @return {boolean}
+ */
+ isActive: cacheWhenLocked( function() {
+ return !!this.getProps();
+ } ),
+
+ /**
+ * Determine whether the target CSS style has changed since the last time it was used.
+ * @return {boolean}
+ */
+ changed: cacheWhenLocked( function() {
+ var currentCss = this.getCss(),
+ changed = currentCss !== this._lastCss;
+ this._lastCss = currentCss;
+ return changed;
+ } ),
+
+ cacheWhenLocked: cacheWhenLocked,
+
+ lock: function() {
+ ++this._locked;
+ },
+
+ unlock: function() {
+ if( !--this._locked ) {
+ delete this._lockedValues;
+ }
+ }
+};
+
+})();/**
+ * Handles parsing, caching, and detecting changes to background (and -pie-background) CSS
+ * @constructor
+ * @param {Element} el the target element
+ */
+PIE.BackgroundStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
+
+ cssProperty: PIE.CSS_PREFIX + 'background',
+ styleProperty: PIE.STYLE_PREFIX + 'Background',
+
+ attachIdents: { 'scroll':1, 'fixed':1, 'local':1 },
+ repeatIdents: { 'repeat-x':1, 'repeat-y':1, 'repeat':1, 'no-repeat':1 },
+ originAndClipIdents: { 'padding-box':1, 'border-box':1, 'content-box':1 },
+ positionIdents: { 'top':1, 'right':1, 'bottom':1, 'left':1, 'center':1 },
+ sizeIdents: { 'contain':1, 'cover':1 },
+ propertyNames: {
+ CLIP: 'backgroundClip',
+ COLOR: 'backgroundColor',
+ IMAGE: 'backgroundImage',
+ ORIGIN: 'backgroundOrigin',
+ POSITION: 'backgroundPosition',
+ REPEAT: 'backgroundRepeat',
+ SIZE: 'backgroundSize'
+ },
+
+ /**
+ * For background styles, we support the -pie-background property but fall back to the standard
+ * backround* properties. The reason we have to use the prefixed version is that IE natively
+ * parses the standard properties and if it sees something it doesn't know how to parse, for example
+ * multiple values or gradient definitions, it will throw that away and not make it available through
+ * currentStyle.
+ *
+ * Format of return object:
+ * {
+ * color: <PIE.Color>,
+ * bgImages: [
+ * {
+ * imgType: 'image',
+ * imgUrl: 'image.png',
+ * imgRepeat: <'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'>,
+ * bgPosition: <PIE.BgPosition>,
+ * bgAttachment: <'scroll' | 'fixed' | 'local'>,
+ * bgOrigin: <'border-box' | 'padding-box' | 'content-box'>,
+ * bgClip: <'border-box' | 'padding-box'>,
+ * bgSize: <PIE.BgSize>,
+ * origString: 'url(img.png) no-repeat top left'
+ * },
+ * {
+ * imgType: 'linear-gradient',
+ * gradientStart: <PIE.BgPosition>,
+ * angle: <PIE.Angle>,
+ * stops: [
+ * { color: <PIE.Color>, offset: <PIE.Length> },
+ * { color: <PIE.Color>, offset: <PIE.Length> }, ...
+ * ]
+ * }
+ * ]
+ * }
+ * @param {String} css
+ * @override
+ */
+ parseCss: function( css ) {
+ var el = this.targetElement,
+ cs = el.currentStyle,
+ tokenizer, token, image,
+ tok_type = PIE.Tokenizer.Type,
+ type_operator = tok_type.OPERATOR,
+ type_ident = tok_type.IDENT,
+ type_color = tok_type.COLOR,
+ tokType, tokVal,
+ beginCharIndex = 0,
+ positionIdents = this.positionIdents,
+ gradient, stop, width, height,
+ props = { bgImages: [] };
+
+ function isBgPosToken( token ) {
+ return token && token.isLengthOrPercent() || ( token.tokenType & type_ident && token.tokenValue in positionIdents );
+ }
+
+ function sizeToken( token ) {
+ return token && ( ( token.isLengthOrPercent() && PIE.getLength( token.tokenValue ) ) || ( token.tokenValue === 'auto' && 'auto' ) );
+ }
+
+ // If the CSS3-specific -pie-background property is present, parse it
+ if( this.getCss3() ) {
+ tokenizer = new PIE.Tokenizer( css );
+ image = {};
+
+ while( token = tokenizer.next() ) {
+ tokType = token.tokenType;
+ tokVal = token.tokenValue;
+
+ if( !image.imgType && tokType & tok_type.FUNCTION && tokVal === 'linear-gradient' ) {
+ gradient = { stops: [], imgType: tokVal };
+ stop = {};
+ while( token = tokenizer.next() ) {
+ tokType = token.tokenType;
+ tokVal = token.tokenValue;
+
+ // If we reached the end of the function and had at least 2 stops, flush the info
+ if( tokType & tok_type.CHARACTER && tokVal === ')' ) {
+ if( stop.color ) {
+ gradient.stops.push( stop );
+ }
+ if( gradient.stops.length > 1 ) {
+ PIE.Util.merge( image, gradient );
+ }
+ break;
+ }
+
+ // Color stop - must start with color
+ if( tokType & type_color ) {
+ // if we already have an angle/position, make sure that the previous token was a comma
+ if( gradient.angle || gradient.gradientStart ) {
+ token = tokenizer.prev();
+ if( token.tokenType !== type_operator ) {
+ break; //fail
+ }
+ tokenizer.next();
+ }
+
+ stop = {
+ color: PIE.getColor( tokVal )
+ };
+ // check for offset following color
+ token = tokenizer.next();
+ if( token.isLengthOrPercent() ) {
+ stop.offset = PIE.getLength( token.tokenValue );
+ } else {
+ tokenizer.prev();
+ }
+ }
+ // Angle - can only appear in first spot
+ else if( tokType & tok_type.ANGLE && !gradient.angle && !stop.color && !gradient.stops.length ) {
+ gradient.angle = new PIE.Angle( token.tokenValue );
+ }
+ else if( isBgPosToken( token ) && !gradient.gradientStart && !stop.color && !gradient.stops.length ) {
+ tokenizer.prev();
+ gradient.gradientStart = new PIE.BgPosition(
+ tokenizer.until( function( t ) {
+ return !isBgPosToken( t );
+ }, false )
+ );
+ }
+ else if( tokType & type_operator && tokVal === ',' ) {
+ if( stop.color ) {
+ gradient.stops.push( stop );
+ stop = {};
+ }
+ }
+ else {
+ // Found something we didn't recognize; fail without adding image
+ break;
+ }
+ }
+ }
+ else if( !image.imgType && tokType & tok_type.URL ) {
+ image.imgUrl = tokVal;
+ image.imgType = 'image';
+ }
+ else if( isBgPosToken( token ) && !image.bgPosition ) {
+ tokenizer.prev();
+ image.bgPosition = new PIE.BgPosition(
+ tokenizer.until( function( t ) {
+ return !isBgPosToken( t );
+ }, false )
+ );
+ }
+ else if( tokType & type_ident ) {
+ if( tokVal in this.repeatIdents && !image.imgRepeat ) {
+ image.imgRepeat = tokVal;
+ }
+ else if( tokVal in this.originAndClipIdents && !image.bgOrigin ) {
+ image.bgOrigin = tokVal;
+ if( ( token = tokenizer.next() ) && ( token.tokenType & type_ident ) &&
+ token.tokenValue in this.originAndClipIdents ) {
+ image.bgClip = token.tokenValue;
+ } else {
+ image.bgClip = tokVal;
+ tokenizer.prev();
+ }
+ }
+ else if( tokVal in this.attachIdents && !image.bgAttachment ) {
+ image.bgAttachment = tokVal;
+ }
+ else {
+ return null;
+ }
+ }
+ else if( tokType & type_color && !props.color ) {
+ props.color = PIE.getColor( tokVal );
+ }
+ else if( tokType & type_operator && tokVal === '/' && !image.bgSize && image.bgPosition ) {
+ // background size
+ token = tokenizer.next();
+ if( token.tokenType & type_ident && token.tokenValue in this.sizeIdents ) {
+ image.bgSize = new PIE.BgSize( token.tokenValue );
+ }
+ else if( width = sizeToken( token ) ) {
+ height = sizeToken( tokenizer.next() );
+ if ( !height ) {
+ height = width;
+ tokenizer.prev();
+ }
+ image.bgSize = new PIE.BgSize( width, height );
+ }
+ else {
+ return null;
+ }
+ }
+ // new layer
+ else if( tokType & type_operator && tokVal === ',' && image.imgType ) {
+ image.origString = css.substring( beginCharIndex, tokenizer.ch - 1 );
+ beginCharIndex = tokenizer.ch;
+ props.bgImages.push( image );
+ image = {};
+ }
+ else {
+ // Found something unrecognized; chuck everything
+ return null;
+ }
+ }
+
+ // leftovers
+ if( image.imgType ) {
+ image.origString = css.substring( beginCharIndex );
+ props.bgImages.push( image );
+ }
+ }
+
+ // Otherwise, use the standard background properties; let IE give us the values rather than parsing them
+ else {
+ this.withActualBg( PIE.ieDocMode < 9 ?
+ function() {
+ var propNames = this.propertyNames,
+ posX = cs[propNames.POSITION + 'X'],
+ posY = cs[propNames.POSITION + 'Y'],
+ img = cs[propNames.IMAGE],
+ color = cs[propNames.COLOR];
+
+ if( color !== 'transparent' ) {
+ props.color = PIE.getColor( color )
+ }
+ if( img !== 'none' ) {
+ props.bgImages = [ {
+ imgType: 'image',
+ imgUrl: new PIE.Tokenizer( img ).next().tokenValue,
+ imgRepeat: cs[propNames.REPEAT],
+ bgPosition: new PIE.BgPosition( new PIE.Tokenizer( posX + ' ' + posY ).all() )
+ } ];
+ }
+ } :
+ function() {
+ var propNames = this.propertyNames,
+ splitter = /\s*,\s*/,
+ images = cs[propNames.IMAGE].split( splitter ),
+ color = cs[propNames.COLOR],
+ repeats, positions, origins, clips, sizes, i, len, image, sizeParts;
+
+ if( color !== 'transparent' ) {
+ props.color = PIE.getColor( color )
+ }
+
+ len = images.length;
+ if( len && images[0] !== 'none' ) {
+ repeats = cs[propNames.REPEAT].split( splitter );
+ positions = cs[propNames.POSITION].split( splitter );
+ origins = cs[propNames.ORIGIN].split( splitter );
+ clips = cs[propNames.CLIP].split( splitter );
+ sizes = cs[propNames.SIZE].split( splitter );
+
+ props.bgImages = [];
+ for( i = 0; i < len; i++ ) {
+ image = images[ i ];
+ if( image && image !== 'none' ) {
+ sizeParts = sizes[i].split( ' ' );
+ props.bgImages.push( {
+ origString: image + ' ' + repeats[ i ] + ' ' + positions[ i ] + ' / ' + sizes[ i ] + ' ' +
+ origins[ i ] + ' ' + clips[ i ],
+ imgType: 'image',
+ imgUrl: new PIE.Tokenizer( image ).next().tokenValue,
+ imgRepeat: repeats[ i ],
+ bgPosition: new PIE.BgPosition( new PIE.Tokenizer( positions[ i ] ).all() ),
+ bgOrigin: origins[ i ],
+ bgClip: clips[ i ],
+ bgSize: new PIE.BgSize( sizeParts[ 0 ], sizeParts[ 1 ] )
+ } );
+ }
+ }
+ }
+ }
+ );
+ }
+
+ return ( props.color || props.bgImages[0] ) ? props : null;
+ },
+
+ /**
+ * Execute a function with the actual background styles (not overridden with runtimeStyle
+ * properties set by the renderers) available via currentStyle.
+ * @param fn
+ */
+ withActualBg: function( fn ) {
+ var isIE9 = PIE.ieDocMode > 8,
+ propNames = this.propertyNames,
+ rs = this.targetElement.runtimeStyle,
+ rsImage = rs[propNames.IMAGE],
+ rsColor = rs[propNames.COLOR],
+ rsRepeat = rs[propNames.REPEAT],
+ rsClip, rsOrigin, rsSize, rsPosition, ret;
+
+ if( rsImage ) rs[propNames.IMAGE] = '';
+ if( rsColor ) rs[propNames.COLOR] = '';
+ if( rsRepeat ) rs[propNames.REPEAT] = '';
+ if( isIE9 ) {
+ rsClip = rs[propNames.CLIP];
+ rsOrigin = rs[propNames.ORIGIN];
+ rsPosition = rs[propNames.POSITION];
+ rsSize = rs[propNames.SIZE];
+ if( rsClip ) rs[propNames.CLIP] = '';
+ if( rsOrigin ) rs[propNames.ORIGIN] = '';
+ if( rsPosition ) rs[propNames.POSITION] = '';
+ if( rsSize ) rs[propNames.SIZE] = '';
+ }
+
+ ret = fn.call( this );
+
+ if( rsImage ) rs[propNames.IMAGE] = rsImage;
+ if( rsColor ) rs[propNames.COLOR] = rsColor;
+ if( rsRepeat ) rs[propNames.REPEAT] = rsRepeat;
+ if( isIE9 ) {
+ if( rsClip ) rs[propNames.CLIP] = rsClip;
+ if( rsOrigin ) rs[propNames.ORIGIN] = rsOrigin;
+ if( rsPosition ) rs[propNames.POSITION] = rsPosition;
+ if( rsSize ) rs[propNames.SIZE] = rsSize;
+ }
+
+ return ret;
+ },
+
+ getCss: PIE.StyleInfoBase.cacheWhenLocked( function() {
+ return this.getCss3() ||
+ this.withActualBg( function() {
+ var cs = this.targetElement.currentStyle,
+ propNames = this.propertyNames;
+ return cs[propNames.COLOR] + ' ' + cs[propNames.IMAGE] + ' ' + cs[propNames.REPEAT] + ' ' +
+ cs[propNames.POSITION + 'X'] + ' ' + cs[propNames.POSITION + 'Y'];
+ } );
+ } ),
+
+ getCss3: PIE.StyleInfoBase.cacheWhenLocked( function() {
+ var el = this.targetElement;
+ return el.style[ this.styleProperty ] || el.currentStyle.getAttribute( this.cssProperty );
+ } ),
+
+ /**
+ * Tests if style.PiePngFix or the -pie-png-fix property is set to true in IE6.
+ */
+ isPngFix: function() {
+ var val = 0, el;
+ if( PIE.ieVersion < 7 ) {
+ el = this.targetElement;
+ val = ( '' + ( el.style[ PIE.STYLE_PREFIX + 'PngFix' ] || el.currentStyle.getAttribute( PIE.CSS_PREFIX + 'png-fix' ) ) === 'true' );
+ }
+ return val;
+ },
+
+ /**
+ * The isActive logic is slightly different, because getProps() always returns an object
+ * even if it is just falling back to the native background properties. But we only want
+ * to report is as being "active" if either the -pie-background override property is present
+ * and parses successfully or '-pie-png-fix' is set to true in IE6.
+ */
+ isActive: PIE.StyleInfoBase.cacheWhenLocked( function() {
+ return (this.getCss3() || this.isPngFix()) && !!this.getProps();
+ } )
+
+} );/**
+ * Handles parsing, caching, and detecting changes to border CSS
+ * @constructor
+ * @param {Element} el the target element
+ */
+PIE.BorderStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
+
+ sides: [ 'Top', 'Right', 'Bottom', 'Left' ],
+ namedWidths: {
+ 'thin': '1px',
+ 'medium': '3px',
+ 'thick': '5px'
+ },
+
+ parseCss: function( css ) {
+ var w = {},
+ s = {},
+ c = {},
+ active = false,
+ colorsSame = true,
+ stylesSame = true,
+ widthsSame = true;
+
+ this.withActualBorder( function() {
+ var el = this.targetElement,
+ cs = el.currentStyle,
+ i = 0,
+ style, color, width, lastStyle, lastColor, lastWidth, side, ltr;
+ for( ; i < 4; i++ ) {
+ side = this.sides[ i ];
+
+ ltr = side.charAt(0).toLowerCase();
+ style = s[ ltr ] = cs[ 'border' + side + 'Style' ];
+ color = cs[ 'border' + side + 'Color' ];
+ width = cs[ 'border' + side + 'Width' ];
+
+ if( i > 0 ) {
+ if( style !== lastStyle ) { stylesSame = false; }
+ if( color !== lastColor ) { colorsSame = false; }
+ if( width !== lastWidth ) { widthsSame = false; }
+ }
+ lastStyle = style;
+ lastColor = color;
+ lastWidth = width;
+
+ c[ ltr ] = PIE.getColor( color );
+
+ width = w[ ltr ] = PIE.getLength( s[ ltr ] === 'none' ? '0' : ( this.namedWidths[ width ] || width ) );
+ if( width.pixels( this.targetElement ) > 0 ) {
+ active = true;
+ }
+ }
+ } );
+
+ return active ? {
+ widths: w,
+ styles: s,
+ colors: c,
+ widthsSame: widthsSame,
+ colorsSame: colorsSame,
+ stylesSame: stylesSame
+ } : null;
+ },
+
+ getCss: PIE.StyleInfoBase.cacheWhenLocked( function() {
+ var el = this.targetElement,
+ cs = el.currentStyle,
+ css;
+
+ // Don't redraw or hide borders for cells in border-collapse:collapse tables
+ if( !( el.tagName in PIE.tableCellTags && el.offsetParent.currentStyle.borderCollapse === 'collapse' ) ) {
+ this.withActualBorder( function() {
+ css = cs.borderWidth + '|' + cs.borderStyle + '|' + cs.borderColor;
+ } );
+ }
+ return css;
+ } ),
+
+ /**
+ * Execute a function with the actual border styles (not overridden with runtimeStyle
+ * properties set by the renderers) available via currentStyle.
+ * @param fn
+ */
+ withActualBorder: function( fn ) {
+ var rs = this.targetElement.runtimeStyle,
+ rsWidth = rs.borderWidth,
+ rsColor = rs.borderColor,
+ ret;
+
+ if( rsWidth ) rs.borderWidth = '';
+ if( rsColor ) rs.borderColor = '';
+
+ ret = fn.call( this );
+
+ if( rsWidth ) rs.borderWidth = rsWidth;
+ if( rsColor ) rs.borderColor = rsColor;
+
+ return ret;
+ }
+
+} );
+/**
+ * Handles parsing, caching, and detecting changes to border-radius CSS
+ * @constructor
+ * @param {Element} el the target element
+ */
+(function() {
+
+PIE.BorderRadiusStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
+
+ cssProperty: 'border-radius',
+ styleProperty: 'borderRadius',
+
+ parseCss: function( css ) {
+ var p = null, x, y,
+ tokenizer, token, length,
+ hasNonZero = false;
+
+ if( css ) {
+ tokenizer = new PIE.Tokenizer( css );
+
+ function collectLengths() {
+ var arr = [], num;
+ while( ( token = tokenizer.next() ) && token.isLengthOrPercent() ) {
+ length = PIE.getLength( token.tokenValue );
+ num = length.getNumber();
+ if( num < 0 ) {
+ return null;
+ }
+ if( num > 0 ) {
+ hasNonZero = true;
+ }
+ arr.push( length );
+ }
+ return arr.length > 0 && arr.length < 5 ? {
+ 'tl': arr[0],
+ 'tr': arr[1] || arr[0],
+ 'br': arr[2] || arr[0],
+ 'bl': arr[3] || arr[1] || arr[0]
+ } : null;
+ }
+
+ // Grab the initial sequence of lengths
+ if( x = collectLengths() ) {
+ // See if there is a slash followed by more lengths, for the y-axis radii
+ if( token ) {
+ if( token.tokenType & PIE.Tokenizer.Type.OPERATOR && token.tokenValue === '/' ) {
+ y = collectLengths();
+ }
+ } else {
+ y = x;
+ }
+
+ // Treat all-zero values the same as no value
+ if( hasNonZero && x && y ) {
+ p = { x: x, y : y };
+ }
+ }
+ }
+
+ return p;
+ }
+} );
+
+var zero = PIE.getLength( '0' ),
+ zeros = { 'tl': zero, 'tr': zero, 'br': zero, 'bl': zero };
+PIE.BorderRadiusStyleInfo.ALL_ZERO = { x: zeros, y: zeros };
+
+})();/**
+ * Handles parsing, caching, and detecting changes to border-image CSS
+ * @constructor
+ * @param {Element} el the target element
+ */
+PIE.BorderImageStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
+
+ cssProperty: 'border-image',
+ styleProperty: 'borderImage',
+
+ repeatIdents: { 'stretch':1, 'round':1, 'repeat':1, 'space':1 },
+
+ parseCss: function( css ) {
+ var p = null, tokenizer, token, type, value,
+ slices, widths, outsets,
+ slashCount = 0,
+ Type = PIE.Tokenizer.Type,
+ IDENT = Type.IDENT,
+ NUMBER = Type.NUMBER,
+ PERCENT = Type.PERCENT;
+
+ if( css ) {
+ tokenizer = new PIE.Tokenizer( css );
+ p = {};
+
+ function isSlash( token ) {
+ return token && ( token.tokenType & Type.OPERATOR ) && ( token.tokenValue === '/' );
+ }
+
+ function isFillIdent( token ) {
+ return token && ( token.tokenType & IDENT ) && ( token.tokenValue === 'fill' );
+ }
+
+ function collectSlicesEtc() {
+ slices = tokenizer.until( function( tok ) {
+ return !( tok.tokenType & ( NUMBER | PERCENT ) );
+ } );
+
+ if( isFillIdent( tokenizer.next() ) && !p.fill ) {
+ p.fill = true;
+ } else {
+ tokenizer.prev();
+ }
+
+ if( isSlash( tokenizer.next() ) ) {
+ slashCount++;
+ widths = tokenizer.until( function( token ) {
+ return !token.isLengthOrPercent() && !( ( token.tokenType & IDENT ) && token.tokenValue === 'auto' );
+ } );
+
+ if( isSlash( tokenizer.next() ) ) {
+ slashCount++;
+ outsets = tokenizer.until( function( token ) {
+ return !token.isLength();
+ } );
+ }
+ } else {
+ tokenizer.prev();
+ }
+ }
+
+ while( token = tokenizer.next() ) {
+ type = token.tokenType;
+ value = token.tokenValue;
+
+ // Numbers and/or 'fill' keyword: slice values. May be followed optionally by width values, followed optionally by outset values
+ if( type & ( NUMBER | PERCENT ) && !slices ) {
+ tokenizer.prev();
+ collectSlicesEtc();
+ }
+ else if( isFillIdent( token ) && !p.fill ) {
+ p.fill = true;
+ collectSlicesEtc();
+ }
+
+ // Idents: one or values for 'repeat'
+ else if( ( type & IDENT ) && this.repeatIdents[value] && !p.repeat ) {
+ p.repeat = { h: value };
+ if( token = tokenizer.next() ) {
+ if( ( token.tokenType & IDENT ) && this.repeatIdents[token.tokenValue] ) {
+ p.repeat.v = token.tokenValue;
+ } else {
+ tokenizer.prev();
+ }
+ }
+ }
+
+ // URL of the image
+ else if( ( type & Type.URL ) && !p.src ) {
+ p.src = value;
+ }
+
+ // Found something unrecognized; exit.
+ else {
+ return null;
+ }
+ }
+
+ // Validate what we collected
+ if( !p.src || !slices || slices.length < 1 || slices.length > 4 ||
+ ( widths && widths.length > 4 ) || ( slashCount === 1 && widths.length < 1 ) ||
+ ( outsets && outsets.length > 4 ) || ( slashCount === 2 && outsets.length < 1 ) ) {
+ return null;
+ }
+
+ // Fill in missing values
+ if( !p.repeat ) {
+ p.repeat = { h: 'stretch' };
+ }
+ if( !p.repeat.v ) {
+ p.repeat.v = p.repeat.h;
+ }
+
+ function distributeSides( tokens, convertFn ) {
+ return {
+ 't': convertFn( tokens[0] ),
+ 'r': convertFn( tokens[1] || tokens[0] ),
+ 'b': convertFn( tokens[2] || tokens[0] ),
+ 'l': convertFn( tokens[3] || tokens[1] || tokens[0] )
+ };
+ }
+
+ p.slice = distributeSides( slices, function( tok ) {
+ return PIE.getLength( ( tok.tokenType & NUMBER ) ? tok.tokenValue + 'px' : tok.tokenValue );
+ } );
+
+ if( widths && widths[0] ) {
+ p.widths = distributeSides( widths, function( tok ) {
+ return tok.isLengthOrPercent() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue;
+ } );
+ }
+
+ if( outsets && outsets[0] ) {
+ p.outset = distributeSides( outsets, function( tok ) {
+ return tok.isLength() ? PIE.getLength( tok.tokenValue ) : tok.tokenValue;
+ } );
+ }
+ }
+
+ return p;
+ }
+
+} );/**
+ * Handles parsing, caching, and detecting changes to box-shadow CSS
+ * @constructor
+ * @param {Element} el the target element
+ */
+PIE.BoxShadowStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
+
+ cssProperty: 'box-shadow',
+ styleProperty: 'boxShadow',
+
+ parseCss: function( css ) {
+ var props,
+ getLength = PIE.getLength,
+ Type = PIE.Tokenizer.Type,
+ tokenizer;
+
+ if( css ) {
+ tokenizer = new PIE.Tokenizer( css );
+ props = { outset: [], inset: [] };
+
+ function parseItem() {
+ var token, type, value, color, lengths, inset, len;
+
+ while( token = tokenizer.next() ) {
+ value = token.tokenValue;
+ type = token.tokenType;
+
+ if( type & Type.OPERATOR && value === ',' ) {
+ break;
+ }
+ else if( token.isLength() && !lengths ) {
+ tokenizer.prev();
+ lengths = tokenizer.until( function( token ) {
+ return !token.isLength();
+ } );
+ }
+ else if( type & Type.COLOR && !color ) {
+ color = value;
+ }
+ else if( type & Type.IDENT && value === 'inset' && !inset ) {
+ inset = true;
+ }
+ else { //encountered an unrecognized token; fail.
+ return false;
+ }
+ }
+
+ len = lengths && lengths.length;
+ if( len > 1 && len < 5 ) {
+ ( inset ? props.inset : props.outset ).push( {
+ xOffset: getLength( lengths[0].tokenValue ),
+ yOffset: getLength( lengths[1].tokenValue ),
+ blur: getLength( lengths[2] ? lengths[2].tokenValue : '0' ),
+ spread: getLength( lengths[3] ? lengths[3].tokenValue : '0' ),
+ color: PIE.getColor( color || 'currentColor' )
+ } );
+ return true;
+ }
+ return false;
+ }
+
+ while( parseItem() ) {}
+ }
+
+ return props && ( props.inset.length || props.outset.length ) ? props : null;
+ }
+} );
+/**
+ * Retrieves the state of the element's visibility and display
+ * @constructor
+ * @param {Element} el the target element
+ */
+PIE.VisibilityStyleInfo = PIE.StyleInfoBase.newStyleInfo( {
+
+ getCss: PIE.StyleInfoBase.cacheWhenLocked( function() {
+ var cs = this.targetElement.currentStyle;
+ return cs.visibility + '|' + cs.display;
+ } ),
+
+ parseCss: function() {
+ var el = this.targetElement,
+ rs = el.runtimeStyle,
+ cs = el.currentStyle,
+ rsVis = rs.visibility,
+ csVis;
+
+ rs.visibility = '';
+ csVis = cs.visibility;
+ rs.visibility = rsVis;
+
+ return {
+ visible: csVis !== 'hidden',
+ displayed: cs.display !== 'none'
+ }
+ },
+
+ /**
+ * Always return false for isActive, since this property alone will not trigger
+ * a renderer to do anything.
+ */
+ isActive: function() {
+ return false;
+ }
+
+} );
+PIE.RendererBase = {
+
+ /**
+ * Create a new Renderer class, with the standard constructor, and augmented by
+ * the RendererBase's members.
+ * @param proto
+ */
+ newRenderer: function( proto ) {
+ function Renderer( el, boundsInfo, styleInfos, parent ) {
+ this.targetElement = el;
+ this.boundsInfo = boundsInfo;
+ this.styleInfos = styleInfos;
+ this.parent = parent;
+ }
+ PIE.Util.merge( Renderer.prototype, PIE.RendererBase, proto );
+ return Renderer;
+ },
+
+ /**
+ * Flag indicating the element has already been positioned at least once.
+ * @type {boolean}
+ */
+ isPositioned: false,
+
+ /**
+ * Determine if the renderer needs to be updated
+ * @return {boolean}
+ */
+ needsUpdate: function() {
+ return false;
+ },
+
+ /**
+ * Run any preparation logic that would affect the main update logic of this
+ * renderer or any of the other renderers, e.g. things that might affect the
+ * element's size or style properties.
+ */
+ prepareUpdate: PIE.emptyFn,
+
+ /**
+ * Tell the renderer to update based on modified properties
+ */
+ updateProps: function() {
+ this.destroy();
+ if( this.isActive() ) {
+ this.draw();
+ }
+ },
+
+ /**
+ * Tell the renderer to update based on modified element position
+ */
+ updatePos: function() {
+ this.isPositioned = true;
+ },
+
+ /**
+ * Tell the renderer to update based on modified element dimensions
+ */
+ updateSize: function() {
+ if( this.isActive() ) {
+ this.draw();
+ } else {
+ this.destroy();
+ }
+ },
+
+
+ /**
+ * Add a layer element, with the given z-order index, to the renderer's main box element. We can't use
+ * z-index because that breaks when the root rendering box's z-index is 'auto' in IE8+ standards mode.
+ * So instead we make sure they are inserted into the DOM in the correct order.
+ * @param {number} index
+ * @param {Element} el
+ */
+ addLayer: function( index, el ) {
+ this.removeLayer( index );
+ for( var layers = this._layers || ( this._layers = [] ), i = index + 1, len = layers.length, layer; i < len; i++ ) {
+ layer = layers[i];
+ if( layer ) {
+ break;
+ }
+ }
+ layers[index] = el;
+ this.getBox().insertBefore( el, layer || null );
+ },
+
+ /**
+ * Retrieve a layer element by its index, or null if not present
+ * @param {number} index
+ * @return {Element}
+ */
+ getLayer: function( index ) {
+ var layers = this._layers;
+ return layers && layers[index] || null;
+ },
+
+ /**
+ * Remove a layer element by its index
+ * @param {number} index
+ */
+ removeLayer: function( index ) {
+ var layer = this.getLayer( index ),
+ box = this._box;
+ if( layer && box ) {
+ box.removeChild( layer );
+ this._layers[index] = null;
+ }
+ },
+
+
+ /**
+ * Get a VML shape by name, creating it if necessary.
+ * @param {string} name A name identifying the element
+ * @param {string=} subElName If specified a subelement of the shape will be created with this tag name
+ * @param {Element} parent The parent element for the shape; will be ignored if 'group' is specified
+ * @param {number=} group If specified, an ordinal group for the shape. 1 or greater. Groups are rendered
+ * using container elements in the correct order, to get correct z stacking without z-index.
+ */
+ getShape: function( name, subElName, parent, group ) {
+ var shapes = this._shapes || ( this._shapes = {} ),
+ shape = shapes[ name ],
+ s;
+
+ if( !shape ) {
+ shape = shapes[ name ] = PIE.Util.createVmlElement( 'shape' );
+ if( subElName ) {
+ shape.appendChild( shape[ subElName ] = PIE.Util.createVmlElement( subElName ) );
+ }
+
+ if( group ) {
+ parent = this.getLayer( group );
+ if( !parent ) {
+ this.addLayer( group, doc.createElement( 'group' + group ) );
+ parent = this.getLayer( group );
+ }
+ }
+
+ parent.appendChild( shape );
+
+ s = shape.style;
+ s.position = 'absolute';
+ s.left = s.top = 0;
+ s['behavior'] = 'url(#default#VML)';
+ }
+ return shape;
+ },
+
+ /**
+ * Delete a named shape which was created by getShape(). Returns true if a shape with the
+ * given name was found and deleted, or false if there was no shape of that name.
+ * @param {string} name
+ * @return {boolean}
+ */
+ deleteShape: function( name ) {
+ var shapes = this._shapes,
+ shape = shapes && shapes[ name ];
+ if( shape ) {
+ shape.parentNode.removeChild( shape );
+ delete shapes[ name ];
+ }
+ return !!shape;
+ },
+
+
+ /**
+ * For a given set of border radius length/percentage values, convert them to concrete pixel
+ * values based on the current size of the target element.
+ * @param {Object} radii
+ * @return {Object}
+ */
+ getRadiiPixels: function( radii ) {
+ var el = this.targetElement,
+ bounds = this.boundsInfo.getBounds(),
+ w = bounds.w,
+ h = bounds.h,
+ tlX, tlY, trX, trY, brX, brY, blX, blY, f;
+
+ tlX = radii.x['tl'].pixels( el, w );
+ tlY = radii.y['tl'].pixels( el, h );
+ trX = radii.x['tr'].pixels( el, w );
+ trY = radii.y['tr'].pixels( el, h );
+ brX = radii.x['br'].pixels( el, w );
+ brY = radii.y['br'].pixels( el, h );
+ blX = radii.x['bl'].pixels( el, w );
+ blY = radii.y['bl'].pixels( el, h );
+
+ // If any corner ellipses overlap, reduce them all by the appropriate factor. This formula
+ // is taken straight from the CSS3 Backgrounds and Borders spec.
+ f = Math.min(
+ w / ( tlX + trX ),
+ h / ( trY + brY ),
+ w / ( blX + brX ),
+ h / ( tlY + blY )
+ );
+ if( f < 1 ) {
+ tlX *= f;
+ tlY *= f;
+ trX *= f;
+ trY *= f;
+ brX *= f;
+ brY *= f;
+ blX *= f;
+ blY *= f;
+ }
+
+ return {
+ x: {
+ 'tl': tlX,
+ 'tr': trX,
+ 'br': brX,
+ 'bl': blX
+ },
+ y: {
+ 'tl': tlY,
+ 'tr': trY,
+ 'br': brY,
+ 'bl': blY
+ }
+ }
+ },
+
+ /**
+ * Return the VML path string for the element's background box, with corners rounded.
+ * @param {Object.<{t:number, r:number, b:number, l:number}>} shrink - if present, specifies number of
+ * pixels to shrink the box path inward from the element's four sides.
+ * @param {number=} mult If specified, all coordinates will be multiplied by this number
+ * @param {Object=} radii If specified, this will be used for the corner radii instead of the properties
+ * from this renderer's borderRadiusInfo object.
+ * @return {string} the VML path
+ */
+ getBoxPath: function( shrink, mult, radii ) {
+ mult = mult || 1;
+
+ var r, str,
+ bounds = this.boundsInfo.getBounds(),
+ w = bounds.w * mult,
+ h = bounds.h * mult,
+ radInfo = this.styleInfos.borderRadiusInfo,
+ floor = Math.floor, ceil = Math.ceil,
+ shrinkT = shrink ? shrink.t * mult : 0,
+ shrinkR = shrink ? shrink.r * mult : 0,
+ shrinkB = shrink ? shrink.b * mult : 0,
+ shrinkL = shrink ? shrink.l * mult : 0,
+ tlX, tlY, trX, trY, brX, brY, blX, blY;
+
+ if( radii || radInfo.isActive() ) {
+ r = this.getRadiiPixels( radii || radInfo.getProps() );
+
+ tlX = r.x['tl'] * mult;
+ tlY = r.y['tl'] * mult;
+ trX = r.x['tr'] * mult;
+ trY = r.y['tr'] * mult;
+ brX = r.x['br'] * mult;
+ brY = r.y['br'] * mult;
+ blX = r.x['bl'] * mult;
+ blY = r.y['bl'] * mult;
+
+ str = 'm' + floor( shrinkL ) + ',' + floor( tlY ) +
+ 'qy' + floor( tlX ) + ',' + floor( shrinkT ) +
+ 'l' + ceil( w - trX ) + ',' + floor( shrinkT ) +
+ 'qx' + ceil( w - shrinkR ) + ',' + floor( trY ) +
+ 'l' + ceil( w - shrinkR ) + ',' + ceil( h - brY ) +
+ 'qy' + ceil( w - brX ) + ',' + ceil( h - shrinkB ) +
+ 'l' + floor( blX ) + ',' + ceil( h - shrinkB ) +
+ 'qx' + floor( shrinkL ) + ',' + ceil( h - blY ) + ' x e';
+ } else {
+ // simplified path for non-rounded box
+ str = 'm' + floor( shrinkL ) + ',' + floor( shrinkT ) +
+ 'l' + ceil( w - shrinkR ) + ',' + floor( shrinkT ) +
+ 'l' + ceil( w - shrinkR ) + ',' + ceil( h - shrinkB ) +
+ 'l' + floor( shrinkL ) + ',' + ceil( h - shrinkB ) +
+ 'xe';
+ }
+ return str;
+ },
+
+
+ /**
+ * Get the container element for the shapes, creating it if necessary.
+ */
+ getBox: function() {
+ var box = this.parent.getLayer( this.boxZIndex ), s;
+
+ if( !box ) {
+ box = doc.createElement( this.boxName );
+ s = box.style;
+ s.position = 'absolute';
+ s.top = s.left = 0;
+ this.parent.addLayer( this.boxZIndex, box );
+ }
+
+ return box;
+ },
+
+
+ /**
+ * Hide the actual border of the element. In IE7 and up we can just set its color to transparent;
+ * however IE6 does not support transparent borders so we have to get tricky with it. Also, some elements
+ * like form buttons require removing the border width altogether, so for those we increase the padding
+ * by the border size.
+ */
+ hideBorder: function() {
+ var el = this.targetElement,
+ cs = el.currentStyle,
+ rs = el.runtimeStyle,
+ tag = el.tagName,
+ isIE6 = PIE.ieVersion === 6,
+ sides, side, i;
+
+ if( ( isIE6 && ( tag in PIE.childlessElements || tag === 'FIELDSET' ) ) ||
+ tag === 'BUTTON' || ( tag === 'INPUT' && el.type in PIE.inputButtonTypes ) ) {
+ rs.borderWidth = '';
+ sides = this.styleInfos.borderInfo.sides;
+ for( i = sides.length; i--; ) {
+ side = sides[ i ];
+ rs[ 'padding' + side ] = '';
+ rs[ 'padding' + side ] = ( PIE.getLength( cs[ 'padding' + side ] ) ).pixels( el ) +
+ ( PIE.getLength( cs[ 'border' + side + 'Width' ] ) ).pixels( el ) +
+ ( PIE.ieVersion !== 8 && i % 2 ? 1 : 0 ); //needs an extra horizontal pixel to counteract the extra "inner border" going away
+ }
+ rs.borderWidth = 0;
+ }
+ else if( isIE6 ) {
+ // Wrap all the element's children in a custom element, set the element to visiblity:hidden,
+ // and set the wrapper element to visiblity:visible. This hides the outer element's decorations
+ // (background and border) but displays all the contents.
+ // TODO find a better way to do this that doesn't mess up the DOM parent-child relationship,
+ // as this can interfere with other author scripts which add/modify/delete children. Also, this
+ // won't work for elements which cannot take children, e.g. input/button/textarea/img/etc. Look into
+ // using a compositor filter or some other filter which masks the border.
+ if( el.childNodes.length !== 1 || el.firstChild.tagName !== 'ie6-mask' ) {
+ var cont = doc.createElement( 'ie6-mask' ),
+ s = cont.style, child;
+ s.visibility = 'visible';
+ s.zoom = 1;
+ while( child = el.firstChild ) {
+ cont.appendChild( child );
+ }
+ el.appendChild( cont );
+ rs.visibility = 'hidden';
+ }
+ }
+ else {
+ rs.borderColor = 'transparent';
+ }
+ },
+
+ unhideBorder: function() {
+
+ },
+
+
+ /**
+ * Destroy the rendered objects. This is a base implementation which handles common renderer
+ * structures, but individual renderers may override as necessary.
+ */
+ destroy: function() {
+ this.parent.removeLayer( this.boxZIndex );
+ delete this._shapes;
+ delete this._layers;
+ }
+};
+/**
+ * Root renderer; creates the outermost container element and handles keeping it aligned
+ * with the target element's size and position.
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ */
+PIE.RootRenderer = PIE.RendererBase.newRenderer( {
+
+ isActive: function() {
+ var children = this.childRenderers;
+ for( var i in children ) {
+ if( children.hasOwnProperty( i ) && children[ i ].isActive() ) {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ needsUpdate: function() {
+ return this.styleInfos.visibilityInfo.changed();
+ },
+
+ updatePos: function() {
+ if( this.isActive() ) {
+ var el = this.getPositioningElement(),
+ par = el,
+ docEl,
+ parRect,
+ tgtCS = el.currentStyle,
+ tgtPos = tgtCS.position,
+ boxPos,
+ s = this.getBox().style, cs,
+ x = 0, y = 0,
+ elBounds = this.boundsInfo.getBounds(),
+ logicalZoomRatio = elBounds.logicalZoomRatio;
+
+ if( tgtPos === 'fixed' && PIE.ieVersion > 6 ) {
+ x = elBounds.x * logicalZoomRatio;
+ y = elBounds.y * logicalZoomRatio;
+ boxPos = tgtPos;
+ } else {
+ // Get the element's offsets from its nearest positioned ancestor. Uses
+ // getBoundingClientRect for accuracy and speed.
+ do {
+ par = par.offsetParent;
+ } while( par && ( par.currentStyle.position === 'static' ) );
+ if( par ) {
+ parRect = par.getBoundingClientRect();
+ cs = par.currentStyle;
+ x = ( elBounds.x - parRect.left ) * logicalZoomRatio - ( parseFloat(cs.borderLeftWidth) || 0 );
+ y = ( elBounds.y - parRect.top ) * logicalZoomRatio - ( parseFloat(cs.borderTopWidth) || 0 );
+ } else {
+ docEl = doc.documentElement;
+ x = ( elBounds.x + docEl.scrollLeft - docEl.clientLeft ) * logicalZoomRatio;
+ y = ( elBounds.y + docEl.scrollTop - docEl.clientTop ) * logicalZoomRatio;
+ }
+ boxPos = 'absolute';
+ }
+
+ s.position = boxPos;
+ s.left = x;
+ s.top = y;
+ s.zIndex = tgtPos === 'static' ? -1 : tgtCS.zIndex;
+ this.isPositioned = true;
+ }
+ },
+
+ updateSize: PIE.emptyFn,
+
+ updateVisibility: function() {
+ var vis = this.styleInfos.visibilityInfo.getProps();
+ this.getBox().style.display = ( vis.visible && vis.displayed ) ? '' : 'none';
+ },
+
+ updateProps: function() {
+ if( this.isActive() ) {
+ this.updateVisibility();
+ } else {
+ this.destroy();
+ }
+ },
+
+ getPositioningElement: function() {
+ var el = this.targetElement;
+ return el.tagName in PIE.tableCellTags ? el.offsetParent : el;
+ },
+
+ getBox: function() {
+ var box = this._box, el;
+ if( !box ) {
+ el = this.getPositioningElement();
+ box = this._box = doc.createElement( 'css3-container' );
+ box.style['direction'] = 'ltr'; //fix positioning bug in rtl environments
+
+ this.updateVisibility();
+
+ el.parentNode.insertBefore( box, el );
+ }
+ return box;
+ },
+
+ finishUpdate: PIE.emptyFn,
+
+ destroy: function() {
+ var box = this._box, par;
+ if( box && ( par = box.parentNode ) ) {
+ par.removeChild( box );
+ }
+ delete this._box;
+ delete this._layers;
+ }
+
+} );
+/**
+ * Renderer for element backgrounds.
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ * @param {PIE.RootRenderer} parent
+ */
+PIE.BackgroundRenderer = PIE.RendererBase.newRenderer( {
+
+ boxZIndex: 2,
+ boxName: 'background',
+
+ needsUpdate: function() {
+ var si = this.styleInfos;
+ return si.backgroundInfo.changed() || si.borderRadiusInfo.changed();
+ },
+
+ isActive: function() {
+ var si = this.styleInfos;
+ return si.borderImageInfo.isActive() ||
+ si.borderRadiusInfo.isActive() ||
+ si.backgroundInfo.isActive() ||
+ ( si.boxShadowInfo.isActive() && si.boxShadowInfo.getProps().inset );
+ },
+
+ /**
+ * Draw the shapes
+ */
+ draw: function() {
+ var bounds = this.boundsInfo.getBounds();
+ if( bounds.w && bounds.h ) {
+ this.drawBgColor();
+ this.drawBgImages();
+ }
+ },
+
+ /**
+ * Draw the background color shape
+ */
+ drawBgColor: function() {
+ var props = this.styleInfos.backgroundInfo.getProps(),
+ bounds = this.boundsInfo.getBounds(),
+ el = this.targetElement,
+ color = props && props.color,
+ shape, w, h, s, alpha;
+
+ if( color && color.alpha() > 0 ) {
+ this.hideBackground();
+
+ shape = this.getShape( 'bgColor', 'fill', this.getBox(), 1 );
+ w = bounds.w;
+ h = bounds.h;
+ shape.stroked = false;
+ shape.coordsize = w * 2 + ',' + h * 2;
+ shape.coordorigin = '1,1';
+ shape.path = this.getBoxPath( null, 2 );
+ s = shape.style;
+ s.width = w;
+ s.height = h;
+ shape.fill.color = color.colorValue( el );
+
+ alpha = color.alpha();
+ if( alpha < 1 ) {
+ shape.fill.opacity = alpha;
+ }
+ } else {
+ this.deleteShape( 'bgColor' );
+ }
+ },
+
+ /**
+ * Draw all the background image layers
+ */
+ drawBgImages: function() {
+ var props = this.styleInfos.backgroundInfo.getProps(),
+ bounds = this.boundsInfo.getBounds(),
+ images = props && props.bgImages,
+ img, shape, w, h, s, i;
+
+ if( images ) {
+ this.hideBackground();
+
+ w = bounds.w;
+ h = bounds.h;
+
+ i = images.length;
+ while( i-- ) {
+ img = images[i];
+ shape = this.getShape( 'bgImage' + i, 'fill', this.getBox(), 2 );
+
+ shape.stroked = false;
+ shape.fill.type = 'tile';
+ shape.fillcolor = 'none';
+ shape.coordsize = w * 2 + ',' + h * 2;
+ shape.coordorigin = '1,1';
+ shape.path = this.getBoxPath( 0, 2 );
+ s = shape.style;
+ s.width = w;
+ s.height = h;
+
+ if( img.imgType === 'linear-gradient' ) {
+ this.addLinearGradient( shape, img );
+ }
+ else {
+ shape.fill.src = img.imgUrl;
+ this.positionBgImage( shape, i );
+ }
+ }
+ }
+
+ // Delete any bgImage shapes previously created which weren't used above
+ i = images ? images.length : 0;
+ while( this.deleteShape( 'bgImage' + i++ ) ) {}
+ },
+
+
+ /**
+ * Set the position and clipping of the background image for a layer
+ * @param {Element} shape
+ * @param {number} index
+ */
+ positionBgImage: function( shape, index ) {
+ var me = this;
+ PIE.Util.withImageSize( shape.fill.src, function( size ) {
+ var el = me.targetElement,
+ bounds = me.boundsInfo.getBounds(),
+ elW = bounds.w,
+ elH = bounds.h;
+
+ // It's possible that the element dimensions are zero now but weren't when the original
+ // update executed, make sure that's not the case to avoid divide-by-zero error
+ if( elW && elH ) {
+ var fill = shape.fill,
+ si = me.styleInfos,
+ border = si.borderInfo.getProps(),
+ bw = border && border.widths,
+ bwT = bw ? bw['t'].pixels( el ) : 0,
+ bwR = bw ? bw['r'].pixels( el ) : 0,
+ bwB = bw ? bw['b'].pixels( el ) : 0,
+ bwL = bw ? bw['l'].pixels( el ) : 0,
+ bg = si.backgroundInfo.getProps().bgImages[ index ],
+ bgPos = bg.bgPosition ? bg.bgPosition.coords( el, elW - size.w - bwL - bwR, elH - size.h - bwT - bwB ) : { x:0, y:0 },
+ repeat = bg.imgRepeat,
+ pxX, pxY,
+ clipT = 0, clipL = 0,
+ clipR = elW + 1, clipB = elH + 1, //make sure the default clip region is not inside the box (by a subpixel)
+ clipAdjust = PIE.ieVersion === 8 ? 0 : 1; //prior to IE8 requires 1 extra pixel in the image clip region
+
+ // Positioning - find the pixel offset from the top/left and convert to a ratio
+ // The position is shifted by half a pixel, to adjust for the half-pixel coordorigin shift which is
+ // needed to fix antialiasing but makes the bg image fuzzy.
+ pxX = Math.round( bgPos.x ) + bwL + 0.5;
+ pxY = Math.round( bgPos.y ) + bwT + 0.5;
+ fill.position = ( pxX / elW ) + ',' + ( pxY / elH );
+
+ // Set the size of the image. We have to actually set it to px values otherwise it will not honor
+ // the user's browser zoom level and always display at its natural screen size.
+ fill['size']['x'] = 1; //Can be any value, just has to be set to "prime" it so the next line works. Weird!
+ fill['size'] = size.w + 'px,' + size.h + 'px';
+
+ // Repeating - clip the image shape
+ if( repeat && repeat !== 'repeat' ) {
+ if( repeat === 'repeat-x' || repeat === 'no-repeat' ) {
+ clipT = pxY + 1;
+ clipB = pxY + size.h + clipAdjust;
+ }
+ if( repeat === 'repeat-y' || repeat === 'no-repeat' ) {
+ clipL = pxX + 1;
+ clipR = pxX + size.w + clipAdjust;
+ }
+ shape.style.clip = 'rect(' + clipT + 'px,' + clipR + 'px,' + clipB + 'px,' + clipL + 'px)';
+ }
+ }
+ } );
+ },
+
+
+ /**
+ * Draw the linear gradient for a gradient layer
+ * @param {Element} shape
+ * @param {Object} info The object holding the information about the gradient
+ */
+ addLinearGradient: function( shape, info ) {
+ var el = this.targetElement,
+ bounds = this.boundsInfo.getBounds(),
+ w = bounds.w,
+ h = bounds.h,
+ fill = shape.fill,
+ stops = info.stops,
+ stopCount = stops.length,
+ PI = Math.PI,
+ GradientUtil = PIE.GradientUtil,
+ perpendicularIntersect = GradientUtil.perpendicularIntersect,
+ distance = GradientUtil.distance,
+ metrics = GradientUtil.getGradientMetrics( el, w, h, info ),
+ angle = metrics.angle,
+ startX = metrics.startX,
+ startY = metrics.startY,
+ startCornerX = metrics.startCornerX,
+ startCornerY = metrics.startCornerY,
+ endCornerX = metrics.endCornerX,
+ endCornerY = metrics.endCornerY,
+ deltaX = metrics.deltaX,
+ deltaY = metrics.deltaY,
+ lineLength = metrics.lineLength,
+ vmlAngle, vmlGradientLength, vmlColors,
+ stopPx, vmlOffsetPct,
+ p, i, j, before, after;
+
+ // In VML land, the angle of the rendered gradient depends on the aspect ratio of the shape's
+ // bounding box; for example specifying a 45 deg angle actually results in a gradient
+ // drawn diagonally from one corner to its opposite corner, which will only appear to the
+ // viewer as 45 degrees if the shape is equilateral. We adjust for this by taking the x/y deltas
+ // between the start and end points, multiply one of them by the shape's aspect ratio,
+ // and get their arctangent, resulting in an appropriate VML angle. If the angle is perfectly
+ // horizontal or vertical then we don't need to do this conversion.
+ vmlAngle = ( angle % 90 ) ? Math.atan2( deltaX * w / h, deltaY ) / PI * 180 : ( angle + 90 );
+
+ // VML angles are 180 degrees offset from CSS angles
+ vmlAngle += 180;
+ vmlAngle = vmlAngle % 360;
+
+ // Add all the stops to the VML 'colors' list, including the first and last stops.
+ // For each, we find its pixel offset along the gradient-line; if the offset of a stop is less
+ // than that of its predecessor we increase it to be equal. We then map that pixel offset to a
+ // percentage along the VML gradient-line, which runs from shape corner to corner.
+ p = perpendicularIntersect( startCornerX, startCornerY, angle, endCornerX, endCornerY );
+ vmlGradientLength = distance( startCornerX, startCornerY, p[0], p[1] );
+ vmlColors = [];
+ p = perpendicularIntersect( startX, startY, angle, startCornerX, startCornerY );
+ vmlOffsetPct = distance( startX, startY, p[0], p[1] ) / vmlGradientLength * 100;
+
+ // Find the pixel offsets along the CSS3 gradient-line for each stop.
+ stopPx = [];
+ for( i = 0; i < stopCount; i++ ) {
+ stopPx.push( stops[i].offset ? stops[i].offset.pixels( el, lineLength ) :
+ i === 0 ? 0 : i === stopCount - 1 ? lineLength : null );
+ }
+ // Fill in gaps with evenly-spaced offsets
+ for( i = 1; i < stopCount; i++ ) {
+ if( stopPx[ i ] === null ) {
+ before = stopPx[ i - 1 ];
+ j = i;
+ do {
+ after = stopPx[ ++j ];
+ } while( after === null );
+ stopPx[ i ] = before + ( after - before ) / ( j - i + 1 );
+ }
+ // Make sure each stop's offset is no less than the one before it
+ stopPx[ i ] = Math.max( stopPx[ i ], stopPx[ i - 1 ] );
+ }
+
+ // Convert to percentage along the VML gradient line and add to the VML 'colors' value
+ for( i = 0; i < stopCount; i++ ) {
+ vmlColors.push(
+ ( vmlOffsetPct + ( stopPx[ i ] / vmlGradientLength * 100 ) ) + '% ' + stops[i].color.colorValue( el )
+ );
+ }
+
+ // Now, finally, we're ready to render the gradient fill. Set the start and end colors to
+ // the first and last stop colors; this just sets outer bounds for the gradient.
+ fill['angle'] = vmlAngle;
+ fill['type'] = 'gradient';
+ fill['method'] = 'sigma';
+ fill['color'] = stops[0].color.colorValue( el );
+ fill['color2'] = stops[stopCount - 1].color.colorValue( el );
+ if( fill['colors'] ) { //sometimes the colors object isn't initialized so we have to assign it directly (?)
+ fill['colors'].value = vmlColors.join( ',' );
+ } else {
+ fill['colors'] = vmlColors.join( ',' );
+ }
+ },
+
+
+ /**
+ * Hide the actual background image and color of the element.
+ */
+ hideBackground: function() {
+ var rs = this.targetElement.runtimeStyle;
+ rs.backgroundImage = 'url(about:blank)'; //ensures the background area reacts to mouse events
+ rs.backgroundColor = 'transparent';
+ },
+
+ destroy: function() {
+ PIE.RendererBase.destroy.call( this );
+ var rs = this.targetElement.runtimeStyle;
+ rs.backgroundImage = rs.backgroundColor = '';
+ }
+
+} );
+/**
+ * Renderer for element borders.
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ * @param {PIE.RootRenderer} parent
+ */
+PIE.BorderRenderer = PIE.RendererBase.newRenderer( {
+
+ boxZIndex: 4,
+ boxName: 'border',
+
+ needsUpdate: function() {
+ var si = this.styleInfos;
+ return si.borderInfo.changed() || si.borderRadiusInfo.changed();
+ },
+
+ isActive: function() {
+ var si = this.styleInfos;
+ return si.borderRadiusInfo.isActive() &&
+ !si.borderImageInfo.isActive() &&
+ si.borderInfo.isActive(); //check BorderStyleInfo last because it's the most expensive
+ },
+
+ /**
+ * Draw the border shape(s)
+ */
+ draw: function() {
+ var el = this.targetElement,
+ props = this.styleInfos.borderInfo.getProps(),
+ bounds = this.boundsInfo.getBounds(),
+ w = bounds.w,
+ h = bounds.h,
+ shape, stroke, s,
+ segments, seg, i, len;
+
+ if( props ) {
+ this.hideBorder();
+
+ segments = this.getBorderSegments( 2 );
+ for( i = 0, len = segments.length; i < len; i++) {
+ seg = segments[i];
+ shape = this.getShape( 'borderPiece' + i, seg.stroke ? 'stroke' : 'fill', this.getBox() );
+ shape.coordsize = w * 2 + ',' + h * 2;
+ shape.coordorigin = '1,1';
+ shape.path = seg.path;
+ s = shape.style;
+ s.width = w;
+ s.height = h;
+
+ shape.filled = !!seg.fill;
+ shape.stroked = !!seg.stroke;
+ if( seg.stroke ) {
+ stroke = shape.stroke;
+ stroke['weight'] = seg.weight + 'px';
+ stroke.color = seg.color.colorValue( el );
+ stroke['dashstyle'] = seg.stroke === 'dashed' ? '2 2' : seg.stroke === 'dotted' ? '1 1' : 'solid';
+ stroke['linestyle'] = seg.stroke === 'double' && seg.weight > 2 ? 'ThinThin' : 'Single';
+ } else {
+ shape.fill.color = seg.fill.colorValue( el );
+ }
+ }
+
+ // remove any previously-created border shapes which didn't get used above
+ while( this.deleteShape( 'borderPiece' + i++ ) ) {}
+ }
+ },
+
+
+ /**
+ * Get the VML path definitions for the border segment(s).
+ * @param {number=} mult If specified, all coordinates will be multiplied by this number
+ * @return {Array.<string>}
+ */
+ getBorderSegments: function( mult ) {
+ var el = this.targetElement,
+ bounds, elW, elH,
+ borderInfo = this.styleInfos.borderInfo,
+ segments = [],
+ floor, ceil, wT, wR, wB, wL,
+ round = Math.round,
+ borderProps, radiusInfo, radii, widths, styles, colors;
+
+ if( borderInfo.isActive() ) {
+ borderProps = borderInfo.getProps();
+
+ widths = borderProps.widths;
+ styles = borderProps.styles;
+ colors = borderProps.colors;
+
+ if( borderProps.widthsSame && borderProps.stylesSame && borderProps.colorsSame ) {
+ if( colors['t'].alpha() > 0 ) {
+ // shortcut for identical border on all sides - only need 1 stroked shape
+ wT = widths['t'].pixels( el ); //thickness
+ wR = wT / 2; //shrink
+ segments.push( {
+ path: this.getBoxPath( { t: wR, r: wR, b: wR, l: wR }, mult ),
+ stroke: styles['t'],
+ color: colors['t'],
+ weight: wT
+ } );
+ }
+ }
+ else {
+ mult = mult || 1;
+ bounds = this.boundsInfo.getBounds();
+ elW = bounds.w;
+ elH = bounds.h;
+
+ wT = round( widths['t'].pixels( el ) );
+ wR = round( widths['r'].pixels( el ) );
+ wB = round( widths['b'].pixels( el ) );
+ wL = round( widths['l'].pixels( el ) );
+ var pxWidths = {
+ 't': wT,
+ 'r': wR,
+ 'b': wB,
+ 'l': wL
+ };
+
+ radiusInfo = this.styleInfos.borderRadiusInfo;
+ if( radiusInfo.isActive() ) {
+ radii = this.getRadiiPixels( radiusInfo.getProps() );
+ }
+
+ floor = Math.floor;
+ ceil = Math.ceil;
+
+ function radius( xy, corner ) {
+ return radii ? radii[ xy ][ corner ] : 0;
+ }
+
+ function curve( corner, shrinkX, shrinkY, startAngle, ccw, doMove ) {
+ var rx = radius( 'x', corner),
+ ry = radius( 'y', corner),
+ deg = 65535,
+ isRight = corner.charAt( 1 ) === 'r',
+ isBottom = corner.charAt( 0 ) === 'b';
+ return ( rx > 0 && ry > 0 ) ?
+ ( doMove ? 'al' : 'ae' ) +
+ ( isRight ? ceil( elW - rx ) : floor( rx ) ) * mult + ',' + // center x
+ ( isBottom ? ceil( elH - ry ) : floor( ry ) ) * mult + ',' + // center y
+ ( floor( rx ) - shrinkX ) * mult + ',' + // width
+ ( floor( ry ) - shrinkY ) * mult + ',' + // height
+ ( startAngle * deg ) + ',' + // start angle
+ ( 45 * deg * ( ccw ? 1 : -1 ) // angle change
+ ) : (
+ ( doMove ? 'm' : 'l' ) +
+ ( isRight ? elW - shrinkX : shrinkX ) * mult + ',' +
+ ( isBottom ? elH - shrinkY : shrinkY ) * mult
+ );
+ }
+
+ function line( side, shrink, ccw, doMove ) {
+ var
+ start = (
+ side === 't' ?
+ floor( radius( 'x', 'tl') ) * mult + ',' + ceil( shrink ) * mult :
+ side === 'r' ?
+ ceil( elW - shrink ) * mult + ',' + floor( radius( 'y', 'tr') ) * mult :
+ side === 'b' ?
+ ceil( elW - radius( 'x', 'br') ) * mult + ',' + floor( elH - shrink ) * mult :
+ // side === 'l' ?
+ floor( shrink ) * mult + ',' + ceil( elH - radius( 'y', 'bl') ) * mult
+ ),
+ end = (
+ side === 't' ?
+ ceil( elW - radius( 'x', 'tr') ) * mult + ',' + ceil( shrink ) * mult :
+ side === 'r' ?
+ ceil( elW - shrink ) * mult + ',' + ceil( elH - radius( 'y', 'br') ) * mult :
+ side === 'b' ?
+ floor( radius( 'x', 'bl') ) * mult + ',' + floor( elH - shrink ) * mult :
+ // side === 'l' ?
+ floor( shrink ) * mult + ',' + floor( radius( 'y', 'tl') ) * mult
+ );
+ return ccw ? ( doMove ? 'm' + end : '' ) + 'l' + start :
+ ( doMove ? 'm' + start : '' ) + 'l' + end;
+ }
+
+
+ function addSide( side, sideBefore, sideAfter, cornerBefore, cornerAfter, baseAngle ) {
+ var vert = side === 'l' || side === 'r',
+ sideW = pxWidths[ side ],
+ beforeX, beforeY, afterX, afterY;
+
+ if( sideW > 0 && styles[ side ] !== 'none' && colors[ side ].alpha() > 0 ) {
+ beforeX = pxWidths[ vert ? side : sideBefore ];
+ beforeY = pxWidths[ vert ? sideBefore : side ];
+ afterX = pxWidths[ vert ? side : sideAfter ];
+ afterY = pxWidths[ vert ? sideAfter : side ];
+
+ if( styles[ side ] === 'dashed' || styles[ side ] === 'dotted' ) {
+ segments.push( {
+ path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) +
+ curve( cornerBefore, 0, 0, baseAngle, 1, 0 ),
+ fill: colors[ side ]
+ } );
+ segments.push( {
+ path: line( side, sideW / 2, 0, 1 ),
+ stroke: styles[ side ],
+ weight: sideW,
+ color: colors[ side ]
+ } );
+ segments.push( {
+ path: curve( cornerAfter, afterX, afterY, baseAngle, 0, 1 ) +
+ curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ),
+ fill: colors[ side ]
+ } );
+ }
+ else {
+ segments.push( {
+ path: curve( cornerBefore, beforeX, beforeY, baseAngle + 45, 0, 1 ) +
+ line( side, sideW, 0, 0 ) +
+ curve( cornerAfter, afterX, afterY, baseAngle, 0, 0 ) +
+
+ ( styles[ side ] === 'double' && sideW > 2 ?
+ curve( cornerAfter, afterX - floor( afterX / 3 ), afterY - floor( afterY / 3 ), baseAngle - 45, 1, 0 ) +
+ line( side, ceil( sideW / 3 * 2 ), 1, 0 ) +
+ curve( cornerBefore, beforeX - floor( beforeX / 3 ), beforeY - floor( beforeY / 3 ), baseAngle, 1, 0 ) +
+ 'x ' +
+ curve( cornerBefore, floor( beforeX / 3 ), floor( beforeY / 3 ), baseAngle + 45, 0, 1 ) +
+ line( side, floor( sideW / 3 ), 1, 0 ) +
+ curve( cornerAfter, floor( afterX / 3 ), floor( afterY / 3 ), baseAngle, 0, 0 )
+ : '' ) +
+
+ curve( cornerAfter, 0, 0, baseAngle - 45, 1, 0 ) +
+ line( side, 0, 1, 0 ) +
+ curve( cornerBefore, 0, 0, baseAngle, 1, 0 ),
+ fill: colors[ side ]
+ } );
+ }
+ }
+ }
+
+ addSide( 't', 'l', 'r', 'tl', 'tr', 90 );
+ addSide( 'r', 't', 'b', 'tr', 'br', 0 );
+ addSide( 'b', 'r', 'l', 'br', 'bl', -90 );
+ addSide( 'l', 'b', 't', 'bl', 'tl', -180 );
+ }
+ }
+
+ return segments;
+ },
+
+ destroy: function() {
+ var me = this;
+ if (me.finalized || !me.styleInfos.borderImageInfo.isActive()) {
+ me.targetElement.runtimeStyle.borderColor = '';
+ }
+ PIE.RendererBase.destroy.call( me );
+ }
+
+
+} );
+/**
+ * Renderer for border-image
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ * @param {PIE.RootRenderer} parent
+ */
+PIE.BorderImageRenderer = PIE.RendererBase.newRenderer( {
+
+ boxZIndex: 5,
+ pieceNames: [ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl', 'c' ],
+
+ needsUpdate: function() {
+ return this.styleInfos.borderImageInfo.changed();
+ },
+
+ isActive: function() {
+ return this.styleInfos.borderImageInfo.isActive();
+ },
+
+ draw: function() {
+ this.getBox(); //make sure pieces are created
+
+ var props = this.styleInfos.borderImageInfo.getProps(),
+ borderProps = this.styleInfos.borderInfo.getProps(),
+ bounds = this.boundsInfo.getBounds(),
+ el = this.targetElement,
+ pieces = this.pieces;
+
+ PIE.Util.withImageSize( props.src, function( imgSize ) {
+ var elW = bounds.w,
+ elH = bounds.h,
+ zero = PIE.getLength( '0' ),
+ widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ),
+ widthT = widths['t'].pixels( el ),
+ widthR = widths['r'].pixels( el ),
+ widthB = widths['b'].pixels( el ),
+ widthL = widths['l'].pixels( el ),
+ slices = props.slice,
+ sliceT = slices['t'].pixels( el ),
+ sliceR = slices['r'].pixels( el ),
+ sliceB = slices['b'].pixels( el ),
+ sliceL = slices['l'].pixels( el );
+
+ // Piece positions and sizes
+ function setSizeAndPos( piece, w, h, x, y ) {
+ var s = pieces[piece].style,
+ max = Math.max;
+ s.width = max(w, 0);
+ s.height = max(h, 0);
+ s.left = x;
+ s.top = y;
+ }
+ setSizeAndPos( 'tl', widthL, widthT, 0, 0 );
+ setSizeAndPos( 't', elW - widthL - widthR, widthT, widthL, 0 );
+ setSizeAndPos( 'tr', widthR, widthT, elW - widthR, 0 );
+ setSizeAndPos( 'r', widthR, elH - widthT - widthB, elW - widthR, widthT );
+ setSizeAndPos( 'br', widthR, widthB, elW - widthR, elH - widthB );
+ setSizeAndPos( 'b', elW - widthL - widthR, widthB, widthL, elH - widthB );
+ setSizeAndPos( 'bl', widthL, widthB, 0, elH - widthB );
+ setSizeAndPos( 'l', widthL, elH - widthT - widthB, 0, widthT );
+ setSizeAndPos( 'c', elW - widthL - widthR, elH - widthT - widthB, widthL, widthT );
+
+
+ // image croppings
+ function setCrops( sides, crop, val ) {
+ for( var i=0, len=sides.length; i < len; i++ ) {
+ pieces[ sides[i] ]['imagedata'][ crop ] = val;
+ }
+ }
+
+ // corners
+ setCrops( [ 'tl', 't', 'tr' ], 'cropBottom', ( imgSize.h - sliceT ) / imgSize.h );
+ setCrops( [ 'tl', 'l', 'bl' ], 'cropRight', ( imgSize.w - sliceL ) / imgSize.w );
+ setCrops( [ 'bl', 'b', 'br' ], 'cropTop', ( imgSize.h - sliceB ) / imgSize.h );
+ setCrops( [ 'tr', 'r', 'br' ], 'cropLeft', ( imgSize.w - sliceR ) / imgSize.w );
+
+ // edges and center
+ // TODO right now this treats everything like 'stretch', need to support other schemes
+ //if( props.repeat.v === 'stretch' ) {
+ setCrops( [ 'l', 'r', 'c' ], 'cropTop', sliceT / imgSize.h );
+ setCrops( [ 'l', 'r', 'c' ], 'cropBottom', sliceB / imgSize.h );
+ //}
+ //if( props.repeat.h === 'stretch' ) {
+ setCrops( [ 't', 'b', 'c' ], 'cropLeft', sliceL / imgSize.w );
+ setCrops( [ 't', 'b', 'c' ], 'cropRight', sliceR / imgSize.w );
+ //}
+
+ // center fill
+ pieces['c'].style.display = props.fill ? '' : 'none';
+ }, this );
+ },
+
+ getBox: function() {
+ var box = this.parent.getLayer( this.boxZIndex ),
+ s, piece, i,
+ pieceNames = this.pieceNames,
+ len = pieceNames.length;
+
+ if( !box ) {
+ box = doc.createElement( 'border-image' );
+ s = box.style;
+ s.position = 'absolute';
+
+ this.pieces = {};
+
+ for( i = 0; i < len; i++ ) {
+ piece = this.pieces[ pieceNames[i] ] = PIE.Util.createVmlElement( 'rect' );
+ piece.appendChild( PIE.Util.createVmlElement( 'imagedata' ) );
+ s = piece.style;
+ s['behavior'] = 'url(#default#VML)';
+ s.position = "absolute";
+ s.top = s.left = 0;
+ piece['imagedata'].src = this.styleInfos.borderImageInfo.getProps().src;
+ piece.stroked = false;
+ piece.filled = false;
+ box.appendChild( piece );
+ }
+
+ this.parent.addLayer( this.boxZIndex, box );
+ }
+
+ return box;
+ },
+
+ prepareUpdate: function() {
+ if (this.isActive()) {
+ var me = this,
+ el = me.targetElement,
+ rs = el.runtimeStyle,
+ widths = me.styleInfos.borderImageInfo.getProps().widths;
+
+ // Force border-style to solid so it doesn't collapse
+ rs.borderStyle = 'solid';
+
+ // If widths specified in border-image shorthand, override border-width
+ // NOTE px units needed here as this gets used by the IE9 renderer too
+ if ( widths ) {
+ rs.borderTopWidth = widths['t'].pixels( el ) + 'px';
+ rs.borderRightWidth = widths['r'].pixels( el ) + 'px';
+ rs.borderBottomWidth = widths['b'].pixels( el ) + 'px';
+ rs.borderLeftWidth = widths['l'].pixels( el ) + 'px';
+ }
+
+ // Make the border transparent
+ me.hideBorder();
+ }
+ },
+
+ destroy: function() {
+ var me = this,
+ rs = me.targetElement.runtimeStyle;
+ rs.borderStyle = '';
+ if (me.finalized || !me.styleInfos.borderInfo.isActive()) {
+ rs.borderColor = rs.borderWidth = '';
+ }
+ PIE.RendererBase.destroy.call( this );
+ }
+
+} );
+/**
+ * Renderer for outset box-shadows
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ * @param {PIE.RootRenderer} parent
+ */
+PIE.BoxShadowOutsetRenderer = PIE.RendererBase.newRenderer( {
+
+ boxZIndex: 1,
+ boxName: 'outset-box-shadow',
+
+ needsUpdate: function() {
+ var si = this.styleInfos;
+ return si.boxShadowInfo.changed() || si.borderRadiusInfo.changed();
+ },
+
+ isActive: function() {
+ var boxShadowInfo = this.styleInfos.boxShadowInfo;
+ return boxShadowInfo.isActive() && boxShadowInfo.getProps().outset[0];
+ },
+
+ draw: function() {
+ var me = this,
+ el = this.targetElement,
+ box = this.getBox(),
+ styleInfos = this.styleInfos,
+ shadowInfos = styleInfos.boxShadowInfo.getProps().outset,
+ radii = styleInfos.borderRadiusInfo.getProps(),
+ len = shadowInfos.length,
+ i = len, j,
+ bounds = this.boundsInfo.getBounds(),
+ w = bounds.w,
+ h = bounds.h,
+ clipAdjust = PIE.ieVersion === 8 ? 1 : 0, //workaround for IE8 bug where VML leaks out top/left of clip region by 1px
+ corners = [ 'tl', 'tr', 'br', 'bl' ], corner,
+ shadowInfo, shape, fill, ss, xOff, yOff, spread, blur, shrink, color, alpha, path,
+ totalW, totalH, focusX, focusY, isBottom, isRight;
+
+
+ function getShadowShape( index, corner, xOff, yOff, color, blur, path ) {
+ var shape = me.getShape( 'shadow' + index + corner, 'fill', box, len - index ),
+ fill = shape.fill;
+
+ // Position and size
+ shape['coordsize'] = w * 2 + ',' + h * 2;
+ shape['coordorigin'] = '1,1';
+
+ // Color and opacity
+ shape['stroked'] = false;
+ shape['filled'] = true;
+ fill.color = color.colorValue( el );
+ if( blur ) {
+ fill['type'] = 'gradienttitle'; //makes the VML gradient follow the shape's outline - hooray for undocumented features?!?!
+ fill['color2'] = fill.color;
+ fill['opacity'] = 0;
+ }
+
+ // Path
+ shape.path = path;
+
+ // This needs to go last for some reason, to prevent rendering at incorrect size
+ ss = shape.style;
+ ss.left = xOff;
+ ss.top = yOff;
+ ss.width = w;
+ ss.height = h;
+
+ return shape;
+ }
+
+
+ while( i-- ) {
+ shadowInfo = shadowInfos[ i ];
+ xOff = shadowInfo.xOffset.pixels( el );
+ yOff = shadowInfo.yOffset.pixels( el );
+ spread = shadowInfo.spread.pixels( el );
+ blur = shadowInfo.blur.pixels( el );
+ color = shadowInfo.color;
+ // Shape path
+ shrink = -spread - blur;
+ if( !radii && blur ) {
+ // If blurring, use a non-null border radius info object so that getBoxPath will
+ // round the corners of the expanded shadow shape rather than squaring them off.
+ radii = PIE.BorderRadiusStyleInfo.ALL_ZERO;
+ }
+ path = this.getBoxPath( { t: shrink, r: shrink, b: shrink, l: shrink }, 2, radii );
+
+ if( blur ) {
+ totalW = ( spread + blur ) * 2 + w;
+ totalH = ( spread + blur ) * 2 + h;
+ focusX = totalW ? blur * 2 / totalW : 0;
+ focusY = totalH ? blur * 2 / totalH : 0;
+ if( blur - spread > w / 2 || blur - spread > h / 2 ) {
+ // If the blur is larger than half the element's narrowest dimension, we cannot do
+ // this with a single shape gradient, because its focussize would have to be less than
+ // zero which results in ugly artifacts. Instead we create four shapes, each with its
+ // gradient focus past center, and then clip them so each only shows the quadrant
+ // opposite the focus.
+ for( j = 4; j--; ) {
+ corner = corners[j];
+ isBottom = corner.charAt( 0 ) === 'b';
+ isRight = corner.charAt( 1 ) === 'r';
+ shape = getShadowShape( i, corner, xOff, yOff, color, blur, path );
+ fill = shape.fill;
+ fill['focusposition'] = ( isRight ? 1 - focusX : focusX ) + ',' +
+ ( isBottom ? 1 - focusY : focusY );
+ fill['focussize'] = '0,0';
+
+ // Clip to show only the appropriate quadrant. Add 1px to the top/left clip values
+ // in IE8 to prevent a bug where IE8 displays one pixel outside the clip region.
+ shape.style.clip = 'rect(' + ( ( isBottom ? totalH / 2 : 0 ) + clipAdjust ) + 'px,' +
+ ( isRight ? totalW : totalW / 2 ) + 'px,' +
+ ( isBottom ? totalH : totalH / 2 ) + 'px,' +
+ ( ( isRight ? totalW / 2 : 0 ) + clipAdjust ) + 'px)';
+ }
+ } else {
+ // TODO delete old quadrant shapes if resizing expands past the barrier
+ shape = getShadowShape( i, '', xOff, yOff, color, blur, path );
+ fill = shape.fill;
+ fill['focusposition'] = focusX + ',' + focusY;
+ fill['focussize'] = ( 1 - focusX * 2 ) + ',' + ( 1 - focusY * 2 );
+ }
+ } else {
+ shape = getShadowShape( i, '', xOff, yOff, color, blur, path );
+ alpha = color.alpha();
+ if( alpha < 1 ) {
+ // shape.style.filter = 'alpha(opacity=' + ( alpha * 100 ) + ')';
+ // ss.filter = 'progid:DXImageTransform.Microsoft.BasicImage(opacity=' + ( alpha ) + ')';
+ shape.fill.opacity = alpha;
+ }
+ }
+ }
+ }
+
+} );
+/**
+ * Renderer for re-rendering img elements using VML. Kicks in if the img has
+ * a border-radius applied, or if the -pie-png-fix flag is set.
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ * @param {PIE.RootRenderer} parent
+ */
+PIE.ImgRenderer = PIE.RendererBase.newRenderer( {
+
+ boxZIndex: 6,
+ boxName: 'imgEl',
+
+ needsUpdate: function() {
+ var si = this.styleInfos;
+ return this.targetElement.src !== this._lastSrc || si.borderRadiusInfo.changed();
+ },
+
+ isActive: function() {
+ var si = this.styleInfos;
+ return si.borderRadiusInfo.isActive() || si.backgroundInfo.isPngFix();
+ },
+
+ draw: function() {
+ this._lastSrc = src;
+ this.hideActualImg();
+
+ var shape = this.getShape( 'img', 'fill', this.getBox() ),
+ fill = shape.fill,
+ bounds = this.boundsInfo.getBounds(),
+ w = bounds.w,
+ h = bounds.h,
+ borderProps = this.styleInfos.borderInfo.getProps(),
+ borderWidths = borderProps && borderProps.widths,
+ el = this.targetElement,
+ src = el.src,
+ round = Math.round,
+ cs = el.currentStyle,
+ getLength = PIE.getLength,
+ s, zero;
+
+ // In IE6, the BorderRenderer will have hidden the border by moving the border-width to
+ // the padding; therefore we want to pretend the borders have no width so they aren't doubled
+ // when adding in the current padding value below.
+ if( !borderWidths || PIE.ieVersion < 7 ) {
+ zero = PIE.getLength( '0' );
+ borderWidths = { 't': zero, 'r': zero, 'b': zero, 'l': zero };
+ }
+
+ shape.stroked = false;
+ fill.type = 'frame';
+ fill.src = src;
+ fill.position = (w ? 0.5 / w : 0) + ',' + (h ? 0.5 / h : 0);
+ shape.coordsize = w * 2 + ',' + h * 2;
+ shape.coordorigin = '1,1';
+ shape.path = this.getBoxPath( {
+ t: round( borderWidths['t'].pixels( el ) + getLength( cs.paddingTop ).pixels( el ) ),
+ r: round( borderWidths['r'].pixels( el ) + getLength( cs.paddingRight ).pixels( el ) ),
+ b: round( borderWidths['b'].pixels( el ) + getLength( cs.paddingBottom ).pixels( el ) ),
+ l: round( borderWidths['l'].pixels( el ) + getLength( cs.paddingLeft ).pixels( el ) )
+ }, 2 );
+ s = shape.style;
+ s.width = w;
+ s.height = h;
+ },
+
+ hideActualImg: function() {
+ this.targetElement.runtimeStyle.filter = 'alpha(opacity=0)';
+ },
+
+ destroy: function() {
+ PIE.RendererBase.destroy.call( this );
+ this.targetElement.runtimeStyle.filter = '';
+ }
+
+} );
+/**
+ * Root renderer for IE9; manages the rendering layers in the element's background
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ */
+PIE.IE9RootRenderer = PIE.RendererBase.newRenderer( {
+
+ updatePos: PIE.emptyFn,
+ updateSize: PIE.emptyFn,
+ updateVisibility: PIE.emptyFn,
+ updateProps: PIE.emptyFn,
+
+ outerCommasRE: /^,+|,+$/g,
+ innerCommasRE: /,+/g,
+
+ setBackgroundLayer: function(zIndex, bg) {
+ var me = this,
+ bgLayers = me._bgLayers || ( me._bgLayers = [] ),
+ undef;
+ bgLayers[zIndex] = bg || undef;
+ },
+
+ finishUpdate: function() {
+ var me = this,
+ bgLayers = me._bgLayers,
+ bg;
+ if( bgLayers && ( bg = bgLayers.join( ',' ).replace( me.outerCommasRE, '' ).replace( me.innerCommasRE, ',' ) ) !== me._lastBg ) {
+ me._lastBg = me.targetElement.runtimeStyle.background = bg;
+ }
+ },
+
+ destroy: function() {
+ this.targetElement.runtimeStyle.background = '';
+ delete this._bgLayers;
+ }
+
+} );
+/**
+ * Renderer for element backgrounds, specific for IE9. Only handles translating CSS3 gradients
+ * to an equivalent SVG data URI.
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ */
+PIE.IE9BackgroundRenderer = PIE.RendererBase.newRenderer( {
+
+ bgLayerZIndex: 1,
+
+ needsUpdate: function() {
+ var si = this.styleInfos;
+ return si.backgroundInfo.changed();
+ },
+
+ isActive: function() {
+ var si = this.styleInfos;
+ return si.backgroundInfo.isActive() || si.borderImageInfo.isActive();
+ },
+
+ draw: function() {
+ var me = this,
+ props = me.styleInfos.backgroundInfo.getProps(),
+ bg, images, i = 0, img, bgAreaSize, bgSize;
+
+ if ( props ) {
+ bg = [];
+
+ images = props.bgImages;
+ if ( images ) {
+ while( img = images[ i++ ] ) {
+ if (img.imgType === 'linear-gradient' ) {
+ bgAreaSize = me.getBgAreaSize( img.bgOrigin );
+ bgSize = ( img.bgSize || PIE.BgSize.DEFAULT ).pixels(
+ me.targetElement, bgAreaSize.w, bgAreaSize.h, bgAreaSize.w, bgAreaSize.h
+ ),
+ bg.push(
+ 'url(data:image/svg+xml,' + escape( me.getGradientSvg( img, bgSize.w, bgSize.h ) ) + ') ' +
+ me.bgPositionToString( img.bgPosition ) + ' / ' + bgSize.w + 'px ' + bgSize.h + 'px ' +
+ ( img.bgAttachment || '' ) + ' ' + ( img.bgOrigin || '' ) + ' ' + ( img.bgClip || '' )
+ );
+ } else {
+ bg.push( img.origString );
+ }
+ }
+ }
+
+ if ( props.color ) {
+ bg.push( props.color.val );
+ }
+
+ me.parent.setBackgroundLayer(me.bgLayerZIndex, bg.join(','));
+ }
+ },
+
+ bgPositionToString: function( bgPosition ) {
+ return bgPosition ? bgPosition.tokens.map(function(token) {
+ return token.tokenValue;
+ }).join(' ') : '0 0';
+ },
+
+ getBgAreaSize: function( bgOrigin ) {
+ var me = this,
+ el = me.targetElement,
+ bounds = me.boundsInfo.getBounds(),
+ elW = bounds.w,
+ elH = bounds.h,
+ w = elW,
+ h = elH,
+ borders, getLength, cs;
+
+ if( bgOrigin !== 'border-box' ) {
+ borders = me.styleInfos.borderInfo.getProps();
+ if( borders && ( borders = borders.widths ) ) {
+ w -= borders[ 'l' ].pixels( el ) + borders[ 'l' ].pixels( el );
+ h -= borders[ 't' ].pixels( el ) + borders[ 'b' ].pixels( el );
+ }
+ }
+
+ if ( bgOrigin === 'content-box' ) {
+ getLength = PIE.getLength;
+ cs = el.currentStyle;
+ w -= getLength( cs.paddingLeft ).pixels( el ) + getLength( cs.paddingRight ).pixels( el );
+ h -= getLength( cs.paddingTop ).pixels( el ) + getLength( cs.paddingBottom ).pixels( el );
+ }
+
+ return { w: w, h: h };
+ },
+
+ getGradientSvg: function( info, bgWidth, bgHeight ) {
+ var el = this.targetElement,
+ stopsInfo = info.stops,
+ stopCount = stopsInfo.length,
+ metrics = PIE.GradientUtil.getGradientMetrics( el, bgWidth, bgHeight, info ),
+ startX = metrics.startX,
+ startY = metrics.startY,
+ endX = metrics.endX,
+ endY = metrics.endY,
+ lineLength = metrics.lineLength,
+ stopPx,
+ i, j, before, after,
+ svg;
+
+ // Find the pixel offsets along the CSS3 gradient-line for each stop.
+ stopPx = [];
+ for( i = 0; i < stopCount; i++ ) {
+ stopPx.push( stopsInfo[i].offset ? stopsInfo[i].offset.pixels( el, lineLength ) :
+ i === 0 ? 0 : i === stopCount - 1 ? lineLength : null );
+ }
+ // Fill in gaps with evenly-spaced offsets
+ for( i = 1; i < stopCount; i++ ) {
+ if( stopPx[ i ] === null ) {
+ before = stopPx[ i - 1 ];
+ j = i;
+ do {
+ after = stopPx[ ++j ];
+ } while( after === null );
+ stopPx[ i ] = before + ( after - before ) / ( j - i + 1 );
+ }
+ }
+
+ svg = [
+ '<svg width="' + bgWidth + '" height="' + bgHeight + '" xmlns="http://www.w3.org/2000/svg">' +
+ '<defs>' +
+ '<linearGradient id="g" gradientUnits="userSpaceOnUse"' +
+ ' x1="' + ( startX / bgWidth * 100 ) + '%" y1="' + ( startY / bgHeight * 100 ) + '%" x2="' + ( endX / bgWidth * 100 ) + '%" y2="' + ( endY / bgHeight * 100 ) + '%">'
+ ];
+
+ // Convert to percentage along the SVG gradient line and add to the stops list
+ for( i = 0; i < stopCount; i++ ) {
+ svg.push(
+ '<stop offset="' + ( stopPx[ i ] / lineLength ) +
+ '" stop-color="' + stopsInfo[i].color.colorValue( el ) +
+ '" stop-opacity="' + stopsInfo[i].color.alpha() + '"/>'
+ );
+ }
+
+ svg.push(
+ '</linearGradient>' +
+ '</defs>' +
+ '<rect width="100%" height="100%" fill="url(#g)"/>' +
+ '</svg>'
+ );
+
+ return svg.join( '' );
+ },
+
+ destroy: function() {
+ this.parent.setBackgroundLayer( this.bgLayerZIndex );
+ }
+
+} );
+/**
+ * Renderer for border-image
+ * @constructor
+ * @param {Element} el The target element
+ * @param {Object} styleInfos The StyleInfo objects
+ * @param {PIE.RootRenderer} parent
+ */
+PIE.IE9BorderImageRenderer = PIE.RendererBase.newRenderer( {
+
+ REPEAT: 'repeat',
+ STRETCH: 'stretch',
+ ROUND: 'round',
+
+ bgLayerZIndex: 0,
+
+ needsUpdate: function() {
+ return this.styleInfos.borderImageInfo.changed();
+ },
+
+ isActive: function() {
+ return this.styleInfos.borderImageInfo.isActive();
+ },
+
+ draw: function() {
+ var me = this,
+ props = me.styleInfos.borderImageInfo.getProps(),
+ borderProps = me.styleInfos.borderInfo.getProps(),
+ bounds = me.boundsInfo.getBounds(),
+ repeat = props.repeat,
+ repeatH = repeat.h,
+ repeatV = repeat.v,
+ el = me.targetElement,
+ isAsync = 0;
+
+ PIE.Util.withImageSize( props.src, function( imgSize ) {
+ var elW = bounds.w,
+ elH = bounds.h,
+ imgW = imgSize.w,
+ imgH = imgSize.h,
+
+ // The image cannot be referenced as a URL directly in the SVG because IE9 throws a strange
+ // security exception (perhaps due to cross-origin policy within data URIs?) Therefore we
+ // work around this by converting the image data into a data URI itself using a transient
+ // canvas. This unfortunately requires the border-image src to be within the same domain,
+ // which isn't a limitation in true border-image, so we need to try and find a better fix.
+ imgSrc = me.imageToDataURI( props.src, imgW, imgH ),
+
+ REPEAT = me.REPEAT,
+ STRETCH = me.STRETCH,
+ ROUND = me.ROUND,
+ ceil = Math.ceil,
+
+ zero = PIE.getLength( '0' ),
+ widths = props.widths || ( borderProps ? borderProps.widths : { 't': zero, 'r': zero, 'b': zero, 'l': zero } ),
+ widthT = widths['t'].pixels( el ),
+ widthR = widths['r'].pixels( el ),
+ widthB = widths['b'].pixels( el ),
+ widthL = widths['l'].pixels( el ),
+ slices = props.slice,
+ sliceT = slices['t'].pixels( el ),
+ sliceR = slices['r'].pixels( el ),
+ sliceB = slices['b'].pixels( el ),
+ sliceL = slices['l'].pixels( el ),
+ centerW = elW - widthL - widthR,
+ middleH = elH - widthT - widthB,
+ imgCenterW = imgW - sliceL - sliceR,
+ imgMiddleH = imgH - sliceT - sliceB,
+
+ // Determine the size of each tile - 'round' is handled below
+ tileSizeT = repeatH === STRETCH ? centerW : imgCenterW * widthT / sliceT,
+ tileSizeR = repeatV === STRETCH ? middleH : imgMiddleH * widthR / sliceR,
+ tileSizeB = repeatH === STRETCH ? centerW : imgCenterW * widthB / sliceB,
+ tileSizeL = repeatV === STRETCH ? middleH : imgMiddleH * widthL / sliceL,
+
+ svg,
+ patterns = [],
+ rects = [],
+ i = 0;
+
+ // For 'round', subtract from each tile's size enough so that they fill the space a whole number of times
+ if (repeatH === ROUND) {
+ tileSizeT -= (tileSizeT - (centerW % tileSizeT || tileSizeT)) / ceil(centerW / tileSizeT);
+ tileSizeB -= (tileSizeB - (centerW % tileSizeB || tileSizeB)) / ceil(centerW / tileSizeB);
+ }
+ if (repeatV === ROUND) {
+ tileSizeR -= (tileSizeR - (middleH % tileSizeR || tileSizeR)) / ceil(middleH / tileSizeR);
+ tileSizeL -= (tileSizeL - (middleH % tileSizeL || tileSizeL)) / ceil(middleH / tileSizeL);
+ }
+
+
+ // Build the SVG for the border-image rendering. Add each piece as a pattern, which is then stretched
+ // or repeated as the fill of a rect of appropriate size.
+ svg = [
+ '<svg width="' + elW + '" height="' + elH + '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'
+ ];
+
+ function addImage( x, y, w, h, cropX, cropY, cropW, cropH, tileW, tileH ) {
+ patterns.push(
+ '<pattern patternUnits="userSpaceOnUse" id="pattern' + i + '" ' +
+ 'x="' + (repeatH === REPEAT ? x + w / 2 - tileW / 2 : x) + '" ' +
+ 'y="' + (repeatV === REPEAT ? y + h / 2 - tileH / 2 : y) + '" ' +
+ 'width="' + tileW + '" height="' + tileH + '">' +
+ '<svg width="' + tileW + '" height="' + tileH + '" viewBox="' + cropX + ' ' + cropY + ' ' + cropW + ' ' + cropH + '" preserveAspectRatio="none">' +
+ '<image xlink:href="' + imgSrc + '" x="0" y="0" width="' + imgW + '" height="' + imgH + '" />' +
+ '</svg>' +
+ '</pattern>'
+ );
+ rects.push(
+ '<rect x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" fill="url(#pattern' + i + ')" />'
+ );
+ i++;
+ }
+ addImage( 0, 0, widthL, widthT, 0, 0, sliceL, sliceT, widthL, widthT ); // top left
+ addImage( widthL, 0, centerW, widthT, sliceL, 0, imgCenterW, sliceT, tileSizeT, widthT ); // top center
+ addImage( elW - widthR, 0, widthR, widthT, imgW - sliceR, 0, sliceR, sliceT, widthR, widthT ); // top right
+ addImage( 0, widthT, widthL, middleH, 0, sliceT, sliceL, imgMiddleH, widthL, tileSizeL ); // middle left
+ if ( props.fill ) { // center fill
+ addImage( widthL, widthT, centerW, middleH, sliceL, sliceT, imgCenterW, imgMiddleH,
+ tileSizeT || tileSizeB || imgCenterW, tileSizeL || tileSizeR || imgMiddleH );
+ }
+ addImage( elW - widthR, widthT, widthR, middleH, imgW - sliceR, sliceT, sliceR, imgMiddleH, widthR, tileSizeR ); // middle right
+ addImage( 0, elH - widthB, widthL, widthB, 0, imgH - sliceB, sliceL, sliceB, widthL, widthB ); // bottom left
+ addImage( widthL, elH - widthB, centerW, widthB, sliceL, imgH - sliceB, imgCenterW, sliceB, tileSizeB, widthB ); // bottom center
+ addImage( elW - widthR, elH - widthB, widthR, widthB, imgW - sliceR, imgH - sliceB, sliceR, sliceB, widthR, widthB ); // bottom right
+
+ svg.push(
+ '<defs>' +
+ patterns.join('\n') +
+ '</defs>' +
+ rects.join('\n') +
+ '</svg>'
+ );
+
+ me.parent.setBackgroundLayer( me.bgLayerZIndex, 'url(data:image/svg+xml,' + escape( svg.join( '' ) ) + ') no-repeat border-box border-box' );
+
+ // If the border-image's src wasn't immediately available, the SVG for its background layer
+ // will have been created asynchronously after the main element's update has finished; we'll
+ // therefore need to force the root renderer to sync to the final background once finished.
+ if( isAsync ) {
+ me.parent.finishUpdate();
+ }
+ }, me );
+
+ isAsync = 1;
+ },
+
+ /**
+ * Convert a given image to a data URI
+ */
+ imageToDataURI: (function() {
+ var uris = {};
+ return function( src, width, height ) {
+ var uri = uris[ src ],
+ image, canvas;
+ if ( !uri ) {
+ image = new Image();
+ canvas = doc.createElement( 'canvas' );
+ image.src = src;
+ canvas.width = width;
+ canvas.height = height;
+ canvas.getContext( '2d' ).drawImage( image, 0, 0 );
+ uri = uris[ src ] = canvas.toDataURL();
+ }
+ return uri;
+ }
+ })(),
+
+ prepareUpdate: PIE.BorderImageRenderer.prototype.prepareUpdate,
+
+ destroy: function() {
+ var me = this,
+ rs = me.targetElement.runtimeStyle;
+ me.parent.setBackgroundLayer( me.bgLayerZIndex );
+ rs.borderColor = rs.borderStyle = rs.borderWidth = '';
+ }
+
+} );
+
+PIE.Element = (function() {
+
+ var wrappers = {},
+ lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init',
+ pollCssProp = PIE.CSS_PREFIX + 'poll',
+ trackActiveCssProp = PIE.CSS_PREFIX + 'track-active',
+ trackHoverCssProp = PIE.CSS_PREFIX + 'track-hover',
+ hoverClass = PIE.CLASS_PREFIX + 'hover',
+ activeClass = PIE.CLASS_PREFIX + 'active',
+ focusClass = PIE.CLASS_PREFIX + 'focus',
+ firstChildClass = PIE.CLASS_PREFIX + 'first-child',
+ ignorePropertyNames = { 'background':1, 'bgColor':1, 'display': 1 },
+ classNameRegExes = {},
+ dummyArray = [];
+
+
+ function addClass( el, className ) {
+ el.className += ' ' + className;
+ }
+
+ function removeClass( el, className ) {
+ var re = classNameRegExes[ className ] ||
+ ( classNameRegExes[ className ] = new RegExp( '\\b' + className + '\\b', 'g' ) );
+ el.className = el.className.replace( re, '' );
+ }
+
+ function delayAddClass( el, className /*, className2*/ ) {
+ var classes = dummyArray.slice.call( arguments, 1 ),
+ i = classes.length;
+ setTimeout( function() {
+ if( el ) {
+ while( i-- ) {
+ addClass( el, classes[ i ] );
+ }
+ }
+ }, 0 );
+ }
+
+ function delayRemoveClass( el, className /*, className2*/ ) {
+ var classes = dummyArray.slice.call( arguments, 1 ),
+ i = classes.length;
+ setTimeout( function() {
+ if( el ) {
+ while( i-- ) {
+ removeClass( el, classes[ i ] );
+ }
+ }
+ }, 0 );
+ }
+
+
+
+ function Element( el ) {
+ var renderers,
+ rootRenderer,
+ boundsInfo = new PIE.BoundsInfo( el ),
+ styleInfos,
+ styleInfosArr,
+ initializing,
+ initialized,
+ eventsAttached,
+ eventListeners = [],
+ delayed,
+ destroyed,
+ poll;
+
+ /**
+ * Initialize PIE for this element.
+ */
+ function init() {
+ if( !initialized ) {
+ var docEl,
+ bounds,
+ ieDocMode = PIE.ieDocMode,
+ cs = el.currentStyle,
+ lazy = cs.getAttribute( lazyInitCssProp ) === 'true',
+ trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false',
+ trackHover = cs.getAttribute( trackHoverCssProp ) !== 'false',
+ childRenderers;
+
+ // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll
+ poll = cs.getAttribute( pollCssProp );
+ poll = ieDocMode > 7 ? poll !== 'false' : poll === 'true';
+
+ // Force layout so move/resize events will fire. Set this as soon as possible to avoid layout changes
+ // after load, but make sure it only gets called the first time through to avoid recursive calls to init().
+ if( !initializing ) {
+ initializing = 1;
+ el.runtimeStyle.zoom = 1;
+ initFirstChildPseudoClass();
+ }
+
+ boundsInfo.lock();
+
+ // If the -pie-lazy-init:true flag is set, check if the element is outside the viewport and if so, delay initialization
+ if( lazy && ( bounds = boundsInfo.getBounds() ) && ( docEl = doc.documentElement || doc.body ) &&
+ ( bounds.y > docEl.clientHeight || bounds.x > docEl.clientWidth || bounds.y + bounds.h < 0 || bounds.x + bounds.w < 0 ) ) {
+ if( !delayed ) {
+ delayed = 1;
+ PIE.OnScroll.observe( init );
+ }
+ } else {
+ initialized = 1;
+ delayed = initializing = 0;
+ PIE.OnScroll.unobserve( init );
+
+ // Create the style infos and renderers
+ if ( ieDocMode === 9 ) {
+ styleInfos = {
+ backgroundInfo: new PIE.BackgroundStyleInfo( el ),
+ borderImageInfo: new PIE.BorderImageStyleInfo( el ),
+ borderInfo: new PIE.BorderStyleInfo( el )
+ };
+ styleInfosArr = [
+ styleInfos.backgroundInfo,
+ styleInfos.borderImageInfo
+ ];
+ rootRenderer = new PIE.IE9RootRenderer( el, boundsInfo, styleInfos );
+ childRenderers = [
+ new PIE.IE9BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ),
+ new PIE.IE9BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer )
+ ];
+ } else {
+
+ styleInfos = {
+ backgroundInfo: new PIE.BackgroundStyleInfo( el ),
+ borderInfo: new PIE.BorderStyleInfo( el ),
+ borderImageInfo: new PIE.BorderImageStyleInfo( el ),
+ borderRadiusInfo: new PIE.BorderRadiusStyleInfo( el ),
+ boxShadowInfo: new PIE.BoxShadowStyleInfo( el ),
+ visibilityInfo: new PIE.VisibilityStyleInfo( el )
+ };
+ styleInfosArr = [
+ styleInfos.backgroundInfo,
+ styleInfos.borderInfo,
+ styleInfos.borderImageInfo,
+ styleInfos.borderRadiusInfo,
+ styleInfos.boxShadowInfo,
+ styleInfos.visibilityInfo
+ ];
+ rootRenderer = new PIE.RootRenderer( el, boundsInfo, styleInfos );
+ childRenderers = [
+ new PIE.BoxShadowOutsetRenderer( el, boundsInfo, styleInfos, rootRenderer ),
+ new PIE.BackgroundRenderer( el, boundsInfo, styleInfos, rootRenderer ),
+ //new PIE.BoxShadowInsetRenderer( el, boundsInfo, styleInfos, rootRenderer ),
+ new PIE.BorderRenderer( el, boundsInfo, styleInfos, rootRenderer ),
+ new PIE.BorderImageRenderer( el, boundsInfo, styleInfos, rootRenderer )
+ ];
+ if( el.tagName === 'IMG' ) {
+ childRenderers.push( new PIE.ImgRenderer( el, boundsInfo, styleInfos, rootRenderer ) );
+ }
+ rootRenderer.childRenderers = childRenderers; // circular reference, can't pass in constructor; TODO is there a cleaner way?
+ }
+ renderers = [ rootRenderer ].concat( childRenderers );
+
+ // Add property change listeners to ancestors if requested
+ initAncestorEventListeners();
+
+ // Add to list of polled elements in IE8
+ if( poll ) {
+ PIE.Heartbeat.observe( update );
+ PIE.Heartbeat.run();
+ }
+
+ // Trigger rendering
+ update( 1 );
+ }
+
+ if( !eventsAttached ) {
+ eventsAttached = 1;
+ if( ieDocMode < 9 ) {
+ addListener( el, 'onmove', handleMoveOrResize );
+ }
+ addListener( el, 'onresize', handleMoveOrResize );
+ addListener( el, 'onpropertychange', propChanged );
+ if( trackHover ) {
+ addListener( el, 'onmouseenter', mouseEntered );
+ }
+ if( trackHover || trackActive ) {
+ addListener( el, 'onmouseleave', mouseLeft );
+ }
+ if( trackActive ) {
+ addListener( el, 'onmousedown', mousePressed );
+ }
+ if( el.tagName in PIE.focusableElements ) {
+ addListener( el, 'onfocus', focused );
+ addListener( el, 'onblur', blurred );
+ }
+ PIE.OnResize.observe( handleMoveOrResize );
+
+ PIE.OnUnload.observe( removeEventListeners );
+ }
+
+ boundsInfo.unlock();
+ }
+ }
+
+
+
+
+ /**
+ * Event handler for onmove and onresize events. Invokes update() only if the element's
+ * bounds have previously been calculated, to prevent multiple runs during page load when
+ * the element has no initial CSS3 properties.
+ */
+ function handleMoveOrResize() {
+ if( boundsInfo && boundsInfo.hasBeenQueried() ) {
+ update();
+ }
+ }
+
+
+ /**
+ * Update position and/or size as necessary. Both move and resize events call
+ * this rather than the updatePos/Size functions because sometimes, particularly
+ * during page load, one will fire but the other won't.
+ */
+ function update( force ) {
+ if( !destroyed ) {
+ if( initialized ) {
+ var i, len = renderers.length;
+
+ lockAll();
+ for( i = 0; i < len; i++ ) {
+ renderers[i].prepareUpdate();
+ }
+ if( force || boundsInfo.positionChanged() ) {
+ /* TODO just using getBoundingClientRect (used internally by BoundsInfo) for detecting
+ position changes may not always be accurate; it's possible that
+ an element will actually move relative to its positioning parent, but its position
+ relative to the viewport will stay the same. Need to come up with a better way to
+ track movement. The most accurate would be the same logic used in RootRenderer.updatePos()
+ but that is a more expensive operation since it does some DOM walking, and we want this
+ check to be as fast as possible. */
+ for( i = 0; i < len; i++ ) {
+ renderers[i].updatePos();
+ }
+ }
+ if( force || boundsInfo.sizeChanged() ) {
+ for( i = 0; i < len; i++ ) {
+ renderers[i].updateSize();
+ }
+ }
+ rootRenderer.finishUpdate();
+ unlockAll();
+ }
+ else if( !initializing ) {
+ init();
+ }
+ }
+ }
+
+ /**
+ * Handle property changes to trigger update when appropriate.
+ */
+ function propChanged() {
+ var i, len = renderers.length,
+ renderer,
+ e = event;
+
+ // Some elements lik