jQuery(document).ready(function() {
	
/* footer share icons  	*/
	jQuery("#btn-email").click(function(){
		thisUrl = window.location.href;
		window.open('form_emailpage.php?pageUrl='+thisUrl, 'EmailForm', 'height=400,width=450,scrollbars=yes');
	});
	jQuery("#btn-print").click(function(){
		appendWith = '&';
		// first check if there are any params
		thisUrl = window.location.href;
		urlArry = thisUrl.split('?');
		appendWith = (urlArry.length > 1) ? '&' : '?';
		thisUrl = window.location.href + appendWith + 'print=1';
		window.open(thisUrl, 'printWin', 'width=1000, height=600, scrollbars=1, menubar=1');
	});


	jQuery(".share_button_item").hover(
		function () {
			jQuery(this).addClass("hover");
			jQuery(this).children().addClass("hover");
		},
		function () {
			jQuery(this).removeClass("hover");
			jQuery(this).children().removeClass("hover");
		}
	);
	
	
	function printThis(){
		window.print();
	}
	
	jQuery("#share-button").click(function(){

			// If the menu is already open, close it
			if (jQuery('#kraemerShareThisStory').is(':visible')) {
				jQuery('#kraemerShareThisStory').hide();
			}
			else {
				jQuery('#kraemerShareThisStory').show();
				//kraemerOverlayOpenId = menuId;
					//kraemerOverlayMenuOpen = true;
				//kraemerOverlayClickedId = "";
			}
	

	});
	jQuery("#btn-closeshare").click(function(){
		jQuery('#kraemerShareThisStory').hide();																					 
	});
	
	/* IE8 alpha transparency fixes on bubble*/
	/*
	jQuery("#share-bubble").bubble({
		'effectTime' : 100,
		'distance' : 10,
		'hideDelay' : 100,
		'topPx' : -210,
		'leftPx' : -20
	});


	jQuery(".coda3-topleft").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-1.png,sizingMethod='scale')");
	jQuery(".coda3-top").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-2.png,sizingMethod='scale')");
	jQuery(".coda3-topright").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-3.png,sizingMethod='scale')");
	jQuery(".coda3-bottomleft").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-6.png,sizingMethod='scale')");
	jQuery(".coda3-bottom").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-7.png,sizingMethod='scale')");
	jQuery(".coda3-bottomright").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-8.png,sizingMethod='scale')");
	jQuery(".coda3-left").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-4.png,sizingMethod='scale')");
	jQuery(".coda3-right").css('filter',  "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/codabubble/bubble3-5.png,sizingMethod='scale')");
*/
});


function kraemerHideOverlay(menuId) {
	if ($(menuId)) {
		$(menuId).style.display = "none";
		kraemerOverlayOpenId = '';
	    kraemerOverlayMenuOpen = false;
	}

	// Add code here for overlay menus with non-default behavior
}



	share = function(sitename){
		var shareUrl;
		var thisDescription = '';
		thisUrl = encodeURIComponent(window.location.href);
		thisTitle = top.document.title;
	
		switch(sitename){
		 case 'ybuzz':
			 shareUrl = 'http://buzz.yahoo.com/buzz?src=addthis&targetUrl='+thisUrl+'&headline='+thisTitle;
		 break;
		 case 'linkedin':
		 	shareUrl = 'http://www.linkedin.com/shareArticle?mini=true&url='+thisUrl+'&title='+thisTitle;
		 break;
		 case 'digg':
		 	shareUrl = 'http://digg.com/submit?url='+thisUrl+'&title='+thisTitle;
		 break;
		 case 'facebook':
			shareUrl = 'http://www.facebook.com/sharer.php?u='+thisUrl;
		 break;
		 case 'gbuzz':
		 //No preview found for this link.
			shareUrl = 'http://www.google.com/buzz/post?url='+thisUrl;
		 break;
		 case 'mixx':
		 	shareUrl = 'http://www.mixx.com/submit?page_url='+thisUrl;
		 break;
		 case 'twitter':
		 	shareUrl = 'http://twitter.com/home?status=' +thisUrl;
		 break;
		 case 'delicious':
		 	shareUrl = 'http://del.icio.us/post?v=4&noui&jump=close&url='+thisUrl+'&title='+thisTitle;
		 break;
		 case 'reddit':
		 	shareUrl = 'http://reddit.com/submit?url='+thisUrl+'&title='+thisTitle;
		 break;
		 case 'myspace':
		 	shareUrl = 'http://www.myspace.com/Modules/PostTo/Pages/?' + 't=' + thisTitle + '&c=' + thisDescription + '&u=' + thisUrl;
		 break;
		 case 'stumbleupon':
		 	shareUrl = 'http://www.stumbleupon.com/submit?url='+thisUrl+'&title='+thisTitle;
		 break;
		}
		
		window.open(shareUrl,"share","width=1050,height=480,toolbar=no,resizable=yes,scrollbars=yes");
	}

/* end footer share icons  	*/