// JScript source code
var websites = new Array(
			{name: "43Things", link: "http://www.43things.com", aname:"43things", niche: "Goal setting", bl: "Users are encouraged to build a list of 43 things they want to do in their lives and share their progress toward those goals with other users.", users:"1,007,000"},
			{name: "Bebo", link: "http://www.bebo.com", aname:"bebo", niche: "School networks", bl: "Bebo invites users to 'stay in touch with their College friends, connect with friends, share photos, discover new interests and just hang out.'", users:"34,000,000"},
			{name: "CyWorld", link: "http://www.cyworld.com", aname: "cyworld", niche: "Multipurpose", bl: "Build your own 'minihome' by buying items with 'acorn' currency on this site, which is enormously popular in South Korea.", users:"15,000,000"},
			{name: "Facebook", link: "http://www.facebook.com", aname: "facebook", niche: "School, work, and regional networks", bl: "One of the biggest, most innovative social networking sites on the web with a special emphasis on school networks.", users:"23,000,000"},
			{name: "Last.fm", link: "http://www.last.fm", aname: "lastfm", niche: "Music", bl: "After downloading their 'audio scrobbler' which track the music you listen to, last.fm dishes up music recommendations and a community of like-minded listeners.", users:"15,000,000"},
			{name: "Myspace", link: "http://www.myspace.com", aname: "myspace", niche: "Multimedia/multipurpose", bl: "One of the most visited websites on the entire planet, this social networking giant is universally popular and innovative.", users:"182,000,000"},
			{name: "Orkut", link: "http://www.orkut.com", aname: "orkut", niche: "Multipurpose/Communities", bl: "Particularly popular among Brazilian users, Orkut features easy-to-create 'communities' or forums of users.", users:"46,424,000"},
			{name: "Yahoo! 360º", link: "http://360.yahoo.com", aname:"yahoo360", niche: "Multipurpose/Linked to Yahoo! IDs.", bl: "Yahoo! is currently beta testing this venture, with which Yahoo! users are able to connect with the world.", users:"4,700,000"},
			{name: "YouTube", link: "http://www.youtube.com", aname:"youtube", niche: "Videos", bl: "Upload and watch videos at YouTube, an enormous compendium of great and not-so-great videos from all walks of life.", users:"Unknown, 53,500,000 Unique streamers (registered and unregistered)"}
			);

function writeDirectory() {
	var length = websites.length - 1;
	var ran_number=Math.floor(Math.random()* length);
	
	var output = document.createElement("h2");
	var text = document.createTextNode("Here's our current listing of social networking sites:");
	output.appendChild(text);
	document.getElementById("directory").appendChild(output);
	
	output = document.createElement("table");
	output.setAttribute("style", "border-spacing:0px; border-collapse:collapse");
	output.getAttribute("style");	
	row = document.createElement("tr");
	
	col = document.createElement("td");
	col.setAttribute("class", "directoryHead");
	col.getAttribute("class");
	text = document.createTextNode("Link");
	col.appendChild(text);
	row.appendChild(col);
	
	col = document.createElement("td");
	col.setAttribute("class", "directoryHead");
	col.getAttribute("class");
	text = document.createTextNode("SN Guide Analysis");
	col.appendChild(text);
	row.appendChild(col);	
	
	col = document.createElement("td");
	col.setAttribute("class", "directoryHead");
	col.getAttribute("class");
	text = document.createTextNode("Niche");
	col.appendChild(text);
	row.appendChild(col);	
	
	col = document.createElement("td");
	col.setAttribute("class", "directoryHead");
	col.getAttribute("class");
	text = document.createTextNode("Users");
	col.appendChild(text);
	row.appendChild(col);	
	
	col = document.createElement("td");
	col.setAttribute("class", "directoryHead");
	col.getAttribute("class");
	text = document.createTextNode("About");
	col.appendChild(text);
	row.appendChild(col);	
		
	output.appendChild(row);	

	for(var i = 0; i < websites.length; i++) {
		row = document.createElement("tr");		
		
		col = document.createElement("td");
		col.setAttribute("class", "directoryCell");
		col.getAttribute("class");
		link = document.createElement("a");
		link.setAttribute("href", getLink(i));
		link.setAttribute("target", "_blank");
		link.getAttribute("href");
		link.getAttribute("target");
		text = document.createTextNode(getName(i));
		link.appendChild(text);
		col.appendChild(link);
		row.appendChild(col);
		
		col = document.createElement("td");
		col.setAttribute("class", "directoryCell");
		col.getAttribute("class");
		link = document.createElement("a");
		link.setAttribute("href", getAname(i) + ".html");
		link.getAttribute("href");
		text = document.createTextNode("Analysis");
		
		link.appendChild(text);
		col.appendChild(link);
		row.appendChild(col);
	
		
		col = document.createElement("td");
		col.setAttribute("class", "directoryCell");
		col.getAttribute("class");
		text = document.createTextNode(getNiche(i));
		row.appendChild(col);
		col.appendChild(text);
		
		col = document.createElement("td");
		col.setAttribute("class", "directoryCell");
		col.getAttribute("class");
		text = document.createTextNode(getUsers(i));
		row.appendChild(col);
		col.appendChild(text);
		
		col = document.createElement("td");
		col.setAttribute("class", "directoryCell");
		col.getAttribute("class");
		text = document.createTextNode(getBl(i));
		row.appendChild(col);
		col.appendChild(text);
		
		output.appendChild(row);
	}
	document.getElementById("directory").appendChild(output);	
}

function getName(i){
	return websites[i].name;
}

function getAname(i){
	return websites[i].aname;
}

function getLink(i){
	return websites[i].link;
}

function getNiche(i){
	return websites[i].niche;
}

function getBl(i){
	return websites[i].bl;
}

function getUsers(i){
	return websites[i].users;
}

function writeFeature() {
	var length = websites.length - 1;
	var i=Math.floor(Math.random()* length);
	document.getElementById("featurebox").innerHTML += "<tr><td><span class='boxhead'>Featured Site</span><br />(Refresh for another)<a href='" + getLink(i) + "' target='_blank'><img src='logos/" + getAname(i) + ".jpg' width='115' /></a><br /><strong>Analysis:</strong><a href='" + getAname(i) + ".html'>" + getName(i) + "</a><br /><strong>Users: </strong>" + getUsers(i) + "<br /><strong>Niche: </strong>" + getNiche(i) + "<br /><strong>Bottom Line</strong> " + getBl(i);
}
