jQuery.noConflict();

function urlActual(){
	url = document.location.href;
	partes = url.split('/');
	// obtención del nombre de la página, la última parte de la url y sus parámetros.
	return partes[partes.length-1]+partes[partes.length-2];
}
		
/////////* inicio formulario contacto */
	// MOSTRAR FORMULARIO
	if(navigator.appName == "Netscape"){
		function mostrar_ocultar(){
			if(urlActual().match("contacto") != null || urlActual().match("informacion-de-contacto") != null || urlActual().match("ayuda-y-soporte") != null || urlActual().match("diseno-web") != null || urlActual().match("dominios-tel") != null){
				cargarVacio();
				document.location.href="/corporativo/contacto";
				return;
			}
			
			maxInterval=0;
			minInterval=0;
			if(document.getElementById('micontactoform').style.display == "none"){
				opfx = 0.1;
				document.getElementById('micontactoform').style.opacity = opfx;
				document.getElementById('micontactoform').style.display = "";
				maxInterval=window.setInterval("maxOpacidad()", 100);
			}else{
				opfx = 1;
				minInterval=window.setInterval("minOpacidad()", 100);
			}
			
		}
		function maxOpacidad(){
			if(opfx <= 1){
				opfx = opfx + 0.25;
				document.getElementById('micontactoform').style.opacity = opfx;
			}else{
				maxInterval=window.clearInterval(maxInterval);
			}
		}
		function minOpacidad(){
			if(opfx >= 0){
				opfx = opfx - 0.25;
				document.getElementById('micontactoform').style.opacity = opfx;
			}else{
				minInterval=window.clearInterval(minInterval);
				document.getElementById('micontactoform').style.display="none";
			}
		}
	} // if Netscape
	if(navigator.appName == "Microsoft Internet Explorer"){
		function mostrar_ocultar(){
			if(urlActual().match("contacto") != null || urlActual().match("informacion-de-contacto") != null || urlActual().match("ayuda-y-soporte") != null || urlActual().match("diseno-web") != null || urlActual().match("dominios-tel") != null){
				cargarVacio();
				document.location.href="/corporativo/contacto";
				return;
			}

			cadena_version = navigator.appVersion;
			pos_version = navigator.appVersion.indexOf("MSIE");
			cadena_version = cadena_version.substr(pos_version,8);
			version = cadena_version.substr(5,3);
			if(version == "8.0"){ // sin efecto Alpha // Explorer 8.0
				if(document.getElementById('micontactoform').style.display == "none"){
					document.getElementById('micontactoform').style.display = "";
				}else{
					document.getElementById('micontactoform').style.display = "none";
				}
			}else{
				maxInterval=0;
				minInterval=0;
				if(document.getElementById('micontactoform').style.display == "none"){
					opie = 10;
					document.getElementById("micontactoform").filters.item("DXImageTransform.Microsoft.Alpha").Opacity = opie;
					document.getElementById('micontactoform').style.display = "";
					maxInterval=window.setInterval("maxOpacidad()", 100);
				}else{
					opie = 100;
					minInterval=window.setInterval("minOpacidad()", 100);
				}
			}
		}
		function maxOpacidad(){
			if(opie <= 100){
				opie = opie + 25;
				document.getElementById("micontactoform").filters.item("DXImageTransform.Microsoft.Alpha").Opacity = opie;
			}else{
				maxInterval=window.clearInterval(maxInterval);
			}
		}
		function minOpacidad(){
			if(opie >= 0){
				opie = opie - 25;
				document.getElementById("micontactoform").filters.item("DXImageTransform.Microsoft.Alpha").Opacity = opie;
			}else{
				minInterval=window.clearInterval(minInterval);
				document.getElementById('micontactoform').style.display="none";
			}
		}
	} // Explorer 6.0 - 7.0
	// FIN MOSTRAR FORMULARIO
	
	// rollovers campos formulario
	function over(id){
		document.getElementById(id).style.background="#fff";
		document.getElementById(id).style.color="#3e8313";
	}
	function out(id){
		document.getElementById(id).style.background="#e0e0e0";
		document.getElementById(id).style.color="#666";
	}
	// fin rollovers campos formulario
	
	// vaciar campos al pulsar en ellos y llenarlos al soltarlos vacios
	function vaciar(id){
		var contenedor = document.getElementById(id).value;

		switch (id){
			case "nombre":
				var contenido = "Nombre";
				break;
			case "email":
				var contenido = "E-mail";
				break;
			case "telefono":
				var contenido = "Tel";
				break;
			case "empresa":
				var contenido = "Empresa";
				break;
			case "codigo":
				var contenido = "Introduce";
				break;
		}
		if(contenedor.indexOf(contenido)!=-1)document.getElementById(id).value="";
	}
	function llenar(id){
		var contenedor = document.getElementById(id).value;

		switch (id){
			case "nombre":
				var texto = "Nombre y Apellidos";
				break;
			case "email":
				var texto = "E-mail";
				break;
			case "telefono":
				var texto = "Teléfono";
				break;
			case "empresa":
				var texto = "Empresa";
				break;
			case "codigo":
				var texto = "Introduce el código de la imagen";
				break;
		}
		if(contenedor=="")document.getElementById(id).value=texto;
	}
	// fin vaciar campos al pulsar en ellos y llenarlos al soltarlos vacios
	
	function show_err(error,id) {
	jQuery("#error").show();
	
	jQuery("#error").empty();
	jQuery("#error").append('<p>'+error+'</p>');
	
	//jQuery(id).addClass('error');
	//jQuery(id+'_label').addClass('error');
		
	jQuery(id).focus();	
}

	
	function ValidarForm(form) {
		if(form.id =="config-form")form.id="datos-config";
		
		var form = document.forms[form.id]; //alert(form.id);
		var errors='';var error='';var elemOk=false;
		var nom = form.nombre.value;
		var com = form.comentarios.value;
		//var nom_valido = new RegExp("^[a-zA-Z{ }ñÑá-úÁ-Úä-üÄ-Ü']+jQuery");
		//var com_valido = new RegExp("^[a-zA-Z{ }ñÑá-úÁ-Úä-üÄ-Ü']+jQuery");
		//var nom_valido=nom.match(/[^a-zA-Z áéíóúüÁÉÍÓÚÜÑñÇç·.]/);
		var nom_valido=nom.match(/[^a-zA-Z0-9 áéíóúüÁÉÍÓÚÜÑñÇç·.()-_\n][\n]/);
		var com_valido=com.match(/[^a-zA-Z0-9 áéíóúüÁÉÍÓÚÜÑñÇç·.()-_\n][\n]/);
		if (form.nombre.value == "" || nom_valido != null || form.nombre.value == "Nombre y Apellidos"){ 
			jQuery('#'+form.id+' #f_nombre').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_nombre #nombre').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_nombre').addClass('error');
			//jQuery('#f_nombre #nombre').addClass('error');
			error+= 'El nombre solo debe contener car&aacute;cteres v&aacute;lidos<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#nombre");
			errors = true;
		}else{
			jQuery('#'+form.id+' #f_nombre').css({ "color":"" });
			jQuery('#'+form.id+' #f_nombre #nombre').css({ "border":"", "color":"" });
			//jQuery('#f_nombre').removeClass('error');
			//jQuery('#f_nombre #nombre').removeClass('error');
		}
		if ((form.email.value == "")||(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form.email.value)))){
			jQuery('#'+form.id+' #f_email').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_email #email').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_email').addClass('error');
			//jQuery('#f_email #email').addClass('error');
			error+= 'No es un email v&aacute;lido<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#email");
			errors = true;
		}else{
			jQuery('#'+form.id+' #f_email').css({ "color":"" });
			jQuery('#'+form.id+' #f_email #email').css({ "border":"", "color":"" });
			//jQuery('#f_email').removeClass('error');
			//jQuery('#f_email #email').removeClass('error');
		}
		if (form.telefono.value == ""){
			jQuery('#'+form.id+' #f_telefono').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_telefono #telefono').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_telefono').addClass('error');
			//jQuery('#f_telefono #telefono').addClass('error');
			//document.getElementById("f_telefono").style.background = "#fec141";
			error+= 'El tel&eacute;fono solo puede contener n&uacute;meros<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#telefono");
			errors = true;
		}else{
			// Puede empezar con + o con un numero
			elemOk1 = form.telefono.value.substr(0,1) == "+" || !isNaN(form.telefono.value.substr(0,1));
			// Tiene entre 9 y 20 caracteres
			elemOk2 = form.telefono.value.length >= 9 && form.telefono.value.length <= 20;
			// Todos los caracteres son numeros excepto el primero que podia ser un +
			for(j=1;j<form.telefono.value.length;j++){
				if(form.telefono.value.substr(j,1) == " " || !isNaN(form.telefono.value.substr(j,1))){
					elemOk3 = true;
				}else{
					elemOk3	= false;
					break;
				}
			}
			elemOk = elemOk1 && elemOk2 && elemOk3;
		}
		if (!elemOk) {
			jQuery('#'+form.id+' #f_telefono').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_telefono #telefono').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_telefono').addClass('error');
			//jQuery('#f_telefono #telefono').addClass('error');
			error+= 'El tel&eacute;fono solo puede contener n&uacute;meros<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#telefono");
			errors = true;
		} else {
			jQuery('#'+form.id+' #f_telefono').css({ "color":"" });
			jQuery('#'+form.id+' #f_telefono #telefono').css({ "border":"", "color":"" });
			//jQuery('#f_telefono').removeClass('error');
			//jQuery('#f_telefono #telefono').removeClass('error');
		}
		if (form.motivo.value == ""){
			jQuery('#'+form.id+' #f_motivo').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_motivo #motivo').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_motivo').addClass('error');
			//jQuery('#f_motivo #motivo').addClass('error');
			error+= 'Debe seleccionar un departamento<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#motivo");
			errors = true;
		}else{
			jQuery('#'+form.id+' #f_motivo').css({ "color":"" });
			jQuery('#'+form.id+' #f_motivo #motivo').css({ "border":"", "color":"" });
			//jQuery('#f_motivo').removeClass('error');
			//jQuery('#f_motivo #motivo').removeClass('error');
		}


		if(form.id!="contact-form-cloud-linkedin"){
			if (form.empresa.value == "" || form.empresa.value == "Empresa"){
				jQuery('#'+form.id+' #f_empresa').css({ "color":"#f81435" });
				jQuery('#'+form.id+' #f_empresa #empresa').css({ "border":"1px solid #f81435", "color":"#f81435" });
				//jQuery('#f_empresa').addClass('error');
				//jQuery('#f_empresa #empresa').addClass('error');
				error+= 'El nombre de la empresa solo debe contener car&aacute;cteres v&aacute;lidos<br />';
				if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config")show_err(error,"#empresa");
				errors = true;
			}else{
				jQuery('#'+form.id+' #f_empresa').css({ "color":"" });
				jQuery('#'+form.id+' #f_empresa #empresa').css({ "border":"", "color":"" });
				//jQuery('#f_empresa').removeClass('error');
				//jQuery('#f_empresa #empresa').removeClass('error');
			}
		}
		if(form.id!="contact-form-cloud-linkedin"){
			if (form.provincia.value == ""){
				jQuery('#'+form.id+' #f_provincia').css({ "color":"#f81435" });
				jQuery('#'+form.id+' #f_provincia #provincia').css({ "border":"1px solid #f81435", "color":"#f81435" });
				//jQuery('#f_provincia').addClass('error');
				//jQuery('#f_provincia #provincia').addClass('error');
				error+= 'Debe seleccionar una provincia<br />';
				if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config")show_err(error,"#provincia");
				errors = true;
			}else{
				jQuery('#'+form.id+' #f_provincia').css({ "color":"" });
				jQuery('#'+form.id+' #f_provincia #provincia').css({ "border":"", "color":"" });
				//jQuery('#f_provincia').removeClass('error');
				//jQuery('#f_provincia #provincia').removeClass('error');
			}
		}
		if(form.id!="contact-form-prueba-cloud" && form.id!="datos-config" && form.id!="contact-form-cloud-linkedin"){
			if ((form.comentarios.value == "")||(com_valido != null)){
				jQuery('#'+form.id+' #f_comentarios').css({ "color":"#f81435" });
				jQuery('#'+form.id+' #f_comentarios #comentarios').css({ "border":"1px solid #f81435", "color":"#f81435" });
				//jQuery('#f_comentarios').addClass('error');
				//jQuery('#f_comentarios #comentarios').addClass('error');
				error+= 'El motivo de su consulta contiene caracteres no v&aacute;lidos<br />';
				if(form.id=="contact-form")show_err(error,"#comentarios");
				errors = true;
			}else{
				jQuery('#'+form.id+' #f_comentarios').css({ "color":"" });
				jQuery('#'+form.id+' #f_comentarios #comentarios').css({ "border":"", "color":"" });
				//jQuery('#f_comentarios').removeClass('error');
				//jQuery('#f_comentarios #comentarios').removeClass('error');
			}
		}
		if (form.codigo.value == "" || form.codigo.value.length != 6){
			jQuery('#'+form.id+' #f_codigo').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_codigo #codigo').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_codigo').addClass('error');
			//jQuery('#f_codigo #codigo').addClass('error');
			error+= 'El c&oacute;digo no es v&aacute;lido<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#codigo");
			errors = true;
		}else{
			jQuery('#'+form.id+' #f_codigo').css({ "color":"" });
			jQuery('#'+form.id+' #f_codigo #codigo').css({ "border":"", "color":"" });
			//jQuery('#f_codigo').removeClass('error');
			//jQuery('#f_codigo #codigo').removeClass('error');
		}
		if (form.acepta.checked == false){
			jQuery('#'+form.id+' #f_acepta').css({ "color":"#f81435" });
			jQuery('#'+form.id+' #f_acepta #acepta').css({ "border":"1px solid #f81435", "color":"#f81435" });
			//jQuery('#f_acepta').addClass('error');
			//jQuery('#f_acepta #acepta').addClass('error');
			error+= 'Tiene que aceptar las condiciones de uso<br />';
			if(form.id=="contact-form"||form.id=="contact-form-prueba-cloud"||form.id=="datos-config"||form.id=="contact-form-cloud-linkedin")show_err(error,"#acepta");
			errors = true;
		}else{
			jQuery('#'+form.id+' #f_acepta').css({ "color":"" });
			jQuery('#'+form.id+' #f_acepta #acepta').css({ "border":"", "color":"" });
			//jQuery('#f_acepta').removeClass('error');
			//jQuery('#f_acepta #acepta').removeClass('error');
		}

		if (errors) {
			return false;
		}else{
			if(form.id=="datos-config"){
				cargarContenidoConfigOk(form);
			}else{
				cargarContenidoContactoOk(form);
			}
		}
	}
	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 cargarContenidoContactoOk(form){//alert(form.id);
		t1 = form.motivo.value;
		t2 = form.nombre.value;
		t3 = form.email.value;
		t4 = form.telefono.value;
		t5 = form.empresa.value;
		t6 = form.provincia.value;
		t7 = form.comentarios.value;
		t8 = form.codigo.value;
		t9 = form.agente.value;
		t10 = form.seccion.value;
		t11 = form.idioma.value;
		t12 = form.charset.value;
		t13 = form.dpto.value;
		t14 = form.acepta.checked;
		t16 = form.news.checked;
		t15 = form.formulario.value;
		if(form.formulario.value == "Cabecera"){
			id = document.getElementById('contaj_cab');
		}else{
			id = document.getElementById('contaj');
			if(form.formulario.value == "Legal"){
				t16 = form.cargo.value;
				t17 = form.chk_mcomunitaria.checked;
				t18 = form.chk_mnacional.checked;
				t19 = form.chk_minternacional.checked;
				t20 = form.chk_pdatos.checked;
				t21 = form.chk_psoftware.checked;
				t22 = form.chk_pweb.checked;
				t23 = form.chk_auditoria.checked;
			}else if(form.formulario.value == "Dominios tel"){
				t16 = form.dominio.value;
			}
		}
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/f_contactoOk.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		
		if(form.formulario.value == "Legal"){
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&cargo="+t16+"&chk_mcomunitaria="+t17+"&chk_mnacional="+t18+"&chk_minternacional="+t19+"&chk_pdatos="+t20+"&chk_psoftware="+t21+"&chk_pweb="+t22+"&chk_auditoria="+t23);
		}else if(form.formulario.value == "Dominios tel"){
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&dominio="+t16);
		}else{
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&news="+t16);
		}
		
	}
	function cargarContenidoContactoError(form){
		t1 = document.getElementById("motivo").value;
		t2 = document.getElementById("nombre").value;
		t3 = document.getElementById("email").value;
		t4 = document.getElementById("telefono").value;
		t5 = document.getElementById("empresa").value;
		t6 = document.getElementById("provincia").value;
		t7 = document.getElementById("comentarios").value;
		t8 = document.getElementById("seccion").value;
		if(document.getElementById("formulario").value == "Cabecera"){
			id = document.getElementById('contaj_cab');
		}else{
			id = document.getElementById('contaj');
		}
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/f_contacto.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&seccion="+t8);
	}
	function cargarContenidoContacto(){
		id = document.getElementById('contaj_cab');
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/f_contacto.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.send(null);
	}
	function cargarVacio(){	
		id = document.getElementById('contaj_cab');
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/f_contactoVacio.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.send(null);
	}
	random_img=0;
	function cargarContenidoImgSec(){
	   id = document.getElementById('img-php');
		random_img++;
	   ajax=nuevoAjax();
	   ajax.open("POST","/marketing/formContactHome/f_contactoImgSec.php",true);
	   ajax.onreadystatechange=function() {
		  if (ajax.readyState==4) {
			 id.innerHTML = ajax.responseText;
		   }
	   }
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("random_img="+random_img);
	}
		/* fin formulario contacto */

	/* inicio configurador dedicados*/
	function cargarContenidoConfigOk(form){//alert(form.id);
					jQuery('html, body').animate({scrollTop:400},'slow');

		t1 = form.motivo.value;
		t2 = form.nombre.value;
		t3 = form.email.value;
		t4 = form.telefono.value;
		t5 = form.empresa.value;
		t6 = form.provincia.value;
		t7 = form.comentarios.value;
		t8 = form.codigo.value;
		t9 = form.agente.value;
		t10 = form.seccion.value;
		t11 = form.idioma.value;
		t12 = form.charset.value;
		t13 = form.dpto.value;
		t14 = form.acepta.checked;
		t16 = form.news.checked;
		t15 = form.formulario.value;
		if(form.formulario.value == "Cabecera"){
			id = document.getElementById('contaj_cab');
		}else if(form.formulario.value == "ConfiguradorDedicados"){
			id = document.getElementById('contaj_config');
			t16 = getRadioButtonSelectedValue(form.cont);
			t17 = getRadioButtonSelectedValue(form.server);
			t18 = getRadioButtonSelectedValue(form.aloj);
			t19 = form.procesador.checked;
			t20 = form.fuente.checked;
			t21 = form.remota.checked;
			t22 = form.memoria.value;
			t23 = getRadioButtonSelectedValue(form.disco);
			if(t23!="no"){
				t24b = "select_disco_"+t23;
				t24 = eval('form.'+t24b+'.value');
			}else{
				t24="";
			}
			t25 = getRadioButtonSelectedValue(form.so);
			t26 = getRadioButtonSelectedValue(form.particion);
			t27 = form.particion_personalizada.value;
			t28 = form.shop_price_month.value;
			t29 = form.shop_price_periodo.value;
			t30 = form.shop_price_periodo_mas_alta.value;
		}else{
			id = document.getElementById('contaj');
			if(form.formulario.value == "Legal"){
				t16 = form.cargo.value;
				t17 = form.chk_mcomunitaria.checked;
				t18 = form.chk_mnacional.checked;
				t19 = form.chk_minternacional.checked;
				t20 = form.chk_pdatos.checked;
				t21 = form.chk_psoftware.checked;
				t22 = form.chk_pweb.checked;
				t23 = form.chk_auditoria.checked;
			}else if(form.formulario.value == "Dominios tel"){
				t16 = form.dominio.value;
			}
		}
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/f_configOk.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		
		if(form.formulario.value == "ConfiguradorDedicados"){
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&periodo="+t16+"&servidor="+t17+"&alojamiento="+t18+"&procesador="+t19+"&fuente="+t20+"&remota="+t21+"&memoria="+t22+"&disco="+t23+"&discoGB="+t24+"&so="+t25+"&particion="+t26+"&particion_personalizada="+t27+"&precio_mes="+t28+"&precio_periodo="+t29+"&precio_periodo_alta="+t30);
		}else if(form.formulario.value == "Legal"){
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&cargo="+t16+"&chk_mcomunitaria="+t17+"&chk_mnacional="+t18+"&chk_minternacional="+t19+"&chk_pdatos="+t20+"&chk_psoftware="+t21+"&chk_pweb="+t22+"&chk_auditoria="+t23);
		}else if(form.formulario.value == "Dominios tel"){
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&dominio="+t16);
		}else{
			ajax.send("motivo="+t1+"&nombre="+t2+"&email="+t3+"&telefono="+t4+"&empresa="+t5+"&provincia="+t6+"&comentarios="+t7+"&codigo="+t8+"&agente="+t9+"&seccion="+t10+"&idioma="+t11+"&charset="+t12+"&dpto="+t13+"&acepta="+t14+"&formulario="+t15+"&news="+t16);
		}
		
	}
	
	/* fin configurador dedicados*/



