
 	/************************************************************************************************************
	Kontakty - show / hide
	************************************************************************************************************/
	

		  $(document).ready(function() {
  
        $('#slickbox').hide();
        $('#slick-show').click(function() {
        $('#slickbox').show('slow');
          return false;
        });
        $('#slick-hide').click(function() {
        $('#slickbox').hide('fast');
        return false;
        });
        $('#slick-toggle').click(function() {
        $('#slickbox').toggle(400);
        return false;
        });
        $('#slick-down').click(function() {
        $('#slickbox').slideDown('slow');
        return false;
        });
        $('#slick-up').click(function() {
        $('#slickbox').slideUp('fast');
        return false;
        });
        $('#slick-slidetoggle').click(function() {
        $('#slickbox').slideToggle(400);
        return false;
        });
     });

 	/************************************************************************************************************
	Treeview - nastaveni promennych
	************************************************************************************************************/
	
		$(function() {
			$("#tree").treeview({
				collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				persist: "location"
			});
		})
$(document).ready(function() {
	//Show the paging and activate its first link
$(".paging").show();
$(".paging a:first").addClass("active");

//Get size of the image, how many images there are, then determin the size of the image reel.
var imageWidth = $(".window").width();
var imageSum = $(".image_reel img").size();
var imageReelWidth = imageWidth * imageSum;

//Adjust the image reel to its new size
$(".image_reel").css({'width' : imageReelWidth});
//Paging  and Slider Function
rotate = function(){
    var triggerID = $active.attr("rel") - 1; //Get number of times to slide
    var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

    $(".paging a").removeClass('active'); //Remove all active class
    $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)

    //Slider Animation
    $(".image_reel").animate({
        left: -image_reelPosition
    }, 500 );

}; 

//Rotation  and Timing Event
rotateSwitch = function(){
    play = setInterval(function(){ //Set timer - this will repeat itself every 7 seconds
        $active = $('.paging a.active').next(); //Move to the next paging
        if ( $active.length === 0) { //If paging reaches the end...
            $active = $('.paging a:first'); //go back to first
        }
        rotate(); //Trigger the paging and slider function
    }, 7000); //Timer speed in milliseconds (7 seconds)
};

rotateSwitch(); //Run function on launch
//On Hover
$(".image_reel a").hover(function() {
    clearInterval(play); //Stop the rotation
}, function() {
    rotateSwitch(); //Resume rotation timer
});	

//On Click
$(".paging a").click(function() {
    $active = $(this); //Activate the clicked paging
    //Reset Timer
    clearInterval(play); //Stop the rotation
    rotate(); //Trigger rotation immediately
    rotateSwitch(); // Resume rotation timer
    return false; //Prevent browser jump to link anchor
});
});
	/************************************************************************************************************
	Slide down menu
	Copyright (C) October 2005  DTHMLGoodies.com, Alf Magne Kalleland
 
	This library is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License as published by the Free Software Foundation; either
	version 2.1 of the License, or (at your option) any later version.
 
	This library is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	Lesser General Public License for more details.
 
	You should have received a copy of the GNU Lesser General Public
	License along with this library; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
	Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
	written by Alf Magne Kalleland.
 
	Alf Magne Kalleland, 2010
	Owner of DHTMLgoodies.com
 
	************************************************************************************************************/
/************************************************************************************************************
Slide down menu
Copyright (C) October 2005  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2010
Owner of DHTMLgoodies.com

************************************************************************************************************/
var expandFirstItemAutomatically = false;	// Expand first menu item automatically ?
var initMenuIdToExpand = false;	// Id of menu item that should be initially expanded. the id is defined in the <li> tag.
var expandMenuItemByUrl = true;	// Menu will automatically expand by url - i.e. if the href of the menu item is in the current location, it will expand
var initialMenuItemAlwaysExpanded = true;	// NOT IMPLEMENTED YET




var dhtmlgoodies_slmenuObj;
var divToScroll = false;
var ulToScroll = false;
var divCounter = 1;
var otherDivsToScroll = new Array();
var divToHide = false;
var parentDivToHide = new Array();
var ulToHide = false;
var offsetOpera = 0;
if(navigator.userAgent.indexOf('Opera')>=0)offsetOpera=1;
var slideMenuHeightOfCurrentBox = 0;
var objectsToExpand = new Array();
var initExpandIndex = 0;
var alwaysExpanedItems = new Array();

