/* 
 * Jquery browser detect plugin to identify browser/os detection.
 * jQuery Browser Plugin - http://jquery.thewikies.com/browser/
*/
(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent,true);})(jQuery);

/* Replace links to latest album */
if(location.href.match("/album/$") == "/album/") {
	window.location = location.href.substring(0, location.href.indexOf("/album/")) + "/album/riot-1/"
}
if(location.href.match("/music/$") == "/music/" ) {
	window.location = location.href.substring(0, location.href.indexOf("/music/")) + "/album/riot-1/"		
}

var blogTwitterBlurbText = 	"Follow this on Twitter using the tag #";
var privacyPolicyText = 'By registering, I acknowledge that I have reviewed and agreed to the '+ '<a target="_new" href="http://www.fueledbyramen.com/privacy/eos" rel="external">Privacy Policy</a> and <a target="_new" href="http://www.fueledbyramen.com/terms/eos" rel="external">Terms of Service</a>' + ', and I agree to receive marketing messages from Fueled by Ramen, its affiliates and Paramore with the latest news, updates and information about Paramore';

$(document).ready(function(){

 	$("#sharelinkWrapper").hide();
	
	/* Setting the browser name and classname in the top */
	$("html").addClass($.os.name);
	$("body").addClass($.browser.className);

/*
*/
	/* Suppresses display of empty footers on IE */
	$('.module .foot:empty').addClass('empty');
	
	
	/* START Add "Launch Player" links to footer nav of all audio playlist modules */
	var launchLink =  $('<li class="launchPlayer"><a href="/music-player/" class="launchPlayerLink">Launch Player</a></li>');
	$(".song_playlist .module .content .nav_meta ul").prepend(launchLink);
	/* END Add "Launch Player" links to footer nav of all audio playlist modules */
	
	/* add popup onClick handler for audio player links */
	$("a.launchPlayerLink").click(function() {
			window.open("/music-player/", "Window2", "width=363,height=303,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no"); 
			return false;
	});
		
	/* Replace links to "Music" to links to latest album. NOTE: this will need to be reworked whenever a new album is released */
	$("a[href$=/music/]").attr("href", "/album/riot-1/");

	//add UK link

/*	$('#nav_global #nav_member ul li.signup').parent().prepend("&lt;li id=\'uk_site_link\'&gt;&lt;a href=\'http://www.lauraizibor.co.uk\' &gt;&lt;img src=\'http://static.ciscoeos.com/zipupload/d5e/ae7/7172158535aff4eac97276f2f6/images/global/uk_fans_click_here.gif\' alt=\'Laura Izibor UK Site\'/&gt;&lt;/a&gt;&lt;/li&gt;");
	$('#nav_global #nav_user ul li.signup').parent().prepend("&lt;li id=\'FBR_link\'  style=\'display : inline\' &gt;&lt;a href=\'javascript:void(0)\' &gt;FBR dropdown &lt;/a&gt;&lt;/li&gt;"); 
	*/
	
	$tempFBRDrpdwn = $('<li id="FBR_link"  style="display : inline" ><a id="FBR_LINK_Text" href="javascript:void(0)" >FUELEDBYRAMEN</a></li>');
	$tempFBRDrpdwn.insertBefore('#nav_global #nav_member ul li.hello');
	$tempFBRDrpdwn.insertBefore('#nav_global #nav_user ul li.signin'); 


	//Define XHTML source for the community subnav inn the variable below
	var FBRSubNav = '<ul class="flyoutMenu" id="FBRSubNav" style="display:none">\
		<li id="moreFBR"><span> More from </span> <a target="_blank" href="http://www.fueledbyramen.com/">fueled by ramen</a></li>\
		<li id="emptytrail"> </li>\
		<li id="academyNav"> <a target="_blank" href="http://www.theacademyis.com/">The Academy Is...</a></li>\
		<li id="CabNav"> <a target="_blank" href="http://www.fueledbyramen.com/bands/index.php?id=54">The Cab</a></li>\
		<li id="CobraNav"> <a target="_blank" href="http://www.cobrastarship.com/">Cobra Starship</a></li>\
		<li id="ForgiveNav"> <a target="_blank" href="http://www.forgivedurden.com/">Forgive Durden</a> </li>\
		<li id="FridayNightNav"> <a target="_blank" href="http://www.myspace.com/thefridaynightboys">The Friday Night Boys</a> </li>\
		<li id="GymNav"> <a target="_blank" href="http://www.gymclassheroes.com/">Gym Class Heroes</a> </li>\
		<li id="panicatthediscoNav"> <a target="_blank" href="http://www.panicatthedisco.com/">Panic! At The Disco</a> </li>\
		<li id="PowerspaceNav"> <a target="_blank" href="http://www.powerspacetheband.com/">Powerspace</a> </li>\
		<li id="RocketNav"> <a target="_blank" href="http://www.myspace.com/arockettothemoon">A Rocket To The Moon</a> </li>\
		<li id="SwellersNav"> <a target="_blank" href="http://www.myspace.com/theswellers">The Swellers</a> </li>\
		<li id="ProvidenceNav"> <a target="_blank" href="http://www.thisprovidence.com/">This Providence</a> </li>\
		<li id="VersaEmergeNav"> <a target="_blank" href="http://www.myspace.com/versaemerge">VersaEmerge</a> </li>\
		<li id="emptytrail" class="FBR_foot"><div class="fbr_close"></div> </li>';
	var FBRNavCell = $("#nav_global ul #FBR_link");   //change this selector to target a diffent cell in the top nav
/*	FBRNavCell.addClass('dropdown');  */
	FBRNavCell.append(FBRSubNav);
	/* END: Community drop-down for top nav */

	$("#FBRSubNav .fbr_close").click( function(event) {
		$("ul#FBRSubNav").hide();		
	});
	
	$("#FBR_link #FBR_LINK_Text").click( function(event) {
				$("ul#FBRSubNav").show();		
	});
	
	
	/* START: Community drop-down for top nav */
	//Define XHTML source for the community subnav inn the variable below
	var communitySubNav = '<ul class="flyoutMenu" id="communitySubNav" style="display:none">\
		<li id="communityHomeNav"><a href="/community-landing/">Community Home</a></li>\
		<li id="memberNav"><a href="/member/">Fans</a></li>\
		<li id="discussionsNav"><a href="/forums/">Discussions</a></li>\
		</ul>';
	var communityNavCell = $(".nav_main ul li.nav-community_landing");   //change this selector to target a diffent cell in the top nav
	communityNavCell.addClass('dropdown');
	communityNavCell.append(communitySubNav);
	/* END: Community drop-down for top nav */
	
	/* START: Store drop-down for top nav */
	//Define XHTML source for the community subnav inn the variable below
	var storeSubNav = '<ul class="flyoutMenu" id="storeSubNav" style="display:none">\
		<li><a href="http://store.paramore.net" class="flag us" rel="external">US Preorder</a></li>\
		<li><a href="http://store.fueledbyramen.com/" class="flag us" rel="external">US Merch</a></li>\
		<li><a href="http://paramore.warnerartists.com/eu" class="flag europe" rel="external">Europe Store</a></li>\
		<li><a href="http://paramore.warnerartists.com/en" class="flag uk" rel="external">UK Store</a></li>\
		<li><a href="http://www.mymusic.com/promotions/paramore/" class="flag canada" rel="external">Canada Store</a></li>\
		<li><a href="http://www.paramore.net.au" class="flag australia" rel="external">Australia Store</a></li>\
		<li><a href="http://www.paramore.com.mx" class="flag mexico" rel="external">Mexico Store</a></li>\
		<li><a href="http://item.rakuten.co.jp/warnermusic/d7567-89662/" class="flag japan" rel="external">Japan Store</a></li>\
		<li><a href="http://www.paramore.co.nz" class="flag newzealand" rel="external">New Zealand Store</a></li>\
		<li id="ringtonesNav"><a href="/ringtones/">Ringtones</a></li>';
	/* Make store top nav link open in a new window and add the subnav to the li*/
	$('.nav_main ul li.nav-custom a').filter(function(){
	  return (/\.Store/i).test($(this).text())
	}).attr("rel","external")
	  .parent()
	  .addClass('dropdown')
	  .addClass('tonesNav')	  
	  .append(storeSubNav);
	  
	 //Define XHTML source for the community subnav inn the variable below
	var bioSubNav = '<ul class="flyoutMenu" id="bioSubNav" style="display:none">\
		<li id="band"><a href="/member/i/19155/"  class="profile" >Band Profile</a></li>\
		<li id="hayley"><a href="/member/i/19150/"  class="profile" >Hayley&#39;s Profile</a></li>\
		<li id="jeremy"><a href="/member/i/19151/"  class="profile" >Jeremy&#39;s Profile</a></li>\
		<li id="josh"><a href="/member/i/19152/"  class="profile" >Josh&#39;s Profile</a></li>\
		<li id="taylor"><a href="/member/i/19162/"  class="profile" >Taylor&#39;s Profile</a></li>\
		<li id="zac"><a href="/member/i/19163/"  class="profile" >Zac&#39;s Profile </a></li>';
	/* Make store top nav link open in a new window and add the subnav to the li*/
	
	var bioNavCell = $(".nav_main ul li.nav-bio");   //change this selector to target a diffent cell in the top nav
	bioNavCell.addClass('dropdown');
	bioNavCell.append(bioSubNav);
		
/*	$('.nav_main ul li.nav-custom a').filter(function(){
	  return (/\.Store/i).test($(this).text())
	}).attr("rel","external")
	  .parent()
	  .addClass('dropdown')
	  .addClass('tonesNav')	  
	  .append(storeSubNav); */
	  


	var storeNavCell = $('.nav_main ul li.tonesNav');   //change this selector to target a different cell in the top nav
/*	storeNavCell.addClass('dropdown');
	storeNavCell.append(storeSubNav); 

*/	/* END: Store drop-down for top nav */
	
	/* Make store top nav link open in a new window */
	$('.nav_main ul li.nav-custom a[href*=http://store.paramore.net/]').attr("rel", "external");
	
	
	/* START: FanClub drop-down for top nav */
	var FCSubNav = '<ul class="flyoutMenu" id="FCSubNav" style="display:none">\
			<li id="FCMemberNav"><a href="http://starterfanclub1.wmg.ciscoeos.com/member/" >Fan Club Members</a></li>\
			<li id="FCForumNav"><a href="http://starterfanclub1.wmg.ciscoeos.com/talk/" >Fan Club Forum</a></li>\
			<li id="FCChat"><a href="http://starterfanclub1.wmg.ciscoeos.com/" >Fan Club Chat</a></li>\
			<li id="FCBlog"><a href="http://starterfanclub1.wmg.ciscoeos.com/blog/" >Fan Club Blog</a></li>';			
	var FCNavCell =  $('.nav_main ul li.nav-custom:has(a[href*=http://starterfanclub1.wmg.ciscoeos.com])');    //change this selector to target a diffent cell in the top nav
	FCNavCell.addClass('dropdown');
	FCNavCell.append(FCSubNav);
	
	/* START: country drop-down for top nav */
	//Define XHTML source for the community subnav inn the variable below
	var countrySubNav = '<ul class="flyoutMenu" id="internationalSubNav" style="display:none">\
					<li id="australiaNav"><a href="/au/" class="flag australia" >Australia</a></li>\
					<li id="canadaNav"><a href="/ca/" class="flag canada" >Canada</a></li>\
	  				<li id="franceNav"><a href="/fr/" class="flag france" >France</a></li>\
					<li id="germanyNav"><a href="/de/" class="flag germany" >Germany</a></li>\
					<li id="italyNav"><a href="/it/" class="flag italy" >Italy</a></li>\
					<li id="japanNav"><a href="/jp/" class="flag japan" >Japan</a></li>\
					<li id="mexicoNav"><a href="/mx/" class="flag mexico" >Mexico</a></li>\
					<li id="spainNav"><a href="/es/" class="flag spain" >Spain</a></li>\
					<li id="ukNav"><a href="/gb/" class="flag uk" >UK</a></li>';
	var countryNavCell =  $('.nav_main ul li.nav-custom:has(a[href*=javascript:void(0)])');    //change this selector to target a diffent cell in the top nav
	countryNavCell.addClass('dropdown');
	countryNavCell.append(countrySubNav);
	/* END: country drop-down for top nav */
	
	$("a[href^=http://starterfanclub1.wmg.ciscoeos.com]").parent(".nav-custom").addClass("Fanclub");
	
	/* END: FanClub drop-down for top nav */
	
	/*Hover event handler for all drop-downs in top nav */
	$(".dropdown").hover(
			function() { $(".flyoutMenu", this).show(); },
			function() { $(".flyoutMenu", this).hide(); }
	);
	
	
	if($("#sign_up-294578 li.input input").attr('class')== "focused"){		
		$descriptionDisplay = $("#sign_up-294578 li.input input.focused").parent().contents().filter(".message").children();
		if ($descriptionDisplay.css("display") == "inline" ||$descriptionDisplay.css("display") == "none"  ){
			$descriptionDisplay.css("display","block");
		}
	} 
	
	$("#sign_up-294578 li.input input").click( function() {
		// In this check for the corresponding description div. 		
		 $descriptionDisplay = $(this).next().filter(".message").children();
		if ($descriptionDisplay.css("display") == "inline"){
			$descriptionDisplay.css("display","block");
		}
	});
	
	$("#sign_up-294578 li.select input").click( function() {
		// In this check for the corresponding description div. 
		$descriptionDisplay = $(this).parent().contents().filter(".message").children();
		if ($descriptionDisplay.css("display") == "inline"){
			$descriptionDisplay.css("display","block");
		}
	});
	
	
	if (location.href.indexOf("/member/i/19155/") != -1) {
			bioNavCell.addClass("active");
			$("#band").addClass("active");
	}else if (location.href.indexOf("/member/i/19150/") != -1) {
			bioNavCell.addClass("active");
			$("#hayley").addClass("active");
	}else if (location.href.indexOf("/member/i/19151/") != -1) {
			bioNavCell.addClass("active");
			$("#jeremy").addClass("active");
	}else if (location.href.indexOf("/member/i/19152/") != -1) {
			bioNavCell.addClass("active");
			$("#josh").addClass("active");
	}else if (location.href.indexOf("/member/i/19162/") != -1) {
			bioNavCell.addClass("active");
			$("#taylor").addClass("active");
	}else if (location.href.indexOf("/member/i/19163/") != -1) {
			bioNavCell.addClass("active");
			$("#zac").addClass("active");
	}else if (location.href.indexOf("/member/") != -1) {
			communityNavCell.addClass("active");
			$("#memberNav").addClass("active");
	}	
	
	
		
	if (location.href.indexOf("/forums/") != -1) {
			communityNavCell.addClass("active");
			$("#discussionsNav").addClass("active");
		}

	if (location.href.indexOf("/community-landing/") != -1) {
			communityNavCell.addClass("active");
			$("#communityHomeNav").addClass("active");
		}
		
	if (location.href.indexOf("/ringtones/") != -1) {
		storeNavCell.addClass("active");
		$("#ringtonesNav").addClass("active");
		}
	
	var photoNavCell = $(".nav_main ul li.photo");
	if (location.href.indexOf("/cellstream/") != -1) {
		photoNavCell.addClass("active");
	}
	
	if (location.href.indexOf("/album/") != -1) {	
		$("a[href^=/album/]").parent(".nav-custom").addClass("active");
		
	}
	
	if (location.href.indexOf("/music/") != -1) {	
		$("a[href^=/album/]").parent(".nav-custom").addClass("active");
		
	}
		
	if (location.href.indexOf("/gb/") != -1) {
		countryNavCell.addClass("active");
		$("#ukNav").addClass("active");
	}	
	if (location.href.indexOf("/fr/") != -1) {
		countryNavCell.addClass("active");
		$("#franceNav").addClass("active");
	}	
	if (location.href.indexOf("/de/") != -1) {
		countryNavCell.addClass("active");
		$("#germanyNav").addClass("active");
	}	
	if (location.href.indexOf("/au/") != -1) {
		countryNavCell.addClass("active");
		$("#australiaNav").addClass("active");
	}	
	if (location.href.indexOf("/es/") != -1) {
		countryNavCell.addClass("active");
		$("#spainNav").addClass("active");
	}	
	if (location.href.indexOf("/it/") != -1) {
		countryNavCell.addClass("active");
		$("#italyNav").addClass("active");
	}
	if (location.href.indexOf("/mx/") != -1) {
		countryNavCell.addClass("active");
		$("#mexicoNav").addClass("active");
	}	
	
	
	
	/* START: Merch module drop-downs */
	$(".ArtistStore").hover (
			function() { $(".flyoutMenu", this).show(); },
			function() { $(".flyoutMenu", this).hide(); }
		);
	$(".ArtistStore_footer").hover (
			function() { $(".flyoutMenu", this).show(); },
			function() { $(".flyoutMenu", this).hide(); }
		);		
	$(".topAlbumBuyDrop").hover (
			function() { $(".topPrdtflyoutMenu", this).show(); },
			function() { $(".topPrdtflyoutMenu", this).hide(); }
		);		
	$(".centerAlbumBuyDrop").hover (
			function() { $(".centerPrdtflyoutMenu", this).show(); },
			function() { $(".centerPrdtflyoutMenu", this).hide(); }
		);		
	$(".bottomAlbumBuyDrop").hover (
			function() { $(".bottomPrdtflyoutMenu", this).show(); },
			function() { $(".bottomPrdtflyoutMenu", this).hide(); }
		);				
	
	/* END: Merch module drop-downs */
	
	/* Replace EOS default privacy policy and terms of use with Atlantic Records links */
	$('[href$=/privacy-policy/]').attr("href", "http://www.fueledbyramen.com/privacy/eos").attr("rel", "external");
	$('[href$=/terms-of-use/]').attr("href", "http://www.fueledbyramen.com/terms/eos").attr("rel", "external");

	/* Make rel="external" links open in a new window */
	$("a[rel=external]").attr("target", "_new");

	/* Fixing the target for the digg link */
	$(".shareweb .digg a").attr("target", "_new");	
	/* Make  links open in a new window */
	$("a[href=http://www.paramorefanclub.com/]").attr("target", "_new");
	
	/* Append labels to elements in discussion module */
	$(".topics li.list .category li:first-child").prepend("Category: ");
	$(".topics li.list .activity").prepend("Replies: ");
	$(".topics li.list .date").prepend("Last Reply: ");
	
	/* Add "Close" text to close link in social media sharebox on photo and video detail pages */
	$(".sharebox .sb_head .sb_title a.shareclose").prepend("Close");
	
	var noOfImageDscDtl=$("#discussion_entry-294529 .topic .description img").length;
		for(i=0;i<noOfImageDscDtl;i++){
			var discussionImageElement = $("#discussion_entry-294529 .topic .description img:eq(" +i+ ")");
			var imgHeight=discussionImageElement.height();
			var imgWidth=discussionImageElement.width();
			if(imgHeight>200 && imgWidth>200){		
				var calcheight = (imgHeight/imgWidth)*200;		
				discussionImageElement.css("height",calcheight);	
				discussionImageElement.css("width",200);	
			}
			
		}
	
	
	var noOfImageDscDtl=$("#discussion_listing-340654  .topic .description img").length;
		for(i=0;i<noOfImageDscDtl;i++){
			var discussionImageElement = $("#discussion_listing-340654 .topic .description img:eq(" +i+ ")");
			var imgHeight=discussionImageElement.height();
			var imgWidth=discussionImageElement.width();
			if(imgHeight>200 && imgWidth>200){		
				var calcheight = (imgHeight/imgWidth)*200;		
				discussionImageElement.css("height",calcheight);	
				discussionImageElement.css("width",200);	
			}
			
		}
	
	TwitterMap = {
	    "yelyahwilliams": {
		"name"		: "Hayley",
		"profileUrl": "/member/i/19150/",
		"color"		: "#f7c39d"
	    },
	    "joshfarro": {
		"name"		: "Joshua",
		"profileUrl": "/member/i/19152/",
		"color"		: "#cdc97a"
	    },
	    "schzimmydeanie": {
		"name"		: "Jeremy",
		"profileUrl": "/member/i/19151/",
		"color"		: "#f7c39d"
	    },
	    "zacfarro": {
		"name"		: "Zachary",
		"profileUrl": "/member/i/19163/",
		"color"		: "#cdc97a"
	    },
	    "itstayloryall": {
		"name"		: "Taylor",
		"profileUrl": "/member/i/19162/",
		"color"		: "#cdc97a"
	    },
	    "paramore": {
		"name"		: "Paramore",
		"profileUrl": "/member/i/19151/",
		"color"		: "#f7c39d"
	    }
	};
	
	$.urlParam = function(name){
		var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
		if (results == null) {
			return 0;
		}
		else {
			return results[1];
		}
	}
	
/* To add the odd class to achieve alternate colouring for the modules */	
	alternateColouringListing();
   
 $('.nav_page ul li.prev span').empty();
 $('.nav_page ul li.next a').empty();
	
	 //Album detail stuff
	$buylinks = $('#album_info-383751 .foot .nav_meta ul');
	$buylinks.insertBefore('#album_info-383751 .album .txt div.description');
	$('#album_info-383751.album_info .module .content .foot .nav_meta ul').css("display","block"); 
	
    // Functionality for add new blogs.
if( $("body").attr("id") == "add_new_blog"){
   blogCookieText = $.cookie("blog_body");
   if (blogCookieText){
	   blogTwitterBlurbText = blogCookieText + blogTwitterBlurbText;
   }
   $.cookie("blog_body",blogTwitterBlurbText,{path:"/"});
}

	//Modifying the legal text in the log in and sign up pages.
	$("body#sign_up #cmsgData\\[agreeToTerms\\]").next().html(privacyPolicyText + "")
	                                                    .show();
	$("body#join #cmsgData\\[agreeToTerms\\]").next().html(privacyPolicyText + "")
	                                                    .show();
	  $("#sharelinkWrapper").insertBefore("#video_playlist-327525 .module .content .foot .nav_meta");
	  $("#sharelinkWrapper").show();
});


