// Brag Book JavaScript Document

//check browser version
function getFlashMovie(movieName)
{
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}

// show or hide the divs
var current_brag = String;
function MM_showHideLayers()
{ //v9.0
  var i,p,v,obj,args=arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='unhide')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v;
  }
  
  // sets brag phrases and links info (see function setBrag() below)
  current_brag = args[0];
  setBrag();
  
  analytics();

  sendToActionscript('closed');
  
  closeTweet();
  closeEmail();
}

function analytics()
{
	// send brag to google alerts
	if (document.getElementById(current_brag).style.visibility == "visible")
	{
		pageTracker._trackPageview(current_brag);
		//alert(current_brag);
	}
}

function prevBrag()
{
	var brag = current_brag.substring(5);
	var bragNum = parseInt(brag);
	document.getElementById(current_brag).style.visibility = "hidden";
	current_brag = "apDiv" + (bragNum - 1);
	setBrag();
	closeTweet();
	closeEmail();
	document.getElementById(current_brag).style.visibility = "visible";
	analytics();
}

function nextBrag()
{
	var brag = current_brag.substring(5);
	var bragNum = parseInt(brag);
	document.getElementById(current_brag).style.visibility = "hidden";
	current_brag = "apDiv" + (bragNum + 1);
	setBrag();
	closeTweet();
	closeEmail();
	document.getElementById(current_brag).style.visibility = "visible";
	analytics();
}

//enable flash when div is closed
function sendToActionscript(str) 
{
     getFlashMovie("bragbook").sendToActionscript(str); 
}

//lets AS call JS to see if it should skip the preloader
function getSkipParam()
{
    var param = gup("skip")
    return param;
}

//lets AS call JS to let it know which, if any, brag is open
function getBragParam()
{
    var divID = gup("brag");
    if (divID) {
    return divID;
    } else {
    return "nope";
    }
}

//parse the URL parameters
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

//if opens with div showing, disable flash
function divIsOpen(divstatus)
{
    getFlashMovie("bragbook");
	//divIsOpen(divstatus);
}

// META DESCRIPTIONS/IMAGES AND LINKS FOR THE BRAG BOOK
var fb = String;
var u = String;
var fb_desc = String;
var email_msg1 = String;
var email_msg2 = String;
var sender = String;