var dg_activeItem = null;

function popMenusToShow()
{
	var obj = divToScroll;
	var endArray = new Array();
	while(obj && obj.tagName!='BODY'){
		if(obj.tagName=='DIV' && obj.id.indexOf('slideDiv')>=0){
			var objFound = -1;
			for(var no=0;no<otherDivsToScroll.length;no++){
				if(otherDivsToScroll[no]==obj){
					objFound = no;
				}
			}
			if(objFound>=0){
				otherDivsToScroll.splice(objFound,1);
			}
		}
		obj = obj.parentNode;
	}
}

function showSubMenu(e,inputObj)
{

	if(this && this.tagName)inputObj = this.parentNode;
	if(inputObj && inputObj.tagName=='LI'){
		divToScroll = inputObj.getElementsByTagName('DIV')[0];
		for(var no=0;no<otherDivsToScroll.length;no++){
			if(otherDivsToScroll[no]==divToScroll)return;
		}
	}
	hidingInProcess = false;
	if(otherDivsToScroll.length>0){
		if(divToScroll){
			if(otherDivsToScroll.length>0){
				popMenusToShow();
			}
			if(otherDivsToScroll.length>0){
				autoHideMenus();
				hidingInProcess = true;
			}
		}
	}
	if(divToScroll && !hidingInProcess){
		divToScroll.style.display='';
		otherDivsToScroll.length = 0;
		otherDivToScroll = divToScroll.parentNode;
		otherDivsToScroll.push(divToScroll);
		while(otherDivToScroll && otherDivToScroll.tagName!='BODY'){
			if(otherDivToScroll.tagName=='DIV' && otherDivToScroll.id.indexOf('slideDiv')>=0){
				otherDivsToScroll.push(otherDivToScroll);

			}
			otherDivToScroll = otherDivToScroll.parentNode;
		}
		ulToScroll = divToScroll.getElementsByTagName('UL')[0];
		if(divToScroll.style.height.replace('px','')/1<=1)scrollDownSub();
	}

	if(e || inputObj) {

		if(dg_activeItem) {
			dg_activeItem.className = dg_activeItem.className.replace('dhtmlgoodies_activeItem','');
		}
		var aTags = inputObj.getElementsByTagName('A');
		if(aTags.length>0) {
			aTags[0].className = aTags[0].className + ' dhtmlgoodies_activeItem';
			dg_activeItem = aTags[0];
			if(aTags[0].href.indexOf('#') == -1 || aTags[0].href.indexOf('#') < aTags[0].href.length-1){
				return true;
			}
		}

	}

	return false;


}



function autoHideMenus()
{
	if(otherDivsToScroll.length>0){
		divToHide = otherDivsToScroll[otherDivsToScroll.length-1];
		parentDivToHide.length=0;
		var obj = divToHide.parentNode.parentNode.parentNode;
		while(obj && obj.tagName=='DIV'){
			if(obj.id.indexOf('slideDiv')>=0)parentDivToHide.push(obj);
			obj = obj.parentNode.parentNode.parentNode;
		}
		var tmpHeight = (divToHide.style.height.replace('px','')/1 - slideMenuHeightOfCurrentBox);
		if(tmpHeight<0)tmpHeight=0;
		if(slideMenuHeightOfCurrentBox)divToHide.style.height = tmpHeight  + 'px';
		ulToHide = divToHide.getElementsByTagName('UL')[0];
		slideMenuHeightOfCurrentBox = ulToHide.offsetHeight;
		scrollUpMenu();
	}else{
		slideMenuHeightOfCurrentBox = 0;
		showSubMenu();
	}
}


function scrollUpMenu()
{

	var height = divToHide.offsetHeight;
	height-=15;
	if(height<0)height=0;
	divToHide.style.height = height + 'px';

	for(var no=0;no<parentDivToHide.length;no++){
		parentDivToHide[no].style.height = parentDivToHide[no].getElementsByTagName('UL')[0].offsetHeight + 'px';
	}
	if(height>0){
		setTimeout('scrollUpMenu()',5);
	}else{
		divToHide.style.display='none';
		otherDivsToScroll.length = otherDivsToScroll.length-1;
		autoHideMenus();
	}
}

