<?php
/**
* @package Krown
* @subpackage Krown
* @since Krown 1.0
*/
//=========================================
// Enqueue all Evential CSS
//=========================================
global $tlazya_krwn; 
if (isset($tlazya_krwn['rtl_switch']) && $tlazya_krwn['rtl_switch'] == 1 ) {

function krwn_all_default_style()
{
	wp_enqueue_style( 'style', get_stylesheet_uri());
    wp_enqueue_style('bootstrap-css', get_template_directory_uri().'/assets/css/bootstrap.css');
    wp_enqueue_style('bootstraprtl-css', get_template_directory_uri().'/assets/css/bootstrap-rtl.css');
    wp_enqueue_style('awesome-css', get_template_directory_uri().'/assets/css/font-awesome.min.css');
    wp_enqueue_style('Pixelvicon-css', get_template_directory_uri().'/assets/css/Pixelvicon.css');
    wp_enqueue_style('animate-css', get_template_directory_uri().'/assets/css/animate.css');
    wp_enqueue_style('carousel-css', get_template_directory_uri().'/assets/css/owl.carousel.css');
    wp_enqueue_style('magnific-css', get_template_directory_uri().'/assets/css/magnific-popup.css');
    wp_enqueue_style('theme-css', get_template_directory_uri().'/assets/css/style-rtl.css');
}

} 
elseif (isset($tlazya_krwn['rtl_switch']) && $tlazya_krwn['rtl_switch'] == 0 ) 
{

function krwn_all_default_style()
{
	wp_enqueue_style( 'style', get_stylesheet_uri());
    wp_enqueue_style('bootstrap-css', get_template_directory_uri().'/assets/css/bootstrap.css');
    wp_enqueue_style('awesome-css', get_template_directory_uri().'/assets/css/font-awesome.min.css');
    wp_enqueue_style('Pixelvicon-css', get_template_directory_uri().'/assets/css/Pixelvicon.css');
    wp_enqueue_style('animate-css', get_template_directory_uri().'/assets/css/animate.css');
    wp_enqueue_style('carousel-css', get_template_directory_uri().'/assets/css/owl.carousel.css');
    wp_enqueue_style('magnific-css', get_template_directory_uri().'/assets/css/magnific-popup.css');
    wp_enqueue_style('theme-css', get_template_directory_uri().'/assets/css/style.css');
}

}
else 
{

function krwn_all_default_style()
{
	wp_enqueue_style( 'style', get_stylesheet_uri());
    wp_enqueue_style('bootstrap-css', get_template_directory_uri().'/assets/css/bootstrap.css');
    wp_enqueue_style('awesome-css', get_template_directory_uri().'/assets/css/font-awesome.min.css');
    wp_enqueue_style('Pixelvicon-css', get_template_directory_uri().'/assets/css/Pixelvicon.css');
    wp_enqueue_style('animate-css', get_template_directory_uri().'/assets/css/animate.css');
    wp_enqueue_style('carousel-css', get_template_directory_uri().'/assets/css/owl.carousel.css');
    wp_enqueue_style('magnific-css', get_template_directory_uri().'/assets/css/magnific-popup.css');
    wp_enqueue_style('theme-css', get_template_directory_uri().'/assets/css/style.css');
}

}

// Google Font //
function krwn_google_fonts() {
    $protocol = is_ssl() ? 'https' : 'http';
    wp_enqueue_style( 'mytheme-roboto', "$protocol://fonts.googleapis.com/css?family=Montserrat:400,700%7CCrete+Round:400,400italic" );}

// Editor Style //

function krwn_add_editor_styles() {
    add_editor_style( 'editor-style.css' );
}

//=========================================
// Enqueue all Evential JS
//=========================================
function krwn_all_default_script()
{
	wp_enqueue_script('appear', get_template_directory_uri().'/assets/js/jquery.appear.js', array( 'jquery' ), '', true);
	wp_enqueue_script('placeholder', get_template_directory_uri().'/assets/js/jquery.placeholder.js', array( 'appear' ), '', true);
	wp_enqueue_script('imagesloaded', get_template_directory_uri().'/assets/js/jquery.imagesloaded.js', array( 'placeholder' ), '', true);
	wp_enqueue_script('magnific', get_template_directory_uri().'/assets/js/jquery.magnific-popup.js', array( 'imagesloaded' ), '', true);
	wp_enqueue_script('carousel', get_template_directory_uri().'/assets/js/jquery.owl.carousel.min.js', array( 'magnific' ), '', true);
	wp_enqueue_script('nav', get_template_directory_uri().'/assets/js/jquery.nav.js', array( 'carousel' ), '', true);
	wp_enqueue_script('parallax', get_template_directory_uri().'/assets/js/jquery.parallax-1.1.3.js', array( 'nav' ), '', true);
	wp_enqueue_script('countTo', get_template_directory_uri().'/assets/js/jquery.countTo.js', array( 'parallax' ), '', true);
	wp_enqueue_script('pin', get_template_directory_uri().'/assets/js/jquery.pin.js', array( 'countTo' ), '', true);
	wp_enqueue_script('isotope', get_template_directory_uri().'/assets/js/jquery.isotope.min.js', array( 'pin' ), '', true);
	wp_enqueue_script('fitvids', get_template_directory_uri().'/assets/js/jquery.fitvids.js', array( 'isotope' ), '', true);
	wp_enqueue_script('gmap', 'http://maps.google.com/maps/api/js', array( 'fitvids' ), '', true);
	wp_enqueue_script('easypiechart', get_template_directory_uri().'/assets/js/jquery.easypiechart.min.js', array( 'gmap' ), '', true);
	//wp_enqueue_script('custom', get_template_directory_uri().'/assets/js/custom.js', array( 'easypiechart' ), '', true);

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
            wp_enqueue_script( 'comment-reply' );
    }
}