/*
 * k12.js
 *
 * k-12 center at ets.org
 * http://www.k12center.org/ 
 *
 * REQUIRES: jQuery (min 1.6.2)
 *
 * minimize this file before publishing
 *
 * ------------------------------------------------------------------- 
 * history
 * ------------------------------------------------------------------- 
 *
 * 2011-08-16: dev started (dhj) 
 *
 */

var centerArticleHeight = 0;

var socialMedia = "";
socialMedia += "<span id=\"share-dialog\">Share</span>";
socialMedia += "<div id=\"socials\">";
socialMedia += "<div>";
socialMedia += "<g:plusone count=\"false\"></g:plusone>";
socialMedia += "</div>";
socialMedia += "<div>";
socialMedia += "<iframe src=\"http://www.facebook.com/plugins/like.php?app_id=100315616741534&amp;href=http%3A%2F%2Fwww.k12center.org%2F&amp;send=false&amp;layout=button_count&amp;width=80&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:25px;\" allowTransparency=\"true\"></iframe>";
socialMedia += "</div>";
socialMedia += "<div>";
socialMedia += "<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-text=\"this\" data-count=\"none\">Tweet</a><script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>";
socialMedia += "</div>";
socialMedia += "</div>";

$(document).ready(function(){
		
	$('#k12-search-go').hover(
		function () {
			$(this).addClass('over');
		},
		function () {
			$(this).removeClass('over');
		}
	);

	$('body.k12-index section#right article').each(function(){
		height = $(this).height();
		if( height > centerArticleHeight ) {
			centerArticleHeight = height;
		}
	}).each(function(){
		$(this).height(centerArticleHeight);
	});
	

	$('li#share').html(socialMedia);
	$('span#share-dialog').click(function(){

		if( $('#socials').is(':visible') ) {
			$('#socials').slideUp('slow', function() { /* Animation complete */ });
		} else {
			$('#socials').slideDown('slow', function() { /* Animation complete */ });
		}

	});
	
	/* 20110915 Added link to top left graphic CM */
	$('header h1').click(function() {
		window.location="/";
	}).css('cursor','pointer');
		

}); // end: document.ready






/* ------------------------------------------------------------------- */

// set the top site-nav 'current' state
//
function setCurrentNav(id){
	$('#'+id).addClass('current');
} // end: setCurrentNav

