 var $j = jQuery.noConflict();      
 
 $j(document).ready(function(){
    //navigation fade effects
    $j('.nav li strong').append('<div class="hover"></div>');     
    $j('.nav li strong').hover(             
        function() {                
            $j(this).children('div').fadeIn(250);             
        },         
        function() {            
            $j(this).children('div').fadeOut(250);                
    }).click(
        function() {            
            window.location.href = $j(this).find('a').attr('href');
    });
    
    //Send to friend
    if($j('.absoluteIframeDOMWindow').attr('href'))
    {
        $j('.absoluteIframeDOMWindow').openDOMWindow({ 
            borderColor: '#59b1d9',
            height:325, 
            width:500,       
            eventType:'click', 
            windowSource:'iframe', 
            windowPadding:10,
            windowBGColor:'#d5ddd9',
            windowSourceURL:$j('.absoluteIframeDOMWindow').attr('href').replace('$id',currentItemId), 
            loader:1, 
            loaderImagePath:'/~/settingsimage/Send page settings/PreloadingImage.ashx', 
            loaderHeight:43, 
            loaderWidth:43         
        });
    }  
    
    //remove links from spots, if whole spot is clickable
    if($j('.clickablespot').length)     
    {
         $j(".clickablespot a").each(function (){
            $j(this).replaceWith("<span>" + $j(this).text() + "</span>");
        });
        
        $j('.clickablespot').hover(
          function () {
            $j(this).css("cursor", "pointer");
          }, 
          function () {
            $j(this).css("cursor", "");
          }
        );
    }
    
    //Paging history and ajax
    $j('#listresults').wrap('<div id="newsloadercontainer"></div>');
    
    $j('a.remote').click(function(){
        $j('.bottompaginglinks').hide();
        $j('#newsloadercontainer').html('<img class="loaderimg" src="/~/settingsimage/Send page settings/PreloadingImage.ashx" />')
        $j('a.remote').attr("class", "remote");
        var selectedPagerButton = $j(this).text();
        $j('a.remote').each(function(){
            if($j(this).text() == selectedPagerButton)
                $j(this).attr("class", $j(this).attr("class") + " active");
        });
        return $j(this);
    ;})
    
    $j('a.remote').remote('#newsloadercontainer',function(a) {
                        $j('.bottompaginglinks').show();
                    });
    
    $j.ajaxHistory.initialize();

 });
 

