$(document).ready(function() {
	$("div.flashbox").each(function() {
		var box_body = $(this).text();    
		if (box_body != '') {			
			var delim = box_body.indexOf(',');			
			var path = box_body.substring(0, delim);			
			var box_url = box_body.substring(delim+1);			
			$(this).html('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				+ '	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" '
				+ '	width="214" height="110">'
				+ ' <param name="movie" value="' + path + '" /><param name="wmode" value="transparent" /><param name="quality" value="high" />  '
				+ ' <param name="flashvars" value="' + box_url + '" />'
				+ '	<param name="scale" value="exactfit"><embed src="' + path + '" width="214" height="110"  quality="high" scale="exactfit"  '
				+ ' flashvars="' + box_url + '" '
				+ ' wmode="transparent"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" ></embed> '
				+ ' </object> ').removeClass("flashbox");
			$("object:first-child", $(this)).bind("mouseover", function() {
				this.style.cursor = 'pointer';
			}).bind("mouseout", function() { 
				this.style.cursor = 'default';
			});

		}
	});
	$("div.imagebox").each(function() {
		var div = $(this);		
		var box_body = div.text();
		if (box_body != '') {
			var delim = box_body.indexOf(',');			
			var path = box_body.substring(26, delim);
			var box_url = box_body.substring(delim+1, box_body.length-6);
			div.empty()
			var image = new Image();
			$(image).load(function() {
				div.append($(this)).removeClass("imagebox");
			}).attr("src",'/thumbnails/214x110' + path);
		}
	});
});

function gotoPage(url) {
	window.location.href = url;
}

function openPage(url) {
	window.open(url);
}