
/* 
 * 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);

var blogTwitterBlurbText = 	"<br><br><br> Follow this on Twitter using the tag #";
var privacyPolicyText   = 'By submitting my information above, I acknowledge that I have reviewed and agreed to the ' + '<a target="_new" href="/privacy-policy" rel="external">Privacy Policy</a> and <a target="_new" href="/terms-of-use" rel="external">Terms of Use</a>' + ', and I agree to receive updates and marketing messages from time to time from SerenaRyder, and her record label.';

$(document).ready(function(){
/* To implement the new twitter */
var listing = 'moduleListing';
var detail = 'moduleDetail';
var detailPageValue = window.location.href;

if(detailPageValue.indexOf('.wmg') != -1){
	var dplen = detailPageValue.length;
	var dpdot = detailPageValue.indexOf('.com/');
	var detailPageValue = detailPageValue.substring(dpdot+5, dplen);
	detailPageValue = 'http://www.serenaryder.com/' + detailPageValue;
}

$('#community_landing #photo_thumbnail-399817').find('.nav_meta ul li.more a').attr('href','/photo/category/member/');
$('#community_landing #video_thumbnail-399818').find('.nav_meta ul li.more a').attr('href','/video/category/member/');
 /* fblikebutton */
if (($('body').attr('id') == "blog") || ($('body').attr('id') == "home")) {
    var twitterObj = {
        blockSelector: '.blog_listing .body li.article',
        urlSelector: '.title h4 a',
        urlQualifier: 'href',
        insertionSelector: '.activity',
        viaParam: '&amp;via=serenaryder',
        siteUrl: 'http://www.serenaryder.com',
        relatedParam: '&amp;related=serenaryder',
        buttonPosition: 'horizontal'
    }
    var fbLikeObj = {
        blockSelector: '.blog_listing .body .article',
        siteUrl: 'http://www.serenaryder.com',
        urlSelector: '.title h4 a',
        detailPageUrl: detailPageValue,
        insertionSelector: '.activity',
        urlQualifier: 'href',
        fblikePosition: 'horizontal'
    }
    $.wmgfeature.fbLike(fbLikeObj, listing);
    $.wmgfeature.twttrButton(twitterObj, listing);
}
if (($('body').attr('id') == "blog_detail")) {
    var twitterObj = {
        blockSelector: '.blog_entry .body .article .meta',
        detailPageUrl: detailPageValue,
        insertionSelector: '.activity',
        viaParam: '&amp;via=serenaryder',
        detailPageName: 'blogDetail',
        relatedParam: '&amp;related=serenaryder',
        buttonPosition: 'horizontal'
    }
    var fbLikeObj = {
        blockSelector: '.blog_entry .body .article .meta',
        detailPageUrl: detailPageValue,
        insertionSelector: '.activity',
        fblikePosition: 'horizontal'
    }
    $.wmgfeature.twttrButton(twitterObj, detail);
    $.wmgfeature.fbLike(fbLikeObj, detail);
}
/* To implement the new twitter */
if (($('body').attr('id') == "photo_detail")) {
    var fbLikeObj = {
        blockSelector: '.photo_viewer .body',
        detailPageUrl: detailPageValue,
        insertionSelector: '.rating',
        fblikePosition: 'horizontal'
    }
    var twitterObj = {
        blockSelector: '.photo_viewer .body',
        detailPageUrl: detailPageValue,
        insertionSelector: '.rating',
        viaParam: '&amp;via=serenaryder',
        detailPageName: 'photoDetail',
        relatedParam: '&amp;related=serenaryder',
        buttonPosition: 'horizontal'
    }
    $.wmgfeature.twttrButton(twitterObj, detail);
    $.wmgfeature.fbLike(fbLikeObj, detail);
}
if (($('body').attr('id') == "video_detail")) {
    var fbLikeObj = {
        blockSelector: '.video_player .body',
        detailPageUrl: detailPageValue,
        insertionSelector: '.rating',
        fblikePosition: 'horizontal'
    }
    var twitterObj = {
        blockSelector: '.video_player .body .video',
        detailPageUrl: detailPageValue,
        insertionSelector: '.rating',
        viaParam: '&amp;via=serenaryder',
        detailPageName: 'videoDetail',
        relatedParam: '&amp;related=serenaryder',
        buttonPosition: 'horizontal'
    }
    $.wmgfeature.twttrButton(twitterObj, detail);
    $.wmgfeature.fbLike(fbLikeObj, detail);
}
/* To implement the new twitter */
	
	/* Setting the browser name and classname in the top */
	$("html").addClass($.os.name);
	$("body").addClass($.browser.className);
    $("body").addClass($.browser.name);
	
	ord=Math.random()*10000000000000000;
		/* Suppresses display of empty footers on IE */
	$('.module .foot:empty').addClass('empty');
	
	/* 
	  Cookie setting and other steps 
	  The lightbox code. This can be enabled or disabled as and when you think about it.	
	*/
	
