//
// culture-mood (c)
// Created by Carlos D. Correa
// http://www.caip.rutgers.edu/~cdcorrea
// 2004
//

var image = "images/emilio.jpg";
var cmood = new Array(4);

cmood[0] = new CMoodItem(
	"Animal",
	"Emilio Guinea Pig",
	"http://picasaweb.google.com/mariacv/Emilio03"
);

cmood[1] = new CMoodItem(
	"Music",
	"Skip James",
	"http://en.wikipedia.org/wiki/Skip_James"
);

cmood[2] = new CMoodItem(
	"TV",
	"Avatar: The Last Airbender",
	"http://en.wikipedia.org/wiki/Avatar:_The_Last_Airbender"
);

cmood[3] = new CMoodItem(
	"Movie",
	"The Dark Knight",
	"http://thedarkknight.warnerbros.com/"
);


function CMoodItem_Print() {
	var temp="";
	temp += "<td>";
	temp += "	"+this.category + " : "+ this.name;
	temp += "</td>";
	temp += "<td>";
	temp += (this.link!="")? "	<a href=\""+ this.link + "\" class=\"symbol\">>></a>": "&nbsp;";
	temp += "</td>";
	window.document.write(temp);
}

function CMoodItem(Category, Name, Link) {
	this.category = Category;
	this.name = Name;
	this.link = Link;
	this.print = CMoodItem_Print;
}


function showCmood() {
	
	window.document.open();
	showCmoodHeader();
	
	for(var i=0;i<cmood.length;i++) {
		var style = (i%2==0)? "row1": "row2";
		window.document.write("<tr class=\""+style+"\">");
		cmood[i].print();
		
		window.document.write("</tr>");
	}
	showCmoodFooter();
	window.document.close();
}


function showCmoodHeader() {
    window.document.write("\
	<fieldset id=\"cultureMood\" class=\"cultureMood\" width=100% title=\"To find out what's this, click on link in the bottom right corner\">\
		<legend>My Culture-Mood</legend>\
		<table cellspacing=2>\
			<tr>\
				<td>\
					<img src=\"" + image + " \" width=64 height=64 border=1>\
				</td>\
				<td>\
					<table>\
    ");
}

function showCmoodFooter() {
    window.document.write("\
    					</table>\
    				</td>\
    			</tr>\
    			<tr>\
				<td class=\"details\" colspan=2>\
					<a href=\"http://www.caip.rutgers.edu/~cdcorrea/cmood.html\" class=\"details\">What's Culture-Mood?</html>\
				</td>\
			</tr>\
		</table>\
	</fieldset>\
    ");
}
