/* BMW ~ JAVASCRIPT Flash Interaction v1.1

	Author: Joel Nagy | dotglu
	Last Modified: Sept 11th, 2008 02:56:47 AM EST

	Dependency: none
*/

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function DownloadFileFromFlash(file, target) {
		var a = document.createElement('A');
		a.id = '__download_win';
		a.href = file;
		a.onclick = function () {
			if (target != null && target != '')
				window.open(file, target);
			else
				document.location.href = file;
			document.body.removeChild(document.getElementById('__download_win'));
		};
		if (target != null && target != '')
			a.target = target;
		a.style.visibility = 'hidden';
		a.style.display = 'block';
		a.style.position = 'absolute';
		a.style.zIndex = '99999';

		document.body.appendChild(a);
		a.onclick();
}
