//used for Omniture auths
var g_loc; //possible vals are "home", "post"
var g_auth = ""; //pulls author name from post

// These functions are used in the blogFunctions.js file in order to match values for Omniture Variables, Author and Fray Links, and Blog Styles
// Keep in mind that whenever a new USER and/or BLOG is created/updated in Community Server, the data in these files must be updated to match
// -- items match by value of blogs[n].name 
function getBlogData(blog) //-- BLOG Data Container
{
	var blogs = new Array();
		blogs.push({
			name : "xxfactor",
			pstax : 2175222,
			frayId : 2175222,
			dept : "xx factor",
			auth : (g_loc=="home")?"bazelon,hulbert,larimore,lapidos,lithwick,henneberger,o'rourke,stevens,yoffe":g_auth.toLowerCase(),
			sect : "news and politics",
			title : "The XX Factor",
			subhead : "Slate women blog about politics, etc...",
			commercialNode : "blogs/xxfactor"
			});
		blogs.push({
			name : "kausfiles",
			pstax : 58291,
			frayId : 2065132,
			dept : "kausfiles",
			auth : "mickey kaus",
			sect : "news and politics",
			title : "Kausfiles",
			subhead : "A mostly political weblog.",
			commercialNode : "blogs/kaus"
		});
		blogs.push({
			name : "trailhead",
			pstax : 2174010,
			frayId : 2174010,
			dept : "trailhead",
			auth : "christopher beam, chadwick matlin",
			sect : "news and politics",
			title : "Trailhead",
			subhead : "A campaign blog.",
			commercialNode : "blogs/"
		});
		blogs.push({
			name : "humannature",
			pstax : 73706,
			frayId : 2100253,
			dept : "human nature",
			auth : "william saletan",
			sect : "health and science",
			title : "Human Nature",
			subhead : "Science, technology, and life.",
			commercialNode : "blogs/humannature"
		})
		blogs.push({
			name : "hasbeen",
			pstax : 88139,
			frayId : 2120447,
			dept : "the has-been",
			auth : "bruce reed",
			sect : "news and politics",
			title : "The Has-Been",
			subhead : "Notes from the political sidelines.",
			commercialNode : "blogs/"
		})
		blogs.push({			
			name : "convictions",
			pstax : 2185238,
			frayId : 3000067,
			dept : "convictions",
			auth : "emily bazelon, phillip carter",
			sect : "news and politics",
			title : "Convictions",
			subhead : "Slate's blog on legal issues.",
			commercialNode : "blogs/"
		})
		blogs.push({			
			name : "happinessproject",
			pstax : 2208032,
			frayId : 2208032,
			dept : "happinessproject",
			auth : "gretchen rubin",
			sect : "Art & Life",
			title : "The Happiness Project",
			subhead : "Slate's blog on Happiness.",
			commercialNode : "blogs/happinessproject"
		})
		blogs.push({			
			name : "newmans",
			pstax : 2209972,
			frayId : 2209972,
			dept : "newmans",
			auth : "michael newman, nora krug",
			sect : "Art & Life",
			title : "Newmans Own",
			subhead : "Our family's search for a house.",
			commercialNode : "blogs/newmansown"
		})
		blogs.push({			
			name : "browbeat",
			pstax : 2217478,
			frayId : 2217478,
			dept : "browbeat",
			auth : (g_loc=="home")? "slate browbeat writers" :g_auth.toLowerCase(),
			sect : "Art & Life",
			title : "Brow Beat",
			subhead : "Slate's culture blog.",
			commercialNode : "blogs/browbeat"
		})

	if(blog != "" && blog != null)
	{
		for (i=0; i<blogs.length; i++)
		{
			try
			{
			    if(blogs[i].name == blog)
			    {
				    return blogs[i];
			    }
			}
			catch(err){ }
		}
	}
	else
	{
		return blogs;
	}
}


