function getCookie()
{
	// used for upload in firefox
	return document.cookie; 
}


	// This is only needed for Netscape browsers.
function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }

function FlashFocus(){
	window.document.FamilyMingle.focus();
}

function FlashEmbed(swf,id,width,height,color,quality,version,redirectUrl,trans,OurParams, base)
{
	this.params = new Object();
	this.attributes = new Object();
	if(color) this.addParam('bgcolor', color);
	if(quality) this.addParam('quality', quality);
	if(trans) this.addParam('wmode', trans);
	if(base) this.addParam('base', base);	
	this.addParam('swLiveConnect',true);
	
	this.setAttribute('src', swf);
	this.setAttribute('id', id ? id : '');
	this.setAttribute('salign', 'lt');
	this.setAttribute('width', width ? width : '100');
	this.setAttribute('height', height ? height : '100');
	this.setAttribute('swLiveConnect',true);
	if(base) this.setAttribute('base', base);
	
	this.addParam('FlashVars', OurParams);
	this.setAttribute('FlashVars',OurParams);
	
	if(version){
		this.reqVersion = version.toString().split(version.indexOf(",") > -1 ? "," : ":");
		var i = this.reqVersion.length;
		while(i--){
			this.reqVersion[i] = parseInt(this.reqVersion[i]) || 0;
		}
	}
	if(redirectUrl){
		this.redirectUrl = redirectUrl;
	}
}
var p = FlashEmbed.prototype;
p.addParam = function(name, value){
	this.params[name] = value;
};
p.setAttribute = function(name, value){
	this.attributes[name] = value;
};
p.output = function(){
	if(this.reqVersion){
		if(!this.playerVersionIsValid()){
			if(this.redirectUrl) {
				window.onbeforeunload = "";
				document.location.replace(this.redirectUrl);
			}
			return false;
		}
	}
	var swf = "";
	if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { //Netscape
			swf += '<embed type="application/x-shockwave-flash"';
			swf += ' name="'+ this.attributes['id'] + '"';
			for (var key in this.attributes){
				swf += ' ' + key + '="' + this.attributes[key] + '"';
			}
			for (var key in this.params){
				swf += ' ' + key + '="' + this.params[key] + '"';
			}
			swf += '/>';
	} else { //IE
			swf += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
			for (var key in this.attributes){
				if(key != 'src'){
					swf += ' ' + key + '="' + this.attributes[key] + '"';
				}
			}
			swf += '>';
			swf += '<param name="movie" value="' + this.attributes['src'] + '" />';
			for (var key in this.params){
				swf += '<param name="'+ key +'" value="'+ this.params[key] + '" />';
			}
			swf += "</object>";
	}
	document.write(swf);
	//alert(swf);
	return true
};
p.playerVersionIsValid = function(){
	var version = [0,0,0];
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			version = x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".");
		}
	}else{
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i=3; (axo!=null)&&(i<20); i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				version = [i,0,0];
			}	
		}catch(e){}
		if (version[0] == this.reqVersion[0]){
			//minor version:
			if ((this.reqVersion[1] != 0 || this.reqVersion[2] != 0) || version[0] != 6) {//skip version 6, cause of IE bug
				try{
					version = axo.GetVariable("$version").split(" ")[1].split(",");
				}catch(e){}
			}
		}
	}
	
	
	
	if(!version[0])
	{
		
	
		if(hasVersion(8) || hasVersion(9) || hasVersion(10))
		{
			return true;
		}
	}
	
	var i = -1;
	while(++i < version.length){
		version[i] = parseInt(version[i]) || 0;
		if(version[i] < this.reqVersion[i])
		{	
			return false;
		}
		if(version[i] > this.reqVersion[i])
		{
			return true;
		}
	}
	return true;
}
delete p;


function hasVersion( v )
{
	var result = false;

	if( window.ActiveXObject )
	{
		if( v < 10 )
		{
			try
			{
				new ActiveXObject( "ShockwaveFlash.ShockwaveFlash." + v );
				result = true;
			}
			catch( err )
			{}
		}
		else
		{
			try
			{
				var o = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash" );
				var m = o.GetVariable("$version").match( /([0-9]+)/ );
				result = ( m && m[ 1 ] >= v );
			}
			catch( err )
			{}
		}
	}
	else if( navigator.plugins && navigator.plugins[ "Shockwave Flash" ] )
	{
		var d = navigator.plugins[ "Shockwave Flash" ].description;
		var m = d.match( /([0-9]+)/ );
		result = ( m && m[ 1 ] >= v );
	}

	return result;
}
