FlashTag.prototype.setParam = function (name,value) {
	this.param[name]=value;
}

FlashTag.prototype.addFlashVar = function (name,value) {
	if (this.param["FlashVars"] == undefined) {
		this.param["FlashVars"] = "";
	} else {
		this.param["FlashVars"] += "&"
	}
	this.param["FlashVars"] += name+"="+value; 
}

function FlashTag(src, width, height) {
    this.param = new Array();
	this.setParam('src','"'+src+'"');
	this.setParam('width','"'+width+'"');
	this.setParam('height','"'+height+'"');
	this.setParam('quality','"high"'); 
	this.setParam('type','"application/x-shockwave-flash"');
	this.setParam('pluginspage','"http://www.macromedia.com/go/getflashplayer"');
	this.setParam('allowScriptAccess',"sameDomain");
	this.setParam('version','"7,0,14,0"');
}


FlashTag.prototype.toString = function() { 	
	var tagString = new String('');
	tagString += '<embed ';
	for(var name in this.param) {
		tagString += name +"="+this.param[name]+" ";
	}
	tagString += "></embed>";
	return (tagString);
}


function putFlashSite() {
	var toput = "";
	var rand = Math.round(Math.random()*10000);
	var flashTag = new FlashTag("index.swf?"+rand,"800","700");
	flashTag.setParam("id","site");
	flashTag.setParam("align","middle");
	flashTag.setParam("quality","high");
	var url = location.href;
	flashTag.addFlashVar("gallery",url);
	toput = flashTag.toString();
	document.write(toput);
}