<?php
$init_script = <<<HTML
	jQuery('[name="number"]').live("change",function(){
		var box_number = jQuery(this).val();
		jQuery('.shortcode-item').each(function(i){
			if(i>(9+parseInt(box_number))){
				jQuery(this).hide();
			}else{
				jQuery(this).show();
			}
		});
	}).trigger("change");
HTML;
$custom_script = <<<HTML
	var title = attrs['title'].value;
	var number = attrs['number'].value;
	var animate = attrs['animate'].value;
	var easing = attrs['easing'].value;
	var speed = attrs['speed'].value;
	var bgcolor = attrs['bgcolor'].value;
	var bordercolor = attrs['bordercolor'].value;
	var delay = attrs['delay'].value;
	var width = attrs['width'].value;

	if(title != ''){
		title = ' title="'+title+'"';
	}
	if(animate != ''){
		animate = ' animate="'+animate+'"';
	}
	if(easing != ''){
		easing = ' easing="'+easing+'"';
	}
	if(bgcolor != ''){
		bgcolor = ' bgcolor="'+bgcolor+'"';
	}
	if(bordercolor != ''){
		bordercolor = ' bordercolor="'+bordercolor+'"';
	}
	if(speed != ''){
		speed = ' speed="'+speed+'"';
	}
	if(delay != ''){
		delay = ' delay="'+delay+'"';
	}
	if(width != ''){
		width = ' width="'+width+'"';
	}

	var ret = '\\n[cycle_box'+title+width+easing+animate+bgcolor+bordercolor+speed+delay+']\\n';
	for(var i=1;i<=number;i++){
		ret +='[cycle]\\n'+attrs['box','content_'+i].value+'\\n[/cycle]\\n';
	}
	ret +='[/cycle_box]\\n';
	return ret;
HTML;
return array(
	"title" => __("Cycle Box",THEME_ADMIN_DOMAIN),
	"type" => 'custom',
	'contentOption' => 'content_1',
	"options" => array(
		array(
			"name" => __("Title (optional)",THEME_ADMIN_DOMAIN),
			"id" => "title",
			"default" => "",
			"type" => "text",
		),
		array(
			"name" => __("Animations",THEME_ADMIN_DOMAIN),
			"id" => "animate",
			"default" => 'fade',
			"options" => array(
				'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),
			"id" => "easing",
			"default" => 'swing',
			"type" => "select",
			"options" => array(
				'swing'=>__("swing",THEME_ADMIN_DOMAIN),
				'linear'=>__("linear",THEME_ADMIN_DOMAIN),
				'def'=>__("def",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" => __("Delay",THEME_ADMIN_DOMAIN),
			"id" => "delay",
			"min" => "1000",
			"max" => "30000",
			"step" => "500",
			'unit' => 'miliseconds',
			"default" => "3500",
			"type" => "range"
		),
		array(
			"name" => __("Speed",THEME_ADMIN_DOMAIN),
			"id" => "speed",
			"min" => "200",
			"max" => "3000",
			"step" => "100",
			"unit" => 'miliseconds',
			"default" => "500",
			"type" => "range"
		),
		array(
			"name" => __("Number of box",THEME_ADMIN_DOMAIN),
			"id" => "number",
			"min" => "1",
			"max" => "8",
			"step" => "1",
			"default" => "3",
			"type" => "range"
		),
		array(
			"name" => __("Frame Width",THEME_ADMIN_DOMAIN),
			"id" => "width",
			"min" => "100",
			"max" => "922",
			"step" => "1",
			"unit" => 'px',
			"default" => "600",
			"type" => "range"
		),
		array(	
			"name" => __("Background Color (optional)",THEME_ADMIN_DOMAIN),
			"id" => "bgcolor",
			"default" => "",
			"type" => "color"
		),
		array(
			"name" => __("BorderColor",THEME_ADMIN_DOMAIN),
			"id" => "bordercolor",
			"default" => "",
			"type" => "color"
		),
		array(
			"name" => __("Align",THEME_ADMIN_DOMAIN),
			"id" => "align",
			"default" => 'left',
			"options" => array(
				"left" => __("Left",THEME_ADMIN_DOMAIN),
				"right" => __("Right",THEME_ADMIN_DOMAIN),
				"center" => __("Center",THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),1),
			"id" => "content_1",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),2),
			"id" => "content_2",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),3),
			"id" => "content_3",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),4),
			"id" => "content_4",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),5),
			"id" => "content_5",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),6),
			"id" => "content_6",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),7),
			"id" => "content_7",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => sprintf(__("Box %d Content",THEME_ADMIN_DOMAIN),8),
			"id" => "content_8",
			"default" => "",
			"type" => "textarea"
		),


	),
	"custom" => $custom_script,
	"init" => $init_script,
);
