// JavaScript Document

function send(saction){
	var form = document.form1;
	form.acc.value=saction;
	form.submit();
	}
function muestradiv(div, array){
alert("funciona");
alert(div);
alert(array);
var lista= Array =(array);
for (i=0; i<7; i++){
	document.getElementById(lista[i]).style.display= 'none';
}
document.get.ElementById(div).style.display= 'block';
return false;
}

function hora()
	{
	var now = new Date();
	var yr = now.getYear();
	if (navigator.appName=='Netscape'){yr = yr + 1900;}
	var mName = now.getMonth() + 1;
	var dName = now.getDay() + 1;
	var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
	if(dName==1) Day = "Domingo";
	if(dName==2) Day = "Lunes";
	if(dName==3) Day = "Martes";
	if(dName==4) Day = "Mi&eacute;rcoles";
	if(dName==5) Day = "Jueves";
	if(dName==6) Day = "Viernes";
	if(dName==7) Day = "S&aacute;bado";
	if(mName==1) Month="Enero";
	if(mName==2) Month="Febrero";
	if(mName==3) Month="Marzo";
	if(mName==4) Month="Abril";
	if(mName==5) Month="Mayo";
	if(mName==6) Month="Junio";
	if(mName==7) Month="Julio";
	if(mName==8) Month="Agosto";
	if(mName==9) Month="Septiembre";
	if(mName==10) Month="Octubre";
	if(mName==11) Month="Noviembre";
	if(mName==12) Month="Diciembre";
	var todaysDate =(Day + " " + dayNr + " de " + Month + " de " + yr); 
	document.open();
	document.write(todaysDate);
	}
	
	
function preguntar(mensaje){
	if(confirm(""+mensaje+"")){
		document.form1.submit();
	}
	
}

function preguntarRedireccion(mensaje, ruta){
	if(confirm(""+mensaje+"")){
		window.location.href= ruta;
	}
	
}


var numero = 0; 
function evento (evt) {
   return (!evt) ? event : evt;
}

function addCampo() { 
   nDiv = document.createElement('div');
   nDiv.className = 'archivo';
   nDiv.id = 'file' + (++numero);
   nCampo = document.createElement('input');
   nCampo.name = 'archivos[]';
   nCampo.type = 'file';
   a = document.createElement('a');
   a.name = nDiv.id;
   a.href = '#';
   a.onclick = elimCamp;
   a.innerHTML = 'Eliminar';
   nDiv.appendChild(nCampo);
   nDiv.appendChild(a);
   container = document.getElementById('adjuntos');
   container.appendChild(nDiv);
}
function addCampoT() { 
   nDiv = document.createElement('div');
   nDiv.className = 'archivo';
   nDiv.id = 'Campo' + (++numero);
   nCampo = document.createElement('input');
   nCampo.name = 'campos[]';
   nCampo.type = 'text';
   a = document.createElement('a');
   a.name = nDiv.id;
   a.href = '#';
   a.onclick = elimCamp;
   a.innerHTML = 'Eliminar';
   nDiv.appendChild(nCampo);
   nDiv.appendChild(a);
   container = document.getElementById('adjuntos');
   container.appendChild(nDiv);
}

function elimCamp(evt){
   evt = evento(evt);
   nCampo = rObj(evt);
   div = document.getElementById(nCampo.name);
   div.parentNode.removeChild(div);
}

function rObj(evt) { 
   return evt.srcElement ?  evt.srcElement : evt.target;
}



function cambiarImagenes(nuevaImagen, nuevoTitulo){
	document.getElementById("imagenGrande").src = "archivos/productos/"+nuevaImagen;
	document.getElementById("titutoImagen").innerHTML= nuevoTitulo;
}


function aparecer(){
		document.getElementById("divAyuda").style.display = "block";
}

function cerrar(){
		document.getElementById("divAyuda").style.display = "none";
}




<!-- DRAG AND DROP -->

function $(v) { return(document.getElementById(v)); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function xy(e,v) { return(v?(agent('msie')?event.clientY+document.body.scrollTop:e.pageY):(agent('msie')?event.clientX+document.body.scrollTop:e.pageX)); }

function dragOBJ(d,e) {

    function drag(e) { if(!stop) { d.style.top=(tX=xy(e,1)+oY-eY+'px'); d.style.left=(tY=xy(e)+oX-eX+'px'); } }

    var oX=parseInt(d.style.left),oY=parseInt(d.style.top),eX=xy(e),eY=xy(e,1),tX,tY,stop;

    document.onmousemove=drag; document.onmouseup=function(){ stop=1; document.onmousemove=''; document.onmouseup=''; };

}

<!-- DRAG AND DROP -->




function tipoAfiliacion(){
seleccion = document.getElementById("tipo_afiliacion").value;
	if(seleccion == 0){
		document.getElementById("divImpresiones").style.display = "block";
		document.getElementById("divClick").style.display = "none";
		document.getElementById("divTiempo").style.display = "none";
		document.getElementById("divPrincipal").style.display = "none";
		
		document.getElementById("fecha_inicio_click_campo").value = "";
		document.getElementById("fecha_fin_click_campo").value = "";
		document.getElementById("fecha_inicio_campo").value = "";
		document.getElementById("fecha_fin_campo").value = "";
		
	}else if(seleccion == 1){
		document.getElementById("divImpresiones").style.display = "none";
		document.getElementById("divClick").style.display = "block";
		document.getElementById("divTiempo").style.display = "none";
		document.getElementById("divPrincipal").style.display = "none";

		document.getElementById("cantidad_impresiones").value = 0;
		document.getElementById("fecha_inicio_campo").value = "";
		document.getElementById("fecha_fin_campo").value = "";
		
		
	}else if(seleccion == 2){
		document.getElementById("divImpresiones").style.display = "none";
		document.getElementById("divClick").style.display = "none";
		document.getElementById("divTiempo").style.display = "block";	
		document.getElementById("divPrincipal").style.display = "none";

		document.getElementById("fecha_inicio_click_campo").value = "";
		document.getElementById("fecha_fin_click_campo").value = "";
		document.getElementById("cantidad_impresiones").value = 0;

		
	}else if(seleccion == "seleccione"){
		document.getElementById("divImpresiones").style.display = "none";
		document.getElementById("divClick").style.display = "none";
		document.getElementById("divTiempo").style.display = "none";	
		document.getElementById("divPrincipal").style.display = "block";
		
		
		document.getElementById("fecha_inicio_click_campo").value = "";
		document.getElementById("fecha_fin_click_campo").value = "";
		document.getElementById("fecha_inicio_campo").value = "";
		document.getElementById("fecha_fin_campo").value = "";
		document.getElementById("cantidad_impresiones").value = 0;
	}

}



