$(document).ready(function() {
			/*
			*   Examples - images
			*/

			$("a#example1").fancybox({
				'titleShow'		: false
			});

			$("a#example2").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a#example3").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'
			});

			$("a#example4").fancybox();

			$("a#example5").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example6").fancybox({
				'titlePosition'	: 'over'
			});

			$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			/*
			*   Examples - various
			*/

			$("#various1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});

			$("#various2").fancybox();

			$("#various3").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$("#various4").fancybox({
				'padding'			: 0,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
		});
function cambiar()
{
   var index=document.forms.formulario.categoria.selectedIndex;
   
   formulario.tamano.length=0;
   
   if(index==0) fun1();
   if(index==1) fun2();
   if(index==2) fun3();
}
 
function fun1(){
  opcion0=new Option("732x92 (Banner superior)","1","defauldSelected");
  opcion1=new Option("120x600 (Banner's laterales)","2");
  opcion2=new Option("468x60 (Banner inferior)","3");
  
  document.forms.formulario.tamano.options[0]=opcion0;
  document.forms.formulario.tamano.options[1]=opcion1;
  document.forms.formulario.tamano.options[2]=opcion2;  
 }
 
function fun2(){
  opcion0=new Option("Sin banner, sólo link","0","defauldSelected");
  
  document.forms.formulario.tamano.options[0]=opcion0;
 }
 
function fun3(){
  opcion0=new Option("Cartel","4","defauldSelected");
 
  document.forms.formulario.tamano.options[0]=opcion0;
 }
function check242(_form)
{
if(_form.titulo.value.length == 0) { alert('Título.') ; return false ; }
if(_form.url.value.length == 0) { alert('URL.') ; return false ; }
}
function check2421(_form)
{
if(_form.titulo.value.length == 0) { alert('Título.') ; return false ; }
if(_form.url.value.length == 0) { alert('URL.') ; return false ; }
}
function agregar_articulo(_form)
{
if(_form.titulo.value.length == 0) { alert('Debes escribir un título.') ; return false ; }
if(_form.articulo.value.length == 0) { alert('IMPORTANTE: VERIFICA QUE EL TIPO DE LETRA SEA "Arial" Y EL TAMAÑO SEA "3"') ; return false ; }
if(_form.autor.value.length == 0) { alert('Debes escribir el autor.') ; return false ; }
}
var numero = 0; //Esta es una variable de control para mantener nombres
            //diferentes de cada campo creado dinamicamente.
evento = function (evt) { //esta funcion nos devuelve el tipo de evento disparado
   return (!evt) ? event : evt;
}

//Aqui se hace lamagia... jejeje, esta funcion crea dinamicamente los nuevos campos file
addCampo = function () { 
//Creamos un nuevo div para que contenga el nuevo campo
   nDiv = document.createElement('div');
//con esto se establece la clase de la div
   nDiv.className = 'archivo';
//este es el id de la div, aqui la utilidad de la variable numero
//nos permite darle un id unico
   nDiv.id = 'file' + (++numero);
//creamos el input para el formulario:
   nCampo = document.createElement('input');
//le damos un nombre, es importante que lo nombren como vector, pues todos los campos
//compartiran el nombre en un arreglo, asi es mas facil procesar posteriormente con php
   nCampo.name = 'archivos[]';
//Establecemos el tipo de campo
   nCampo.type = 'file';
//Ahora creamos un link para poder eliminar un campo que ya no deseemos
   a = document.createElement('a');
//El link debe tener el mismo nombre de la div padre, para efectos de localizarla y eliminarla
   a.name = nDiv.id;
//Este link no debe ir a ningun lado
   a.href = '#';
//Establecemos que dispare esta funcion en click
   a.onclick = elimCamp;
//Con esto ponemos el texto del link
   a.innerHTML = 'Eliminar';
//Bien es el momento de integrar lo que hemos creado al documento,
//primero usamos la función appendChild para adicionar el campo file nuevo
   nDiv.appendChild(nCampo);
//Adicionamos el Link
   nDiv.appendChild(a);
//Ahora si recuerdan, en el html hay una div cuyo id es 'adjuntos', bien
//con esta función obtenemos una referencia a ella para usar de nuevo appendChild
//y adicionar la div que hemos creado, la cual contiene el campo file con su link de eliminación:
   container = document.getElementById('adjuntos');
   container.appendChild(nDiv);
}
//con esta función eliminamos el campo cuyo link de eliminación sea presionado
elimCamp = function (evt){
   evt = evento(evt);
   nCampo = rObj(evt);
   div = document.getElementById(nCampo.name);
   div.parentNode.removeChild(div);
}
//con esta función recuperamos una instancia del objeto que disparo el evento
rObj = function (evt) { 
   return evt.srcElement ?  evt.srcElement : evt.target;
}