﻿function abreVideo(cual, flashvars, pars, overrides) {
	$('#body .galeria li a img').removeClass('selected');
	$('#galeria').css({ visibility: 'hidden' });
	// var response = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="775" height="380"><param name="allowfullscreen" value="true" />';
	// response += '<param name="movie" value="media/swf/mediaplayer.swf?src=../../' + cual + '&autoplay=1&loop=1&noprogress=0" /><embed src="media/swf/mediaplayer.swf?src=../../' + cual + '&autoplay=1&loop=1" allowfullscreen="true" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="775" height="380"></embed></object>';
	//document.getElementById("reproductor").innerHTML = response;
	document.getElementById('reproductor').innerHTML = "";
	var message = 'No dispones de una version suficientemente reciente de flash para poder visualizar este contenido <a href="http://www.adobe.com/go/getflashplayer/">Consigue la última versión de Flash Player</a>.';
	var minVersion = 10;
	if ($.flash.hasVersion(minVersion)) {
		var defaults = {
			width: '775',
			height: '380',
			swf: 'media/swf/mediaplayer.swf',
			params: {
				allowfullscreen: 'true',
				flashvars: {
					src: cual,
					autoplay: 1,
					loop: 1,
					noprogress: 0
				}
			}
		};
		if (flashvars) { $.extend(true, defaults.params.flashvars, flashvars); }
		if (pars) { $.extend(true, defaults.params, pars); }
		if (overrides) { $.extend(true, defaults, overrides); }
		$('#reproductor').flash(defaults);
	} else {
		domAlert(message);
	}
}
function MM_openBrWindow(theURL, winName, features) { //v2.0
  window.open(theURL,winName,features);
}
function accionDeshabilitada() {
	domAlert("Esta función esta deshabilitada temporalmente");
}
function aviso_legal_old() {
	window.open("pub_aviso_legal.html", "aviso", "width=700, height=400, left=, top=");
}
function aviso_legal() {
	window.open(jsRootFq+"AvisoLegal", "aviso", "width=700, height=400, left=, top=");
}
function condiciones_uso() {
	window.open(jsRootFq+"ContratoCondicionesDeUso", "condicionesuso", "width=715, height=480, left=, top=, scrollbars=1");
}
function lopd() {
	window.open(jsRootFq+"LOPD", "lopd", "width=700, height=400, left=, top=");
}
function openWindowArquired(theURL, winName, w, h) { //v2.0
    t1 = (screen.availWidth / 2) - (w / 2);
    t2 = (screen.availHeight / 2) - (h / 2);
    tmp = "width=" + w + ", height=" + h + ", left=" + t1 + ", top=" + t2 + ", resizable=yes, scrollbars=yes, location=yes";
    window.open(theURL, winName, tmp);
}
function validaEmail(email) {
    tmp = true;
    ////////////////////////////
    arroba = email.indexOf("@", 0);
    if (arroba == -1 || arroba < 2) {
        tmp = false;
    }
    punto = email.lastIndexOf(".", email.length);
    if (punto < arroba || punto == -1 || punto > email.length - 2) {
        tmp = false;
    }
    return tmp;
}
