// JavaScript Document
var aheap = [];
aheap[0] = "help";
aheap[1] = "feel";
var bheap = [];
bheap[0] = String.fromCharCode(64)+"noregr";
bheap[1] = String.fromCharCode(64)+"noregr";
var cheap = [];
cheap[0] = "et.org";
cheap[1] = "et.org";
function feedback(id) {	
 var asdf="lto:", tyui="ject=", qwer="mai", zxcv="?sub";
 var txt = "noregret.org/tutor/"
 window.open(qwer+asdf+aheap[id]+bheap[id]+cheap[id]+zxcv+tyui+txt, "send");
}
var flash_template = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+
                     'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '+
                     'width="%width%" height="%height%" '+
                     'id="%name%" '+
                     '>'+
                     '<param name="movie" value="%name%">'+
                     '<param name="allowScriptAccess" value="always">'+
                     '<embed src="%name%" '+
                     'pluginspage="http://www.macromedia.com/go/getflashplayer" '+
                     'allowScriptAccess="always" '+
                     'type="application/x-shockwave-flash" '+
                     'width="%width%" height="%height%" '+
                     'name="%name%" '+
                     '>'+
                     '</embed>'+
                     '</object>';
var flash_tag_error = "Invalid flash tag composition.";
var flash_width = 100;
var flash_height = 100;
function getFlashContent (name, width, height) {	
	if (!name.length) {
		return flash_tag_error;
	}
	var result = flash_template.split("%name%").join(name);
		width = width.toString();
	height = height.toString();
	result = result.split("%width%").join(width.length ? width : flash_width);
	result = result.split("%height%").join(height.length ? height : flash_height);
	return result;
}
function printFlashTo (element_id, name, width, height) {
	var content = getFlashContent (name, width, height);
	var target = document.getElementById(element_id);
	if (target != null) {
		target.innerHTML = content;
	} else {
		alert(flash_tag_error);
	}
}