//	var lightboxUrl = "/splash/?KeepThis=true&TB_iframe=true&height=515&width=810&modal=true"; 
//	var lightboxCookie = $.cookie("homeLightBox");
//	if (lightboxCookie == null){
//		if ($("body#home").length > 0){
//			if (parent.$("#TB_window").html() == null) {
//				tb_show(null,lightboxUrl,false);
//			}
//			$.cookie("homeLightBox",true);
//		}	
//	}
	
	
	/* ********** Added for adding Iggli In the light box ********** */
	if ($("body#splash").length > 0) {
		var newDate = new Date();
		var yearStringSpl = newDate.getFullYear();
		var mnthStringApr = "04";
		var mnthStringMay = "05";
		var iCount = 0;
		
		$("#contentWrapper #content p").each(function(){
			var onclickString;
			var inviteTitleSpl ="Serena Ryder Tours";
			var inviteLocation;
			var inviteDate;
			var locationDate;
			var locationDateArray;
			var dateStringSpl;
			
			if( $(this).find("a").length > 0 ){
				$copyOfThis = $(this);
				$copyOfThis.remove("a");
				$copyOfThis.remove("div");
				inviteLocationFull = $copyOfThis.text();
				inviteLocationFull = inviteLocationFull.replace(new RegExp ("\\n","g"),"");
				writeToConsole($copyOfThis.text()+ inviteLocationFull);
				locationDate = $(this).text();
				locationDate = $.trim(locationDate);
				
				locationDateArray = locationDate.split(' ');
				dateStringSpl = locationDateArray[0];
				inviteLocation = locationDateArray[locationDateArray.length - 1];
				if(iCount <= 12){
					inviteDate = mnthStringApr+'/' + dateStringSpl + '/' +yearStringSpl;
				}else{
					inviteDate = mnthStringMay+'/' + dateStringSpl + '/' +yearStringSpl;
				}
				
				onclickStringSpl = "populateInviteData('"+ inviteTitleSpl + "','"+inviteLocationFull+"','"+inviteDate +"');";
				$(this).append('<div class="iggli-invite-button"><a class="iggli-button" onclick="' + onclickStringSpl + '"></a></div>');
				$(this).append('<div class="clear"></div>');
			}
			iCount++;
		});
		
	}
	
	/* ********** Added for adding Iggli In the light box ********** */
	
	/* 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=375,height=275,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no"); 
			return false;
	});
	
	
	/* 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="commHomeNav"><a href="/community-landing/">Community home</a></li>\
		<li id="memberNav"><a href="/member/">Fans</a></li>\
		<li id="discussionsNav"><a href="/talk/">Discussions</a></li>';
	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://serenaryder.hasawebstore.com/" class="flag us" rel="external">Visit US Store</a></li>\
				<li><a href="/store/" class="flag canada" >Visit Canada Store</a></li>';
/*
	var storeNavCell = $('.nav_main ul li.custom:has(a[href*=amazon.com])');   //change this selector to target a different cell in the top nav
	storeNavCell.addClass('dropdown');
	storeNavCell.append(storeSubNav);
*/	
		$('.nav_main ul li.nav-custom a').filter(function(){
  			 return (/^Store$/i).test($(this).text())
			}).parent()
		   .addClass('dropdown')  
		   .addClass('nav-store')
		   .append(storeSubNav);
	/* END: Store drop-down for top nav */
	
		
	$('.nav_main ul li.nav-custom a').filter(function(){
	  return (/^Global$/i).test($(this).text())
	}).parent()
	  .addClass('nav-global');	

	
	
		
	/*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");
		}
	});
	
	var $customNavs = $('.nav_main ul li.nav-custom a');
	$customNavs.filter(function(){
	  return (/Discography/i).test($(this).text())
	}).parent()
	  .addClass('nav-music');
	$customNavs.filter(function(){
	  return (/Fan Club/i).test($(this).text())
	}).parent()
	  .addClass('nav-fanclub');
	  	
	$customNavs.filter(function(){
	  return (/Contact Us/i).test($(this).text())
	}).parent()
	  .addClass('nav-contacts');	
	  
	
	/* Flag subnav pages in parent top nav li */	
	if (location.href.indexOf("/community-landing/") != -1) {
			communityNavCell.addClass("active");
			$("#commHomeNav").addClass("active");
		}
	if (location.href.indexOf("/member/") != -1) {
    if(!(location.href.indexOf("/category/member/") != -1)){ 
         communityNavCell.addClass("active");
         $("#memberNav").addClass("active");
     }  
     }	
	if (location.href.indexOf("/talk/") != -1) {
			communityNavCell.addClass("active");
			$("#discussionsNav").addClass("active");
		}	
		
	
	if (location.href.indexOf("/album/") != -1) {	
		$(".nav-music").addClass("active");
	}

	
	if (location.href.indexOf("/store/") != -1) {
		$(".nav-store").addClass("active");		
	}
	
	if (location.href.indexOf("/music/") != -1) {	
		$(".nav-music").addClass("active");
	}
	if (location.href.indexOf("/upload/") != -1) {	
		$(".upload").addClass("active");
	}
	if (location.href.indexOf("/contact-us/") != -1) {	
		$(".nav-contacts").addClass("active");
	}

	/* START: Merch module drop-downs */
	$(".ArtistStore").hover (
			function() { $(".flyoutMenu", this).show(); },
			function() { $(".flyoutMenu", this).hide(); }
		);
			
	$(".mainAlbumBuyDrop").hover (
		function() { $("#subMainAlbumBuy", this).show(); },
		function() { $("#subMainAlbumBuy", this).hide(); }		
	);

	$(".productLeftBuyDrop").hover (
		function() { $("#subLeftAlbumBuy", this).show(); },
		function() { $("#subLeftAlbumBuy", this).hide(); }		
	);

	$(".productCenterBuyDrop").hover (
		function() { $("#subCenterAlbumBuy", this).show(); },
		function() { $("#subCenterAlbumBuy", this).hide(); }		
	);
	
	$(".productRightBuyDrop").hover (
		function() { $("#subRightAlbumBuy", this).show(); },
		function() { $("#subRightAlbumBuy", this).hide(); }		
	);

	$(".ArtistStoreBottom").hover (
		function() { $(".flyoutMenuFooter", this).show(); },
		function() { $(".flyoutMenuFooter", this).hide(); }		
	);
	/* END: Merch module drop-downs */	
	
	
	

	/* 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");
	
	/* Setting the width of the nav bar*/
	$("#nav_global").css({width : '993px'});
	$("#nav_global").children("ul").css({width : '983px'});
	
	if ($("#moduleForm350371").length){
		moduleContainer1Height = ($("#moduleForm350371").height()-122)+'px';
		$("#moduleContainer1").css({'margin-top': moduleContainer1Height })
	}
	
	/* 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");
	
	/* Home page album links changing the title */
	$("#moduleForm382837 ul.albums li:last-child").addClass("albumsLastChild");
	
	/* Regarding SIFR removal in Upload page */
	$('#upload .module .content .head h3').addClass('removeSifr');
	$('#upload .module .content .body h3').addClass('removeSifr');
	$('#upload .module .content .body h4').addClass('removeSifr');
	$('#upload h1.pageTitle').addClass('removeSifr');
	
	
	var noOfImageDscDtl=$("#discussion_entry-350389 .topic .description img").length;
		for(i=0;i<noOfImageDscDtl;i++){
			var discussionImageElement = $("#discussion_entry-350389 .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-399821  .topic .description img").length;
		for(i=0;i<noOfImageDscDtl;i++){
			var discussionImageElement = $("#discussion_listing-399821 .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 = {
	    "serenaryder": {
		"name"		: "Serena Ryder",
		"profileUrl": "/member/i/19150/",
		"color"		: "#f7c39d"
	    }
	};
	
	
	/* To add the odd class to achieve alternate colouring for the modules */	
	alternateColouringListing();
	
	//Album detail stuff 
	$buylinks = $('#album_info-390840 .foot .nav_meta ul');
	$buylinks.insertBefore('#album_info-390840 .album .txt div.description');
	$('#album_info-390840.album_info .module .content .foot .nav_meta ul').css("display","block");
	
	/* Adding class names for custom drop downs, to implement handdrawn navigation */
	
	  
	  
	  $("#blog_listing-350371 .module .content .body ul li.article:last-child").addClass("emptyborder");
	  
	  
	   
/*

		
		$("#discussion_listing-340654.discussion_listing .foot .nav_meta ul li.new a").html("Castro Cafe").show(); 
		$("#discussion_listing-340654.discussion_listing .foot .nav_meta ul li.new a").attr("target","_blank").attr("href","http://cafe.jasoncastromusic.com/");


*/		
		$("#discussion_listing-399821.discussion_listing .foot .nav_meta ul li.new a").html("Old Forum").show(); 
		$("#discussion_listing-399821.discussion_listing .foot .nav_meta ul li.new a").attr("target","_blank").attr("href","http://boards.atlanticrecords.com/artists/serenaryder/forums");
		var discussoldlink='<li class="discussion_old_link"><a href="http://boards.atlanticrecords.com/artists/serenaryder/forums" target="_blank">Old Forum</a></li>'
		$("#discussion_listing-350391.discussion_listing .foot .nav_meta ul ").prepend(discussoldlink);
	  
	  
	  
	  
	  //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();    
    
	  
/*START- code which obfuscates email addresses #2420*/	
		var m_ = "mailto:";
		var a_ = "@";
		var d_ = ".";
		var i = 0;
		var j  = 0;
		var q_ = "?";
		var e_ = "=";
		
		$('span.ciReplace').each(function(){	
			if(cId[i].format == ""){
				$(this).html('<a href="'+m_+cId[i].name+a_+cId[i].domain+d_+cId[i].tld+'">'+ cId[i].name + a_+ cId[i].domain + d_+ cId[i].tld +'</a>');
			}
			else{
				if(cId[i].param == ""){
					$(this).html('<a href="'+m_+cId[i].name+a_+cId[i].domain+d_+cId[i].tld+'">'+ cId[i].format+'</a>');
				}
				else{
					$(this).html('<a href="'+m_+cId[i].name+a_+cId[i].domain+d_+cId[i].tld+q_+'subject'+e_+cId[i].param+'">'+cId[i].format+'</a>');
				}
			}
		i++;				
		});
		
		
		$('span.footReplace').each(function(){
					if(fId[j].format == ""){
				$(this).html('<a href="'+m_+fId[j].name+a_+fId[j].domain+d_+fId[j].tld+'">'+ fId[j].name + a_+ fId[j].domain + d_+ fId[j].tld +'</a>');
			}
			else{
				if(fId[j].param == ""){
					$(this).html('<a href="'+m_+fId[j].name+a_+fId[j].domain+d_+fId[j].tld+'">'+ fId[j].format+'</a>');
				}
				else{
					$(this).html('<a href="'+m_+fId[j].name+a_+fId[j].domain+d_+fId[j].tld+q_+'subject'+e_+fId[j].param+'">'+fId[j].format+'</a>');
				}
			}
			j++;		
		});	
		
	/*End - code which obfuscates email addresses #2420*/
	
	/*if ($("body#splash").length) {
		$("html").css("background", "none !important");
	} */
	
	var prvteCont="<i class='prText'>&nbsp;&nbsp;</i>";
	var prvtLegend='<span class="private">Visible only to site adminstrators</span>';
	$('.edit_account li.input.annotation').append(prvtLegend);
	$('.edit_account li.input.text.private').append(prvteCont);
	$('.edit_account li.input.radio.private').append(prvteCont);
	$('#join-350410.join li.input.text.private').each(function(){
		var cont = (this).innerHTML;		
		(this).innerHTML= prvteCont+cont;
	});

	
	/* SP to Eos Use Plugin Configuration set the parametres as per the modulecontainer */
	$.wmgfeature.spFeatureJoin("#join .input .button.submit input", "join-350410", false, arrElementIDs, "http://www.serenaryder.com/", "288234");
	$.wmgfeature.spFeatureEditProfile(".edit_profile .input .button.submit input", "edit_profile-350396", true, arrElementIDs, "http://www.serenaryder.com/", "288234");
	/* End SP Migration Changes */	
	  
});
function eoscInit(){
	
	//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(); 
	
	alternateColouringListing();
	sIFR.replace(saltrg, {
	selector: '.video_thumbnail .module .content .head h3, .photo_thumbnail .module .content .head h3 , .photo_thumnail .module .content .head h3,#html-625958 .module .content .head h3,.blog_listing .module .content .head h3',
	css: ['.sIFR-root { background-color: #cccccc; color: #FFFFFF; text-transform:uppercase; font-size:24px; }'],
	wmode: 'transparent',
	tuneHeight: '-9'
	});

/* Real Time Sign-Up Start */
	$(".edit_account #accountData .buttons.input .button.submit input.submit").removeAttr("onclick");
	$(".edit_account #accountQuestoins .buttons.input .button.submit input.submit").removeAttr("onclick");
	
	$('.edit_account #accountData .buttons.input .button.submit input.submit').die();
	$('.edit_account #accountQuestoins .buttons.input .button.submit input.submit').die();
	
	$.wmgfeature.spFeatureEditAccountAccData(".edit_account #accountData .buttons.input .button.submit input.submit", "edit_account-350394", true, arrElementIDs, "http://www.serenaryder.com/", "288234");
	$.wmgfeature.spFeatureEditAccountAccQuestions(".edit_account #accountQuestoins .buttons.input .button.submit input.submit", "edit_account-350394", true, arrElementIDs, "http://www.serenaryder.com/", "288234");	
/* Real Time Sign-Up End */
	
}


