// JavaScript Document
var MeadTemplateBundleID = "111967179770";
var MeadHost = "http://www.meadonline.com";
var MeadDefaultPic = "/App_Themes/Mead/images/mead_facebook_icon.gif";
var templateBundle = new Array();
var description = ' '; //'{*actor*} ';
var href = "http://www.meadonline.com";
var name = "Meadonline";
var properties;
var actor = "";
var source = { 'text': 'www.meadonline.com', 'href': 'http://www.meadonline.com' };
 

function SetData() {
    switch (location.pathname) {
        case "/Teachers/Beta_Signin.aspx":
            href = "http://www.meadonline.com/Students/Downloads.aspx";
            name = "Facebook Gear";
            description += "download Facebook Gear on ";
            AnnonProperty = { 'text': 'the text', 'href': 'http://www.meadonline.com/Students/Downloads.aspx' };
            properties = { ' - ': AnnonProperty, 'Source': source };
            break;
        case "/Profile/ThankYou.aspx":
            href = "http://www.meadonline.com";
            name = "Mead&reg; | learn, imagine, create.";
            description += "just joined mead.com and  and has already started earning Mead Money Madness&reg; rewards points and playing awesome games.";
            description += " Since you're a friend, " + actor + " is letting you in on the fun too. Join now!";
            
            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";

            AnnonProperty = { 'text': 'the text', 'href': 'http://www.meadonline.com/Students/Downloads.aspx' };
            properties = { ' - ': AnnonProperty, 'Source': source };

            break;
        case "/CheckOut.aspx":
            MeadDefaultPic = "/App_Themes/Mead/images/facebook_icon_redemption.jpg";
            href = "http://www.meadonline.com/Rewards/Home.aspx";

            name = "Mead&reg; Rewards & Offers";
            description += "just cashed in Mead Money Madness&reg; points for sweet <a href='http://www.meadonline.com/rewards/gallery.aspx'>rewards</a>.";
            description += " Since you're a friend, " + actor + " is letting you in on the fun too.";
            description += " Join now to start earning your own points for awesome rewards!";
            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com/Rewards/Home.aspx";

            properties = { 'Source': source };


            break;
        case "/Teachers/Beta_Signin_ThankYou.aspx":
            MeadDefaultPic = "/App_Themes/Mead/images/mead4teachers_facebook_icon.jpg";
            href = "http://www.meadonline.com/Teachers/Beta_Signin.aspx";
            name = "Become a Mead partner in education";
            description += "just joined the Mead4Teachers program on mead.com.";
            description += "Since you're a friend and fellow teacher, " + actor + " wants you to take advantage of our special rewards and benefits, too."
            description += " Join our exclusive community now!";
            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com/Teachers/Beta_Signin.aspx";

            properties = { 'Source': source };

            break;

        case "/App/FiveStarBeats/index.aspx":
            href = "http://www.meadonline.com/Students/Play.aspx";
            MeadDefaultPic = "/App_Themes/Mead/images/facebook_icon_bofb.jpg";
            name = "Battle of The Beats";
            description += 'just mastered some awesome drum riffs in Battle of the Beats.';
            description += 'Can you keep up? Play the game to show off your skills and see if you can get a better score.';
            AnnonProperty = { 'text': '<b>Play Now</b>', 'href': 'http://www.meadonline.com/Students/Play.aspx' };

            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";
            properties = { ' - ': AnnonProperty, 'Source': source };

            break;
        case "/App/ClassRoom_Chaos/index.aspx":
            href = "http://www.meadonline.com/Students/Play.aspx";
            MeadDefaultPic = "/App_Themes/Mead/images/facebook_icon_classroom_chaos.jpg";
            name = "Classroom Chaos";
            description += 'just wreaked a ton of havoc in class without getting caught! ';
            description += 'Play the game to show off your skills and see if you can get a better score.';
            AnnonProperty = { 'text': '<b>Play Now</b>', 'href': 'http://www.meadonline.com/Students/Play.aspx' };

            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";
            properties = { ' - ': AnnonProperty, 'Source': source };

            break;
        case "/App/MazeOMadness/index.aspx":
            href = "http://www.meadonline.com/Students/Play.aspx";
            MeadDefaultPic = "/App_Themes/Mead/images/facebook_icon_maze.jpg";
            name = "Maze-o-Madness";
            description += 'just dodged angry teachers and collected school supplies to make it out of the maze alive! ';
            description += 'Play the game to show off your skills and see if you can get a better score.';
            AnnonProperty = { 'text': '<b>Play Now</b>', 'href': 'http://www.meadonline.com/Students/Play.aspx' };

            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";
            properties = { ' - ': AnnonProperty, 'Source': source };
                        
            break;
        case "/App/GearGrabGame/index.aspx":
            href = "http://www.meadonline.com/Students/Play.aspx";
            MeadDefaultPic = "/App_Themes/Mead/images/facebook_icon_gear_grab.jpg";
            name = "Gear Grab";
            description += 'just grabbed a ton of Five Star&reg; gear in under two minutes! Think you can beat the bell? ';
            description += 'Play the game to show off your skills and see if you can get a better score.';
            AnnonProperty = { 'text': '<b>Play Now</b>', 'href': 'http://www.meadonline.com/Students/Play.aspx' };

            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";
            properties = { ' - ': AnnonProperty, 'Source': source };


            break;
        case "/App/Vocab/default.aspx":
            href = "http://www.meadonline.com/Students/Play.aspx";
            MeadDefaultPic = "/App_Themes/Mead/images/facebook_icon_vocab.jpg";
            name = "Vocabularious";
            description += 'solved a tough word puzzle. ';
            description += 'Play Vocabularious to show off your skills and see how your performance stacks up.';
            AnnonProperty = { 'text': '<b>Play Now</b>', 'href': 'http://www.meadonline.com/Students/Play.aspx' };

            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";
            properties = { ' - ': AnnonProperty, 'Source': source };

            break;
        default:
            description += " www.meadonline.com";
            source.text = "www.meadonline.com";
            source.href = "http://www.meadonline.com";
            properties = { 'Source': source };

    }


}

function publish2Facebook(firstName, bundleArrayKey) {

    actor = firstName;
    SetData();
    var attachment = { 'name': name
		 , 'href': href
	     , 'description': firstName + description
		 , 'media': [{ 'type': 'image'
		 , 'src': MeadHost + MeadDefaultPic
		 , 'href': href}]
		 , 'properties': properties
    };


    // 	 , 'caption': ''

    FB.ensureInit(function() {
        FB.Connect.streamPublish('', attachment);
    });
}





