/* GZIP by Raccoon Framework */ var _ = {}; _.extend = jQuery.extend; _.extend({ mail_regexp: /^[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]$/, alert: function(message, callback){ $.blockUI({ message: "" + "
" + message + "
" + "" + ""+message+"
" + "
"
});
},
showProduct: function(id,lang){
_.loading();
$("#product").load("index.php/page,producto/lang,"+lang+"/id," + id, "", function(){
$.blockUI({
message: $('#product'),
css: {
width: 900 + 'px',
height: 500 + 'px',
top: ($(window).height() - 500) / 2 + 'px',
left: ($(window).width() - 900) / 2 + 'px'
}
});
});
},
closeProduct: function(){
$.unblockUI();
},
changeProduct: function(id){
$(".presentacion_on").attr("class","presentacion_off");
$("#producto"+id).attr("class","presentacion_on");
},
showContact: function(id){
$.blockUI({
message: $('#contact'),
css: {
width: 900 + 'px',
height: 500 + 'px',
top: ($(window).height() - 500) / 2 + 'px',
left: ($(window).width() - 900) / 2 + 'px'
}
});
$('#contact #btn_cancel').click(function(){
$('#contact #registry_error_msg').html('');
$.unblockUI();
});
$('#contact #tache').click(function(){
$('#contact #registry_error_msg').html('');
$.unblockUI();
});
$('#contact #btn_ok').click(function(){
var contact_dpto = $("#contact_form #contact_dpto").val();
var contact_name = $("#contact_form #contact_name").val();
var contact_email = $("#contact_form #contact_email").val();
var contact_phone = $("#contact_form #contact_phone").val();
var contact_city = $("#contact_form #contact_city").val();
var contact_comments = $("#contact_form #contact_comments").val();
if (!contact_email.match(_.mail_regexp)) {
alert("Por favor ingresa una cuenta de correo vĂ¡lida.");
return false;
}
if (contact_name == "") {
alert("Ingresa tu nombre");
return false;
}
if (contact_comments == "") {
alert("Ingresa tus comentarios");
return false;
}
$.post("index.php/mode,json/control,Contact.index/", {
contact_name: contact_name,
contact_email: contact_email,
contact_comments: contact_comments,
contact_dpto: contact_dpto,
contact_phone: contact_phone,
contact_city: contact_city
}, function(json){
if (json.status == 201) {
_.alert("Su forma de contacto ha sido enviada.