function shareModuleReplaceLinks(shareURL,shareTitle,shareObjectEmbedString){

	shareTextAreaToBeEmbedded = '<label>Embed this video on a website:</label><textarea style="height: 34px;" readonly="readonly" onclick="$(this).focus().select();" name="share_embed"></textarea>';
    $("#sharelinkWrapper .shareembed").append(shareTextAreaToBeEmbedded);
	
	$("#sharelinkWrapper .shareweb .facebook a").attr("href","http://www.facebook.com/share.php?u="+shareURL+"&amp;t="+shareTitle);
	$("#sharelinkWrapper .shareweb .delicious a").attr("href","http://del.icio.us/post?url="+shareURL+"&amp;title="+shareTitle);
	$("#sharelinkWrapper .shareweb .twitter a").attr("href","http://twitter.com/home/?status=Check out "+shareURL);
	$("#sharelinkWrapper .shareweb .email a").attr("href","mailto:?subject="+ shareTitle + "&amp;body="+ shareURL);
    $("#sharelinkWrapper .shareweb .myspace a").attr("href","http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=" + shareURL+ "&amp;t=" + shareTitle +"&amp;c=");
    $("#sharelinkWrapper .shareweb .google a").attr("href","http://www.google.com/bookmarks/mark?op=edit&amp;bkmk="+ shareURL + "&amp;title="+ shareTitle);
    $("#sharelinkWrapper .shareweb .digg a").attr("href","http://digg.com/submit?phase=2&amp;title="+shareTitle+"&amp;url="+ shareURL );
	if (shareObjectEmbedString){
		$("#sharelinkWrapper .shareweb .eos_blog a").click(function(){
         addToBlog(shareTitle, shareObjectEmbedString, '/blog/new/');return false;
  		 return false;
		});
	}
	$("#sharelinkWrapper .shareurl input[name=share_link]").val(shareURL);
	$("#sharelinkWrapper .shareembed textarea[name=share_embed]").val(shareObjectEmbedString);
}

