jQuery(function(){
	
	//jQuery( ".date , .date2" ).datepicker({
	//									   dateFormat: 'dd/mm/yy',
	//									   dayNamesMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
	//									   monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
	//									   firstDay:1,
	//									   beforeShowDay: function(date) {
    //            if(date.getDate()==2)    {
    //               return [false,,'Понедельник - день тяжёлый!']
    //            } else if (date.getDay()==0 || date.getDay()==6) {
    //                return [false,,'Выходной!']
    //            } else {
    //                return  [true,, 'Работать, негры, солнце еще высоко!']
    //            }
    //        }
	//									   });
	
	
	jQuery('#gallery .e2g').cycle({ 
	    fx:      'fade', 
	    speed:    1300, 
	    timeout:  5000,
	    before: function(currSlideElement, nextSlideElement, options, forwardFlag){
			var imgHeight = jQuery(nextSlideElement).height();
			var imgContainerHeight = jQuery(nextSlideElement).parent().height();
			jQuery(nextSlideElement).css('top',imgContainerHeight-imgHeight);
			jQuery("#title").animate({opacity:0},1000);
		
			
		},
	    after: function(currSlideElement, nextSlideElement, options, forwardFlag){
		//	console.log(jQuery(nextSlideElement));
			jQuery(nextSlideElement).animate(
					{'top':0,},										
					options.timeout*1.5);
			jQuery("#title").stop().html(jQuery(nextSlideElement).attr('alt')).animate({opacity:1},2000);
		
		}	
	});	
	
	jQuery("a[rel^='to_big']").prettyPhoto();
	jQuery(".thumb a[rel^='prettyPhoto']").prettyPhoto({
												 show_title: false,
												 theme: 'facebook',
												 slideshow:5000, 
												 autoplay_slideshow:true
												});

	/*   
	jQuery('.thumb .boxcontent .image_border').click(function(){
		jQuery(this).next().click();		
	})
 */	
	jQuery('.dir .boxcontent .image_border').click(function(){
		href = jQuery(this).next().attr('href');
		window.location = href;

	})
	
	// gallery click first img 
	/*
	if ( jQuery('.e2g .thumb .boxcontent a').size() )
	{
		jQuery('.e2g .thumb .boxcontent a').eq(0).click();
	}
	*/
	/*
	font=Array();
	font[0]='"Times New Roman", Times, serif';
	font[1]='Georgia, "Times New Roman", Times, serif';
	font[2]='Arial, Helvetica, sans-serif';
	font[3]='"Courier New", Courier, monospace';
	font[4]='Tahoma, Geneva, sans-serif';
	font[5]='"Trebuchet MS", Arial, Helvetica, sans-serif';
	font[6]='Arial Black, Arial Black, Gadget, sans-serif';
	font[7]='Lucida Sans Unicode, Lucida Grande, sans-serif';
	font[8]='Palatino Linotype, Book Antiqua3, Palatino, serif';	
	
	var html='';
	for(i=0;i<font.length;i++)	{
		html+="<option value='"+font[i]+"'>"+font[i]+"</option>";
	}	
	jQuery('.content_text').before("<select id='font_select' style='display: block;width:300px;margin:auto'>"+html+"</select>");
	jQuery('#font_select').live('change',function(){
		jQuery('.content_text').css({'font-family':this.value});						   
	
	});
	*/
})
