

function replaceLabelArgs (label, args) {
	var argCount = 0;

	if(typeof args !== "object") {
		label = label.replace("{0}", args);
	} else {
		argCount = args.length;
		for(i=0; i < argCount; i = i + 1) {
			var replaceArgs = "{" + i + "}";
			label = label.replace("{" + i + "}", args[i]);
		}
	}
	return label;

}

var commonLabels = {
    "visitingProfile" : "Visiting Profile"
}

var permissionsLabels = {
	"mainTitle" : "Profile Permissions",
    "subTitle" : "Set profile visibility options"
}

var charStats = {
	"friendsCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"friendCountN\">0</strong> <span class=\"statsBlueText\">Friends</span>", args);    },
	"friendsCountPlusOnlineNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"friendCountP\">0</strong> <span class=\"statsBlueText\">Friends</span>", args);    },
	"goldCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"goldCount\">0</strong> <span class=\"statsBlueText\">Coins</span>", args);    },
	"tokensCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"tokenCount\">0</strong> <span class=\"statsBlueText\">Station Cash&#8482;</span>", args);    },
	"levelCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"levelText\">0</strong> <span class=\"statsBlueText\">Levels earned across all jobs</span>", args);    },
	"collectionsCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"collectionCount\">0</strong> <span class=\"statsBlueText\">Collections started</span>", args);    },
	"questsCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"questCount\">0</strong> <span class=\"statsBlueText\">Quests completed</span>", args);    },
	"leaderboardCountNone" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"leaderboardCount\">0</strong> <span class=\"statsBlueText\">Leaderboards listings</span>", args);    },

	"friendsCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"friendCountN\">1</strong> <span class=\"statsBlueText\">Friend</span>", args);    },
	"friendsCountPlusOnline" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"friendCountP\">1</strong> <span class=\"statsBlueText\">Friend ({1} online now!)</span>", args);    },
	"goldCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"goldCount\">1</strong> <span class=\"statsBlueText\">Coin</span>", args);    },
	"tokensCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"tokenCount\">1</strong> <span class=\"statsBlueText\">Station Cash&#8482;</span>", args);    },
	"levelCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"levelText\">1</strong> <span class=\"statsBlueText\">Level earned across all jobs</span>", args);    },
	"collectionsCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"collectionCount\">1</strong> <span class=\"statsBlueText\">Collection started</span>", args);    },
	"questsCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"questCount\">1</strong> <span class=\"statsBlueText\">Quest completed</span>", args);    },
	"leaderboardCount" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"leaderboardCount\">1</strong> <span class=\"statsBlueText\">Leaderboards listing</span>", args);    },
	
	"friendsCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"friendCountN\">{0}</strong> <span class=\"statsBlueText\">Friends</span>", args);    },
	"friendsCountPlusOnlinePlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"friendCountP\">{0}</strong> <span class=\"statsBlueText\">Friends ({1} online now!)</span>", args);    },
	"goldCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"goldCount\">{0}</strong> <span class=\"statsBlueText\">Coins</span>", args);    },
	"tokensCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"tokenCount\">{0}</strong> <span class=\"statsBlueText\">Station Cash&#8482;</span>", args);    },
	"levelCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"levelText\">{0}</strong> <span class=\"statsBlueText\">Levels earned across all jobs</span>", args);    },
	"collectionsCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"collectionCount\">{0}</strong> <span class=\"statsBlueText\">Collections started</span>", args);    },
	"questsCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"questCount\">{0}</strong> <span class=\"statsBlueText\">Quests completed</span>", args);    },
	"leaderboardCountPlural" : function (args) { return replaceLabelArgs("&nbsp;<strong id=\"leaderboardCount\">{0}</strong> <span class=\"statsBlueText\">Leaderboards listings</span>", args);    }	
}

var charLabels = {
	"deleteCharMainTitle" : "Do you want to delete this character?",
    "deleteCharSubTitle" : "This cannot be undone.",
	"deleteNameMismatch" : function (args) { return replaceLabelArgs("You did not type \'delete\'. Please type the word \'delete\' for confirmation. ", args);    },
	"profileSettings" : "Profile Settings",
	"friendsView" : "Friend\'s View",
	"myProfile" : "My Profile",
	"manageProfileButton" : "Manage Profile",
	"portraitGalleryButton" : "Portrait Gallery",
	"deleteCharButton" : "Delete Character",
	"deleteText" : "delete",
	"charNameSubHeader" : "My Profile"
}

var friendLabels = {
	"mainHeader" : "Friends List",
    "subHeader" :  function (args) { return replaceLabelArgs("Friends of {0}", args);    },
    "onlineFriends" :  function (args) { return replaceLabelArgs("Online Friends: {0}", args);    },
    "offlineFriends" :  function (args) { return replaceLabelArgs("Offline Friends: {0}", args);    },
    "zoneDetails" :  function (args) { return replaceLabelArgs("Zone: {0}", args);    },
    "lastLogin" :  function (args) { return replaceLabelArgs("Last Login:<br>{0}", args);    },
    "viewProfile" :  "View Profile",
    "joinFriend" :  "Join Friend in Game"
}

var newsLabels = {
	"mainHeader" : "News Feed",
	"showDetails" : "Show Details",
	"hideDetails" : "Hide Details",
	"noNews" : "No news stories found"
}

var galleryLabels = {
	"mainHeader" : "Portrait Gallery"
}

var commentsLabels = {
	"mainHeader" : "Messages From Friends",
    "reported" : "Thank You! This comment has been reported.",
    "removeMsg" : "Are you sure?",
    "noMsgs" : "No messages found"
}

var leaderboardLabels = {
	"mainHeader" : "Leaderboards",
	"myStarsLB" : "My Leaderboard",
	"friendsStarsLB" : "Rank Against Friends",
	"rank" : "Rank",
	"lbName" : "Leaderboard Name",
	"achievement" : "Achievement",
	"score" : "Score",
	"when" : "When",
	"server" : "Server",
	"myStarsLB" : "My Leaderboard",
	"noResultsFound" : "No Results Found for this Leaderboard.",
	"myLbLoading" : "Loading Data",
	"myLbNotListed" : "This character does not appear on any leaderboards.",
	"knockouts" : "Knocked Out",
    "stars" : "Stars",
    "time" : "Time",
    "view" : "View Leaderboards",
	"minutes" : "min",
	"seconds" : "sec",
	"viewMyScores" : "View All My Scores",
	"viewAllScores" : "View All Leaderboards",
	"noneFound" : "You\'re not on any leaderboards yet? You\'re missing out on all the Minigame fun in Free Realms!"
}