/* GZIP on the fly by Raccoon Framework http://www.wt.com.mx/ */ var mailRegex = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; var contacto = function() { Dialog.confirm( $('contact').innerHTML, { className:"freedback", id : "enviar", width:550, okLabel: "Enviar", cancelLabel: "Cancelar", zIndex: 100000, title: "Contactenos", onOk:function(win){ var email = $('email').value; var firstname = $('firstname').value; var lastname = $('lastname').value; var phone = $('phone').value; var city = $('city').value; var comments = $('comments').value; if(!email.match(mailRegex)){ $('contact_msg').innerHTML='Por favor ingrese una direccion de correo electronico valida'; $('contact_msg').show(); Windows.focusedWindow.updateHeight(); new Effect.Shake(Windows.focusedWindow.getId()); return false; } if (firstname === "" || lastname === ""){ $('contact_msg').innerHTML='Por favor ingrese su nombre'; $('contact_msg').show(); Windows.focusedWindow.updateHeight(); new Effect.Shake(Windows.focusedWindow.getId()); return false; } new Ajax.Request('../index.php/ajax/Contact/contact/', { method:'post', parameters: { email : email, firstname : firstname, lastname :lastname, phone : phone, city : city, comments : comments }, onComplete: function(transport){ Dialog.closeInfo(); Dialog.alert("
Gracias por contactarnos.

Su opinión es muy importante para nosotros.

En breve nos comunicaremos con usted.
", { width:400, height:140, okLabel: "Ok", className:"freedback", ok:function(win) { Dialog.closeInfo(); } } ); } }); } } ); }