
$(document).ready(function(){
    $("a.restricted").click(showNotification);
    $("a.notif_back").click(closeNotification);
    
    $("#comments .pagination a").attr("href", $("a.join_url").attr("href"));       
    
    /*
      SELECT IN THE PORNSTAR WIDGET
    */
    $("select#all_pornstars").change(function(){ 
        var id = $(this).val().split("_")[1]; 
        window.location = "index.php?action=pornstar_inside&pornstar_id=" + id ;
    });       
        
        
    /*
    SELECT IN THE CATEGORIES WIDGET
    */
    $("select#categories").change(function(){ 
        var cat = $(this).val();
        window.location = "index.php?action=all-our-scenes-by-category&category=" + cat;
    });       
        
    $(".custom_selector ul.options").mouseout(function(){            
         var custom_selector  = $(this).parents(".custom_selector");
         custom_selector_hover = setTimeout("$('#" + custom_selector.attr("id") + " .head').click();",1000);
    });
    
    $(".custom_selector ul.options").mouseover(function(){ 
        clearTimeout(custom_selector_hover);
    });     
    
    
    $(".letter a").click(function(){
         var letter = $(this).attr("href").replace("#", ""); 
         $("#letter").val(letter);   
         
         if($("#do_search").size()){                  
             $("#do_search").submit();   
         }else{
              window.location = "index.php?action=all-our-pornstars&letter=" + letter;           
         }                
         return false;
    });
    
});


function showNotification()
{
   var info = $(this).attr("href").replace("#", "").split("-");
    
   var notification = $("#" + info[0]);
   notification.find("li").removeClass("active");
   notification.find("li#notif_" + info[1]).addClass("active");
   notification.fadeIn("slow");  
   
   return false;
}

function closeNotification()
{
    $(this).parents(".notification").fadeOut("slow");
    return false;         
}