AC_FL_RunContent = 0;

/*********************************************************************************************
*********************************************************************************************/
function showFlashObject( params )
{
	if (AC_FL_RunContent == 0) {
		alert("Esta página requiere el archivo AC_RunActiveContent.js.");
	} else {
		var hasRequestedVersion = DetectFlashVer(10, 0, 0);
		if ( hasRequestedVersion )
		{
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
				'width', params.width,
				'height', params.height,
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'true',
				'loop', 'false',
				'scale', 'showall',
				'wmode', params.wmode,
				'devicefont', 'false',
				'id', params.name,
				'bgcolor', '#ffffff',
				'name', params.name,
				'menu', 'true',
				'allowFullScreen', params.fullscreen,
				'allowScriptAccess', params.allowScriptAccess,
				'movie', params.url,
				'salign', '',
				'flashVars', params.flashVars,
				'node', params.node
			); //end AC code
		}
		else
		{
			var content = '<div style="padding: 10px; background-color:#ffffff; width:' + params.width + 'px; height:' + params.height + 'px;">';
			content += 	'Este contenido requiere Adobe Flash Player versi&oacute;n 10.0.0 o superior.<br/><br/>';
			content += 	'<center><a href="http://get.adobe.com/es/flashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Obtener Adobe Flash player" /></a></center><br/><br/>';
			content += 	'Puedes instalar la &uacute;ltima versi&oacute;n de Flash Player <a href="http://get.adobe.com/es/flashplayer">aqu&iacute;</a><br/><br/>';
			content += 	'Si ya la tienes instalada, puede ser que tengas el complemento de Flash deshabilitado. Para habilitarlo, accede a las propiedades de tu navegador.';
			content += 	'</div>';
			
			if ( params.node )
				document.getElementById(params.node).innerHTML = content;
			else
				document.write(content);
		}
	}
}

/*********************************************************************************************
*********************************************************************************************/
function showSweepPlayer(w, h, file, lang, node)
{
	var resource_type = ( node != undefined && node != null ) ? '_embed' : '_veil';

	var strFlashVars = 'file=http://sweepfactory.s3.amazonaws.com/' + file + '.swp';
	strFlashVars += '&res=http://www.voovio.com/tours/premium/res' + resource_type + '/&sp=0';
	strFlashVars += '&shareURL=http://www.voovio.com/tours/' + file.substr(11, 36);
	
	if ( lang != undefined && lang != null )
		strFlashVars += '&lang=' + lang;
	else
		strFlashVars += '&lang=en';

	if ( node != undefined && node != null )
	{
		showFlashObject( {
			name : 'SweepPlayer',
			node: node, 
			width: w,
			height: h,
			url: 'http://www.voovio.com/tours/player', 
			flashVars: strFlashVars,
			fullscreen: 'true',
			wmode: 'transparent',
			allowScriptAccess: 'always'
		} );
	}
	else
	{
		$.colorbox({
		html: '<div id=\'popupMain\'></div>',
		width: w, 
		height: h, 
		iframe: false,
		onComplete: function() {
				showFlashObject( {
					name : 'SweepPlayer',
					node: 'popupMain', 
					width: w,
					height: h,
					url: 'http://www.voovio.com/tours/player', 
					flashVars: strFlashVars,
					fullscreen: 'true',
					wmode: 'transparent',
					allowScriptAccess: 'always'
				} );
		}
		});
	}
}

/*********************************************************************************************
*********************************************************************************************/
function closeSweepPlayer(args) {
	$.colorbox.close();
}
