/*********************************************************************************************/
/* Este script ha sido desarrollado exclusivamente para ACI. Queda terminantemente prohibida */
/* la copia y uso sin autorizacion escrita del autor: www.clubpaginasweb.com                 */
/*********************************************************************************************/

function objhttp(){
	try {
		objetus = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			objetus = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			objetus = false;
		}
	}
	if(!objetus && typeof XMLHttpRequest!='undefined'){
		objetus = new XMLHttpRequest();
	}
	return objetus;
}

function actuar(){
	//alert("hola");
	var elDiv, nom, cor, tel, cel, com, men;
	elDiv = document.getElementById('contacto');
	nom = document.getElementById('nombre').value;
	cor = document.getElementById('email').value;
	tel = document.getElementById('telefono').value;
	cel = document.getElementById('celular').value;
	com = document.getElementById('empresa').value;
	men = document.getElementById('mensaje').value;
	_elObjeto = objhttp();
	//alert (_URL);
	_elObjeto.open("POST", "actor.php", true);
	_elObjeto.onreadystatechange=function(){
		if(_elObjeto.readyState==1){
			elDiv.innerHTML="Procesando datos... favor espere";
		} else if(_elObjeto.readyState==4) {
			var response = _elObjeto.responseText;
			elDiv.innerHTML = response;
		}
	}
	_elObjeto.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	_elObjeto.send("nombre="+nom+"&email="+cor+"&telefono="+tel+"&celular="+cel+"&empresa="+com+"&mensaje="+men);
}

function subcat(){
	//alert("hola");
	_objcroquishttp = objhttp();
	_URL = "background.php?cat=";
	_URL += document.formu_producto.cat.value;
	//alert (_URL);
	_objcroquishttp.open("GET",_URL,true);
	_objcroquishttp.onreadystatechange=function(){
		if(_objcroquishttp.readyState==4) {
			var response = _objcroquishttp.responseText;
			document.getElementById('subcategoria').innerHTML = response;
		}
	}
	_objcroquishttp.send(null);
}

var miPopup
function abreVentana(){
    imgserv = window.open("imagenes.php","imags","width=600,height=300,scrollbars=yes")
    imgserv.focus()
}

function tiny(){
tinyMCE.init({
	mode : "textareas",
	theme : "simple"
});
}//end function tiny()

function agarra_imagen(imagen){
    window.open('imagenes.php?id=' + imagen,'','location=No,menubar=No,resizable=No,width=525,height=400');
} 