<?php
$init_script = <<<HTML
	jQuery('[name="_source[]"]').live("change",function(){
		var __val = jQuery(this).val();
		var _val={};
		jQuery.each(__val, function(key, value) { 
			if(value.indexOf('|')!=-1){
				var source = value.split('|');
				if(_val[source[0]] == undefined){
					_val[source[0]]=[];
				}
				if(_val[source[0]] != true){
					_val[source[0]].push(source[1])
				}
			}else{
				_val[value] = true;
			}
		});
		var val=[];
		jQuery.each(_val, function(key, value) { 
			if($.isArray(value)){
				val.push('{'+key+':'+value.join(',')+'}');
			}else{
				val.push('{'+key+'}');
			}
		});
		jQuery('[name="source"]').val(val.join(''));
	});
HTML;
if (! function_exists("theme_dialog_slideshow_source")) {
function theme_dialog_slideshow_source($option){
	include_once (THEME_HELPERS . '/baseOptionsGenerator.php');
	$generator = new baseOptionsGenerator();
	echo '<input type="hidden" id="' . $option['id'] . '" name="' . $option['id'] . '" value="" />';
	$option['id'] = '_source';
	$generator->multiselect($option);
}
}
return array(
	"title" => __("Anything Slideshow", THEME_ADMIN_DOMAIN),
	"shortcode" => 'slideshow',
	"attributes" => 'type="anything"',
	"type" => 'both',
	"init" => $init_script,
	"options" => array(
		array(
			"name" => __("Images Srcs (optional)",THEME_ADMIN_DOMAIN),
			"id" => "content",
			"default" => "",
			"type" => "textarea"
		),
		
		array(
			"name" => __("Number (optional)",THEME_ADMIN_DOMAIN),
			"desc" => __("Sets the number of images to display.<br> 0: Display all images.",THEME_ADMIN_DOMAIN),
			"id" => "number",
			"default" => '0',
			"min" => 0,
			"max" => 20,
			"step" => "1",
			"type" => "range"
		),
		array(
			"name" => __("SlideShow Source (optional)",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which SlideShow Source to show.",THEME_ADMIN_DOMAIN),
			"id" => "source",
			"options" => array(
				"g" => __('Self Gallery',THEME_ADMIN_DOMAIN),
			),
			"default" => "",
			"chosen" => true,
			"prompt" => __("Select Source..",THEME_ADMIN_DOMAIN),
			'target' => 'slideshow_source',
			'function' => 'theme_dialog_slideshow_source',
			"type" => "custom"
		),
		array(
			"name" => __("Width",THEME_ADMIN_DOMAIN),
			"desc" => __("Width of slider.",THEME_ADMIN_DOMAIN),
			"id" => "width",
			"min" => "10",
			"max" => "960",
			"step" => "1",
			"unit" => 'px',
			"default" => "630",
			"type" => "range"
		),
		array(
			"name" => __("Height",THEME_ADMIN_DOMAIN),
			"desc" => __("Height of slider.",THEME_ADMIN_DOMAIN),
			"id" => "height",
			"min" => "10",
			"max" => "1000",
			"step" => "1",
			"unit" => 'px',
			"default" => "300",
			"type" => "range"
		),
		array(
			"name" =>  __("Align (optional)",THEME_ADMIN_DOMAIN),
			"id" => "align",
			"default" => '',
			"prompt" => __("Default",THEME_ADMIN_DOMAIN),
			"options" => array(
				"left" => __('left',THEME_ADMIN_DOMAIN),
				"right" => __('right',THEME_ADMIN_DOMAIN),
				"center" => __('center',THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => __("pauseOnHover",THEME_ADMIN_DOMAIN),
			"desc" => __("If true & the slideshow is active, the slideshow will pause on hover",THEME_ADMIN_DOMAIN),
			"id" => "pauseonhover",
			"default" => "1",
			"type" => "toggle"
		),
		array(
			"name" => __("autoPlay",THEME_ADMIN_DOMAIN),
			"desc" => __("If true, the slideshow will starts running automatically.",THEME_ADMIN_DOMAIN),
			"id" => "nvio_slide_autoPlay",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("Pause Time",THEME_ADMIN_DOMAIN),
			"desc" => __("How long between slideshow transitions in AutoPlay mode",THEME_ADMIN_DOMAIN),
			"id" => "pausetime",
			"min" => "1000",
			"max" => "30000",
			"step" => "500",
			'unit' => 'miliseconds',
			"default" => "3500",
			"type" => "range"
		),
		array(
			"name" => __("Animate Speed",THEME_ADMIN_DOMAIN),
			"desc" => __("How long the slideshow transition takes",THEME_ADMIN_DOMAIN),
			"id" => "animatespeed",
			"min" => "200",
			"max" => "3000",
			"step" => "100",
			"unit" => 'miliseconds',
			"default" => "500",
			"type" => "range"
		),
		array(
			"name" => __("SlideShow Animations",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which slidetext animation effect to use.",THEME_ADMIN_DOMAIN),
			"id" => "animate",
			"default" => 'fade',
			"options" => array(
				'anythingBox'=>__('AnythingBox',THEME_ADMIN_DOMAIN),
				'all'=>__("Random",THEME_ADMIN_DOMAIN),
				'blindX'=>__("BlindX",THEME_ADMIN_DOMAIN),
				'blindY'=>__("BlindY",THEME_ADMIN_DOMAIN),
				'blindZ'=>__("BlindZ",THEME_ADMIN_DOMAIN),
				'cover'=>__("Cover",THEME_ADMIN_DOMAIN),
				'uncover'=>__("Uncover",THEME_ADMIN_DOMAIN),
				'curtainX'=>__("CurtainX",THEME_ADMIN_DOMAIN),
				'curtainY'=>__("CurtainY",THEME_ADMIN_DOMAIN),
				'fade'=>__("Fade",THEME_ADMIN_DOMAIN),
				'fadeout'=>__("FadeOut",THEME_ADMIN_DOMAIN),
				'fadeZoom'=>__("FadeZoom",THEME_ADMIN_DOMAIN),
				'growX'=>__("GrowX",THEME_ADMIN_DOMAIN),
				'growY'=>__("GrowY",THEME_ADMIN_DOMAIN),
				'scrollUp'=>__("ScrollUp",THEME_ADMIN_DOMAIN),
				'scrollDown'=>__("ScrollDown",THEME_ADMIN_DOMAIN),
				'scrollLeft'=>__("ScrollLeft",THEME_ADMIN_DOMAIN),
				'scrollRight'=>__("ScrollRight",THEME_ADMIN_DOMAIN),
				'scrollHorz'=>__("ScrollHorz",THEME_ADMIN_DOMAIN),
				'scrollVert'=>__("ScrollVert",THEME_ADMIN_DOMAIN),
				'shuffle'=>__("Shuffle",THEME_ADMIN_DOMAIN),
				'slideX'=>__("SlideX",THEME_ADMIN_DOMAIN),
				'slideY'=>__("SlideY",THEME_ADMIN_DOMAIN),
				'toss'=>__("Toss",THEME_ADMIN_DOMAIN),
				'turnUp'=>__("TurnUp",THEME_ADMIN_DOMAIN),
				'turnDown'=>__("TurnDown",THEME_ADMIN_DOMAIN),
				'turnLeft'=>__("TurnLeft",THEME_ADMIN_DOMAIN),
				'turnRight'=>__("TurnRigh",THEME_ADMIN_DOMAIN),
				'uncover'=>__("Uncover",THEME_ADMIN_DOMAIN),
				'wipe'=>__("Wipe",THEME_ADMIN_DOMAIN),
				'zoom'=>__("Zoom",THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => __("Easing",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which animation easing to use.",THEME_ADMIN_DOMAIN),
			"id" => "easing",
			"default" => 'swing',
			"type" => "select",
			"options" => array(
				'swing'=>__("swing",THEME_ADMIN_DOMAIN),
				'linear'=>__("linear",THEME_ADMIN_DOMAIN),
				'jswingeY'=>__("jswing",THEME_ADMIN_DOMAIN),
				'easeInQuad'=>__("easeInQuad",THEME_ADMIN_DOMAIN),
				'easeOutQuad'=>__("easeOutQuad",THEME_ADMIN_DOMAIN),
				'easeInOutQuad'=>__("easeInOutQuad",THEME_ADMIN_DOMAIN),
				'easeInCubic'=>__("easeInCubic",THEME_ADMIN_DOMAIN),
				'easeOutCubic'=>__("easeOutCubic",THEME_ADMIN_DOMAIN),
				'easeInOutCubic'=>__("easeInOutCubic",THEME_ADMIN_DOMAIN),
				'easeInQuart'=>__("easeInQuart",THEME_ADMIN_DOMAIN),
				'easeOutQuart'=>__("easeOutQuart",THEME_ADMIN_DOMAIN),
				'easeInOutQuart'=>__("easeInOutQuart",THEME_ADMIN_DOMAIN),
				'easeInQuint'=>__("easeInQuint",THEME_ADMIN_DOMAIN),
				'easeOutQuint'=>__("easeOutQuint",THEME_ADMIN_DOMAIN),
				'easeInOutQuint'=>__("easeInOutQuint",THEME_ADMIN_DOMAIN),
				'easeInSine'=>__("easeInSine",THEME_ADMIN_DOMAIN),
				'easeOutSine'=>__("easeOutSine",THEME_ADMIN_DOMAIN),
				'easeInOutSine'=>__("easeInOutSine",THEME_ADMIN_DOMAIN),
				'easeInExpo'=>__("easeInExpo",THEME_ADMIN_DOMAIN),
				'easeOutExpo'=>__("easeOutExpo",THEME_ADMIN_DOMAIN),
				'easeInCirc'=>__("easeInCirc",THEME_ADMIN_DOMAIN),
				'easeOutCirc'=>__("easeOutCirc",THEME_ADMIN_DOMAIN),
				'easeInOutCirc'=>__("easeInOutCirc",THEME_ADMIN_DOMAIN),
				'easeInElastic'=>__("easeInElastic",THEME_ADMIN_DOMAIN),
				'easeOutElastic'=>__("easeOutElastic",THEME_ADMIN_DOMAIN),
				'easeInOutSine'=>__("easeInOutSine",THEME_ADMIN_DOMAIN),
				'easeInBack'=>__("easeInBack",THEME_ADMIN_DOMAIN),
				'easeOutBack'=>__("easeOutBack",THEME_ADMIN_DOMAIN),
				'easeInOutBack'=>__("easeInOutBack",THEME_ADMIN_DOMAIN),
				'easeInBounce'=>__("easeInBounce",THEME_ADMIN_DOMAIN),
				'easeOutBounce'=>__("easeOutBounce",THEME_ADMIN_DOMAIN),
				'easeInOutBounce'=>__("easeInOutBounce",THEME_ADMIN_DOMAIN),
			),
		),
		array(
			"name" => __("Css Code",THEME_ADMIN_DOMAIN),
			"id" => "style",
			"default" => "",
			"type" => "textarea"
		),
	),
);