function scrollDownSub()
{
	if(divToScroll){
		var height = divToScroll.offsetHeight/1;
		var offsetMove =Math.min(15,(ulToScroll.offsetHeight - height));
		height = height +offsetMove ;
		divToScroll.style.height = height + 'px';

		for(var no=1;no<otherDivsToScroll.length;no++){
			var tmpHeight = otherDivsToScroll[no].offsetHeight/1 + offsetMove;
			otherDivsToScroll[no].style.height = tmpHeight + 'px';
		}
		if(height<ulToScroll.offsetHeight)setTimeout('scrollDownSub()',5); else {
			divToScroll = false;
			ulToScroll = false;
			if(objectsToExpand.length>0 && initExpandIndex<(objectsToExpand.length-1)){
				initExpandIndex++;

				showSubMenu(false,objectsToExpand[initExpandIndex]);
			}
		}
	}
}

function initSubItems(inputObj,currentDepth)
{
	divCounter++;
	var div = document.createElement('DIV');	// Creating new div
	div.style.overflow = 'hidden';
	div.style.position = 'relative';
	div.style.display='none';
	div.style.height = '1px';
	div.id = 'slideDiv' + divCounter;
	div.className = 'slideMenuDiv' + currentDepth;
	inputObj.parentNode.appendChild(div);	// Appending DIV as child element of <LI> that is parent of input <UL>
	div.appendChild(inputObj);	// Appending <UL> to the div
	var menuItem = inputObj.getElementsByTagName('LI')[0];
	while(menuItem){
		if(menuItem.tagName=='LI'){
			var aTag = menuItem.getElementsByTagName('A')[0];
			aTag.className='slMenuItem_depth'+currentDepth;
			var subUl = menuItem.getElementsByTagName('UL');
			if(subUl.length>0){
				initSubItems(subUl[0],currentDepth+1);
			}
			aTag.onclick = showSubMenu;
		}
		menuItem = menuItem.nextSibling;
	}
}

function initSlideDownMenu()
{
	dhtmlgoodies_slmenuObj = document.getElementById('dhtmlgoodies_slidedown_menu');
	dhtmlgoodies_slmenuObj.style.visibility='visible';
	var mainUl = dhtmlgoodies_slmenuObj.getElementsByTagName('UL')[0];
	var mainMenuItem = mainUl.getElementsByTagName('LI')[0];
	mainItemCounter = 1;
	while(mainMenuItem){
		if(mainMenuItem.tagName=='LI'){
			var aTag = mainMenuItem.getElementsByTagName('A')[0];
			aTag.className='slMenuItem_depth1';
			var subUl = mainMenuItem.getElementsByTagName('UL');
			if(subUl.length>0){
				mainMenuItem.id = 'mainMenuItem' + mainItemCounter;
				initSubItems(subUl[0],2);
				aTag.onclick = showSubMenu;
				mainItemCounter++;
			}
		}
		mainMenuItem = mainMenuItem.nextSibling;
	}	

	if(location.search.indexOf('mainMenuItemToSlide')>=0){
		var items = location.search.split('&');
		for(var no=0;no<items.length;no++){
			if(items[no].indexOf('mainMenuItemToSlide')>=0){
				values = items[no].split('=');
				showSubMenu(false,document.getElementById('mainMenuItem' + values[1]));
				initMenuIdToExpand = false;
			}
		}
	}else if(expandFirstItemAutomatically>0		){
		if(document.getElementById('mainMenuItem' + expandFirstItemAutomatically)){
			showSubMenu(false,document.getElementById('mainMenuItem' + expandFirstItemAutomatically));
			initMenuIdToExpand = false;
		}
	}


	if(expandMenuItemByUrl)
	{
		var aTags = dhtmlgoodies_slmenuObj.getElementsByTagName('A');
		var currentLocation = location.pathname;
		for(var no=0;no<aTags.length;no++){
			var hrefToCheckOn = aTags[no].href;
			if(hrefToCheckOn.indexOf(currentLocation)>=0 && hrefToCheckOn.indexOf('#')<hrefToCheckOn.length-1){
				initMenuIdToExpand = false;
				var obj = aTags[no].parentNode;
				while(obj && obj.id!='dhtmlgoodies_slidedown_menu'){
					if(obj.tagName=='LI'){
						var subUl = obj.getElementsByTagName('UL');
						if(initialMenuItemAlwaysExpanded)alwaysExpanedItems[obj.parentNode] = true;
						if(subUl.length>0){
							objectsToExpand.unshift(obj);
						}
					}
					obj = obj.parentNode;
				}
				showSubMenu(false,objectsToExpand[0]);
				break;
			}
		}
	}

	if(initMenuIdToExpand)
	{
		objectsToExpand = new Array();
		var obj = document.getElementById(initMenuIdToExpand)
		while(obj && obj.id!='dhtmlgoodies_slidedown_menu'){
			if(obj.tagName=='LI'){
				var subUl = obj.getElementsByTagName('UL');
				if(initialMenuItemAlwaysExpanded)alwaysExpanedItems[obj.parentNode] = true;
				if(subUl.length>0){
					objectsToExpand.unshift(obj);
				}
			}
			obj = obj.parentNode;
		}

		showSubMenu(false,objectsToExpand[0]);

	}

}

	$(document).ready(function() {
 		$(".tooltips").hover(
			function() { $(this).contents("span:last-child").css({ display: "block" }); },
			function() { $(this).contents("span:last-child").css({ display: "none" }); }
		);
		$(".tooltips").mousemove(function(e) {
			var mousex = 630;
			var mousey = 110;
			$(this).contents("span:last-child").css({  top: mousey, left: mousex });
		});
 	});
 	
 	/************************************************************************************************************
	Accordition - Uvodni stranka
	************************************************************************************************************/
	
 	jQuery().ready(function(){
 	jQuery('#accordition').accordion({ 
    autoheight: false,
    header: 'a.accAct',
    navigation: true,
    event: 'mouseover'
    });
  });

 	
  /************************************************************************************************************
	Scrolovani banneru - Uvodni stranka
	************************************************************************************************************/
	
