
function load_captty(divid, width, height, url, password) {
	swfobject.embedSWF("/swf/CapttyPlayer.swf", divid,
			width, height, "9.0.0", "/swf/expressinstall.swf",
			{ url:url, password:password },
			{ bgcolor:"#000000" },
			{ }
			);
	/*
	so.addVariable("url", url);
	so.addVariable("password", password);
	so.addParam("bgcolor", "#000000");
	so.useExpressInstall("/swf/expressinstall.swf");
	so.write(divid);
	*/
}

function load_partty(divid, width, height,
		host, port, session, password,
		policy_port) {
	/*
	var frame = document.getElementById(divid);
	var so = new SWFObject("/swf/ParttyGuest.swf",
			"partty_gutest", width, height,
			"9", "#eeeeee");
	so.addVariable("host", host);
	so.addVariable("port", port);
	so.addVariable("password", password);
	if(policy_port) {
		so.addVariable("policy_host", host);
		so.addVariable("policy_port", policy_port);
	}
	if(session && session != "") {
		so.addVariable("session", session);
	}
	so.addParam("bgcolor", "#000000");
	//so.addParam("wmode", "transparent");
	so.useExpressInstall("/swf/expressinstall.swf");
	so.write(divid);
	*/

	var vars = {
		host:host,
		port:port,
		password:password
	};
	if(policy_port) {
		vars["policy_host"] = host;
		vars["policy_port"] = policy_port;
	}
	if(session && session != "") {
		vars["session"] = session;
	}

	swfobject.embedSWF("/swf/ParttyGuest.swf", divid,
			width, height, "9.0.0", "/swf/expressinstall.swf",
			vars,
			{ bgcolor:"#000000" },
			{ }
			);
}


$(function(){

	$("#session").css("height", screen.availHeight/2);

	var wheight = screen.availHeight;
	if (self.innerHeight) {
		wheight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		wheight = document.documentElement.clientHeight;
	} else if (document.body) {
		wheight = document.body.clientHeight;
	}

	var toggle = 0;
	$("#session_drag").click(function(){
		if(toggle) {
			jQuery.scrollTo(0, 500,{
					"onAfter": function(){
						$("#session").css("height", wheight/2);
					}
				}
			);
			toggle = 0;
		} else {
			$("#session").css("height", wheight);
			jQuery.scrollTo( document.getElementById("session").offsetTop + 5, 500 );
			toggle = 1;
		}
	});

});


$(function(){
	pres = document.getElementsByTagName('pre');
	var i;
	for (i=0; i<pres.length; i ++) {
		if (pres[i].className.indexOf("code_") >= 0) {
			pres[i].className = "prettyprint " + pres[i].className;
		}
	}
	prettyPrint();
});

/*
Hatena.Star.EntryLoader.loadEntries = function() {
	var entries = [];
	document.getElementById("session_h")
	for (var i = 0; i < divs.length; i++) {
		entries.push(new Hatena.Star.Entry.LivedoorBlog(divs[i]));
	}
	return entries;
}
*/



