﻿/// <reference path="jQuery/jquery-1.6.1.min.js" />
$(document).ready(function () {
    if ($('#InstallButton').length > 0) {
        $('#InstallButton, .installiqmessage').each(function() {
            $(this).hover(
                function() {
                    $('.installiqmessage').show();
                },
                function() {
                    $('.installiqmessage').hide();
                });
        });
    }

    $('.whypageragelink').click(function () {
        $('#HP-WhyDoINeedThis').toggle();
    });

    // Browz Control
    $("#bc1").browzCtrl({
        title: '<a href="http://www.pagerage.com/FacebookLayouts.aspx?select=UserPublic&q=1&sort=Newest&p=1" title="See more layouts like these...">Featured</a>',
        query: { selectMethod: 'UserPublic', terms: '1', sortMethod: 'Newest', page: 1 }
    });

    $("#bc2").browzCtrl({
        title: '<a href="http://www.pagerage.com/FacebookLayouts.aspx?select=All&q=&sort=Popular&p=1" title="See more layouts like these...">Most Selected</a>',
        query: { selectMethod: 'All', terms: '', sortMethod: 'Popular', page: 1 }
    });

    $("#bc3").browzCtrl({
        title: '<a href="http://www.pagerage.com/FacebookLayouts.aspx?select=All&q=&sort=Voted&p=1" title="See more layouts like these...">Top Rated</a>',
        query: { selectMethod: 'NotInCategory', terms: 'Anime,Fantasy,Sexy', sortMethod: 'VotedBound', page: 1 }
    });

    $("#Browzrs").slideDown();
    
    // Check to see if there's a install key in the query string
    if (window.location.search.indexOf("&install=true") > -1) {
        window.startInstall();
    }
});