/* Start of Iggli Implementation*/
/* function populateInviteData(iTitle,iLocation,iDate) {

	//all the possible fields in this json object
	json = {		
	widget_version:"2.0",
	widget_skin:"button_square_small",
	partner_id:"132", 			//Do not change this id. This is unique
	title:iTitle,
	location:iLocation,
	date:iDate
	}
	
	//replace any current invite data using the json object
		inviteButtons[0].setOptions(json);
	
	//refresh the html to reflect new data
		inviteButtons[0].refresh();
		
	// launch the invite
	loadInviteInModal(0);
}*/

/* End of Iggli Implementation*/

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');
		
		
		
	$('#comments-350385 ul li:nth-child(odd)').addClass('li_odd');	
	$('#comments-350385 ul li:nth-child(even)').addClass('li_even');
	
		$('#comments-350383 ul li:nth-child(odd)').addClass('li_odd');	
	$('#comments-350383 ul li:nth-child(even)').addClass('li_even');	
	
		$('#comments-350384 ul li:nth-child(odd)').addClass('li_odd');	
	$('#comments-350384 ul li:nth-child(even)').addClass('li_even');	
	
		$('#comments-350387 ul li:nth-child(odd)').addClass('li_odd');	
	$('#comments-350387 ul li:nth-child(even)').addClass('li_even');	
				   
		$('#comments-350386 ul li:nth-child(odd)').addClass('li_odd');	
	$('#comments-350386 ul li:nth-child(even)').addClass('li_even');				   
	  
   $('#site_activity-327537 ul.events li:nth-child(odd)').addClass('li_odd');
   $('#site_activity-382839 ul.events li:nth-child(odd)').addClass('li_odd');
      $('#site_activity-382839 ul.events li:nth-child(even)').addClass('li_even');

   $('#site_activity-399816 ul.events li:nth-child(odd)').addClass('li_odd');
      $('#site_activity-399816 ul.events li:nth-child(even)').addClass('li_even');
	  
	 

   $('#discussion_listing-399821 ul.topics li.topic:nth-child(odd)').addClass('li_odd');
   $('#discussion_listing-399821 ul.topics li.topic:nth-child(even)').addClass('li_even');	
	  
	   $('#discussion_listing-350391 ul.topics li.topic:nth-child(odd)').addClass('li_odd');
   $('#discussion_listing-350391 ul.topics li.topic:nth-child(even)').addClass('li_even');	

	  
   $('#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');
      $('#discussion_listing-440467 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');
}
$.urlParam = function(name){
		var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
		if (results == null) {
			return 0;
		}
		else {
			return results[1];
		}
	}

	if($.browser.firefox || $.browser.mozilla){
		var safari;
	}

