var selected_image = null;
$j(document).ready(function(){
    //Galleria.loadTheme('/templates/fhiheat/javascript/themes/classic/galleria.classic.min.js');
    //First, turn any p.gallery into div.gallery. p.gallery breaks IE, amazingly.
    $j('p.vision-image-gallery, p.image-gallery').each(function(){
        $j(this).replaceWith($j('<div class="'+$j(this).attr('class')+'">'+ $(this).innerHTML+'</a>'));
    });
    $j('div.vision-image-gallery').galleria({width: 800, height: 500, extend: function() {
        this.bind(Galleria.IMAGE, function(e){
            $j(e.imageTarget).css('cursor','pointer').click(this.proxy(function(){this.openLightbox();}));
        });
    }});

    $j('div.image-gallery').galleria({width: 600, height: 400, extend: function() {
        this.bind(Galleria.IMAGE, function(e){
            $j(e.imageTarget).css('cursor','pointer').click(this.proxy(function(){this.openLightbox();}));
        });
    }});

    $j('div.awardBox a').fancybox({type: 'iframe',width:550,height:600});
    /*$j("#xvision-gallery").jcarousel({
        visible: 9,
        itemFirstInCallback: {
            xonBeforeAnimation: function(theCar, theLi,indx,state){
                if(selected_image!=null)
                {
                    $j(selected_image).css('position',"static").animate({zIndex:0,height:75,width:90,marginTop:"15",marginLeft:"5px",marginRight:"5px"},1000)
                    $j(selected_image+' a').animate({height:73,width:90},1000);
                }
                selected_image = '.jcarousel-item-'+(indx+1) ;
                $j(selected_image).css('position',"relative").animate({zIndex:1000,height:100, width:120,marginTop:"0px",marginLeft: "-10px",marginRight:"-10px"},1000);
                $j(selected_image+' a').animate({height:96,width:116},1000);
                //alert(selected_image);
            },
            onAfterAnimation: function(theCar, theLi, indx, state){


            }
        }
    });*/

});
/*
$j(document).ready(function(){
    jQuery('a.gallery-image').fancybox({
        showNavArrows: 'true',
        'transitionIn'	:	'elastic',
        'transitionOut'	:	'fade',
        'speedIn'		:	600,
        'speedOut'		:	200

        });
});*/
