﻿$(function(){
    //Document Load
    $("#search_box .SearchButton").noText();
    var currentURL = window.location;
    
    //User Interaction
    $(".banner_style").click(function(){ location.href=$("a",this).attr("href"); }).hover(function(){
        $("a",this).css("text-decoration","underline");
    },function(){
        $("a",this).css("text-decoration","none");
    });
    $(".lightbox a").lightBox();
    $(".twitter").click(function(){ location.href="http://twitter.com/home?status=Currently reading "+currentURL+""; });
    $(".stumble").click(function(){ location.href="http://www.stumbleupon.com/submit?url="+currentURL+""; });
    $(".delicious").click(function(){ location.href="http://del.icio.us/post?url="+currentURL+""; });
    $(".facebook").click(function(){ location.href="http://www.facebook.com/sharer.php?u="+currentURL+""; });
    $(".digg").click(function(){ location.href="http://digg.com/submit?url="+currentURL+""; });
    $(".reddit").click(function(){ location.href="http://reddit.com/submit?url="+currentURL+""; });
    $(".resources .email").click(function(){ location.href="mailto:?subject=Wallasey School&body="+currentURL+""; });
    $(".resources .print").click(function(){ window.print(); });
    $(".resources .bookmark").click(function(){
        var bookmark_url = window.location;
        if (window.sidebar) { window.sidebar.addPanel("Wallasey School", bookmark_url,""); }
        else if (window.external) { window.external.AddFavorite(bookmark_url, "Wallasey School"); }
        else if (window.opera) { return false; }
        else { alert("Unfortunately, this browser does not support the requested action, please bookmark this page manually."); }
    });
    $(".resources .contact").click(function(){ location.href="http://www.wallaseyschool.co.uk/contact-us/default.phuse"; });
});