jQuery(document).ready(function() {

    $('.lb-slider').lbSlider();

    $('.lb-play').click(function(){

        var video_url = $(this).attr('href');
        var output = '';

        if(video_url.search('vimeo.com')!=-1){

            var video_url = video_url.split('/');
            output = '<iframe src="http://player.vimeo.com/video/' + video_url[video_url.length-1] + '?autoplay=1" width="643" height="367" frameborder="0"></iframe>';

        }else if(video_url.search('youtube.com')!=-1){

            var results = video_url.match("[\\?&]v=([^&#]*)");

            var vid = ( results === null ) ? video_url : results[1];

            output = '<iframe src="http://www.youtube.com/embed/' + vid + '?autoplay=1" width="643" height="367" frameborder="0" allowfullscreen></iframe>';

        }

        $('#lb-video-full').html(output);

        /*var campText = $(this).parent().parent().parent().parent().find('.camp-content').html();
        if(campText.length){
            $('#camp-content').html('<div class="camp-content-show">' + campText + '</div>');
        }else{
            $('#camp-content').html('');
        } */
                //$("html").scrollTop(300);
        $('html, body').animate({scrollTop:230}, 300);
        return false;

    });

    $('#searchInput').click(function(){

        $(this).val('');

    });

    /*$("img").lazyload({
        placeholder : "img/grey.gif",
        effect : "fadeIn"
    });*/

});