function setBrag()
{
	var brag = current_brag.substring(5);
	
	if (current_brag == 'apDiv1')
	{
		
		// apDiv1 INFO //
		
		// page title for bit.ly and facebook
		var title = "The first computer that could think";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon had the first computer that could think? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_01.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "So cool! @CarnegieMellon had the first computer that could think. http://bit.ly/cmucomputer";
		// email subject
		email_msg1 = "Carnegie Mellon had the first computer that could think.";		
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/cmucomputer";


	} else if (current_brag == 'apDiv2')
	{

		// apDiv2 INFO //
		
		// page title for bit.ly and facebook
		var title = "Changing the way the cookie crumbles";
		// meta description for facebook sharing
		fb_desc = "Did you know the first Girl Scout badge for negotiation started at Carnegie Mellon? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_02.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Awesome! Young girls are learning to be better negotiators thanks to an @CarnegieMellon professor. http://bit.ly/cmunegotiation";
		// email subject
		email_msg1 = "A Carnegie Mellon professor is making sure women learn to be better negotiators.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned that the first Girl Scout badge for negotiation started at Carnegie Mellon. I thought you'd be interested. Learn more at http://bit.ly/cmunegotiation";
	
	} else if (current_brag == 'apDiv3')
	{

		// apDiv3 INFO //
		
		// page title for bit.ly and facebook
		var title = "Stages and screens";
		// meta description for facebook sharing
		fb_desc = "Did you know countless Carnegie Mellon alumni have graced the big and small screens? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_03.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Countless @CarnegieMellon alumni have graced the big and small screens. http://bit.ly/cmucelebrities";
		// email subject
		email_msg1 = "Carnegie Mellon alumni have shaped the world of entertainment.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/cmucelebrities";
		
	} else if (current_brag == 'apDiv4')
	{

		// apDiv4 INFO //
		
		// page title for bit.ly and facebook
		var title = "A hand in the iPhone";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon alumnus was one of the selected few who helped design the iPhone? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_04.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Love this! An @CarnegieMellon alumnus was one of the selected few who helped design the iPhone. http://bit.ly/cmuiPhone";
		// email subject
		email_msg1 = "A Carnegie Mellon alumnus helped design the iPhone.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/cmuiPhone";
		
	} else if (current_brag == 'apDiv5')
	{

		// apDiv5 INFO //
		
		// page title for bit.ly and facebook
		var title = "We have style";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon alumna launched the world-renowned Juicy Couture fashion line? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_05.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Fabulous. An @CarnegieMellon alumna launched the world-renowned Juicy Couture fashion line. http://bit.ly/cmufashion";
		// email subject
		email_msg1 = "A Carnegie Mellon alumna launched the Juicy Couture fashion line.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/cmufashion";
		
	} else if (current_brag == 'apDiv6')
	{

		// apDiv6 INFO //
		
		// page title for bit.ly and facebook
		var title = "Bulletproof";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon alumna made a discovery in 1965 that led to the Kevlar(R) fiber used in bulletproof vests? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_06.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "An @CarnegieMellon alumna made a discovery that led to the Kevlar(R) fiber used in bulletproof vests. http://bit.ly/CMUBulletproof";
		// email subject
		email_msg1 = "A Carnegie Mellon alumna made a discovery that led to the Kevlar(R) fiber.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/CMUBulletproof";
		
	} else if (current_brag == 'apDiv7')
	{

		// apDiv7 INFO //
		
		// page title for bit.ly and facebook
		var title = "Search us";
		// meta description for facebook sharing
		fb_desc = "Did you know the first large-scale Internet search engine was developed by a Carnegie Mellon alumnus? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_07.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Awesome! An @CarnegieMellon alumnus developed the first large-scale Internet search engine. http://bit.ly/SearchCMU";
		// email subject
		email_msg1 = "A Carnegie Mellon alumnus developed the first large-scale Internet search engine.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/SearchCMU";
		
	} else if (current_brag == 'apDiv8')
	{

		// apDiv8 INFO //
		
		// page title for bit.ly and facebook
		var title = "A start on stage";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon alumnus first wrote Pippin for the university's \"Scotch 'n' Soda\" student theater? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_08.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "An @CarnegieMellon alumnus first wrote Pippin for the university's \"Scotch 'n' Soda\" student theater. http://bit.ly/CMUPippin";
		// email subject
		email_msg1 = "Pippin originated at Carnegie Mellon.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned that an alumnus originally wrote Pippin for the university's \"Scotch 'n' Soda\" student theater. I thought you'd be interested. Learn more at http://bit.ly/CMUPippin";
		
	} else if (current_brag == 'apDiv9')
	{

		// apDiv9 INFO //
		
		// page title for bit.ly and facebook
		var title = "Renew it";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon was the largest retail purchaser of wind power in the U.S. in 2001 and by 2008 the Pittsburgh campus grew its use of renewable power sources to 29%? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_09.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Going Green. @CarnegieMellon was the largest retail purchaser of wind power in the U.S. in 2001. http://bit.ly/powerCMU";
		// email subject
		email_msg1 = "Carnegie Mellon was the largest retail purchaser of wind power in the U.S. in 2001.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned about the university's use of renewable power sources. I thought you'd be interested. Learn more at http://bit.ly/powerCMU";
		
	} else if (current_brag == 'apDiv10')
	{

		// apDiv10 INFO //
		
		// page title for bit.ly and facebook
		var title = "First smile in an email";
		// meta description for facebook sharing
		fb_desc = "Did you know the first email smiley :-) was created by a Carnegie Mellon professor? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_10.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Smile! An @CarnegieMellon professor created the first email smiley in 1982. :-) http://bit.ly/CMUsmile";
		// email subject
		email_msg1 = "A Carnegie Mellon professor created the first email smiley :-)";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/CMUsmile";
		
	} else if (current_brag == 'apDiv11')
	{

		// apDiv11 INFO //
		
		// page title for bit.ly and facebook
		var title = "Four giants under one roof";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon is home to the only building in the world where Google, Intel, Apple and a Microsoft-sponsored research lab live under one roof? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_11.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Google, Intel, Apple and a Microsoft-sponsored lab under one roof. Only at @CarnegieMellon! http://bit.ly/4giants";
		// email subject
		email_msg1 = "Carnegie Mellon houses four giants under one roof.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned that the university is home to the only building in the world where Google, Intel, Apple and a Microsoft-sponsored research lab live under one roof. I thought you'd be interested. Learn more at http://bit.ly/4giants";
		
	} else if (current_brag == 'apDiv12')
	{

		// apDiv12 INFO //
		
		// page title for bit.ly and facebook
		var title = "CAPTCHA";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon professor is preventing computer crime while deciphering smudged words from old books? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_12.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "An @CarnegieMellon professor is preventing computer crime while deciphering smudged words from old books. http://bit.ly/captchas";
		// email subject
		email_msg1 = "A Carnegie Mellon professor is preventing computer crime one word at a time.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/captchas";
		
	} else if (current_brag == 'apDiv13')
	{

		// apDiv13 INFO //
		
		// page title for bit.ly and facebook
		var title = "Cruise Controlled";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon established the nation's first Robotics Institute in 1979? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_13.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "So cool! @CarnegieMellon established the nation's first Robotics Institute in 1979. http://bit.ly/roboU";
		// email subject
		email_msg1 = "Carnegie Mellon not only has the first Robotics Institute, looks like they're shooting for the moon.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/roboU";
		
	} else if (current_brag == 'apDiv14')
	{

		// apDiv14 INFO //
		
		// page title for bit.ly and facebook
		var title = "Greenhouse";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon built the first green dormitory in the U.S. in 2003? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_14.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "So green! @CarnegieMellon built the first green dormitory in the U.S. in 2003. http://bit.ly/CMUdorm";
		// email subject
		email_msg1 = "Carnegie Mellon built the first green dormitory in the U.S.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/CMUdorm";
		
	} else if (current_brag == 'apDiv15')
	{

		// apDiv15 INFO //
		
		// page title for bit.ly and facebook
		var title = "Alice in cyberland";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon alumnus and professor Randy Pausch developed Alice, a revolutionary way to teach computer programming? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_15.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Alice was developed by @CarnegieMellon alum and prof Randy Pausch to teach computer programming. http://bit.ly/AliceRandy";
		// email subject
		email_msg1 = "Carnegie Mellon alumnus and professor Randy Pausch developed Alice to teach computer programming.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned that Alice, a revolutionary way to teach computer programming, was developed by alumnus and professor Randy Pausch. Randy also gained international acclaim for his \"Last Lecture\" and his best-selling book. I thought you'd be interested. Learn more at http://bit.ly/AliceRandy";
		
	} else if (current_brag == 'apDiv16')
	{

		// apDiv16 INFO //
		
		// page title for bit.ly and facebook
		var title = "All wired up";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon was the first university with a completely wired campus? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_16.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Not surprising! @CarnegieMellon was the first university with a completely wired campus. http://bit.ly/wiredCMU";
		// email subject
		email_msg1 = "Carnegie Mellon was the first university with a completely wired campus.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/wiredCMU";
		
	} else if (current_brag == 'apDiv17')
	{

		// apDiv17 INFO //
		
		// page title for bit.ly and facebook
		var title = "Are you looking at me?";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon professor created interactive artwork that is aware of you? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_17.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Pretty cool. An @CarnegieMellon professor created interactive art that is aware of your presence. http://bit.ly/AwareArt";
		// email subject
		email_msg1 = "A Carnegie Mellon professor created interactive art that is aware of your presence.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/AwareArt";
		
	} else if (current_brag == 'apDiv18')
	{

		// apDiv18 INFO //
		
		// page title for bit.ly and facebook
		var title = "It's easy being green";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon professor invented TAML(R) catalysts to prevent water supplies from becoming contaminated? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_18.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "An @CarnegieMellon professor invented TAML(R) catalysts to keep water supplies from becoming contaminated. http://bit.ly/CleanH2O";
		// email subject
		email_msg1 = "Water supplies are cleaner thanks to a Carnegie Mellon professor.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned a professor invented TAML(R) catalysts to prevent water supplies from becoming contaminated. I thought you'd be interested. Learn more at http://bit.ly/CleanH2O";
		
	} else if (current_brag == 'apDiv19')
	{

		// apDiv19 INFO //
		
		// page title for bit.ly and facebook
		var title = "(psychology + technology) x Carnegie Mellon = success";
		// meta description for facebook sharing
		fb_desc = "Did you know a Carnegie Mellon alumnus and professor developed cognitive tutor systems that are helping 500,000 students in the U.S. improve their math skills? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_19.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Smart! 500,000 students are improving their math skills thanks to an @CarnegieMellon professor and alumnus. http://bit.ly/CMUtutor";
		// email subject
		email_msg1 = "A Carnegie Mellon alumnus and professor developed Cognitive Tutors to help students with math.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned an alumnus and professor developed tutoring systems that are helping 500,000 students in 2,600 U.S. schools improve their math skills. Learn more at http://bit.ly/CMUtutor";
		
	} else if (current_brag == 'apDiv20')
	{

		// apDiv20 INFO //
		
		// page title for bit.ly and facebook
		var title = "Building business";
		// meta description for facebook sharing
		fb_desc = "Did you know two Carnegie Mellon professors wrote one of the most influential business books of all time: A Behavioral Theory of the Firm? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_20.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "A Behavioral Theory of the Firm, an influential business book, was written by two @CarnegieMellon professors. http://bit.ly/cmuBizBook";
		// email subject
		email_msg1 = "Two Carnegie Mellon professors shaped the business world with their influential book.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag book and just leaned that two Carnegie Mellon professors wrote A Behavioral Theory of the Firm, one of the most influential business books of all time. I thought you'd be interested. Learn more at http://bit.ly/cmuBizBook";
		
	} else if (current_brag == 'apDiv21')
	{

		// apDiv21 INFO //
		
		// page title for bit.ly and facebook
		var title = "We got game";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon students and faculty created video games to train first responders? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_21.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Many first responders are trained with video game technology created by @CarnegieMellon students and faculty. http://bit.ly/TrainingGame";
		// email subject
		email_msg1 = "Carnegie Mellon student and faculty created video games to train first responders.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/TrainingGame";
		
	} else if (current_brag == 'apDiv22')
	{

		// apDiv22 INFO //
		
		// page title for bit.ly and facebook
		var title = "GigaPan";
		// meta description for facebook sharing
		fb_desc = "Did you know GigaPan, a robotic device that enables any camera to take multibillion-pixel panoramic images, was a collaborative effort between Carnegie Mellon and NASA? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_22.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Amazing panoramic images are the result of @CarnegieMellon teaming up with NASA to develop GigaPan. http://bit.ly/cmuGigaPan";
		// email subject
		email_msg1 = "Carnegie Mellon teamed up with NASA to develop the GigaPan Camera System.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned that GigaPan is a robotic device that enables any digital camera to shoot amazing panoramic images. I thought you'd be interested. Learn more at http://bit.ly/cmuGigaPan";
		
	} else if (current_brag == 'apDiv23')
	{

		// apDiv23 INFO //
		
		// page title for bit.ly and facebook
		var title = "Walking on water";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon mechanical engineers created robots that can walk on water and detect harmful toxins? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_23.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Robots that can walk on water and detect harmful toxins were created by @CarnegieMellon mechanical engineers. http://bit.ly/cmuWaterBot";
		// email subject
		email_msg1 = "Robots that can walk on water and detect harmful toxins were created at Carnegie Mellon.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/cmuWaterBot";
		
	} else if (current_brag == 'apDiv24')
	{

		// apDiv24 INFO //
		
		// page title for bit.ly and facebook
		var title = "Not that we're keeping score";
		// meta description for facebook sharing
		fb_desc = "Did you know Carnegie Mellon current and former faculty, and alumni, have won numerous notable awards? Learn more from Carnegie Mellon's Little Brag Book.";
		// images for facebook sharing
		var brag_img = "thumbnails/thumbnail_24.jpg";
		// message and shortened URL for Twitter sharing
		var tweet_msg = "Check out the awards won by @CarnegieMellon people. http://bit.ly/NotableAlums";
		// email subject
		email_msg1 = "From Emmys to Nobels, Carnegie Mellon has a lot of notable award winners.";
		// message and link for email sharing
		email_msg2 = "I'm reading Carnegie Mellon's Little Brag Book and just learned this. I thought you'd be interested. Learn more at http://bit.ly/NotableAlums";
	
	} else {
		alert("Brag information for " + current_brag + " does not exist yet. Please add information for " + current_brag + " to scripts.js ... \n\nIf you feel that you have received this message in error, you will be redirected to the main page.");
		window.location.href = "http://social.web.cmu.edu/brag";
	}
		
	// tricks facebook's share link caching
	var fb_share = Math.random()*12.99;
	
	//sets facebook share url
	u = "http://social.web.cmu.edu/brag/brags.php?brag=" + brag + "&title=" + title + "&desc=" + fb_desc + "&img=" + brag_img + "&share=" + fb_share;
		
	//alert URL for grabbing bit.ly links
	//alert("http://social.web.cmu.edu/brag/brags.php?brag=" + encodeURIComponent(brag) + "&title=" + encodeURIComponent(title) + "&desc=" + encodeURIComponent(fb_desc) + "&img=" + encodeURIComponent(brag_img));
		
	// set tweet message
	document.getElementById("tweet").value = tweet_msg;
	
	// set email message
	document.getElementById("message").value = email_msg1 + "\n\n" + email_msg2;
}

// show facebook
function facebook()
{
	var t = document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
}

//functions for onload in body tag
function loadFunctions()
{
	var brag = gup("brag");
	var skip_param = gup("skip");
	if (skip_param == "yes")
	{
		document.getElementById("apDiv" + brag).style.visibility="visible";
        setTimeout("getFlashMovie('bragbook');divIsOpen('yes');",100);
    }
	
	// check for flash
	if (pluginlist.indexOf("Flash") == -1)
	{
		document.getElementById("flash").style.display="none";
		document.getElementById("noFlash").style.display="block";
	}
}