//parte para el calendario
var ventanaCalendario=false;
var home= "http://www.fmtaekwondo.org/";
var contenido="content/";
function muestraCalendario(raiz,formulario_destino,campo_destino,mes_destino,ano_destino){
	//funcion para abrir una ventana con un calendario.
	//Se deben indicar los datos del formulario y campos que se desean editar con el calendario, es decir, los campos donde va la fecha.
	if (typeof ventanaCalendario.document == "object") {
		ventanaCalendario.close()
	}
	ventanaCalendario = window.open("../lib/calendario/index.php?formulario=" + formulario_destino + "&nomcampo=" + campo_destino,"calendario","width=220,height=240,left=100,top=160,scrollbars=no,menubars=no,statusbar=NO,status=NO,resizable=no,location=no,titlebar=no")
}

//fin de funciones para el calendario

function Aviso(){
	var fil="AvisoCtecSp.htm";
	var nam="Aviso";
	var fmto="width=250,height=200,menubar=no,scrollbars=no,toolbar=no,location=no,";
	fmto+="directories=no,resizable=no,top=200,left=290";
	window.open(fil,nam,fmto);
}
function abref(que,cual){
		   fcam=home+'content/verfotos.php?cto='+cual+'&tip='+que;

window.open(fcam,'fctos','width=695,height=570,menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=50,left=120');
}
function abref1(que,cual){
		   fcam=home+'contenido/verfotos.php?cto='+cual+'&tip='+que;

window.open(fcam,'fctos','width=695,height=570,menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=50,left=120');
}

function abrefKo(que,cual){
		   fcam=home+'content/verfotosKo.php?cto='+cual+'&tip='+que;

window.open(fcam,'fctos','width=695,height=570,menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=50,left=120');
}

// funciones gneradas por Dream.

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*function MM_showHideLayers() { //v6.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
    
}*/
function MM_showHideLayers() { //v6.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; d=(v=='show')?'block':(v=='hide')?'none':d;
    v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.display=d;obj.visibility=v;}
    
}

// funciones de oficina
function PopWinTarifas()
{
window.open('../info/tarifas.htm','tarifas','width=450,height=500,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=no,top=20,left=170');
}
function PopWinCalendario()
{
window.open('../info/calendario.htm','calendario','width=600,height=500,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=no,top=20,left=170');
}
// fin funciones par oficina


// funcionnes de ver videos en download
function PopWindow()
{
if (document.forms.cto.Tvideo.value=="SV"){
	exit;
}
else{
	var doc='VerCtoTec2004Sp.php?cat='+document.forms.cto.Tvideo.value +'.txt';
	window.open(doc,'Tecnica04','width=450,height=500,menubar=no,scrollbars=yes,toolbar=no,location=yes,directories=no,resizable=no,top=20,left=170');
}
}
// fin de funcion download

// funcion para abrir ventana de subir fichero

function SubeFile(){
direccion='SubeDoc.php';
titulo='Subir_Doc';
formato='width=530,height=280,menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=100,left=110'
window.open(direccion,titulo,formato);
window.close;
}

function dame_correo(usuario){
	return usuario + '@' + 'fmtaekwondo.org';
}

function escribe_enlace_correo(usuario){
	document.write("<a class=titulop href='mailto:" + dame_correo(usuario) + "'>"  + dame_correo(usuario) + "</a>");
}

function escribe_link(dir,clase,texto){
	document.write("<a href='"+dir+"' class='"+ clase + "'>" + texto + "</a>");
}