(function($){$.fn.agile_carousel=function(options){agile_validated='fail';validate_carousel=function(){var p;for(p in options){checkme=options[p];checkme=checkme.toString();checkme=checkme.replace(/<\S+>/g,'');};agile_validated='pass';}
validate_carousel();if(agile_validated=='pass'){slide_containter_elem=$(this);var defaults={alt_attributes:"no",continue_timer_after_click:"no",custom_data:"no",disable_on_first_last:"no",first_last_buttons:"no",first_slide_is_intro:"no",hover_next_prev_buttons:"no",target_attributes:"no",intro_timer_length:"3000",intro_transtion:"no",next_prev_buttons:"yes",number_slides_visible:"1",pause_button:"no",php_doc_location:"tools/make_slides.php",remove_content:"yes",slide_buttons:"no",slide_captions:"no",slide_directory:"slides",path_to_slides:"slides",doctype:"html",slide_links:"no",slide_number_display:"no",stop_rotate_on_hover:"no",timer_length:"7000",timer_on:"yes",transition_duration:1000,transition_easing:"swing",transition_type:"carousel",water_mark:"no"};var opts=$.extend(defaults,options);$.ajax({dataType:'json',type:"POST",url:defaults.php_doc_location,cache:false,data:{alt_attributes:defaults.alt_attributes,custom_data:defaults.custom_data,first_last_buttons:defaults.first_last_buttons,first_slide_is_intro:defaults.first_slide_is_intro,hover_next_prev_buttons:defaults.hover_next_prev_buttons,target_attributes:defaults.target_attributes,next_prev_buttons:defaults.next_prev_buttons,path_to_slides:defaults.path_to_slides,pause_button:defaults.pause_button,slide_buttons:defaults.slide_buttons,slide_captions:defaults.slide_captions,slide_directory:defaults.slide_directory,doctype:defaults.doctype,slide_links:defaults.slide_links,slide_number_display:defaults.slide_number_display,water_mark:defaults.water_mark},success:function(json){if(defaults.remove_content=='yes'){slide_containter_elem.html(json['html_output']);}else{slide_containter_elem.append(json['html_output']);}
defaults.slide_captions=json['slide_captions'];if(defaults.first_slide_is_intro=='yes'){intro();}else{$.fn.agile_carousel.carousel();}}});function intro(){$.fn.agile_carousel.next=function(){};$.fn.agile_carousel.next=function(){};$.fn.agile_carousel.prev=function(){};$.fn.agile_carousel.first=function(){};$.fn.agile_carousel.last=function(){};$.fn.agile_carousel.pause_play=function(){};$.fn.agile_carousel.go_to=function(){};$("#intro").appendTo("#slide_holder_inner");$('#slide_1').css("z-index","1000");do_show_1=function(){$('#slide_1').show();};show_1=setTimeout(do_show_1,300);intro_transition=function(){if(defaults.intro_transtion=='fade'){$('#intro').fadeOut("slow");intro_timer=setTimeout($.fn.agile_carousel.carousel,300);}else{$('#intro').hide();intro_timer=setTimeout($.fn.agile_carousel.carousel,300);}}
intro_timer=setTimeout("intro_transition()",defaults.intro_timer_length);}
$.fn.agile_carousel.carousel=function(){carousel_started=true;button_class="slide_1";curr_slide_id="slide_1";curr_slide_id_number=1;next_slide_id_number=1;slideshow_paused="not_paused";transition_type=defaults.transition_type;slide_finder=$("#slide_holder_inner div.slide");slide_id_array=[];slides_index_counter=0;slide_finder.each(function(){slide_id_array[slides_index_counter]=$(this).attr("id");slides_index_counter++;});slide_captions_array=defaults.slide_captions.split("|");slide_height=$('#slide_holder_inner').height();half_slide_height_raw=slide_height/2;half_slide_height=parseFloat(half_slide_height_raw);slide_holder_width=$(slide_containter_elem).width();slide_holder_height=$(slide_containter_elem).height();slide_holder_inner_width=$('#slide_holder_inner').width();slide_holder_inner_height=$('#slide_holder_inner').height();slide_holder_inner_width_px=slide_holder_inner_width+'px';slide_holder_inner_height_px=slide_holder_inner_height+'px';width_per_slide=slide_holder_inner_width/defaults.number_slides_visible;width_per_slide=Math.floor(width_per_slide);all_slides_width_raw=slide_id_array.length*width_per_slide;all_slides_width_raw=Math.floor(all_slides_width_raw);all_slides_width=all_slides_width_raw+'px';slide_finder_array_length=slide_finder.length;carousel_tranition_number_slides_visible=defaults.carousel_tranition_number_slides_visible;num_slides_vis=parseFloat(defaults.number_slides_visible);$('#intro').remove();$('#slide_buttons').show();$('#slide_holder_inner div.slide:not(#slide_1)').hide();$('#slide_1').css("z-index","0");$('#slide_holder_inner .pause_button').show();$("#slide_buttons li").removeAttr("id");$("#slide_buttons .slide_1").attr("id","button_selected");if(defaults.disable_on_first_last=='yes'){$('.prev_button').attr('class','prev_button_disabled');}
Array.prototype.inArray=function(value)
{var i;for(i=0;i<this.length;i++){if(this[i]===value){return true;}}
return false;};slide_finder.each(function(){update_slide_number_display=function(){if(defaults.slide_number_display=="yes"){var id_to_split=curr_slide_id;var the_currrent_slide_number_array=id_to_split.split("_");var the_current_slide_number=the_currrent_slide_number_array.pop();$("#slide_number_display span").html(the_current_slide_number+" of"+" <span>"+slide_id_array.length+"</span>");}}
if(defaults.slide_number_display=="yes"){update_slide_number_display();}})
pause=function(){if(defaults.timer_on=="yes"){clearInterval(slideshow_timer);};$("#pause_button span").html("play");slideshow_paused="paused";$("#pause_button").attr("class","paused_button");}
change_slide_caption=function(){if(defaults.slide_captions!="no"){curr_caption=slide_captions_array[curr_slide_id_number-1];if(curr_caption==null){curr_caption="";}
$("#slide_captions span").html(curr_caption);}}
change_slide_caption();if(defaults.transition_type=='fold'){options_object={'size':half_slide_height,'easing':defaults.transition_easing}}else{options_object={'easing':defaults.transition_easing};}
if((defaults.jquery_ui_effect_param!=null)&&(defaults.jquery_ui_effect_value!=null)){jquery_ui_effect_param=defaults.jquery_ui_effect_param;if((defaults.jquery_ui_effect_param=="distance")||(defaults.jquery_ui_effect_param=="number")||(defaults.jquery_ui_effect_param=="percent")||(defaults.jquery_ui_effect_param=="size")||(defaults.jquery_ui_effect_param=="times")||(defaults.jquery_ui_effect_param=="direction")){jquery_ui_effect_value=defaults.jquery_ui_effect_value;}else{jquery_ui_effect_value="'"+defaults.jquery_ui_effect_value+"'";}
options_object[jquery_ui_effect_param]=jquery_ui_effect_value;}
if(defaults.transition_type=='carousel'){$(".slide").show();for(i=0;i<slide_finder_array_length;i++){var the_slide=slide_finder[i];var x_pos=(width_per_slide)*i;$(the_slide).css('left',x_pos);}
$('#row_of_slides').css('width',all_slides_width);}
x_position_array=[];slidestop_array=[];sliced_slidestop_array=[];next_slidestop_array=[];prev_slidestop_array=[];for(i=0;i<slide_id_array.length;i++){test_me_for_float=(i)/defaults.number_slides_visible;if(i==0||(test_me_for_float==parseInt(test_me_for_float)&&test_me_for_float==parseFloat(test_me_for_float))){var slidestop='yes';the_x_pos=width_per_slide*(i)*-1;the_next_slidestop=(1+i+num_slides_vis);if(the_next_slidestop>slide_id_array.length){the_next_slidestop=1;}
next_slidestop_array[i]=the_next_slidestop;the_prev_slidestop=(1+i-num_slides_vis);if(the_prev_slidestop<1){the_prev_slidestop=slide_id_array.length-num_slides_vis+1;}
prev_slidestop_array[i]=the_prev_slidestop;next_counter=num_slides_vis-1;prev_counter=1;}else{slidestop='no';the_next_slidestop=i+1+next_counter;if(the_next_slidestop>slide_id_array.length){the_next_slidestop=1;}
next_slidestop_array[i]=the_next_slidestop;next_counter=next_counter+1;the_prev_slidestop=i+1-prev_counter;if(the_prev_slidestop<1){the_prev_slidestop==slide_id_array.length;}
if(the_prev_slidestop>slide_id_array.length){the_prev_slidestop=1;}
prev_slidestop_array[i]=the_prev_slidestop;prev_counter=prev_counter+1;}
x_position_array[i]=the_x_pos;slidestop_array[i]=slidestop;}
$("#slide_1").show();function carousel_transition(){$('#row_of_slides').stop().animate({"left":x_position_array[next_slide_id_number-1]},{"duration":defaults.transition_duration,"easing":defaults.transition_easing});}
function fade_transition(){$('#slide_holder_inner div.slide').each(function(){if($(this).attr('id')!=curr_slide_id){$(this).hide();}})
$('#slide_holder_inner div[id$="'+curr_slide_id+'"]').css("z-index","50");$('#slide_holder_inner div[id$="'+button_class+'"]').css("z-index","100");$('#slide_holder_inner div[id$="'+button_class+'"]').animate({"opacity":"show"},{"duration":defaults.transition_duration,"easing":defaults.transition_easing});}
function ui_effects_transition(){next_top_show_next=function(){$('#slide_holder_inner div.slide').show().css('z-index','20');$('#slide_holder_inner div[id$="'+next_slide_id+'"]').css('z-index','60');$('#slide_holder_inner div[id$="'+curr_slide_id+'"]').css('z-index','50');$('#slide_holder_inner div[id$="'+next_slide_id+'"]').stop().show(defaults.transition_type,options_object,defaults.transition_duration);}
next_bottom_hide_curr=function(){$('#slide_holder_inner div.slide').show().css('z-index','20');var the_next_div=$('#slide_holder_inner div[id$="'+next_slide_id+'"]').css('z-index','50');$(the_next_div).css('z-index','1000');$('#slide_holder_inner div[id$="'+curr_slide_id+'"]').css('z-index','60');$('#slide_holder_inner div[id$="'+curr_slide_id+'"]').effect(defaults.transition_type,options_object,defaults.transition_duration);}
if(defaults.transition_type=='blind'||defaults.transition_type=='bounce'||defaults.transition_type=='clip'||defaults.transition_type=='drop'||defaults.transition_type=='fold'||defaults.transition_type=='shake'||defaults.transition_type=='slide'||defaults.transition_type=='scale'||defaults.transition_type=='pulsate'){next_top_show_next();}else if(defaults.transition_type=='explode'||defaults.transition_type=='puff'){next_bottom_hide_curr();}else{next_top_show_next();};}
function scroll_right_transition(){var slideshow_width=$('#slide_holder_inner').width();var n_slideshow_width=-1*slideshow_width+'px';$('#slide_holder_inner div[id$="'+button_class+'"]').stop().show().css("left",n_slideshow_width);$('#slide_holder_inner div[id$="'+button_class+'"]').stop().show().animate({"left":0},{'easing':defaults.transition_easing},defaults.transition_duration);$('#slide_holder_inner div[id$="'+curr_slide_id+'"]').stop().animate({"left":slideshow_width},{'easing':defaults.transition_easing},defaults.transition_duration);}
function no_effect_transition(){$('#slide_holder_inner div[id$="'+button_class+'"]').show();$('#slide_holder_inner div[id$="'+curr_slide_id+'"]').hide();}
function rotate_slides(){function transition_slides(){if(curr_slide_id!=button_class){if(transition_type=='fade'){fade_transition();}else if(transition_type=='no_transition_effect'){no_effect_transition();}else if(transition_type=='scroll_right'){scroll_right_transition();}else if(transition_type=='carousel'){carousel_transition();}else if(transition_type=='blind'||transition_type=='clip'||transition_type=='drop'||transition_type=='explode'||transition_type=='fold'||transition_type=='puff'||transition_type=='slide'||transition_type=='scale'||transition_type=='pulsate'){ui_effects_transition();}else{no_effect_transition();}};curr_slide_id_number=next_slide_id_number;function make_curr_slide_id(){curr_slide_id=button_class;};make_curr_slide_id();}
transition_slides();function animate_slides(){}}
function change_button_class(button_class){$("#slide_buttons li").removeAttr("id");$("#slide_buttons li").each(function(){if($(this).attr("class")==button_class){$(this).attr("id","button_selected");}});}
$.fn.agile_carousel.pause_play=function(){if(slideshow_paused=="paused"){$.fn.agile_carousel.skip('next');if(defaults.timer_on=="yes"){slideshow_timer=setInterval("$.fn.agile_carousel.skip('next')",defaults.timer_length);}
slideshow_paused="not_paused";$("#pause_button span").html("pause");$("#pause_button").attr("class","pause_button");}else if(slideshow_paused=="not_paused"){clearInterval(slideshow_timer);slideshow_paused="paused";$("#pause_button").attr("class","paused_button");pause();}}
$(".pause_button").click($.fn.agile_carousel.pause_play);$.fn.agile_carousel.skip=function(direction){curr_slide_id_string=curr_slide_id.toString();split_curr_slide_id_string=curr_slide_id.split("_");curr_slide_id_string=split_curr_slide_id_string.pop();curr_slide_id_number=parseFloat(curr_slide_id_string);if(direction=='next'){next_slide_id_number=curr_slide_id_number+1;if(defaults.transition_type=='carousel'){the_index_to_use=curr_slide_id_number-1;next_slide_id_number=next_slidestop_array[the_index_to_use];}}else if(direction=='prev'){next_slide_id_number=curr_slide_id_number-1;if(defaults.transition_type=='carousel'){the_index_to_use=curr_slide_id_number-1;next_slide_id_number=prev_slidestop_array[the_index_to_use];}}else if(direction=='first'){next_slide_id_number=slide_id_array.length;curr_slide_id_number=1;}else if(direction=='last'){next_slide_id_number=1;curr_slide_id_number=slide_id_array.length;}else{next_slide_id_number=direction;};next_slide_id="slide_"+next_slide_id_number;if(next_slide_id_number>slide_id_array.length){next_slide_id="slide_1";curr_slide_id_number=slide_id_array.length;next_slide_id_number=1;}else if(next_slide_id_number<1){next_slide_id="slide_"+slide_id_array.length;next_slide_id_number=slide_id_array.length;}
button_class=next_slide_id;rotate_slides();change_button_class(button_class);if(defaults.slide_number_display=="yes"){update_slide_number_display();}
change_slide_caption();if((defaults.disable_on_first_last=='yes'&&((next_slide_id_number==slide_id_array.length)||(next_slide_id_number==slide_id_array.length-num_slides_vis+1)))){$('#next_button').attr('class','next_button_disabled');$('#hover_next_button').attr('class','hover_next_buttondisabled');$('#last_button').attr('class','last_buttondisabled');}else{$('#next_button').attr('class','next_button');$('#hover_next_button').attr('class','hover_next_button');$('#last_button').attr('class','last_buton');}
if((defaults.disable_on_first_last=='yes'&&((next_slide_id_number==1)||(next_slide_id_number==num_slides_vis)))){$('#prev_button').attr('class','prev_button_disabled');$('#hover_prev_button').attr('class','hover_prev_button_disabled');$('#first_button').attr('class','first_button_disabled');}else{$('#prev_button').attr('class','prev_button');$('#hover_prev_button').attr('class','hover_prev_button');$('#first_button').attr('class','first_button');}}
if(defaults.timer_on=="yes"){slideshow_timer=setInterval("$.fn.agile_carousel.skip('next')",defaults.timer_length);}
$("#slide_buttons li").each(function(){$(this).click(function(){button_class=$(this).attr("class");change_button_class(button_class);split_button_class_string=button_class.split("_");button_class_string=split_button_class_string.pop();next_slide_id_number=parseFloat(button_class_string);if(defaults.continue_timer_after_click=="no"){pause();}
$.fn.agile_carousel.skip(next_slide_id_number);return(false);});});if(defaults.transition_type=='carousel'){$("#slide_buttons li").each(function(){test_the_button_number=$(this).text()-1;if(slidestop_array[test_the_button_number]=="no"){$(this).remove();}})}
$.fn.agile_carousel.next=function(){if(defaults.disable_on_first_last!='yes'){$.fn.agile_carousel.skip('next');if(defaults.continue_timer_after_click=="no"){pause();}}else if((defaults.disable_on_first_last=='yes'&&next_slide_id_number==slide_id_array.length)||(next_slide_id_number==(slide_id_array.length-num_slides_vis+1))){if(defaults.continue_timer_after_click=="no"){pause();}}else{$.fn.agile_carousel.skip('next');if(defaults.continue_timer_after_click=="no"){pause();}}}
$(".next_button").click($.fn.agile_carousel.next);$.fn.agile_carousel.prev=function(){if(defaults.disable_on_first_last!='yes'){$.fn.agile_carousel.skip('prev');if(defaults.continue_timer_after_click=="no"){pause();}}else if((defaults.disable_on_first_last=='yes'&&curr_slide_id_number==1)||(defaults.disable_on_first_last=='yes'&&next_slide_id_number==num_slides_vis)){if(defaults.continue_timer_after_click=="no"){pause();}}else{$.fn.agile_carousel.skip('prev');if(defaults.continue_timer_after_click=="no"){pause();}}}
$(".prev_button, .prev_button_disabled").click($.fn.agile_carousel.prev);if(defaults.hover_next_prev_buttons=="yes"){$(".hover_button").fadeTo(1,0,function(){$(this).css("display","block")});$('#hover_prev_button').hover(function(){$("#hover_prev_button").stop().fadeTo("slow",0.95);},function(){$("#hover_prev_button").stop().fadeTo("slow",0.00);});$('#hover_next_button').hover(function(){$("#hover_next_button").stop().fadeTo("slow",0.95);},function(){$("#hover_next_button").stop().fadeTo("slow",0.00);});}
$.fn.agile_carousel.first=function(){$.fn.agile_carousel.skip('last');if(defaults.continue_timer_after_click=="no"){pause();}}
$("#first_button").click($.fn.agile_carousel.first);$.fn.agile_carousel.last=function(){if(defaults.continue_timer_after_click=="no"){pause();}
$.fn.agile_carousel.skip('first');}
$("#last_button").click($.fn.agile_carousel.last);$.fn.agile_carousel.go_to=function(slide_number){if(defaults.continue_timer_after_click=="no"){pause();}
$.fn.agile_carousel.skip(slide_number);}
if(defaults.stop_rotate_on_hover=='yes'){$('.slide').hover(function(){if(typeof short_timer!='undefined'){clearInterval(short_timer);}
clearInterval(slideshow_timer);pause();},function(){if(defaults.timer_on=="yes"){set_short_timer=function(){$.fn.agile_carousel.next();clearInterval(short_timer);clearInterval(slideshow_timer);slideshow_timer=setInterval("$.fn.agile_carousel.next();",defaults.timer_length);}
short_timer=setTimeout(set_short_timer,1000);}});}}}}})(jQuery);
