/*function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}*/

function numero_aleatorio(limite){
	var randomnumber=Math.floor(Math.random()*limite);
	return randomnumber;
}

function generarPalabraAleatoria(cantidadLetras) {  

	var cadenaTexto = "ABCDEFJHIJKLMNOPQRSTUVWXYZabcdefjhijklmnopqrstuvwxyz";
	var numero;
	var numeroNum;
	var i;
	var palabraAleatoria = ""; 

	for (i=0;i<cantidadLetras;i++){
		numero = numero_aleatorio(cadenaTexto.length-1);	// Generamos un número aleatorio entre el total de caracteres 
		letra = cadenaTexto.substring(numero);
	    palabraAleatoria = palabraAleatoria+letra;			// Concatenamos valores 
	}  	
	return palabraAleatoria;
}

function recargar (id_contenedor)
{
	var sid;
    var newDate = new Date;
    var aleatorio = numero_aleatorio(1000);
    var time=newDate.getTime();
    var suma=aleatorio+time;
    sid=calcMD5(suma+generarPalabraAleatoria(10));
    // html='<img src="/includes/securimage/securimage_show.php?sid='+sid+'" alt="" style="" />';
    // document.getElementById(id_contenedor).innerHTML = html;
    document.getElementById(id_contenedor).src = '/includes/securimage/securimage_show.php?sid='+sid;
}