/* noticias home */		
	/*function cargarDatosNoticias(num,limit,maxchars,tipo){
		t1 = num;
		t2 = limit;
		t3 = maxchars;
		t4 = tipo;
		if(tipo == "noticias"){
			id = document.getElementById('noti');
		}else if(tipo == "eventos"){
			id = document.getElementById('even');
		}
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias_conn.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("num="+t1+"&limit="+t2+"&maxchars="+t3+"&tipo="+t4);
	}
	function cargarNoticiaHome(num,tipo){
		t1 = num;
		t2 = tipo;
		if(tipo == "noticias"){
			id = document.getElementById('noti');
		}else if(tipo == "eventos"){
			id = document.getElementById('even');
		}
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("num="+t1+"&tipo="+t2);
	}*/
/* fin noticias home */	

/* noticias home */		
	function cargarNoticiaHome(num,tipo){
		t1 = num;
		t2 = tipo;
		if(tipo == "Actualidad"){
			id = document.getElementById('noti');
		}else if(tipo == "Eventos"){
			id = document.getElementById('even');
		}
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias2.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		if(tipo == "Actualidad"){
			ajax.send("numNot="+t1+"&tipo="+t2);
		}else if(tipo == "Eventos"){
			ajax.send("numEve="+t1+"&tipo="+t2);
		}
	}
	function cargarDatosNoticias2(limitNot,limitEve,maxchars){
		t3 = limitNot;
		t4 = limitEve;
		t5 = maxchars;
		id = document.getElementById('noti');
		id2 = document.getElementById('even');
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias_conn2.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax2=nuevoAjax();
		ajax2.open("POST", "/marketing/formContactHome/noticias_conn2.php",true);
		ajax2.onreadystatechange=function() {
			if (ajax2.readyState==4) {
				id2.innerHTML = ajax2.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("limitNot="+t3+"&limitEve="+t4+"&maxchars="+t5+"&tipo=Actualidad");
		ajax2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax2.send("limitNot="+t3+"&limitEve="+t4+"&maxchars="+t5+"&tipo=Eventos");
	}
	function cargarNoticiaHome2(numNot,numEve){
		t1 = numNot;
		t2 = numEve;
		id = document.getElementById('noti');
		id2 = document.getElementById('even');
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias2.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax2=nuevoAjax();
		ajax2.open("POST", "/marketing/formContactHome/noticias2.php",true);
		ajax2.onreadystatechange=function() {
			if (ajax2.readyState==4) {
				id2.innerHTML = ajax2.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("numNot="+t1+"&numEve="+t2+"&tipo=Actualidad");
		ajax2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax2.send("numNot="+t1+"&numEve="+t2+"&tipo=Eventos");
	}
/* fin noticias home */	
/* inicio noticias Actualidad y acens.tv */
	function cargarDatosNoticias2tv(limitNot,limitEve,maxchars){
		t3 = limitNot;
		t4 = limitEve;
		t5 = maxchars;
		id = document.getElementById('noti');
		id2 = document.getElementById('even');
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias_conn2tv.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax2=nuevoAjax();
		ajax2.open("POST", "/marketing/formContactHome/noticias_conn2tv.php",true);
		ajax2.onreadystatechange=function() {
			if (ajax2.readyState==4) {
				id2.innerHTML = ajax2.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("limitNot="+t3+"&limitEve="+t4+"&maxchars="+t5+"&tipo=Actualidad");
		ajax2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax2.send("limitNot="+t3+"&limitEve="+t4+"&maxchars="+t5+"&tipo=acens.tv");
	}
	function cargarNoticiaHome2tv(numNot,numEve){
		t1 = numNot;
		t2 = numEve;
		id = document.getElementById('noti');
		id2 = document.getElementById('even');
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/formContactHome/noticias2.php",true);
		ajax.onreadystatechange=function() {
			if (ajax.readyState==4) {
				id.innerHTML = ajax.responseText
			}
		}
		ajax2=nuevoAjax();
		ajax2.open("POST", "/marketing/formContactHome/noticias2.php",true);
		ajax2.onreadystatechange=function() {
			if (ajax2.readyState==4) {
				id2.innerHTML = ajax2.responseText
			}
		}
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("numNot="+t1+"&numEve="+t2+"&tipo=Actualidad");
		ajax2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax2.send("numNot="+t1+"&numEve="+t2+"&tipo=acens.tv");
	}
/* fin noticias Actualidad y acens.tv */	



//Url.encode(this.value)
/**
*
*  URL encode / decode
*  http://www.webtoolkit.info/
*
**/
 
var Url = {
 
	// public method for url encoding
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},
 
	// public method for url decoding
	decode : function (string) {
		return this._utf8_decode(unescape(string));
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
 
}

function getRadioButtonSelectedValue(ctrl){
    for(i=0;i<ctrl.length;i++)
        if(ctrl[i].checked) return ctrl[i].value;
}
