﻿/* 
 * Funciones para la carga de imagenes aleatorias
 */




function mostrarSwf(swf)
{
    AC_FL_RunContent(
	    'codebase', 'https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
	    'width', '1000',
	    'height', '150',
	    'src', swf,
	    'quality', 'high',
	    'pluginspage', 'https://www.macromedia.com/go/getflashplayer',
	    'align', 'middle',
	    'play', 'true',
	    'loop', 'true',
	    'scale', 'showall',
	    'wmode', 'opaque',
	    'devicefont', 'false',
	    'id', swf,
	    'bgcolor', '#999999',
	    'name', swf,
	    'menu', 'false',
	    'allowScriptAccess','sameDomain',
	    'movie', swf,
	    'salign', ''
	    ); //end AC code
}

function mostrarImagen(lang)
{
	$.ajax({
		type: "POST",
		url: 'themes/basic/ajax/ajax.master.php',
		data: "action=false&IdiomaID="+lang,
		success: function(data) {
			$("#left-bar").html(data);
		}
	});

}

function imagenAleatoria(lang)
{
	mostrarImagen(lang);
	$(document).everyTime(7500,function(i){
		mostrarImagen(lang);
	})
}

/* 
 * Funciones para la visualización de obra y conjuntos de obras
 */
 var v;
 function detalleObra(p)
 {
    var url = 'DetalleObra.aspx?' + p.join('&');
    var specs = 'width=800,height=600,location=no,status=yes,titlebar=yes,scrollbars=yes,resizable=yes';
    v = window.open(url, 'detalle', specs);
    v.focus();
    return false;
 }


function cambiarVisibilidad(id)
{
    var elemento = document.getElementById(id);
    if (elemento.style.display == 'none')
        elemento.style.display = '';
    else
        elemento.style.display = 'none';
    return false;
}

function MenuIdiomasCommand(lang){
	$("#cl").val(lang);
	$("#cl").parents('form').submit();
}

function showvideo(vidid){
	var player = '<iframe title="YouTube video player" width="425" height="349"  src="http://www.youtube.com/embed/'+vidid+'" frameborder="0" allowfullscreen></iframe>';
	$.facebox(player);
	$(document).bind('close.facebox', function() {
		if($("iframe").length>0){
		$("iframe").remove();
		}
	})
}
