/*
 * Bulitka.com - Home Page - action
 * Created for Victoria Bulitko - Actress, singer, woman of talents.
 *
 * TERMS OF USE 
 * 
 * Copyright © 2011 Andrey Sokol
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/



/** Bulitka - HomePage - All Block - HideShow (Click on iconLogo)  */
function HideShowAll()
{
	if ( $('#bulitka_home_page_menu').css('left') == '0px')
	{
		$('#bulitka_logo_vbname').delay(700).animate({
			'top':'50%'
		 },2000,'easeOutElastic');
	 	$('#bulitka_home_page_menu').animate({
			'left':'-1200px'
		 },900,'easeInOutExpo');
		$('#contentBar').animate({
			'left':'-450px'
		 },400,'easeInOutExpo');	
	/*	$('#bulitka_home_page_afisha').animate({
			'right':'-273px'
		 },1100,'easeInOutExpo');	
	*/
	   $('#bulitka_language_switch').animate({
			'top':'-50px'
		 },500);		
		$('#controls-wrapper').delay(1000).animate({
			'bottom':'-5px'
		 },900,'easeInOutExpo');	
	 }
	 else
	{
		$('#bulitka_logo_vbname').animate({
			'top':'70%'
		 },1200,'easeInOutExpo');
		$('#bulitka_home_page_menu').delay(300).animate({
			'left':'0px'
		 },600,'easeInOutExpo');
		$('#contentBar').animate({
			'left':'-1px'
		 },800,'easeOutQuint');	
	/*	$('#bulitka_home_page_afisha').delay(400).animate({
			'right':'0px'
		 },1400,'easeOutQuint');
	*/
		$('#bulitka_language_switch').delay(900).animate({
			'top':'5px'
		 },500,'easeInOutElastic');	
		$('#controls-wrapper').animate({
			'bottom':'-100px'
		 },500,'easeInOutExpo');
	 }		 		 
}



		

		
		
/** Bulitka - HomePage - Afisha - HideShow */
/*
$('#bulitka_home_page_afisha').bind('mouseleave',function(){
		$('#bulitka_home_page_afisha').animate({
				'right':'-173px'
			 },1100,'easeOutBack');
});
$('#bulitka_home_page_afisha').bind('mouseenter',function(){
		$('#bulitka_home_page_afisha').animate({
				'right':'0px'
			 },300).find('.contentBar').stop(true);
});	
*/

/** Bulitka - Afisha More Link - Mouse Over Action */
/*
$(function() {
    $('#afisha_more').bind('mouseenter',function(){
	$('#afisha_more').stop(true).animate({
					'top':'0px' },1000,'easeOutBack');
				 
   }	  )
	.bind('mouseleave',function(){
	$('#afisha_more').stop(true).animate({
					'top':'-4px'
				 },1000,'easeOutBack');
   }     )
});	
*/

/** Bulitka.com - HomePage - Afisha AJAX */
/* $(function() {
   
	$.ajaxSetup({cache: false});
	$('#HomePageAfishaList a').bind('click',function(e){
			show();
			var $lielem    = $(this).parent();    
			event_id = $lielem.attr('title');
			showAfisha (event_id);
	
	});
	function showAfisha(event_id){	
	  $.ajax({
                 type: "GET",
                 url: "ajax-afisha.php?eventid="+event_id,
                 dataType: "xml",
                 success: xmlParser
             }); 
     
			function xmlParser(xml) {
				
				$(xml).find("Event").each(function () {
													
				$('#latest_post').removeClass('loading')
				.html('<p class="description">' + $(this).find("Description").text() + '</p>');
								
				//<div class="date">'+ $(this).find("Date").text() + '</div>				
				$('#blog_info').html($(this).find("Title").text());
				
				$('#modal .prev').attr('title', $(this).find("Prev_id").text());
				$('#modal .next').attr('title', $(this).find("Next_id").text());
	
				// NEED Cufon on home page!!!
				Cufon.replace('#blog_info,#latest_post',{ textShadow: '1px 1px 1px #111111'	});
				Cufon.now(); 
				});
			}
			
	}
	
	// clicking on the next on the dialog
	
	$('#modal .next').bind('click',function(e){	
			event_id = $('#modal .next').attr('title');
			showAfisha (event_id);
			e.preventDefault();
	});
	
	// clicking on the prev on the dialog
	
	$('#modal .prev').bind('click',function(e){										
			event_id = $('#modal .prev').attr('title');
			showAfisha (event_id);
			e.preventDefault();
	});
	
	// show the dialog with the event
	
	function show(){
		$('#overlay').show();
		if(!$('#modal').is(':visible'))
		$('#modal').css('left','-260px')
				   .show()
				   .stop()
					   .animate({'left':'50%'}, 600);
	}
	
	// hide the dialog
	
	function hide(){
		$('#modal').stop()
				   .animate({'left':'150%'}, 500, function(){
						$(this).hide();
						$('#overlay').hide();
						$('#latest_post').empty();
				   });
	}
	
	// clicking on the cross hides the dialog
	
	$('#modal .close').bind('click',function(){
		hide();
	});	
});
*/
