// OBJECT 통합생성 스크립트
function makeobject(type,path,w,h,id,vars,transparent,bg) {
	this.type = type; // flash, applet, movie
	this.id = id;
	this.path = path;
	this.w = w;
	this.h = h;
	this.vars = (vars) ? vars : '';
	this.trnasparent = (transparent) ? transparent : 'transparent';
	this.bg = (bg) ? bg : '#ffffff';
	
	this.gettag =
		function() {
			switch(this.type) {
				case 'flash' :
					this.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
					this.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
					this.tag = "<object classid='"+this.classid+"' codebase='"+this.codebase+"' id='"+this.id+"' width='"+this.w+"' height='"+this.h+"'>";
					this.tag += "<param name='movie' value='"+this.path+"' />";
					this.tag += "<param name='allowScriptAccess' value='always' />";
					if(this.vars) this.tag += "<param name='FlashVars' value='"+this.vars+"' />";
					if(this.trnasparent) this.tag += "<param name='wmode' value='"+this.trnasparent+"' />";
					this.tag += "<param name='menu' value='false' />";
					this.tag += "<param name='quality' value='high' />"
					this.tag += "<param name='bgcolor' value='"+this.bg+"' />";
					this.tag += "<param value='"+this.path+"'>";
					this.tag += "<param name='base' value='.'>";
					this.tag += "<embed src='"+this.path+"'";
					if(this.vars) this.tag += " FlashVars='"+this.vars+"'";
					if(this.trnasparent) this.tag += " wmode='"+this.trnasparent+"'";
					this.tag += " width='"+this.w+"'";
					this.tag += " height='"+this.h+"'";
					this.tag += " bgcolor='"+this.bg+"'";
					this.tag += " name='"+this.id+"'";
					this.tag += " menu='false'";
				    this.tag += " base='.'";
					this.tag += " quality='high'";
					this.tag += " allowScriptAccess='always'";
					this.tag += " type='application/x-shockwave-flash'";
					this.tag += " pluginspage='http://www.macromedia.com/go/etflashplayer'";
					this.tag += " />";
					this.tag += "</object>";
					return this.tag;
					break;
			}

		}	

	this.writetag =
		function() {
			document.write(this.gettag());
			//Flash의 ExternalInterface가 Form Tag내에서 오류나는 버그를 해결하는 코드
			eval("window." + this.id + " = document.getElementById('" + this.id + "');");
		}
}