<?php
require_once (TEMPLATEPATH . '/Lioit/lioit.php');	
require_once (TEMPLATEPATH . '/admin/index.php');
require_once('woocommerce/lioit_woocommerce.php');
define( 'ACF_LITE' , true );
include_once('advanced-custom-fields/acf.php' );
function isACFActive(){
    return false;
}

/*-----------------------------------------------------------------------------------*/
# CSS
/*-----------------------------------------------------------------------------------*/
function lioit_enqueue_css() {
	
	global $smof_data;
	wp_register_style( 'prettyPhoto', Lioit_URI .'/css/prettyPhoto.css' );
	wp_enqueue_style( 'prettyPhoto' );
	wp_register_style( 'style', Lioit_URI .'/style.css' );
	wp_enqueue_style( 'style' );
	
	wp_register_style( 'rtlstyle', Lioit_URI .'/rtl.css' );
	if(is_rtl()) { 
	wp_enqueue_style( 'rtlstyle' );

 	}
	if ( is_page_template('template-profile.php') ) {
			wp_enqueue_style('thickbox');
			
		}
	if(woocommerce_enabled())
    wp_enqueue_style('lioit_woocommerce', get_template_directory_uri() . '/woocommerce/lioit_woocommerce.css');
	if($smof_data['responsive'] != '0') {
		wp_enqueue_style('responsive', get_template_directory_uri() . '/responsive.css', 'style');
	}	
}
add_action('wp_enqueue_scripts', 'lioit_enqueue_css');
/*-----------------------------------------------------------------------------------*/
# JS
/*-----------------------------------------------------------------------------------*/
function lioit_register_js() {
	

		wp_register_script('jquery_cookie', Lioit_JS . '/cookie.js', 'jquery');
		wp_register_script('cycle_slider', Lioit_JS . '/jquery.cycle.all.min.js', 'jquery');
		wp_register_script('carouFredSel', Lioit_JS . '/jquery.carouFredSel-6.2.1.js', 'jquery');
		wp_register_script('custom-libraries', Lioit_JS . '/custom-libraries.js', 'jquery', '1.0', TRUE);
		wp_register_script('tagsinput', Lioit_JS . '/jquery.tagsinput.js', 'jquery', TRUE);
		wp_register_script('flexslider', Lioit_JS . '/jquery.flexslider-min.js', 'jquery');
		wp_register_script('flexsliderrtl', Lioit_JS . '/jquery.flexslider-rtl.js', 'jquery');
		wp_enqueue_script('notification', Lioit_JS . '/notification.js', 'jquery', '', TRUE);
		wp_register_script('nicescroll', Lioit_JS . '/nicescroll.js', 'jquery', TRUE);
		wp_register_script('validation', Lioit_JS . '/jquery.validate.min.js', 'jquery');
		wp_register_script('classie', Lioit_JS . '/classie.js', 'jquery');
		wp_register_script('gnmenu', Lioit_JS . '/gnmenu.js', 'jquery');
		wp_register_script('custom', Lioit_JS . '/custom.js', 'jquery', '1.0', TRUE);	
		wp_enqueue_script('jquery');	
		wp_enqueue_script('jquery_cookie');
		wp_enqueue_script('cycle_slider');
		wp_enqueue_script('custom-libraries');
		if(is_rtl()) {
			wp_enqueue_script('flexsliderrtl');
		} else {
			wp_enqueue_script('flexslider');
		}
		
		if ( is_page_template('template-profile.php') ) {
			wp_enqueue_script('media-upload');
			wp_enqueue_script('thickbox');
			
		}
		
		 

		if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
		if(woocommerce_enabled())
        wp_enqueue_script('lioit_woocommerce', get_template_directory_uri() . '/woocommerce/lioit_woocommerce.js', false, false, true);
		wp_enqueue_script('carouFredSel');
		wp_enqueue_script('tagsinput');
		wp_enqueue_script('nicescroll');
		wp_enqueue_script('validation');
		wp_enqueue_script('classie');
		wp_enqueue_script('gnmenu');
		wp_enqueue_script('notification');
		wp_enqueue_script('custom');		
	}

add_action('wp_enqueue_scripts', 'lioit_register_js');



function admin_enqueue_scripts() {

    wp_register_script('metasortable', get_template_directory_uri().'/Lioit/meta-box/meta-sortable.js', 'jquery', '1.0');
	wp_register_script('review', get_template_directory_uri().'/Lioit/meta-box/review.js', 'jquery', '1.0');
	wp_enqueue_script('review');	
	wp_enqueue_script('metasortable');
}
add_action( 'admin_enqueue_scripts', 'admin_enqueue_scripts' );

?>