/* Begin Comments ***************************************/
function submit_comment(f) {
	return scene.submit_comment(f);
}
/* End Comments *****************************************/

var menu;
var scene;
var linktothis;
var popup = new Popup();

function changeList(order) {
	menu.order = order;
	menu.getList(0);
}

function getList(snum) {
	menu.getList(snum);
}

function display() {
	var select_collection = objId('collection');
	menu.groupId = select_collection.options[select_collection.selectedIndex].value;
	
	var radio_choices = objId('sortby_recent');
	radio_choices.checked = "checked";
	changeList("chrono");
}

function openCurrent(id) {
	hide_linktothis();
	menu.selectItem(id);
	scene.displayItem(id);
}

function ilikethis() {
	scene.vote();
}

function show_linktothis(e) {
	linktothis.setId(scene.id);
	popup.set_location_byCoord(mouseX(e)-488,mouseY(e)-76);
	popup.load(linktothis.element);
	popup.show();
	linktothis.input.focus();
	linktothis.input.select();
}

function hide_linktothis() {
	popup.hide();
}

addDOMLoadEvent(function () {
	scene = new SceneClass();
	
	Nifty("div#scene","transparent");
	menu = new MenuClass();
	linktothis = new LinkToThisClass();
	openCurrent(session_id);
	
})

