$j = jQuery.noConflict();

$j(document).ready(function(){
    
    var menuLinks = $j('#menu');        

    if (menuLinks.size() > 0 )
    {
        var images = menuLinks.find("li a img");

        var hoverData = new Array();
        images.each(function(index, obj){
            hoverData.push({src: $j(images[index]).attr("src"), hover: menu[index].src});
        });
        
        images.each(function(index, obj){
            if (index == imgSelected) {                
                $j(this).attr("src",hoverData[index].hover);
            }
            else
            {
                $j(this).hover(function(ev){
                    $j(this).attr("src",hoverData[index].hover);
                }, function(ev){
                    $j(this).attr("src",hoverData[index].src);
                });
            }                        
        });
    }
});

var imgSelected = -1;
function selectMenu(no) {
    imgSelected = no;
}


$j(document).ready(function(){
if ($j('#zoomImage').size() > 0 )
{


    $j('a.zoom').click(function(ev){
        ev.preventDefault();

        var zoomDialog = $j('#zoomImage').dialog({
            modal: true,
            autoOpen: false,
            bgiframe: true,
            draggable: false,
            resizable: false,
            width: 660,
            height: 520
        });

        var href = $j(this).attr('href');

        
        var img = $j(document.createElement("img")).attr("src", href);
        
        $j(img).load(function(){            
            $j('#zoomImageContainer').html("");
            $j('#zoomImageContainer').append(img);
            
            zoomDialog.dialog("open");
        });
        
    });
}

});
