$(document).ready(function() {
    $('#show-all').click(function() {
        $(this).parents('.main-area').toggleClass('open');
        var h = $('.top-casinos').height();
        if ($(this).parents('.main-area').hasClass('open')) {
            $('.height-area').stop(true,true).animate({height: h+15+'px'}, 1000);      
        } else {
            $('.height-area').stop(true,true).animate({height: '270'}, 1000);  
        }
        return false;
    });
    $('.select-redirect select').change(select_redirect); 
    $('.screenshot-link').lightBox(); 
    $('#menu A,.left-column UL A').click(function(){ 
        var anchors = $(this).attr('href').split('#'); 
        if (anchors.length == 3) { //Sub Drop 
            $('#'+anchors[1]).attr('class','drop-down drop-box'); 
            location.hash = anchors[2]; 
        }else if (anchors.length == 2) { 
            $('#'+anchors[1]).attr('class','drop-down drop-box'); 
        } 
    }); 
     
    $('.menu').hover( 
          function () { 
            $(this).css("z-index", 101); 
          }, 
          function () { 
            $(this).css("z-index", 2); 
            } 
    ); 
    $('#menu').hover( 
          function () { 
            $(this).css("z-index", 101); 
          }, 
          function () { 
            $(this).css("z-index", 2); 
            } 
    ); 
    $('#wrapper').hover( 
          function () { 
            $(this).css("z-index", 10); 
          }, 
          function () { 
            $(this).css("z-index", 1); 
            } 
    ); 
 
     
    $('.side-content UL.side-menu li').hover(function(){ 
        if (isVisible($(this).find('.full-review'))){ 
            return false; 
        }else{ 
            $(this).find('.full-review').show('slow'); 
        } 
    }, function(){ 
        $(this).find('.full-review').hide('slow'); 
    }); 
     
    $('.drop-down .drop-down-right>A').click(function(){ 
        var dropDown = $(this).attr('rel'); 
        if ($(this).hasClass('drop-box')){ 
            $(dropDown+' ul').hide('slow'); 
            $(this).removeClass('drop-box'); 
            $(this).children('span').html('(+) Expand'); 
        }else{ 
            $(dropDown+' ul').show('slow'); 
            $(this).addClass('drop-box'); 
            $(this).children('span').html('(-) Collapse'); 
        }; 
    }); 
     
    $('.content a.expand-all').click(function(){ 
        if ($(this).hasClass('open-all')){ 
            $('.drop-down ul').hide('slow'); 
            $('.drop-down .drop-down-right>A').removeClass('drop-box'); 
            $('.drop-down .drop-down-right>A span').html('(+) Expand'); 
            $(this).removeClass('open-all').html('Expand All'); 
        }else{ 
            $('.drop-down ul').show('slow'); 
            $('.drop-down .drop-down-right>A').addClass('drop-box'); 
            $('.drop-down .drop-down-right>A span').html('(-) Collapse'); 
            $(this).addClass('open-all').html('Collapse All'); 
        } 
         
    }); 
 
});

function select_redirect() {
    var select = $(this);
    var url = select.val();
    if (url && url.length > 1) {
        window.location.href = url;
    }
} 
 
function isVisible(obj) { return (obj.css('display') == 'block'); } 
 
function PopConsole() { 
    var Url = "http://www.gameinsert.com/box/777s/index.php?page=website"; 
    var WindowWidth = 800; 
    var WindowHeight = 480; 
    var WindowTop = (screen.availHeight/2) - (WindowHeight/2); 
    var WindowLeft = (screen.availWidth/2) - (WindowWidth/2); 
    var WindowProps = 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=no,width='+WindowWidth+',height='+WindowHeight+',left='+WindowLeft+',top='+WindowTop+',screenx='+WindowLeft+',screeny='+WindowTop; 
    GameWindow = window.open(Url,"ConsoleWindow",WindowProps); 
    return; 
} 
 
function MM_jumpMenu(targ,selObj,restore){ //v3.0 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
  if (restore) selObj.selectedIndex=0; 
}
