function ActivexApplet(name, srcbase, file, wait, codebase, width, height) {

    this.attributes = new Object();
	this.variables = new Object();

	this.setAttribute('id', name);
	this.setAttribute('name', name);
	this.setAttribute('srcbase', srcbase);
	this.setAttribute('file', file);
	this.setAttribute('wait', wait);
	this.setAttribute('codebase', codebase);
	this.setAttribute('width', width);
	this.setAttribute('height', height);
};

// PARAMS

ActivexApplet.prototype = {
	
	setAttribute: function(n, v) {
		this.attributes[n] = v;
	},
	
	getAttribute: function(n) {
		return this.attributes[n];
	},

	write: function(n) {

		var c = '<applet archive="ptviewer.jar" code="ptviewer.class" codebase="' + this.getAttribute('codebase') + '"  id="' + this.getAttribute('name') + '" width="' + this.getAttribute('width') + '" height="' + this.getAttribute('height') + '"';

		if ( this.getAttribute('align') ) { c = c + ' align="' + this.getAttribute('align') + '"'; }
		if ( this.getAttribute('style') ) { c = c + ' style="' + this.getAttribute('style') + '"'; }
		if ( this.getAttribute('class') ) { c = c + ' class="' + this.getAttribute('class') + '"'; }

		c = c + '>';

		c = c + '<param name="file" value="' + this.getAttribute('srcbase') + this.getAttribute('file') + '">';
		c = c + '<param name="wait" value="' + this.getAttribute('srcbase') + this.getAttribute('wait') + '">';
		c = c + '<param name="cursor" value="move">';

		if ( this.getAttribute('auto') ) { c = c + '<param name="auto" value="' + this.getAttribute('auto') + '">'; }
		if ( this.getAttribute('pan') ) { c = c + '<param name="pan" value="' + this.getAttribute('pan') + '">'; }

// BAR

		if ( this.getAttribute('barcolor') ) { c = c + '<param name="barcolor" value="' + this.getAttribute('barcolor') + '">'; }
		if ( this.getAttribute('bar_x') ) { c = c + '<param name="bar_x" value="' + this.getAttribute('bar_x') + '">'; }
		if ( this.getAttribute('bar_y') ) { c = c + '<param name="bar_y" value="' + this.getAttribute('bar_y') + '">'; }
		if ( this.getAttribute('bar_width') ) { c = c + '<param name="bar_width" value="' + this.getAttribute('bar_width') + '">'; }
		if ( this.getAttribute('bar_height') ) { c = c + '<param name="bar_height" value="' + this.getAttribute('bar_height') + '">'; }

// FOV

		if ( this.getAttribute('fov') ) { c = c + '<param name="fov" value="' + this.getAttribute('fov') + '">'; } // nagyítás betöltődéskor
		if ( this.getAttribute('fovmin') ) { c = c + '<param name="fovmin" value="' + this.getAttribute('fovmin') + '">'; } // max közeítés
		if ( this.getAttribute('fovmax') ) { c = c + '<param name="fovmax" value="' + this.getAttribute('fovmax') + '">'; } // max távolítás

        c = c + '<\/applet>';

		if ( typeof(n) == 'undefined')
		{
			document.write(c);
		} else {
			document.getElementById(n).innerHTML = c;
		}
		return c;
	},

    encodeMyHtml: function(v) {
		v = new String(v);
		v = v.replace(/</g,"&lt;");
		v = v.replace(/>/g,"&gt;");
		return v;
	} 
}
