
		// enviar
		function enviar () {
			if (document.getElementById("empresahidden").value.length > 0 && document.getElementById("contactohidden").value.length > 0 && document.getElementById("emailhidden").value.length > 0 && document.getElementById("telefonohidden").value.length > 0 && document.getElementById("comentarioshidden").value.length > 0) {
			
							var emailDestino = document.getElementById("emailDestino").value;
							var empresa = document.getElementById("empresahidden").value;
							var contacto = document.getElementById("contactohidden").value;
							var email = document.getElementById("emailhidden").value;
							var telefono = document.getElementById("telefonohidden").value;
							var comentarios = document.getElementById("comentarioshidden").value;
							var cliente = document.getElementById("cliente").value;
							var textoFinal = '<style> h1 {font-size:15px;color:White;} </style> <center> <div style="height:100px;widht:250px;"> <h1>  Enviando .... </h1> </div> </center>';								
							jQuery().colorbox({html:textoFinal});	
							opAjaxAdmin.sendEmailContacto(emailDestino,empresa,contacto,email,telefono,comentarios,cliente,hadlerSendEmailContacto);
			} else {
				alert('rellene todos los campos');
			}
		}
		
		// funcion que envia emails 
		function hadlerSendEmailContacto (correcto) {
			if (correcto) {
				alert('envio correcto');
				jQuery().colorbox.close();	
			} else {
				alert('envio incorrecto');
			}
			
		}
		
		
		function showContacta (email,cabecera,texto,cliente) {
		
				// vamos a cambiar el contenido de la ventana modal
				var textoFinal = "<div style=\"width: 800px;height: 600px;\"> <div id=\"mainPopupContacto\"> <div id=\"headerPopupContacto\"> <a href=\"javascript:jQuery().colorbox.close();\" class=\"cerrar\"></a> <div style=\"clear:both;height:5px;\"></div>";
				textoFinal += "<div class=\"textoCabecera\"> <h1> " + cabecera + " </h1>";
				textoFinal += "<center> <span style=\"color:white;font-weight:bolder;\">  " + texto + "</span></center></div></div>";
				textoFinal += "<div style=\"float:left;width:70%;\">";
				textoFinal += "<form class=\"formulario\" name=\"formenviar\" id=\"formenviar\">";
				textoFinal += "<input type=\"hidden\" value=\"" + email + "\" name=\"emailDestino\" id=\"emailDestino\"/>";
				textoFinal += "<input type=\"hidden\" value=\"\" name=\"empresahidden\" id=\"empresahidden\"/>";
				textoFinal += "<input type=\"hidden\" value=\"\" name=\"contactohidden\" id=\"contactohidden\"/>";
				textoFinal += "<input type=\"hidden\" value=\"\" name=\"emailhidden\" id=\"emailhidden\"/>";
				textoFinal += "<input type=\"hidden\" value=\"\" name=\"telefonohidden\" id=\"telefonohidden\"/>";
				textoFinal += "<input type=\"hidden\" value=\"\" name=\"comentarioshidden\" id=\"comentarioshidden\"/>";
				textoFinal += "<input type=\"hidden\" value=\"" + cliente + "\" name=\"cliente\" id=\"cliente\"/>";
				textoFinal += "<table>";
					textoFinal += "<tr>";
						
						textoFinal += "<td>";
							textoFinal += "<label> Empresa : </label>";
						textoFinal += "</td>";
						textoFinal += "<td>";	
							textoFinal += "<input type=\"text\" name=\"empresa\" id=\"empresa\" value=\"\" onchange=\"javascript:document.getElementById('empresahidden').value=this.value;\"/>";
						textoFinal += "</td>";
						
					textoFinal += "</tr>";
					textoFinal += "<tr>";	
						textoFinal += "<td>";
							textoFinal += "<label> Contacto : </label>";
						textoFinal += "</td>";
						textoFinal += "<td>";	
							textoFinal += "<input type=\"text\" name=\"contacto\" id=\"contacto\" onchange=\"javascript:document.getElementById('contactohidden').value=this.value;\" value=\"\"/>";
						textoFinal += "</td>";
					
					textoFinal += "</tr>";
					textoFinal += "<tr>";	
						textoFinal += "<td>";
							textoFinal += "<label> E-mail : </label>";
						textoFinal += "</td>";
						textoFinal += "<td>";	
							textoFinal += "<input type=\"text\" name=\"email\" id=\"email\" onchange=\"javascript:document.getElementById('emailhidden').value=this.value;\" value=\"\"/>";
						textoFinal += "</td>";
					textoFinal += "</tr>";
					textoFinal += "<tr>";						
						textoFinal += "<td>";
							textoFinal += "<label> Tel&eacute;fono : </label>";
						textoFinal += "</td>";
						textoFinal += "<td>";	
							textoFinal += "<input type=\"text\" name=\"telefono\" id=\"telefono\" onchange=\"javascript:document.getElementById('telefonohidden').value=this.value;\" value=\"\"/>";
						textoFinal += "</td>";
					textoFinal += "</tr>";
					
					textoFinal += "<tr>";		
						textoFinal += "<td>";
							textoFinal += "<label> Comentarios : </label>";
						textoFinal += "</td>";
						textoFinal += "<td>";	
							textoFinal += "<textarea name=\"comentarios\" id=\"comentarios\" cols=10 rows=10 onchange=\"javascript:document.getElementById('comentarioshidden').value=this.value;\"></textarea>";
						textoFinal += "</td>";
						
					
					textoFinal += "</tr>";
				textoFinal += "</table>";
				textoFinal += "</form>";
				textoFinal += "</div>";
				
				textoFinal += "<div style=\"float:right;width:25%;height:345px;\">";
				textoFinal += "<a href=\"javascript:enviar();\" class=\"enviar\"></a> </div>";
				
				textoFinal += "</div></div>";
				jQuery().colorbox({html:textoFinal});										
	}
				

