// Java Applet Object
function AppletObject(code, archive, width, height, mayscript){
	this.code = code;
	this.archive = archive;
	this.library = "";
	this.width = width;
	this.height = height;
	this.mayscript = mayscript;
	this.write = function(div){
		var d=document.getElementById(div);
		var string = '<applet code="'+this.code+'" archive="'+this.archive+this.library+'" width="'+this.width+'" height="'+this.height+'" mayscript="'+this.mayscript+'">';
		for(var i = 0; i < this.param.length; i++){
			string += '<param name="'+this.param[i].name+'" value="'+this.param[i].value+'">';
		}
		string += this.alt;
		string += '</applet>';
		d.innerHTML = string;
	};
	this.addParam = function(name, value){
		var appletParam = new Object();
		appletParam.name = name;
		appletParam.value = value;
		this.param.push(appletParam);
	};
	this.addLibrary = function(file){
		if(file.charAt(0) == ',' || this.library.charAt(this.library.length-1) == ','){
			library += file;
		} else {
			library += ',' + file;
		}
	}
	this.folder = this.archive.substring(0, this.archive.lastIndexOf("/")) + "/";
	this.alt = 'To view this content, you need to install Java from <A HREF="http://java.com">java.com</A>';
	this.param = new Array();
}
