function cn_addLoadEvent(func) {
	if (window.addEventListener) {
		window.addEventListener("load", func, false);
	}
	else {
		if (window.attachEvent) {
			window.attachEvent("onload", func);
		}
	}
}


if (typeof(cn_write_flash)=="undefined") {
	cn_write_flash = function(src, width, height, version, wmode, id, vars) {
		if (wmode=="") { wmode="opaque"; }
		document.write('<object ');
		if (id!="") document.write('id="' + id + '" ');
		document.write('width="' + width + '" height="' + height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' + document.location.protocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + ',0,0,0" align="center">');
		document.write('<param name="movie" value="' + src + '"><param name="quality" value="high"><param name="wmode" value="' + wmode + '">');
		if (typeof(vars)!="undefined" && vars!="") { document.write('<param name="FlashVars" value="' + vars + '">'); }
		document.write('<EMBED width="' + width + '" height="' + height + '" src="' + src + '" quality="high" wmode="' + wmode + '" align="center" swLiveConnect="true" ');
		if (typeof(vars)!="undefined" && vars!="") { document.write(' FlashVars="' + vars + '" '); }
		if (typeof(id)!="undefined" && id!="") { document.write(' name="' + id + '" '); }
		document.write('type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write('</embed></object>');
	}
}


function get_query_variable(name, default_value) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == name) {
			return pair[1];
		}
	}
	return default_value;
}

