﻿$(document).ready(function() {

    $(document).ready(function() {	
        $(".secondarynav li h3").toggle(function() {
            $(this).addClass("active");
        }, function() {
            $(this).removeClass("active");
        });
        $(".secondarynav li h3").click(function() {
            $(this).next("ul").slideToggle(200);
        });				
    });        


    if($('#linkedin-att').length>0)
        new LinkedIn.CompanyInsiderPopup("linkedin-att", "at&t");

    $('#btn-slide').click(function(e) {
        $("#sd-facebook").html('<iframe src="http://www.facebook.com/plugins/likebox.php?id=122379087373&amp;width=421&amp;connections=50&amp;stream=true&amp;header=false&amp;height=480" title="from-facebook" scrolling="no" frameborder="0" id="frm-facebook" ></iframe>');
        $('#btn-slide').hide();
        $('#slider').animate({ width: 'toggle' }, 500);
        $('#slide-content').animate({ opacity: 1 }, 1000);
    });

    $('#btn-slideclose').click(function(e) {
        $('#slider').animate({ width: 'toggle' }, 400);
        $('#slide-content').animate({ opacity: 0.2 }, 500);
        $('#btn-slide').show();
    });

    $('#btn-slideclose-bar').click(function(e) {
        $('#slider').animate({ width: 'toggle' }, 400);
        $('#slide-content').animate({ opacity: 0.2 }, 500);
        $('#btn-slide').show();
    });
 

    /* Social Slider Icons */

    $("#ico-selected").css("left", 56);

    $("#sd-facebook").show();

    $("#social-icons li a").click(function(e) {

        $("#social-icons li a").removeClass("active");
        $(".sframe").hide();
        e.preventDefault(); //Prevent non-javascript action
        var selID = this.id;
        $("#" + selID).addClass("active");
        selID = selID.replace("si", "sd");
        if (selID == "sd-twitter") {
            $("#sd-twitter").html('<iframe frameborder="0" src="http://att.jobs/widget/twitter.aspx" id="frm-twitter"></iframe>');
        }
        else if (selID == "sd-linkedin") {
            $("#sd-linkedin").html('<iframe frameborder="0" src="http://www.linkedin.com/companies/at%26t?" id="frm-linkedin"></iframe>');
        }
        else if (selID == "sd-youtube") {
            $("#sd-youtube").html('<iframe frameborder="0" src="http://att.centralcast.net/feedaggregator/youtubedisplay.aspx?feedid=2&amp;count=10&amp;feedListName=none " id="frm-youtube"></iframe>');
        }
        else if (selID == "sd-facebook") {
            $("#sd-facebook").html('<iframe src="http://www.facebook.com/plugins/likebox.php?id=122379087373&amp;width=421&amp;connections=50&amp;stream=true&amp;header=false&amp;height=480" title="from-facebook" scrolling="no" frameborder="0" id="frm-facebook" ></iframe>');
        }

        $("#" + selID).show();
    });
});