function getUserData(q)
{
	var users = new Array();
		users.push({id:2100,name:"slatedev",blog:["kausfiles","trailhead"]});
		users.push({id:2101,name:"Anonymous",blog:""});
		users.push({id:2102,name:"Vivians",blog:"xxfactor"});
		users.push({id:2103,name:"Vivian Selbo",blog:["convictions","xxfactor","trailhead"]});
		users.push({id:2104,name:"Rachael Larimore",blog:"xxfactor"});
		users.push({id:2105,name:"Amanda Schaffer",blog:"xxfactor"});
		users.push({id:2106,name:"June Thomas",blog:["xxfactor","browbeat"]});
		users.push({id:2107,name:"Dahlia Lithwick",blog:"xxfactor"});
		users.push({id:2108,name:"Juliet Lapidos",blog:["xxfactor","browbeat"]});
		users.push({id:2109,name:"Phillip Carter",blog:"convictions"});
		users.push({id:2110,name:"Kim Runciman",blog:"xxfactor"});
		users.push({id:2111,name:"Emily Bazelon",blog:"xxfactor"});
		users.push({id:2112,name:"Torie Bosch",blog:"xxfactor"});
		users.push({id:2113,name:"Anne Applebaum",blog:"xxfactor"});
		users.push({id:2114,name:"Emily Yoffe",blog:"xxfactor"});
		users.push({id:2115,name:"Jill Hunter Pellettieri",blog:["xxfactor","browbeat"]});
		users.push({id:2116,name:"Ann Hulbert",blog:"xxfactor"});
		users.push({id:2118,name:"Meghan O'Rourke",blog:"xxfactor"});
		users.push({id:2119,name:"Melinda Henneberger",blog:"xxfactor"});
		users.push({id:2120,name:"slateart",blog:""});
		users.push({id:2121,name:"Melonyce McAfee",blog:"xxfactor"});
		users.push({id:2122,name:"Chadwick Matlin",blog:"trailhead"});
		users.push({id:2123,name:"Mickey Kaus",blog:"kausfiles"});
		users.push({id:2124,name:"Christopher Beam",blog:"trailhead"});
		users.push({id:2125,name:"Chad Lorenz",blog:""});
		users.push({id:2126,name:"Ellen Tarlin",blog:"xxfactor"});
		users.push({id:2127,name:"Dana Stevens",blog:["xxfactor","browbeat"]});
		users.push({id:2128,name:"Morgan Smith",blog:"xxfactor"});
		users.push({id:2129,name:"William Saletan",blog:"humannature"});
		users.push({id:2130,name:"Bruce Reed",blog:"hasbeen"});
		users.push({id:2131,name:"Chris Wilson",blog:["xxfactor","browbeat"]});
		users.push({id:2133,name:"Julia Turner",blog:"browbeat"});
		users.push({id:2135,name:"Hanna Rosin",blog:"xxfactor"});
		users.push({id:2136,name:"Daniel Engber",blog:"browbeat"});
		users.push({id:2138,name:"Maureen Sullivan",blog:"xxfactor"});
		users.push({id:2140,name:"Rosa Brooks",blog:"xxfactor"});
		users.push({id:2141,name:"Liza Mundy",blog:"xxfactor"});
		users.push({id:2142,name:"Noreen Malone",blog:["xxfactor","browbeat"]});
		users.push({id:2144,name:"Adam J. White",blog:"convictions"});
		users.push({id:2145,name:"Ben Wittes",blog:"convictions"});
		users.push({id:2146,name:"David Barron",blog:"convictions"});
		users.push({id:2147,name:"Dawn Johnsen",blog:"convictions"});
		users.push({id:2148,name:"Deborah N. Pearlstein",blog:"convictions"});
		users.push({id:2149,name:"Diane Marie Amann",blog:"convictions"});
		users.push({id:2150,name:"Doug Kmiec",blog:"convictions"});
		users.push({id:2151,name:"Nancy Gertner",blog:"convictions"});
		users.push({id:2152,name:"Jack Balkin",blog:"convictions"});
		users.push({id:2153,name:"Kenji Yoshino",blog:"convictions"});
		users.push({id:2154,name:"Marty Lederman",blog:"convictions"});
		users.push({id:2155,name:"Orin Kerr",blog:"convictions"});
		users.push({id:2156,name:"Patrick Keefe",blog:"convictions"});
		users.push({id:2157,name:"Richard Ford",blog:"convictions"});
		users.push({id:2158,name:"Tim Wu",blog:"convictions"});
		users.push({id:2159,name:"Viet Dinh",blog:"convictions"});
		users.push({id:2160,name:"Walter Dellinger",blog:"convictions"});
		users.push({id:2161,name:"Judith Shulevitz",blog:"xxfactor"});
		users.push({id:2162,name:"Bonnie Goldstein",blog:"xxfactor"});
		users.push({id:2163,name:"EJ Graff",blog:"convictions"});
		users.push({id:2164,name:"Eric Posner",blog:"convictions"});
		users.push({id:2165,name:"David Feige",blog:"convictions"});
		users.push({id:2172,name:"Cass Sunstein",blog:"xxfactor"});
		users.push({id:2174,name:"Nina Rastogi",blog:"xxfactor"});
		users.push({id:2175,name:"Neal Katyal",blog:"convictions"});
		users.push({id:2195,name:"Kim McLarin",blog:"xxfactor"});
		users.push({id:2196,name:"Marjorie Valbrun",blog:"xxfactor"});
		users.push({id:2198,name:"Ruth Marcus",blog:"xxfactor"});
		users.push({id:2199,name:"Lucy Morrow Caldwell",blog:"xxfactor"});
		users.push({id:2208,name:"Kara Hadge",blog:"xxfactor"});
		users.push({id:2210,name:"Nayeli Rodriguez",blog:"xxfactor"});
		users.push({id:2211,name:"Amaka Maduka",blog:"xxfactor"});
		users.push({id:2213,name:"Paul Tough",blog:"schoolhouse"});
		users.push({id:2215,name:"Abby Callard",blog:["xxfactor","trailhead"]});
		users.push({id:2217,name:"Michael Newman",blog:["newmansown","bigsort"]});
		users.push({id:2218,name:"Bill Bishop",blog:"bigsort"});
		users.push({id:2220,name:"Somerset Perry",blog:"trailhead"});
		users.push({id:2222,name:"Susannah Breslin",blog:"xxfactor"});
		users.push({id:2223,name:"Elisheva Weiss",blog:"xxfactor"});
		users.push({id:2226,name:"Sara Mosle",blog:"xxfactor"});
		users.push({id:2226,name:"Sarah Wildman",blog:"xxfactor"});
		users.push({id:2234,name:"Lauren Sandler",blog:"xxfactor"});
		users.push({id:2235,name:"DanaGoldstein",blog:"xxfactor"});
		users.push({id:2236,name:"Moe Tkacik",blog:"xxfactor"});
		users.push({id:2237,name:"Sophie Gilbert",blog:"xxfactor"});
		users.push({id:2238,name:"Jennifer Olmstead",blog:"xxfactor"});
		users.push({id:2240,name:"Eve Fairbanks",blog:"xxfactor"});
		users.push({id:2242,name:"Jessica Grose",blog:"xxfactor"});
		users.push({id:2243,name:"Samantha Henig",blog:"xxfactor"});
		users.push({id:2244,name:"Gretchen Rubin",blog:"happinessproject"});
		users.push({id:2250,name:"Dayo Olopade",blog:"xxfactor"});
		users.push({id:2251,name:"Nora Krug",blog:["newmansown","bigsort"]});
		users.push({id:2252,name:"Willa Paskin",blog:"xxfactor"});
		users.push({id:2253,name:"Michael Newman and Nora Krug",blog:"newmansown"});
		users.push({id:2255,name:"Abigail Pilgrim",blog:"xxfactor"});
		users.push({id:2256,name:"Kerry Howley",blog:"xxfactor"});
		users.push({id:2259,name:"Holly Allen",blog:"xxfactor"});
		users.push({id:2271,name:"Jim Festante",blog:"browbeat"});
		users.push({id:2272,name:"Josh Levin",blog:"browbeat"});
		users.push({id:2273,name:"Jody Rosen",blog:"browbeat"});
		users.push({id:2274,name:"John Swansburg",blog:"browbeat"});
		users.push({id:2275,name:"Michael Agger",blog:"browbeat"});
		users.push({id:2276,name:"Seth Stevenson",blog:"browbeat"});
		users.push({id:2277,name:"Stephen Metcalf",blog:"browbeat"});
		users.push({id:2278,name:"Troy Patterson",blog:"browbeat"});
		users.push({id:2283,name:"Jeremy Singer-Vine",blog:"browbeat"});
		users.push({id:2285,name:"Kim Gittleson",blog:"browbeat"});
		users.push({id:2291,name:"Julia Felsenthal",blog:"browbeat"});
		users.push({id:2293,name:"Eric Hynes",blog:"browbeat"});
		users.push({id:2298,name:"Menachem Kaiser",blog:"browbeat"});
		users.push({id:2299,name:"Susan Burton",blog:"browbeat"});
		users.push({id:2300,name:"Jeremy Stahl",blog:"browbeat"});

	if(q)
	{
		for (var i=0; i<users.length; i++)
		{
			try
			{
			    if(users[i].name.match(q))
			    {
				    return users[i].id;
			    }
			}
			catch(err){ }
		}			
	}		
	else 
	{	
		for (var i=0; i<users.length; i++)
		{
			try
			{
			    if(window.location.search.match('u=' + users[i].id))
			    {
				    return users[i];
			    }
			}
			catch(err){ }
		}	
	}
}