<?php

if ( class_exists('WPBakeryVisualComposerAbstract') ) {
	// **********************************************************************//
	// ! Column HTML
	// **********************************************************************//
	function vc_theme_vc_column($atts, $content = null) {
		$output = $el_class = $width = '';
		extract(shortcode_atts(array(
			'el_class' => '',
			'width' => '1/1'
		), $atts));


		switch ( $width ) {
			case "1/6" :
				$w = "span2";
				break;
			case "1/4" :
				$w = "span3";
				break;
			case "1/3" :
				$w = "span4";
				break;
			case "5/12" :
				$w = "span5";
				break;
			case "1/2" :
				$w = "span6";
				break;
			case "7/12" :
				$w = "span7";
				break;
			case "2/3" :
				$w = "span8";
				break;
			case "3/4" :
				$w = "span9";
				break;
			case "5/6" :
				$w = "span10";
				break;
			case "1/1" :
				$w = "span12";
				break;

			default :
				$w = $width;
		}

		$el_class .= ' '.$w;

		$output .= "\n\t".'<div class="'.$el_class.'">';
		$output .= "\n\t\t".wpb_js_remove_wpautop($content);
		$output .= "\n\t".'</div>';

		return $output;
	}

	if ( !function_exists('vc_theme_vc_accordion') ) {
		function vc_theme_vc_accordion($atts, $content = null) {

			//wp_enqueue_script('jquery-ui-accordion');
			$output = $title = $interval = $el_class = $collapsible = $active_tab = '';

			//
			extract(shortcode_atts(array(
				'id' => '',
				'title' => '',
				'interval' => 0,
				'el_class' => '',
				'collapsible' => 'no',
				'active_tab' => '1'
			), $atts));

			$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'accordion accordion-faq '.$el_class, 'vc_accordion');

			$output .= '<div class="'.$css_class.'" data-collapsible='.$collapsible.' data-active-tab="'.$active_tab.'" ' . ( $id != '' ? 'id="'.$id.'"' : '' ) . '>'; //data-interval="'.$interval.'"

			$output .= wpb_js_remove_wpautop($content);
			$output .= '</div>';//.$this->endBlockComment('.wpb_accordion');

			echo $output;
		}
	}


	if ( !function_exists('vc_theme_vc_accordion_tab') ) {
		function vc_theme_vc_accordion_tab($atts, $content = null) {

			$output = $title = '';

			extract(shortcode_atts(array(
				'title' => __("Section", "js_composer")
			), $atts));
			//<div class="accordion-group">
			$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'accordion-group', 'vc_accordion');
			$output .= '<div class="'.$css_class.'">';

			$output .= '<div class="accordion-heading">
							<a class="accordion-toggle collapsed" data-toggle="collapse" href="#' . sanitize_title($title) . '">
								<span class="open">
									<i class="icon-minus"></i>
								</span>
								<span class="closed">
									<i class="icon-plus"></i>
								</span>'
								. $title .
							'</a>
						</div>';


			$output .= '<div class="accordion-body collapse" id="' . sanitize_title($title) . '">';
			$output .= '<div class="accordion-inner">';
			$output .= ($content=='' || $content==' ') ? __("Empty section. Edit page to add content here.", "js_composer") : wpb_js_remove_wpautop($content);
			$output .= '</div>';
			$output .= '</div>';
			$output .= '</div>';// . $this->endBlockComment('.wpb_accordion_section') . "\n";

			return $output;
		}
	}


	function custom_css_classes_for_vc_row_and_vc_column($class_string, $tag) {
		if ($tag=='vc_row' || $tag=='vc_row_inner') {
			$class_string = str_replace('vc_row-fluid', 'row', $class_string);
		}
		if ($tag=='vc_column' || $tag=='vc_column_inner') {
			$class_string = preg_replace('/vc_span(\d{1,2})/', 'span$1', $class_string);
		}

		$elements = array('vc_raw_html', 'vc_single_image');
		if ( in_array($tag, $elements) ) {
			$class_string = str_replace('wpb_content_element', '', $class_string);
			$class_string = str_replace('wpb_raw_html', '', $class_string);
		}
		return $class_string;
	}
	add_filter('vc_shortcodes_css_class', 'custom_css_classes_for_vc_row_and_vc_column', 10, 2);

	// **********************************************************************//
	// ! Register New Element:Pricing Table
	// **********************************************************************//


	$demoTable = '<div class="price-table-title">FREE</div>'."\n";
	$demoTable .= '<div class="price-table-price">$19 </div>'."\n";
	$demoTable .= '<ul class="price-table-info">'."\n";
	$demoTable .= "\t".'<li>512 mb</li>'."\n";
	$demoTable .= "\t".'<li>Vestibulum justo. Nulla mauris ipsum convallis ut, vestibulum eu, tincidunt euismod erat</li>'."\n";
	$demoTable .= '</ul>';
	$demoTable .= '<a class="button btn-middle" href="#"><i class="icon-basket-1"></i> ADD TO CART</a>'."\n";

	$ptable_params = array(
		'name' => 'Pricing Table',
		'base' => 'ptable',
		'icon' => 'icon-wpb-wp',
		'category' => 'WFT Theme',
		'params' => array(
			array(
				"type" => "textarea_html",
				"holder" => "div",
				"heading" => "Table",
				"param_name" => "content",
				"value" => $demoTable
			),
			array(
				"type" => "dropdown",
				"heading" => __("Style", WFT_DOMAIN),
				"param_name" => "style",
				"value" => array( "", __("default", WFT_DOMAIN) => "default", __("Style 2", WFT_DOMAIN) => "style2")
			),
			array(
				"type" => "textfield",
				"heading" => __("Extra Class", WFT_DOMAIN),
				"param_name" => "class",
				"description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		)

	);

	vc_map($ptable_params);

	// **********************************************************************//
	// ! Register New Element: Team Member
	// **********************************************************************//

	$team_member_params = array(
		'name' => 'Team member',
		'base' => 'team_member',
		'icon' => 'icon-wpb-wp',
		'category' => 'WFT Theme',
		'params' => array(
			array(
				'type' => 'textfield',
				"heading" => __("Member name", WFT_DOMAIN),
				"param_name" => "name"
			),
			array(
				'type' => 'textfield',
				"heading" => __("Member email", WFT_DOMAIN),
				"param_name" => "email"
			),
			array(
				'type' => 'textfield',
				"heading" => __("Position", WFT_DOMAIN),
				"param_name" => "position"
			),
			array(
				'type' => 'attach_image',
				"heading" => __("Avatar", WFT_DOMAIN),
				"param_name" => "img"
			),
			array(
				"type" => "textfield",
				"heading" => __("Image size", "js_composer"),
				"param_name" => "img_size",
				"description" => __("Enter image size. Example in pixels: 200x100 (Width x Height).", "js_composer")
			),
			array(
				"type" => "textfield",
				"heading" => __("Image class", "js_composer"),
				"param_name" => "img_class",
				"description" => __("Enter image class.", "js_composer")
			),
			array(
				"type" => "textarea_html",
				"holder" => "div",
				"heading" => __("Member information", "js_composer"),
				"param_name" => "content",
				"value" => __("Member description", "js_composer")
			),
			array(
				"type" => "dropdown",
				"heading" => __("Display Type", "js_composer"),
				"param_name" => "type",
				"value" => array(
					"",
					__("Vertical", WFT_DOMAIN) => 1,
					__("Horizontal", WFT_DOMAIN) => 2
				)
			),
			array(
				'type' => 'textfield',
				"heading" => __("Facebook link", WFT_DOMAIN),
				"param_name" => "facebook"
			),
			array(
				'type' => 'textfield',
				"heading" => __("Twitter link", WFT_DOMAIN),
				"param_name" => "twitter"
			),
			array(
				'type' => 'textfield',
				"heading" => __("Pinterest link", WFT_DOMAIN),
				"param_name" => "pinterest"
			),
			array(
				'type' => 'textfield',
				"heading" => __("Linkedin link", WFT_DOMAIN),
				"param_name" => "linkedin"
			),
			array(
				'type' => 'textfield',
				"heading" => __("Skype name", WFT_DOMAIN),
				"param_name" => "skype"
			),
			array(
				"type" => "textfield",
				"heading" => __("Extra Class", WFT_DOMAIN),
				"param_name" => "class",
				"description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		)

	);
	vc_map($team_member_params);



	// **********************************************************************//
	// ! Visual Composer Setup
	// **********************************************************************//

	if (!class_exists('WPBakeryVisualComposerAbstract')) {

		// **********************************************************************//
		// ! Row HTML
		// **********************************************************************//
		function vc_theme_vc_row($atts, $content = null) {
			$output = $el_class = '';
			extract(shortcode_atts(array(
				'el_class' => '',
			), $atts));

			wp_enqueue_style( 'js_composer_front' );
			wp_enqueue_script( 'wpb_composer_front_js' );
			wp_enqueue_style('js_composer_custom_css');

			$css_class = $el_class.' row-fluid';

			$output .= '<div class="'.$css_class.'">';
			$output .= wpb_js_remove_wpautop($content);
			$output .= '</div>';

			return $output;
		}


		function vc_theme_vc_row_inner($atts, $content = null) {
			$output = $el_class = '';
			extract(shortcode_atts(array(
				'el_class' => '',
			), $atts));

			wp_enqueue_style( 'js_composer_front' );
			wp_enqueue_script( 'wpb_composer_front_js' );
			wp_enqueue_style('js_composer_custom_css');

			$css_class = $el_class.' row-fluid';

			$output .= '<div class="'.$css_class.'">';
			$output .= wpb_js_remove_wpautop($content);
			$output .= '</div>';

			return $output;
		}

		// **********************************************************************//
		// ! Column HTML
		// **********************************************************************//

		function vc_theme_vc_column($atts, $content = null) {
			$output = $el_class = $width = '';
			extract(shortcode_atts(array(
				'el_class' => '',
				'width' => '1/1'
			), $atts));


			switch ( $width ) {
				case "1/6" :
				  $w = "span2";
				  break;
				case "1/4" :
				  $w = "span3";
				  break;
				case "1/3" :
				  $w = "span4";
				  break;
				case "1/2" :
				  $w = "span6";
				  break;
				case "2/3" :
				  $w = "span8";
				  break;
				case "3/4" :
				  $w = "span9";
				  break;
				case "5/6" :
				  $w = "span10";
				  break;
				case "1/1" :
				  $w = "span12";
				  break;

				default :
				  $w = $width;
			}

			$el_class .= ' '.$w;

			$output .= "\n\t".'<div class="'.$el_class.'">';
			$output .= "\n\t\t".'<div class="wpb_wrapper">';
			$output .= "\n\t\t\t".wpb_js_remove_wpautop($content);
			$output .= "\n\t\t".'</div>';
			$output .= "\n\t".'</div>';

			return $output;
		}

		function vc_theme_vc_column_inner($atts, $content = null) {
			$output = $el_class = $width = '';
			extract(shortcode_atts(array(
				'el_class' => '',
				'width' => '1/1'
			), $atts));


			switch ( $width ) {
				case "1/6" :
				  $w = "span2";
				  break;
				case "1/4" :
				  $w = "span3";
				  break;
				case "1/3" :
				  $w = "span4";
				  break;
				case "1/2" :
				  $w = "span6";
				  break;
				case "2/3" :
				  $w = "span8";
				  break;
				case "3/4" :
				  $w = "span9";
				  break;
				case "5/6" :
				  $w = "span10";
				  break;
				case "1/1" :
				  $w = "span12";
				  break;

				default :
				  $w = $width;
			}

			$el_class .= ' '.$w;

			$output .= "\n\t".'<div class="'.$el_class.'">';
			$output .= "\n\t\t".'<div class="wpb_wrapper">';
			$output .= "\n\t\t\t".wpb_js_remove_wpautop($content);
			$output .= "\n\t\t".'</div>';
			$output .= "\n\t".'</div>';

			return $output;
		}

		// **********************************************************************//
		// ! Separator
		// **********************************************************************//
		$setting_vc_separator = array (
		"show_settings_on_create" => true,
		"controls"  => 'popup_delete',
		  'params' => array(
			  array(
				"type" => "dropdown",
				"heading" => __("Type", "js_composer"),
				"param_name" => "type",
				"value" => array(
					"",
					__("Default", WFT_DOMAIN) => "",
					__("Double", WFT_DOMAIN) => "double",
					__("Dashed", WFT_DOMAIN) => "dashed",
					__("Dotted", WFT_DOMAIN) => "dotted",
					__("Double Dotted", WFT_DOMAIN) => "double dotted",
					__("Double Dashed", WFT_DOMAIN) => "double dashed",
					__("Space", WFT_DOMAIN) => "space"
				  )
			  )
			)
		);
		vc_map_update('vc_separator', $setting_vc_separator);

		function vc_theme_vc_separator($atts, $content = null) {
		  $output = $color = $el_class = $css_animation = '';
		  extract(shortcode_atts(array(
			  'type' => ''
		  ), $atts));

		  $output .= do_shortcode('[hr class="'.$type.'"]');
		  return $output;
		}

		// **********************************************************************//
		// ! Alert boxes
		// **********************************************************************//

		function vc_theme_vc_message($atts, $content = null) {
		  $output = $color = $el_class = $css_animation = '';
		  extract(shortcode_atts(array(
			  'color' => 'alert-info',
			  'el_class' => '',
			  'css_animation' => ''
		  ), $atts));

		  $color = ( $color != '' ) ? ' '.$color : '';
		  $css_class = $color.$el_class;
		  $css_class .= WPBakeryShortCode::getCSSAnimation($css_animation);
		  $output .= '<div class="'.$css_class.'">'.wpb_js_remove_wpautop($content).'<span class="close-parent"></span></div>';
		  return $output;
		}

		// **********************************************************************//
		// ! FAQ toggle elements
		// **********************************************************************//

		function vc_theme_vc_toggle($atts, $content = null) {
		  $output = $title = $css_class = $el_class = $open = $css_animation = '';
		  extract(shortcode_atts(array(
			  'title' => __("Click to toggle", "js_composer"),
			  'el_class' => '',
			  'open' => 'false',
			  'css_animation' => ''
		  ), $atts));


		  $open = ( $open == 'true' ) ? 1 : 0;

		  $css_class .= WPBakeryShortCode::getCSSAnimation($css_animation);
		  $css_class .= WPBakeryShortCode::getExtraClass($el_class);

		  $output .= '<div class="toggle-block '.$css_class.'">'.do_shortcode('[toggle title="'.$title.'" class="'.$css_class.'" active="'.$open.'"]'.wpb_js_remove_wpautop($content).'[/toggle]').'</div>';


		  return $output;
		}

		// **********************************************************************//
		// ! Sliders
		// **********************************************************************//

		function vc_theme_vc_gallery($atts, $content = null) {
		  $output = $title = $type = $onclick = $custom_links = $img_size = $custom_links_target = $images = $el_class = $interval = '';
		  extract(shortcode_atts(array(
			  'title' => '',
			  'type' => 'flexslider',
			  'onclick' => 'link_image',
			  'custom_links' => '',
			  'custom_links_target' => '',
			  'img_size' => 'thumbnail',
			  'images' => '',
			  'el_class' => '',
			  'interval' => '5',
		  ), $atts));
		  $gal_images = '';
		  $link_start = '';
		  $link_end = '';
		  $el_start = '';
		  $el_end = '';
		  $slides_wrap_start = '';
		  $slides_wrap_end = '';
		  $rand = rand(1000,9999);

		  $el_class = WPBakeryShortCode::getExtraClass($el_class);

		  if ( $type == 'nivo' ) {
			  $type = ' wpb_slider_nivo theme-default';
			  wp_enqueue_script( 'nivo-slider' );
			  wp_enqueue_style( 'nivo-slider-css' );
			  wp_enqueue_style( 'nivo-slider-theme' );

			  $slides_wrap_start = '<div class="nivoSlider">';
			  $slides_wrap_end = '</div>';
		  } else if ( $type == 'flexslider' || $type == 'flexslider_fade' || $type == 'flexslider_slide' || $type == 'fading' ) {
			  $el_start = '<li>';
			  $el_end = '</li>';
			  $slides_wrap_start = '<ul class="slides">';
			  $slides_wrap_end = '</ul>';
		  } else if ( $type == 'image_grid' ) {
			  wp_enqueue_script( 'isotope' );

			  $el_start = '<li class="isotope-item">';
			  $el_end = '</li>';
			  $slides_wrap_start = '<ul class="wpb_image_grid_ul">';
			  $slides_wrap_end = '</ul>';
		  }

		  $flex_fx = '';
		  $flex = false;
		  if ( $type == 'flexslider' || $type == 'flexslider_fade' || $type == 'fading' ) {
			  $flex = true;
			  $type = ' wpb_flexslider'.$rand.' flexslider_fade flexslider';
			  $flex_fx = ' data-flex_fx="fade"';
		  } else if ( $type == 'flexslider_slide' ) {
			  $flex = true;
			  $type = ' wpb_flexslider'.$rand.' flexslider_slide flexslider';
			  $flex_fx = ' data-flex_fx="slide"';
		  } else if ( $type == 'image_grid' ) {
			  $type = ' wpb_image_grid';
		  }

		  if ( $images == '' ) $images = '-1,-2,-3';

		  $pretty_rel_random = 'rel-'.rand();

		  if ( $onclick == 'custom_link' ) { $custom_links = explode( ',', $custom_links); }
		  $images = explode( ',', $images);
		  $i = -1;

		  foreach ( $images as $attach_id ) {
			  $i++;
			  if ($attach_id > 0) {
				  $post_thumbnail = wpb_getImageBySize(array( 'attach_id' => $attach_id, 'thumb_size' => $img_size ));
			  }
			  else {
				  $different_kitten = 400 + $i;
				  $post_thumbnail = array();
				  $post_thumbnail['thumbnail'] = '<img src="http://placekitten.com/g/'.$different_kitten.'/300" />';
				  $post_thumbnail['p_img_large'][0] = 'http://placekitten.com/g/1024/768';
			  }

			  $thumbnail = $post_thumbnail['thumbnail'];
			  $p_img_large = $post_thumbnail['p_img_large'];
			  $link_start = $link_end = '';

			  if ( $onclick == 'link_image' ) {
				  $link_start = '<a rel="lightbox" href="'.$p_img_large[0].'">';
				  $link_end = '</a>';
			  }
			  else if ( $onclick == 'custom_link' && isset( $custom_links[$i] ) && $custom_links[$i] != '' ) {
				  $link_start = '<a href="'.$custom_links[$i].'"' . (!empty($custom_links_target) ? ' target="'.$custom_links_target.'"' : '') . '>';
				  $link_end = '</a>';
			  }
			  $gal_images .= $el_start . $link_start . $thumbnail . $link_end . $el_end;
		  }
		  $css_class =  apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_gallery wpb_content_element'.$el_class.' clearfix');
		  $output .= "\n\t".'<div class="'.$css_class.'">';
		  $output .= "\n\t\t".'<div class="wpb_wrapper">';
		  $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_gallery_heading'));
		  $output .= '<div class="wpb_gallery_slides'.$type.'" data-interval="'.$interval.'"'.$flex_fx.'>'.$slides_wrap_start.$gal_images.$slides_wrap_end.'</div>';
		  $output .= "\n\t\t".'</div> '.WPBakeryShortCode::endBlockComment('.wpb_wrapper');
		  $output .= "\n\t".'</div> '.WPBakeryShortCode::endBlockComment('.wpb_gallery');

		  if ( $flex ) {
			  $output .= '<script type="text/javascript">';
			  $output .= 'var sliderElement = jQuery(".wpb_flexslider'.$rand.'");';
				$output .= 'var sliderSpeed = 800,';
					$output .= "sliderTimeout = parseInt(sliderElement.attr('data-interval'))*1000,";
					$output .= "sliderFx = sliderElement.attr('data-flex_fx'),";
					$output .= "slideshow = true;";
				$output .= "if ( sliderTimeout == 0 ) slideshow = false;";

				$output .= "sliderElement.flexslider({";
					$output .= "animation: sliderFx,";
					$output .= "slideshow: slideshow,";
					$output .= "slideshowSpeed: sliderTimeout,";
					$output .= "sliderSpeed: sliderSpeed,";
					$output .= "smoothHeight: false";
				$output .= "});";
			  $output .= "</script>";
		  }

		  return $output;
		}


		// **********************************************************************//
		// ! Accordion
		// **********************************************************************//

		function vc_theme_vc_accordion($atts, $content = null) {
		  $output = $title = $interval = $el_class = $collapsible = $active_tab = '';
		  //
		  extract(shortcode_atts(array(
			  'title' => '',
			  'interval' => 0,
			  'el_class' => '',
			  'collapsible' => 'no',
			  'active_tab' => '1'
		  ), $atts));

		  $el_class = WPBakeryShortCode::getExtraClass($el_class);
		  $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion wpb_content_element '.$el_class.' not-column-inherit');


		  $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_accordion_heading'));

		  $output .= "\n\t".'<div class="'.$css_class.' tabs accordion">';
		  $output .= "\n\t\t\t".wpb_js_remove_wpautop($content);
		  $output .= "\n\t".'</div> '.WPBakeryShortCode::endBlockComment('.wpb_accordion');
		  return $output;
		}

		function vc_theme_vc_accordion_tab($atts, $content = null) {
		  global $tab_count;
		  $output = $title = '';

		  extract(shortcode_atts(array(
			'title' => __("Section", "js_composer")
		  ), $atts));

		  $tab_count++;

			  $output .= "\n\t\t\t\t" . '<a href="#tab_'.$tab_count.'" id="tab_'.$tab_count.'" class="tab-title">'.$title.'</a>';
			  $output .= "\n\t\t\t\t" . '<div id="content_tab_'.$tab_count.'" class="tab-content">';
				  $output .= ($content=='' || $content==' ') ? __("Empty section. Edit page to add content here.", "js_composer") : "\n\t\t\t\t" . wpb_js_remove_wpautop($content);
				  $output .= "\n\t\t\t\t" . '</div>';
		  return $output;
		}

		// **********************************************************************//
		// ! Tabs
		// **********************************************************************//

		$tab_id_1 = time().'-1-'.rand(0, 100);
		$tab_id_2 = time().'-2-'.rand(0, 100);
		vc_map( array(
		  "name"  => __("Tabs", "js_composer"),
		  "base" => "vc_tabs",
		  "show_settings_on_create" => true,
		  "is_container" => true,
		  "icon" => "icon-wpb-ui-tab-content",
		  "category" => __('Content', 'js_composer'),
		  "params" => array(
			array(
			  "type" => "textfield",
			  "heading" => __("Widget title", "js_composer"),
			  "param_name" => "title",
			  "description" => __("What text use as a widget title. Leave blank if no title is needed.", "js_composer")
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Tabs type", "js_composer"),
			  "param_name" => "type",
			  "value" => array(__("Default", "js_composer") => '',
				  __("Accordion", "js_composer") => 'accordion',
				  __("Left bar", "js_composer") => 'left-bar',
				  __("Right bar", "js_composer") => 'right-bar')
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra class name", "js_composer"),
			  "param_name" => "el_class",
			  "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer")
			)
		  ),
		  "custom_markup" => '
		  <div class="wpb_tabs_holder wpb_holder vc_container_for_children">
		  <ul class="tabs_controls">
		  </ul>
		  %content%
		  </div>'
		  ,
		  'default_content' => '
		  [vc_tab title="'.__('Tab 1','js_composer').'" tab_id="'.$tab_id_1.'"][/vc_tab]
		  [vc_tab title="'.__('Tab 2','js_composer').'" tab_id="'.$tab_id_2.'"][/vc_tab]
		  ',
		  "js_view" => ($vc_is_wp_version_3_6_more ? 'VcTabsView' : 'VcTabsView35')
		) );


		function vc_theme_vc_tabs($atts, $content = null) {
		  $output = $title = $interval = $el_class = $collapsible = $active_tab = '';
		  //
		  extract(shortcode_atts(array(
			  'title' => '',
			  'interval' => 0,
			  'el_class' => '',
			  'type' => '',
			  'collapsible' => 'no',
			  'active_tab' => '1'
		  ), $atts));

		  $el_class = WPBakeryShortCode::getExtraClass($el_class);
		  $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion wpb_content_element '.$el_class.' '.$type.' not-column-inherit');


		  $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_accordion_heading'));

		  $output .= "\n\t".'<div class="'.$css_class.' tabs">';
		  $output .= "\n\t\t\t".wpb_js_remove_wpautop($content);
		  $output .= "\n\t".'</div> '.WPBakeryShortCode::endBlockComment('.wpb_accordion');
		  return $output;
		}

		vc_map( array(
		  "name" => __("Tab", "js_composer"),
		  "base" => "vc_tab",
		  "allowed_container_element" => 'vc_row',
		  "is_container" => true,
		  "content_element" => false,
		  "params" => array(
			array(
			  "type" => "textfield",
			  "heading" => __("Title", "js_composer"),
			  "param_name" => "title",
			  "description" => __("Tab title.", "js_composer")
			),
			array(
			  'type' => 'icon',
			  "heading" => __("Icon", WFT_DOMAIN),
			  "param_name" => "icon"
			),
			array(
			  "type" => "tab_id",
			  "heading" => __("Tab ID", "js_composer"),
			  "param_name" => "tab_id"
			)
		  ),
		  'js_view' => ($vc_is_wp_version_3_6_more ? 'VcTabView' : 'VcTabView35')
		) );

		function vc_theme_vc_tab($atts, $content = null) {
		  global $tab_count;
		  $output = $title = $iconHtml = '';

		  extract(shortcode_atts(array(
			'title' => __("Section", "js_composer"),
			'icon' => ''
		  ), $atts));

		  $tab_count++;
		  if($icon != '') {
			$iconHtml = '<i class="icon-'.$icon.'"></i>';
		  }

			  $output .= "\n\t\t\t\t" . '<a href="#tab_'.$tab_count.'" id="tab_'.$tab_count.'" class="tab-title">'.$iconHtml.$title.'</a>';
			  $output .= "\n\t\t\t\t" . '<div id="content_tab_'.$tab_count.'" class="tab-content">';
				  $output .= ($content=='' || $content==' ') ? __("Empty section. Edit page to add content here.", "js_composer") : "\n\t\t\t\t" . wpb_js_remove_wpautop($content);
				  $output .= "\n\t\t\t\t" . '</div>';
		  return $output;
		}


		// **********************************************************************//
		// ! Posts Slider
		// **********************************************************************//
		$setting_vc_posts_slider = array (
		  'params' => array(
		array(
		  "type" => "textfield",
		  "heading" => __("Widget title", "js_composer"),
		  "param_name" => "title",
		  "description" => __("What text use as a widget title. Leave blank if no title is needed.", "js_composer")
		),
		array(
		  "type" => "textfield",
		  "heading" => __("Slides count", "js_composer"),
		  "param_name" => "count",
		  "description" => __('How many slides to show? Enter number or word "All".', "js_composer")
		),
		array(
		  "type" => "posttypes",
		  "heading" => __("Post types", "js_composer"),
		  "param_name" => "posttypes",
		  "description" => __("Select post types to populate posts from.", "js_composer")
		),
		array(
		  "type" => 'checkbox',
		  "heading" => __("Output post date?", "js_composer"),
		  "param_name" => "slides_date",
		  "description" => __("If selected, date will be printed before the teaser text.", "js_composer"),
		  "value" => Array(__("Yes, please", "js_composer") => true)
		),
		array(
		  "type" => "dropdown",
		  "heading" => __("Description", "js_composer"),
		  "param_name" => "slides_content",
		  "value" => array(__("No description", "js_composer") => "", __("Teaser (Excerpt)", "js_composer") => "teaser" ),
		  "description" => __("Some sliders support description text, what content use for it?", "js_composer"),
		  "dependency" => Array('element' => "type", 'value' => array('flexslider_fade', 'flexslider_slide')),
		),
		array(
		  "type" => 'checkbox',
		  "heading" => __("Output post title?", "js_composer"),
		  "param_name" => "slides_title",
		  "description" => __("If selected, title will be printed before the teaser text.", "js_composer"),
		  "value" => Array(__("Yes, please", "js_composer") => true),
		  "dependency" => Array('element' => "slides_content", 'value' => array('teaser')),
		),
		array(
		  "type" => "dropdown",
		  "heading" => __("Link", "js_composer"),
		  "param_name" => "link",
		  "value" => array(__("Link to post", "js_composer") => "link_post", __("Link to bigger image", "js_composer") => "link_image", __("Open custom link", "js_composer") => "custom_link", __("No link", "js_composer") => "link_no"),
		  "description" => __("Link type.", "js_composer")
		),
		array(
		  "type" => "exploded_textarea",
		  "heading" => __("Custom links", "js_composer"),
		  "param_name" => "custom_links",
		  "dependency" => Array('element' => "link", 'value' => 'custom_link'),
		  "description" => __('Enter links for each slide here. Divide links with linebreaks (Enter).', 'js_composer')
		),
		array(
		  "type" => "textfield",
		  "heading" => __("Thumbnail size", "js_composer"),
		  "param_name" => "thumb_size",
		  "description" => __('Enter thumbnail size. Example: 200x100 (Width x Height).', "js_composer")
		),
		array(
		  "type" => "textfield",
		  "heading" => __("Post/Page IDs", "js_composer"),
		  "param_name" => "posts_in",
		  "description" => __('Fill this field with page/posts IDs separated by commas (,), to retrieve only them. Use this in conjunction with "Post types" field.', "js_composer")
		),
		array(
		  "type" => "exploded_textarea",
		  "heading" => __("Categories", "js_composer"),
		  "param_name" => "categories",
		  "description" => __("If you want to narrow output, enter category names here. Note: Only listed categories will be included. Divide categories with linebreaks (Enter).", "js_composer")
		),
		array(
		  "type" => "dropdown",
		  "heading" => __("Order by", "js_composer"),
		  "param_name" => "orderby",
		  "value" => array( "", __("Date", "js_composer") => "date", __("ID", "js_composer") => "ID", __("Author", "js_composer") => "author", __("Title", "js_composer") => "title", __("Modified", "js_composer") => "modified", __("Random", "js_composer") => "rand", __("Comment count", "js_composer") => "comment_count", __("Menu order", "js_composer") => "menu_order" ),
		  "description" => sprintf(__('Select how to sort retrieved posts. More at %s.', 'js_composer'), '<a href="http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>')
		),
		array(
		  "type" => "dropdown",
		  "heading" => __("Order by", "js_composer"),
		  "param_name" => "order",
		  "value" => array( __("Descending", "js_composer") => "DESC", __("Ascending", "js_composer") => "ASC" ),
		  "description" => sprintf(__('Designates the ascending or descending order. More at %s.', 'js_composer'), '<a href="http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>')
		),
		array(
		  "type" => "textfield",
		  "heading" => __("Extra class name", "js_composer"),
		  "param_name" => "el_class",
		  "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer")
		)
	  )
		);
		vc_map_update('vc_posts_slider', $setting_vc_posts_slider);

		function vc_theme_vc_posts_slider($atts, $content = null) {
		  $output = $title = $type = $count = $interval = $slides_content = $link = '';
		  $custom_links = $thumb_size = $posttypes = $posts_in = $categories = '';
		  $orderby = $order = $el_class = $link_image_start = '';
		  extract(shortcode_atts(array(
			  'title' => '',
			  'type' => 'flexslider_fade',
			  'count' => 10,
			  'interval' => 3,
			  'slides_content' => '',
			  'slides_title' => '',
			  'link' => 'link_post',
			  'more_link' => 1,
			  'custom_links' => site_url().'/',
			  'thumb_size' => '300x200',
			  'posttypes' => '',
			  'posts_in' => '',
			  'slides_date' => false,
			  'categories' => '',
			  'orderby' => NULL,
			  'order' => 'DESC',
			  'el_class' => ''
		  ), $atts));

		  $gal_images = '';
		  $link_start = '';
		  $link_end = '';
		  $el_start = '';
		  $el_end = '';
		  $slides_wrap_start = '';
		  $slides_wrap_end = '';

		  $el_class = WPBakeryShortCode::getExtraClass($el_class);

		  $query_args = array();

		  //exclude current post/page from query
		  if ( $posts_in == '' ) {
			  global $post;
			  $query_args['post__not_in'] = array($post->ID);
		  }
		  else if ( $posts_in != '' ) {
			  $query_args['post__in'] = explode(",", $posts_in);
		  }

		  // Post teasers count
		  if ( $count != '' && !is_numeric($count) ) $count = -1;
		  if ( $count != '' && is_numeric($count) ) $query_args['posts_per_page'] = $count;

		  // Post types
		  $pt = array();
		  if ( $posttypes != '' ) {
			  $posttypes = explode(",", $posttypes);
			  foreach ( $posttypes as $post_type ) {
				  array_push($pt, $post_type);
			  }
			  $query_args['post_type'] = $pt;
		  }

		  // Narrow by categories
		  if ( $categories != '' ) {
			  $categories = explode(",", $categories);
			  $gc = array();
			  foreach ( $categories as $grid_cat ) {
				  array_push($gc, $grid_cat);
			  }
			  $gc = implode(",", $gc);
			  ////http://snipplr.com/view/17434/wordpress-get-category-slug/
			  $query_args['category_name'] = $gc;

			  $taxonomies = get_taxonomies('', 'object');
			  $query_args['tax_query'] = array('relation' => 'OR');
			  foreach ( $taxonomies as $t ) {
				  if ( in_array($t->object_type[0], $pt) ) {
					  $query_args['tax_query'][] = array(
						  'taxonomy' => $t->name,//$t->name,//'portfolio_category',
						  'terms' => $categories,
						  'field' => 'slug',
					  );
				  }
			  }
		  }

		  // Order posts
		  if ( $orderby != NULL ) {
			  $query_args['orderby'] = $orderby;
		  }
		  $query_args['order'] = $order;

		  $thumb_size = explode('x', $thumb_size);
		  $width = $thumb_size[0];
		  $height = $thumb_size[1];

		  $crop = true;

		  ob_start();
		  etheme_create_posts_slider($query_args, $title, $more_link, $slides_date, $slides_content, $width, $height, $crop );
		  $output = ob_get_contents();
		  ob_end_clean();

		  return $output;
		}



		// **********************************************************************//
		// ! Button
		// **********************************************************************//
		$setting_vc_button = array (
		  "params" => array(
			  array(
				"type" => "textfield",
				"heading" => __("Text on the button", "js_composer"),
				"holder" => "button",
				"class" => "wpb_button",
				"param_name" => "title",
				"value" => __("Text on the button", "js_composer"),
				"description" => __("Text on the button.", "js_composer")
			  ),
			  array(
				"type" => "textfield",
				"heading" => __("URL (Link)", "js_composer"),
				"param_name" => "href",
				"description" => __("Button link.", "js_composer")
			  ),
			  array(
				"type" => "dropdown",
				"heading" => __("Target", "js_composer"),
				"param_name" => "target",
				"value" => $target_arr,
				"dependency" => Array('element' => "href", 'not_empty' => true)
			  ),
			  array(
				"type" => "dropdown",
				"heading" => __("Type", "js_composer"),
				"param_name" => "btn_type",
				"value" => array('bordered', 'filled'),
				"description" => __("Button type.", "js_composer")
			  ),
			  array(
				"type" => "dropdown",
				"heading" => __("Size", "js_composer"),
				"param_name" => "size",
				"value" => array('small','medium','big'),
				"description" => __("Button size.", "js_composer")
			  ),
			  array(
				"type" => "textfield",
				"heading" => __("Extra class name", "js_composer"),
				"param_name" => "el_class",
				"description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer")
			  )
			)
		);
		vc_map_update('vc_button', $setting_vc_button);

		function vc_theme_vc_button($atts, $content = null) {
		  $output = $btn_type = $size = $icon = $target = $href = $el_class = $title = $position = '';
		  extract(shortcode_atts(array(
			  'btn_type' => '',
			  'size' => '',
			  'target' => '_self',
			  'href' => '',
			  'el_class' => '',
			  'title' => __('Text on the button', "js_composer"),
			  'position' => ''
		  ), $atts));

		  if ( $target == 'same' || $target == '_self' ) { $target = ''; }
		  $target = ( $target != '' ) ? ' target="'.$target.'"' : '';

		  $btn_type = ( $btn_type != '' ) ? ' '.$btn_type : '';
		  $size = ( $size != '') ? ' '.$size : ' ';
		  $position = ( $position != '' ) ? ' '.$position.'-button-position' : '';
		  $el_class = WPBakeryShortCode::getExtraClass($el_class);

		  $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' '.$btn_type.$size.$el_class.$position);

		  if ( $href != '' ) {
			  $output = '<a class="button '.$css_class.'" title="'.$title.'" href="'.$href.'"'.$target.'>' . $title . '</a>';
		  } else {
			  $output .= '<button class="button '.$css_class.'">'.$title.'</button>';

		  }

		  return $output;
		}


		// **********************************************************************//
		// ! Call To Action
		// **********************************************************************//
		$setting_cta_button = array (
		  "params" => array(
			  array(
				"type" => "textarea_html",
				"heading" => __("Text", "js_composer"),
				"param_name" => "content",
				"value" => __("Click edit button to change this text.", "js_composer"),
				"description" => __("Enter your content.", "js_composer")
			  ),
			  array(
				"type" => "dropdown",
				"heading" => __("Block Style", "js_composer"),
				"param_name" => "style",
				"value" => array(
				  "" => "",
				  __("Default", "js_composer") => "default",
				  __("Filled", "js_composer") => "filled",
				  __("Without Border", "js_composer") => "without-border",
				  __("Dark", "js_composer") => "dark"
				)
			  ),
			  array(
				"type" => "textfield",
				"heading" => __("Text on the button", "js_composer"),
				"param_name" => "title",
				"value" => __("Text on the button", "js_composer"),
				"description" => __("Text on the button.", "js_composer")
			  ),
			  array(
				"type" => "textfield",
				"heading" => __("URL (Link)", "js_composer"),
				"param_name" => "href",
				"description" => __("Button link.", "js_composer")
			  ),
			  array(
				"type" => "dropdown",
				"heading" => __("Button position", "js_composer"),
				"param_name" => "position",
				"value" => array(__("Align right", "js_composer") => "right", __("Align left", "js_composer") => "left"),
				"description" => __("Select button alignment.", "js_composer")
			  )
			)
		);
		vc_map_update('vc_cta_button', $setting_cta_button);

		function vc_theme_vc_cta_button($atts, $content = null) {
		  $output = $call_title = $href = $title = $call_text = $el_class = '';
		  extract(shortcode_atts(array(
			  'href' => '',
			  'style' => '',
			  'title' => '',
			  'position' => 'right'
		  ), $atts));

		  return do_shortcode('[callto btn_position="'.$position.'" btn="'.$title.'" style="'.$style.'" link="'.$href.'"]'.$content.'[/callto]');
		}

		// **********************************************************************//
		// ! Progress bar
		// **********************************************************************//
		$setting_progress_bar = array (
		  "params" => array(
			array(
			  "type" => "exploded_textarea",
			  "heading" => __("Graphic values", "js_composer"),
			  "param_name" => "values",
			  "description" => __('Input graph values here. Divide values with linebreaks (Enter). Example: 90|Development', 'js_composer'),
			  "value" => "90|Development,80|Design,70|Marketing"
			),
		  )
		);
		vc_map_update('vc_progress_bar', $setting_progress_bar);

		function vc_theme_vc_progress_bar($atts, $content = null) {
		  $output = $title = '';
		  extract( shortcode_atts( array(
			  'title' => '',
			  'values' => ''
		  ), $atts ) );
		  $graph_lines = explode(",", $values);

		  $output .= '<div class="progress-bars">';

		  foreach ($graph_lines as $line) {
			  $single_val = explode("|", $line);
			  $output .= do_shortcode('[progress title="'.$single_val[1].'" complete="'.$single_val[0].'"]');
		  }

		  $output .= '</div>';


		  return $output;
		}


		// **********************************************************************//
		// ! Register New Element: Testimonials Widget
		// **********************************************************************//

		$testimonials_params = array(
		  'name' => 'Testimonials widget',
		  'base' => 'testimonials',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  "type" => "textfield",
			  "heading" => __("Limit", WFT_DOMAIN),
			  "param_name" => "limit",
			  "description" => __('How many testimonials to show? Enter number.', WFT_DOMAIN)
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Display type", "js_composer"),
			  "param_name" => "type",
			  "value" => array(
				  "",
				  __("Slider", WFT_DOMAIN) => 'slider',
				  __("Grid", WFT_DOMAIN) => 'grid'
				)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Interval", WFT_DOMAIN),
			  "param_name" => "interval",
			  "description" => __('Interval between slides. In milliseconds. Default: 10000', WFT_DOMAIN),
			  "dependency" => Array('element' => "type", 'value' => array('slider'))
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Show Control Navigation", "js_composer"),
			  "param_name" => "navigation",
			  "dependency" => Array('element' => "type", 'value' => array('slider')),
			  "value" => array(
				  "",
				  __("Hide", WFT_DOMAIN) => false,
				  __("Show", WFT_DOMAIN) => true
				)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Category", WFT_DOMAIN),
			  "param_name" => "category",
			  "description" => __('Display testimonials from category.', WFT_DOMAIN)
			),
		  )

		);

		vc_map($testimonials_params);

		// **********************************************************************//
		// ! Register New Element: Recent Comments Widget
		// **********************************************************************//

		$recent_comments_params = array(
		  'name' => 'Recent comments widget',
		  'base' => 'et_recent_comments',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  'type' => 'textfield',
			  "heading" => __("Widget title", WFT_DOMAIN),
			  "param_name" => "title",
			  "description" => __("What text use as a widget title. Leave blank if no title is needed.", WFT_DOMAIN)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Limit", WFT_DOMAIN),
			  "param_name" => "number",
			  "description" => __('How many testimonials to show? Enter number.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($recent_comments_params);

		// **********************************************************************//
		// ! Register New Element: Recent Posts Widget
		// **********************************************************************//

		$recent_posts_params = array(
		  'name' => 'Recent posts widget',
		  'base' => 'et_recent_posts_widget',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  'type' => 'textfield',
			  "heading" => __("Widget title", WFT_DOMAIN),
			  "param_name" => "title",
			  "description" => __("What text use as a widget title. Leave blank if no title is needed.", WFT_DOMAIN)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Limit", WFT_DOMAIN),
			  "param_name" => "number",
			  "description" => __('How many testimonials to show? Enter number.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($recent_posts_params);

		// **********************************************************************//
		// ! Register New Element: Team Member
		// **********************************************************************//

		$team_member_params = array(
		  'name' => 'Team member',
		  'base' => 'team_member',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'WFT Theme',
		  'params' => array(
			array(
			  'type' => 'textfield',
			  "heading" => __("Member name", WFT_DOMAIN),
			  "param_name" => "name"
			),
			array(
			  'type' => 'textfield',
			  "heading" => __("Member email", WFT_DOMAIN),
			  "param_name" => "email"
			),
			array(
			  'type' => 'textfield',
			  "heading" => __("Position", WFT_DOMAIN),
			  "param_name" => "position"
			),
			array(
			  'type' => 'attach_image',
			  "heading" => __("Avatar", WFT_DOMAIN),
			  "param_name" => "img"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Image size", "js_composer"),
			  "param_name" => "img_size",
			  "description" => __("Enter image size. Example in pixels: 200x100 (Width x Height).", "js_composer")
			),
			  array(
				  "type" => "textfield",
				  "heading" => __("Image class", "js_composer"),
				  "param_name" => "img_class",
				  "description" => __("Enter image class.", "js_composer")
			  ),
			array(
			  "type" => "textarea_html",
			  "holder" => "div",
			  "heading" => __("Member information", "js_composer"),
			  "param_name" => "content",
			  "value" => __("Member description", "js_composer")
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Display Type", "js_composer"),
			  "param_name" => "type",
			  "value" => array(
				  "",
				  __("Vertical", WFT_DOMAIN) => 1,
				  __("Horizontal", WFT_DOMAIN) => 2
				)
			),
			array(
			  'type' => 'textfield',
			  "heading" => __("Facebook link", WFT_DOMAIN),
			  "param_name" => "facebook"
			),
			  array(
				  'type' => 'textfield',
				  "heading" => __("Twitter link", WFT_DOMAIN),
				  "param_name" => "twitter"
			  ),
			  array(
				  'type' => 'textfield',
				  "heading" => __("Pinterest link", WFT_DOMAIN),
				  "param_name" => "Pinterest"
			  ),
			array(
			  'type' => 'textfield',
			  "heading" => __("Linkedin link", WFT_DOMAIN),
			  "param_name" => "linkedin"
			),
			array(
			  'type' => 'textfield',
			  "heading" => __("Skype name", WFT_DOMAIN),
			  "param_name" => "skype"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra Class", WFT_DOMAIN),
			  "param_name" => "class",
			  "description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		  )

		);
		vc_map($team_member_params);

		// **********************************************************************//
		// ! Register New Element: Icon
		// **********************************************************************//

		$icon_box_params = array(
		  'name' => 'Awesome Icon',
		  'base' => 'icon',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  'type' => 'icon',
			  "heading" => __("Icon", WFT_DOMAIN),
			  "param_name" => "name"
			),
			array(
			  'type' => 'textfield',
			  "heading" => __("Size", WFT_DOMAIN),
			  "param_name" => "size",
			  "description" => __('For example: 64', WFT_DOMAIN)
			),
			array(
			  'type' => 'colorpicker',
			  "heading" => __("Color", WFT_DOMAIN),
			  "param_name" => "color"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra Class", WFT_DOMAIN),
			  "param_name" => "class",
			  "description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($icon_box_params);

		// **********************************************************************//
		// ! Register New Element: Icon Box
		// **********************************************************************//

		$icon_box_params = array(
		  'name' => 'Icon Box',
		  'base' => 'icon_box',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  'type' => 'textfield',
			  "heading" => __("Box title", WFT_DOMAIN),
			  "param_name" => "title"
			),
			array(
			  'type' => 'icon',
			  "heading" => __("Icon", WFT_DOMAIN),
			  "param_name" => "icon"
			),
			array(
			  'type' => 'colorpicker',
			  "heading" => __("Icon Color", WFT_DOMAIN),
			  "param_name" => "color"
			),
			array(
			  "type" => "textarea_html",
			  'admin_label' => true,
			  "heading" => __("Text", "js_composer"),
			  "param_name" => "content",
			  "value" => __("Click edit button to change this text.", "js_composer"),
			  "description" => __("Enter your content.", "js_composer")
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Icon Position", "js_composer"),
			  "param_name" => "icon_position",
			  "value" => array(
				  "",
				  __("Top", WFT_DOMAIN) => 'top',
				  __("Left", WFT_DOMAIN) => 'left'
				)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra Class", WFT_DOMAIN),
			  "param_name" => "class",
			  "description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($icon_box_params);

		// **********************************************************************//
		// ! Register New Element: Banner with mask
		// **********************************************************************//

		$icon_box_params = array(
		  'name' => 'Banner',
		  'base' => 'banner',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  'type' => 'attach_image',
			  "heading" => __("Banner Image", WFT_DOMAIN),
			  "param_name" => "img"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Banner size", "js_composer"),
			  "param_name" => "img_size",
			  "description" => __("Enter image size. Example in pixels: 200x100 (Width x Height).", "js_composer")
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Link", "js_composer"),
			  "param_name" => "link",
			  "description" => __("Enter image size. Example in pixels: 200x100 (Width x Height).", "js_composer")
			),
			array(
			  "type" => "textarea_html",
			  "holder" => "div",
			  "heading" => "Banner Mask Text",
			  "param_name" => "content",
			  "value" => "Some promo text"
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Font style", WFT_DOMAIN),
			  "param_name" => "font_style",
			  "value" => array( "", __("light", WFT_DOMAIN) => "light", __("dark", WFT_DOMAIN) => "dark")
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Hover effect", WFT_DOMAIN),
			  "param_name" => "hover",
			  "value" => array( "", __("zoom", WFT_DOMAIN) => "zoom", __("fade", WFT_DOMAIN) => "fade")
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra Class", WFT_DOMAIN),
			  "param_name" => "class",
			  "description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($icon_box_params);

		// **********************************************************************//
		// ! Register New Element:Pricing Table
		// **********************************************************************//
		$demoTable = "\n\t".'<ul>';
		$demoTable .= "\n\t\t".'<li class="row-title">Free</li>';
		$demoTable .= "\n\t\t".'<li class="row-price"><sup class="currency">$</sup>19<sup>00</sup><sub>per month</sub></li>';
		$demoTable .= "\n\t\t".'<li>512 mb</li>';
		$demoTable .= "\n\t\t".'<li>0.6 GHz</li>';
		$demoTable .= "\n\t\t".'<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</li>';
		$demoTable .= "\n\t\t".'<li><a href="#" class="button">Add to Cart</a></li>';
		$demoTable .= "\n\t".'</ul>';


		$ptable_params = array(
		  'name' => 'Pricing Table',
		  'base' => 'ptable',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'WFT Theme',
		  'params' => array(
			array(
			  "type" => "textarea_html",
			  "holder" => "div",
			  "heading" => "Table",
			  "param_name" => "content",
			  "value" => $demoTable
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Style", WFT_DOMAIN),
			  "param_name" => "style",
			  "value" => array( "", __("default", WFT_DOMAIN) => "default", __("Style 2", WFT_DOMAIN) => "style2")
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra Class", WFT_DOMAIN),
			  "param_name" => "class",
			  "description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($ptable_params);

		// **********************************************************************//
		// ! Register New Element: Single post
		// **********************************************************************//

		$fpost_params = array(
		  'name' => 'Single blog post',
		  'base' => 'single_post',
		  'icon' => 'icon-wpb-etheme',
		  'category' => 'Eight Theme',
		  'params' => array(
			array(
			  "type" => "textfield",
			  "heading" => __("Title", WFT_DOMAIN),
			  "param_name" => "title"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Post ID", WFT_DOMAIN),
			  "param_name" => "id"
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Show more posts link", WFT_DOMAIN),
			  "param_name" => "more_posts",
			  "value" => array( "", __("Show", WFT_DOMAIN) => 1, __("Hide", WFT_DOMAIN) => 0)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra Class", WFT_DOMAIN),
			  "param_name" => "class",
			  "description" => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', WFT_DOMAIN)
			)
		  )

		);

		vc_map($fpost_params);

		// **********************************************************************//
		// ! Register New Element: Sections
		// **********************************************************************//

		vc_map( array(
		  "name" => __("Section", "js_composer"),
		  "base" => "et_section",
		  "is_container" => true,
		  "icon" => "icon-wpb-row",
		  "show_settings_on_create" => false,
		  "category" => __('Content', 'js_composer'),
		  "params" => array(
			array(
			  "type" => "dropdown",
			  "heading" => __("Color Scheme", WFT_DOMAIN),
			  "param_name" => "color_sceheme",
			  "value" => array( "", __("default", WFT_DOMAIN) => "default", __("Dark with light text", WFT_DOMAIN) => "dark")
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Padding", WFT_DOMAIN),
			  "param_name" => "padding",
			  "value" => array( "", __("default", WFT_DOMAIN) => "", __("No padding", WFT_DOMAIN) => "no-padding", __("Small padding", WFT_DOMAIN) => "small-padding", __("Large padding", WFT_DOMAIN) => "large-padding", __("Top padding", WFT_DOMAIN) => "top-padding")
			),
			array(
			  "type" => "attach_image",
			  "heading" => __("Video poster image", "js_composer"),
			  "param_name" => "video_poster"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Video URL (mp4)", "js_composer"),
			  "param_name" => "video_mp4"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Video URL (webm)", "js_composer"),
			  "param_name" => "video_webm"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Video URL (ogv)", "js_composer"),
			  "param_name" => "video_ogv"
			),
			array(
			  'type' => 'colorpicker',
			  "heading" => __("Background color", WFT_DOMAIN),
			  "param_name" => "color"
			),
			array(
			  'type' => 'attach_image',
			  "heading" => __("Background image", WFT_DOMAIN),
			  "param_name" => "img"
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Section Border", WFT_DOMAIN),
			  "param_name" => "section_border",
			  "value" => array( "", __("display border", WFT_DOMAIN) => "display-border", __("no border", WFT_DOMAIN) => "no-border")
			),
			array(
			  "type" => "dropdown",
			  "heading" => __("Parallax effect for background", WFT_DOMAIN),
			  "param_name" => "parallax",
			  "value" => array( "", __("enable", WFT_DOMAIN) => 1,  __("disable", WFT_DOMAIN) => 0)
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Margin top", "js_composer"),
			  "param_name" => "mt"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Margin bottom", "js_composer"),
			  "param_name" => "mb"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Padding top", "js_composer"),
			  "param_name" => "pt"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Padding bottom", "js_composer"),
			  "param_name" => "pb"
			),
			array(
			  "type" => "textfield",
			  "heading" => __("Extra class name", "js_composer"),
			  "param_name" => "el_class",
			  "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer")
			)
		  ),
		  "js_view" => 'VcSectionView'
		) );


		function vc_theme_et_section($atts, $content = null) {
			return etheme_et_section_shortcode($atts, $content);
		}

		add_filter('vc_nav_controls', 'vc_add_section_btn',10,3);

		/**
		 * Add new button to VC toolbar
		 *
		 **/
		function vc_add_section_btn($buttons) {
		  $buttons[] =  array(
						  'add_section',
						  '<ul class="vc_nav">
							<li>
							  <a class="wpb_add_new_section dropable_section button" id="wpb-add-new-section" data-element="vc_section"><i class="icon"></i>'.__('Add Section', 'js_composer').'</a>
							</li>
						  </ul>'
						  );
		  return $buttons;
		}

	}
}