jQuery(function( $ ){
	$('.contPic').serialScroll({
		items:'li',
		prev:'.btns #prev',
		next:'.btns #next',
		offset:0, //when scrolling to photo, stop 230 before reaching it (from the left)
		start:0, //as we are centering it, start at the 2nd
		duration:4200,
		force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		interval:0, // yeah! I now added auto-scrolling
		jump: false //click on the images to scroll to them
	});
	$('.listaStyle1 li:odd, .contentTxt li:even').addClass("alterno1");
	$('.listaStyle2 li:even').addClass("alterno2");
	$('.relatedContent li:even').addClass("alterno3");
	$('#listOfComments li:even').addClass("d");
	 
	
	$('#pause').click(function(){ $('.contPic').stop().trigger('stop'); return false; });
	if(!$.browser.msie){
	$('#sideBar, #subNav').fadeTo("slow", 0.22);
	//$('#sideBar').hover(function(){}, function(){});
	$("#sideBar, #subNav").hover(
    function(){
       $(this).fadeTo("slow", 1);
    },
    function(){
        $(this).fadeTo("slow", 0.22);
    } );
	}
	/*for (var i = 0; i < $("#slideshow li").get().length; i++) {
		  if((i+1)%2 == 0) $("#slideshow li").eq(i).css("clear","both");
    }*/
	var n = Math.floor(Math.random() *3)+1;
	$("body").addClass("back"+n);
	
	
	
    /*var path = location.pathname.substring(1); 
    var $top_item = $('#sidebar h2:nth-child(2) a'); 
    var $all_items = $('#sidebar h2.subnav a'); 
    var $selected_item = $('#sidebar h2 a[@href$="' + path + '"]'); 
    $selected_item.addClass('active'); 
    if ($all_items("href") !== path) $top_item.addClass('active');*/
	var path = location.pathname.substring(1); 
	if(path=="blog/about/"){ $("#nav a").removeClass('active');$("#nav #pasion a").addClass('active'); 
	}else if(path=="blog/proyectos/"){ $("#nav a").removeClass('active');$("#nav #proyectos a").addClass('active');
	}else if(path=="blog/actividades/"){ $("#nav a").removeClass('active');$("#nav #amor a").addClass('active');
	}else if(path=="blog/sumate/"){ $("#nav a").removeClass('active');$("#nav #sumate a").addClass('active');
	}else if(path=="blog/"){
		$("#nav a").removeClass('active'); $("#nav #blog a").addClass('active');
	}else{
		$("#nav a").removeClass('active'); $("#nav #blog a").addClass('active');
	}
	
	 $(function() {
    $('#stagePhoto').crossSlide({
      fade: 1
    }, [
      {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage1.jpg',
        href: '/blog/actividades/',
        from: 'top left',
        to:   'bottom right',
        time: 5
      }, 
	  {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage2.jpg',
        href: '/blog/actividades/',
        from: 'left bottom',
        to:   'top right',
        time: 8
      },
	 {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage3.jpg',
        href: '/blog/actividades/',
        from: 'top left',
        to:   'bottom right',
        time: 5
      }, 
	  {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage4.jpg',
        href: '/blog/actividades/',
        from: 'left bottom',
        to:   'top right',
        time: 8
      },
	  {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage5.jpg',
        href: '/blog/actividades/',
        from: 'top left',
        to:   'bottom right',
        time: 5
      }, 
	  {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage6.jpg',
        href: '/blog/actividades/',
        from: 'left bottom',
        to:   'top right',
        time: 8
      },
	  {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage7.jpg',
        href: '/blog/actividades/',
        from: 'top left',
        to:   'bottom right',
        time: 5
      }, 
	  {
        src:  'http://www.vertice24.com/blog/wp-content/themes/v3/images/v3/stage8.jpg',
        href: '/blog/actividades/',
        from: 'left bottom',
        to:   'top right',
        time: 7
      }

    ]);
  });
	
	
});