function eoscInit(){
	alternateColouringListing();
}

function alternateColouringListing(){
	
   $('#blog_listing-294512 ul.articles li:nth-child(odd)').addClass('odd');
   $('#comments-294522 ul li:nth-child(odd)').addClass('odd');
   $('#comments-294523 ul li:nth-child(odd)').addClass('odd');
   $('#comments-294524 ul li:nth-child(odd)').addClass('odd');
   $('#comments-294525 ul li:nth-child(odd)').addClass('odd');
   $('#comments-294526 ul li:nth-child(odd)').addClass('odd');
   $('#comments-294527 ul li:nth-child(odd)').addClass('odd');
   
   $('#comments-383752 ul li:nth-child(odd)').addClass('odd');
			   
	  
   $('#site_activity-327537 ul.events li:nth-child(odd)').addClass('odd');
   $('#site_activity-340500 ul.events li:nth-child(odd)').addClass('odd');
   $('#discussion_listing-340654 ul.topics li.topic:nth-child(odd)').addClass('odd');
   $('#discussion_listing-294531 ul.topics li.topic:nth-child(odd)').addClass('odd');
   $('#discussion_listing-294533 ul.topics li.topic:nth-child(odd)').addClass('odd');
   
   
   $('#list_audio-294553 ul.songs li.audio:nth-child(odd)').addClass('odd');
   
   
   /************ International pages discussion **********/ 
   $('#discussion_listing-497799 ul.topics li.topic:nth-child(odd)').addClass('odd');   
   $('#discussion_listing-497807 ul.topics li.topic:nth-child(odd)').addClass('odd');
   $('#discussion_listing-490500 ul.topics li.topic:nth-child(odd)').addClass('odd');
   $('#discussion_listing-497815 ul.topics li.topic:nth-child(odd)').addClass('odd');
   $('#discussion_listing-497803 ul.topics li.topic:nth-child(odd)').addClass('odd');
   $('#discussion_listing-497811 ul.topics li.topic:nth-child(odd)').addClass('odd');
}
