/*
 * m1Site.default.js - Biblioteca Javascript base m1Site
 *
 * Copyright (c) 2010 m1a1
 * Copia nao autorizada
 */

var m1SiteIP = 'http://www.m1a1.com.br/';
var divProductExpanded = '';
var newDivNoticia = '';  
var nomePaginaDestino = '';

var m1SiteDefault = 
{
    init: function()
    {
		m1SiteDefault.slider.init();
        m1SiteDefault.buttonHover.init();

        nomePaginaDestino = jQuery("#txtNomePaginaDestino").val();               

        jQuery('#hypHeadLines').click(function()
        {
            jQuery('#' + divProductExpanded).hide();
                        
            jQuery("#divHeadLines").hide();
            jQuery("#divTopoNoticias").show();
            jQuery("#divNoticias").show(300, function()
            {
               m1SiteDefault.listarNoticias(); 
            });

        });

//        jQuery('#hypHeadLineDetail').click(function(ev)
//        {
//            window.open("http://www.m1a1.com.br/talkdoor/lwf/?id=26", 'Brasil Sabor em Tempo Real','width=460,height=598');
//            window.open('http://www.m1a1.com.br/talkdoor/lwf/brasilsabor', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=460,height=598');
//            ev.preventDefault();
//            return false;
//        });

        jQuery("#divTopoNoticias").corner("round 5px");
        jQuery("#divHeadLines").corner("round 5px");
        
        // m1SiteDefault.configurarFormClienteEditar();
        
        // m1SiteDefault.prepararValidacoesCliente();

        jQuery("#hypInicio").bind('click', function()
        { 
            //jQuery('#' + divProductExpanded).hide(300, function() 
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                m1SiteDefault.expandirProduto('divExpandem1a1');
            });

            return false;
        });

        jQuery("#hypQuemSomos").bind('click', function()
        { 
            //jQuery('#' + divProductExpanded).hide(300, function() 
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                m1SiteDefault.expandirProduto('divExpandem1a1');
            });

            return false;
        });

        jQuery("#hypProdutos").bind('click', function()
        { 
            //jQuery('#' + divProductExpanded).hide(300, function() 
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                m1SiteDefault.expandirProduto('divExpandMobile');
            });

            return false;
        });


        jQuery("#hypContato").bind('click', function()
        { 
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                m1SiteDefault.expandirProduto('divExpandContato');
                
//                jQuery('#btnEnviar').attr("disabled", "");

//                jQuery("#txtNome").val('');
//                jQuery("#txtEmail").val('');
//                jQuery("#txtTelefoneFixo").val('');
//                jQuery("#txtTelefoneCelular").val('');
//                jQuery("#txtMensagem").val('');
//                
//                setTimeout("jQuery('#txtNome').focus()", 50);

            });

            return false;
        });
                
        m1SiteDefault.prepararIconeProduto("imgm1a1Icon", "divExpandem1a1", "", "");
        m1SiteDefault.prepararIconeProduto("imgMobileIcon", "divExpandMobile", "", "");
        m1SiteDefault.prepararIconeProduto("imgm1SMSIcon", "divExpandm1SMS", "", "");
        m1SiteDefault.prepararIconeProduto("imgTalkDoorIcon", "divExpandTalkDoor", "divMaisTalkDoor", "divDetalhesTalkDoor");
        m1SiteDefault.prepararIconeProduto("imgm1BlueIcon", "divExpandm1Blue", "", "");
        m1SiteDefault.prepararIconeProduto("imgCupomWebIcon", "divExpandCupomWeb", "", "");        
        m1SiteDefault.prepararIconeProduto("imgm1VoiceIcon", "divExpandm1Voice", "", "");        
        m1SiteDefault.prepararIconeProduto("imgm1EmailIcon", "divExpandm1Email", "", "");   
        

        m1SiteDefault.prepararIconeProduto("imgMobileIcon1", "divExpandMobile", "", "");
        m1SiteDefault.prepararIconeProduto("imgm1SMSIcon1", "divExpandm1SMS", "", "");
        m1SiteDefault.prepararIconeProduto("imgTalkDoorIcon1", "divExpandTalkDoor", "divMaisTalkDoor", "divDetalhesTalkDoor");
        m1SiteDefault.prepararIconeProduto("imgm1BlueIcon1", "divExpandm1Blue", "", "");
        m1SiteDefault.prepararIconeProduto("imgCupomWebIcon1", "divExpandCupomWeb", "", "");        
        m1SiteDefault.prepararIconeProduto("imgm1VoiceIcon1", "divExpandm1Voice", "", "");        
        m1SiteDefault.prepararIconeProduto("imgm1EmailIcon1", "divExpandm1Email", "", "");   

        m1SiteDefault.prepararIconeProduto("imgm1SMSIcon2", "divExpandm1SMS", "", "");
        m1SiteDefault.prepararIconeProduto("imgTalkDoorIcon2", "divExpandTalkDoor", "divMaisTalkDoor", "divDetalhesTalkDoor");
        m1SiteDefault.prepararIconeProduto("imgm1BlueIcon2", "divExpandm1Blue", "", "");
        m1SiteDefault.prepararIconeProduto("imgCupomWebIcon2", "divExpandCupomWeb", "", "");        
        m1SiteDefault.prepararIconeProduto("imgm1VoiceIcon2", "divExpandm1Voice", "", "");        
        m1SiteDefault.prepararIconeProduto("imgm1EmailIcon2", "divExpandm1Email", "", "");   

        
        jQuery("#hypMaisTalkDoor").bind('click', function()
        { 
            jQuery("#divMaisTalkDoor").hide(300);
            jQuery("#divExpandTalkDoor").height('100%');
            jQuery("#divDetalhesTalkDoor").show(300);
            
            return false;
        });
        
        jQuery('#dialog').dialog({
            modal: true,
            height: 400,
            width: 360,
            draggable: true,
            resizeable: true,		
            autoOpen: false,
            buttons: {
                "Ok": function() 
                { 
                    // Limpar o dialog
                    jQuery('#dialog').html('');	        
	                jQuery(this).dialog("close"); 
                }
            }
        });
        
        jQuery('#LwfThumb').click(function()
        {
            jQuery('#dialog').html("<img src='http://www.m1a1.com.br/Library/Images/System/NovoSite/Lwf-Thumb.gif' />");
            jQuery('#dialog').dialog('option', 'width', 350);
            jQuery('#dialog').dialog('option', 'height', 550);                
            jQuery(".ui-dialog-titlebar").hide();                
            jQuery('#dialog').dialog('open');
            
            return false;
        });	

        jQuery('#DashBoardThumb').click(function()
        {
            jQuery('#dialog').html("<img src='http://www.m1a1.com.br/Library/Images/System/NovoSite/TalkDoor-Dashboar-Thumb-794x425.gif' />");
            jQuery('#dialog').dialog('option', 'width', 840);
            jQuery('#dialog').dialog('option', 'height', 490);                
            jQuery(".ui-dialog-titlebar").hide();                
            jQuery('#dialog').dialog('open');
            
            return false;

        });	

        jQuery('#LiveThumb').click(function()
        {
            jQuery('#dialog').html("<img src='http://www.m1a1.com.br/Library/Images/System/NovoSite/TalkDoor-Live-Thumb.PNG' />");
            jQuery('#dialog').dialog('option', 'width', 580);
            jQuery('#dialog').dialog('option', 'height', 430);                
            jQuery(".ui-dialog-titlebar").hide();                
            jQuery('#dialog').dialog('open');
            
            return false;

        });	


        jQuery('#divLwf').hide();
        jQuery('#divRemote').show();
        nomeModuloAberto = 'divRemote';            
        

		jQuery('#btnLwf').click(function()
		{
            jQuery("#" + nomeModuloAberto).hide();
            nomeModuloAberto = 'divLwf';
            jQuery('#divLwf').show();
            return false;
		});
		
        jQuery('#btnLive').click(function()
        {
            jQuery("#" + nomeModuloAberto).hide();
            nomeModuloAberto = 'divLive';
            jQuery('#divLive').show();
            return false;
        });	

        jQuery('#btnRemote').click(function()
        {
            jQuery("#" + nomeModuloAberto).hide();
            nomeModuloAberto = 'divRemote';
            jQuery('#divRemote').show();
            return false;
        });	

        jQuery('#btnDashboard').click(function()
        {
            jQuery("#" + nomeModuloAberto).hide();
            nomeModuloAberto = 'divDashboard';
            jQuery('#divDashboard').show();
            return false;
        });	
        
        if(nomePaginaDestino.toLowerCase() == 'talkdoor')
        {
            divProductExpanded = "divExpandem1a1"; 
            
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                m1SiteDefault.expandirProduto('divExpandTalkDoor');
            });

            return false;        
        }
        else
        {
            jQuery("#divExpandem1a1").show(300);
            divProductExpanded = "divExpandem1a1";        
        }


        if(nomePaginaDestino.toLowerCase() == 'm1sms' || nomePaginaDestino.toLowerCase() == 'sms')
        {
            divProductExpanded = "divExpandem1a1"; 
            
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                m1SiteDefault.expandirProduto('divExpandm1SMS');
            });

            return false;        
        }
        else
        {
            jQuery("#divExpandem1a1").show(300);
            divProductExpanded = "divExpandem1a1";        
        }

    },
   
    prepararIconeProduto: function(nomeIconeProduto, nomeDivProduto, nomeDivMais, nomeDivDetalhes)
    {
        jQuery("#" + nomeIconeProduto).bind('click', function()
        { 
            jQuery('#' + divProductExpanded).hide(300, function() 
            {
                jQuery('#' + divProductExpanded).height('315px');
                
                if(nomeDivMais != "")
                    jQuery('#' + nomeDivMais).show();                
                
                if(nomeDivDetalhes != "")
                    jQuery('#' + nomeDivDetalhes).hide();
                
                m1SiteDefault.expandirProduto(nomeDivProduto);
            });
        });
                        
        setInterval 
        ( 
            function()
            { 
                jQuery('#' + nomeIconeProduto).effect('shake', { times:3, distance:5 }, 20)
            }, 
            5000
        ); 
    
    },
   
    expandirProduto: function(nomeDivProduto)
    {
        jQuery("#divHeadLines").show();
        jQuery("#divTopoNoticias").hide();
        jQuery("#divNoticias").hide();
    
        divProductExpanded = nomeDivProduto;        
        // jQuery("#" + nomeDivProduto).show(1000);
        jQuery("#" + nomeDivProduto).show(300);
    },
    
   
    pausar: function(numberMillis)
    {
        var now = new Date();
        var exitTime = now.getTime() + numberMillis;
        while (true) 
        {
            now = new Date();
            if (now.getTime() > exitTime) 
                return;
        }
    },
    
    /**
    * Metodo para slider de produtos
    **/
    slider: {

        init: function() 
        {
            var outter = '#container-slider';
            var holder = jQuery(outter).find('ul');
            var items = jQuery(holder).find('li');
            var left = jQuery(outter).find('.back');
            var right = jQuery(outter).find('.forward');
            var amountItems = jQuery(items).length;
            var widthItem = 231;
            var widthHolder = widthItem * amountItems;
            jQuery(holder).width(widthHolder);
            jQuery(items).clone().appendTo(holder);
            jQuery(holder).css({ left: parseInt(jQuery(holder).css('left')) - (2 * widthItem) });
            jQuery(holder).width(widthHolder * 2);
            var allItems = jQuery(holder).find('li');
            //jQuery(allItems).neoHighlight({ duration: 400 });
            var automatic = true;
            setInterval(function() { if (automatic) { setHolderLeft("right"); } }, 4000);
            jQuery(allItems).hover(function() { automatic = false }, function() { automatic = true });

            function setHolderLeft(direction) {
                automatic = false;
                var currentPosition = parseInt(jQuery(holder).css('left'));
                var newLeft = direction == 'left' ? currentPosition + widthItem : currentPosition - widthItem;
                jQuery(left).unbind('click');
                jQuery(right).unbind('click');
                jQuery(left).bind('click', function() { automatic = false; return false; });
                jQuery(right).bind('click', function() { automatic = false; return false; });
                jQuery(holder).animate({ left: newLeft }, { queue: false, duration: 700, easing: 'easeOutBack', complete: function() {
                    if (direction == 'right') {
                        jQuery(holder).find('li:first').appendTo(holder);
                        jQuery(holder).css({ left: parseInt(jQuery(holder).css('left')) + widthItem });
                    } else {
                        jQuery(holder).find('li:last').prependTo(holder);
                        jQuery(holder).css({ left: parseInt(jQuery(holder).css('left')) - widthItem });
                    }
                    jQuery(left).unbind('click');
                    jQuery(right).unbind('click');
                    jQuery(left).bind('click', function() { setHolderLeft('left'); return false; });
                    jQuery(right).bind('click', function() { setHolderLeft('right'); return false; });
                    automatic = true;
                }
                });
            }
        }
    },

    buttonHover: 
    {
        init: function() 
        {
            jQuery('.info-left p.button a').mouseover(function() 
            {
                jQuery(this).neoHover();
            });

            jQuery('#container-slider a.back, a.forward').neoHover();
        }
    },
    
    prepararValidacoesCliente: function()
    {
        
        jQuery.validator.addMethod("telefoneValido", function(sTelefone)
        {
            var phoneRE = /^\(\d\d\) \d\d\d\d-\d\d\d\d$/;
            
            var sTelefoneReduzido = sTelefone.replace(/[\(\)\-\ ]/g, '');
            
            if (sTelefone.match(phoneRE) || sTelefoneReduzido.length == 0) 
            {
                return true;
            }
            else 
            {
                return false;
            }
        });
        
        var validator = jQuery("#formEditar").validate(
        {
            rules: 
            {
                txtNome: 
                {
                    required: true,
                    minlength: 3
                },
                txtEmail: 
                {
                    email: true,
					required:true
                },
                txtTelefoneFixo: 
                {
                    required: true,
                    telefoneValido: true
                },
                txtTelefoneCelular: 
                {
                    required: true,
                    telefoneValido: true
                },
                txtMensagem: 
                {
                    required: true,
                    minlength: 3
                }
                
            },
            
            messages: 
            {
                txtNome: "Informe o nome",
                txtEmail: "E-mail inv&aacute;lido",                
                txtTelefoneFixo: "Telefone inv&aacute;lido",
                txtTelefoneCelular: "Telefone inv&aacute;lido",
                txtMensagem: "Informe a mensagem"
            },
            
            // the errorPlacement has to take the table layout into account
            errorPlacement: function(error, element)
            {
                if (element.is(":radio")) 
                    error.appendTo(element.parent().next().next());
                else 
                    if (element.is(":checkbox")) 
                        error.appendTo(element.next());
                    else 
                        error.appendTo(element.parent().next());
            },
            
            // specifying a submitHandler prevents the default submit, good for the demo
            submitHandler: function()
            {
                m1SiteDefault.postarFormularioCliente();
                
                return false;
            },
            
            // set this class to error-labels to indicate valid fields
            success: function(label)
            {
                // set &nbsp; as text for IE
                label.html("&nbsp;").addClass("checked");
            }
        });
        
    },
    
    configurarFormClienteEditar: function()
    {
        jQuery("#txtTelefoneFixo").mask("(99) 9999-9999", 
        {
            placeholder: " "
        });

        jQuery("#txtTelefoneCelular").mask("(99) 9999-9999", 
        {
            placeholder: " "
        });
        
    },
    
    mostrarNoticia: function(codigoNoticia)
    {
        try 
		{
			// Buscar dados do timeline do TalkDoor
			jQuery.getJSON("noticias/getNoticiaDetalheJson.aspx?id=" + codigoNoticia , function(aDados)
			{
				if (aDados != '') 								
				{
					try 
					{
					    jQuery('#divListaNoticias').html('');

					    newDivNoticia = '';
						
					    // Primeira notícia
					    newDivNoticia += "<table width='100%' border='0' cellpadding='2'>";
                        newDivNoticia += "  <tr>";
                        
                        // Primeira coluna
                        newDivNoticia += "<td>";
                        
                        if(aDados[a].notThumbNailUrl != '')
                        {
                            newDivNoticia += "<img src='" + aDados[a].notThumbNailUrl + "' alt='' border='0'/>";
                        }
                        
                        newDivNoticia += "</td>";
                        
                        // Segunda coluna
                        newDivNoticia += "<td>";

                        newDivNoticia += "<strong>" + aDados[a].notTitulo + "</strong>";						
					    newDivNoticia += "<br/>";
                        newDivNoticia += aDados[a].D_A_T_A_I_N_C +  "<br/>";
                        newDivNoticia += aDados[a].notSinopse + "<br/><br/>";
                        
                        newDivNoticia += aDados[a].notConteudo;
                        
                        newDivNoticia += "</td>";
                        newDivNoticia += "</tr>";                                
                        newDivNoticia += "</table>";
                        
                        newDivNoticia += "<table>";
                        newDivNoticia += "<tr>";
                        newDivNoticia += "<td class='linhadivExpans'>&nbsp";
                        newDivNoticia += "</td>";
                        newDivNoticia += "</tr>";
                        newDivNoticia += "</table>";
                        

                        newDivNoticia += "<br/>";
                        newDivNoticia += "<br/>";                                
												
					}
					catch(err)					
					{
						bRetorno = false;
					}					
				}
				else				
				{
				}
												
			});
		}
		catch(error)
		{
			//alert(err);
		}
    
    },
    
    listarNoticias: function()
    {
        try 
		{
			// Buscar dados do timeline do TalkDoor
			jQuery.getJSON("noticias/getNoticiasJson.aspx", function(aDados)
			{
				if (aDados != '') 								
				{
					try 
					{
					    jQuery('#divListaNoticias').html('');
					    
						// Adiciona as linhas				
						for (var a = 0; a < aDados.length; a++) 
						{
						    newDivNoticia = '';
							
							if(a == 0)
							{
							    // Primeira notícia
							    newDivNoticia += "<table width='100%' border='0' cellpadding='2'>"
                                newDivNoticia += "  <tr>";
                                
                                // Primeira coluna
                                newDivNoticia += "<td>";
                                
                                if(aDados[a].notThumbNailUrl != '')
                                {
                                    newDivNoticia += "<img src='" + aDados[a].notThumbNailUrl + "' alt='' border='0'/>";
                                }
                                
                                newDivNoticia += "</td>";
                                
                                // Segunda coluna
                                newDivNoticia += "<td>";
                                if(aDados[a].notLocal == 2)
                                {
                                    // Externa
                                    newDivNoticia += "<a href='" + aDados[a].notOrigemSiteUrl + "' target='_blank'>" +  "<strong>" + aDados[a].notTitulo + "</strong>&nbsp;" + "<img src='library/images/system/novosite/NoticiaExternaIcon.PNG' width='16' height='16' alt='' border='0'/>" + "</a>";
                                }
                                else
                                {
                                    // Interna
                                    newDivNoticia += "<a id='hypNoticia" + aDados[a].id + "' href='#'>" + "<strong>" + aDados[a].notTitulo + "</strong></a>";
                                }
    							
							    newDivNoticia += "<br/>";
                                newDivNoticia += aDados[a].D_A_T_A_I_N_C +  "<br/>";
                                newDivNoticia += aDados[a].notSinopse;
                                
                                if(aDados[a].notLocal == 1)
                                {
                                    // Interna
                                    newDivNoticia += "&nbsp;<a id='hypNoticia1" + aDados[a].id + "'href='#'>Leia mais</a><br/><br/>";
                                }
                                else
                                {
                                    // Externa
                                    newDivNoticia += "&nbsp;<a href='" + aDados[a].notOrigemSiteUrl + "' target='_blank'>Leia mais: " + aDados[a].notOrigemSite + "&nbsp;" + "<img src='library/images/system/novosite/NoticiaExternaIcon.PNG' width='16' height='16' alt='' border='0'/>" + "</a><br/><br/>";
                                }                            

                                newDivNoticia += "</td>";
                                newDivNoticia += "</tr>";                                
                                newDivNoticia += "</table>";
                                
                                newDivNoticia += "<table>";
                                newDivNoticia += "<tr>";
                                newDivNoticia += "<td class='linhadivExpans'>&nbsp";
                                newDivNoticia += "</td>";
                                newDivNoticia += "</tr>";
                                newDivNoticia += "</table>";
                                

                                newDivNoticia += "<br/>";
                                newDivNoticia += "<br/>";
                                
							}
							else
							{
                                if(aDados[a].notLocal == 2)
                                {
                                    // Externa
                                    newDivNoticia += "<a href='" + aDados[a].notOrigemSiteUrl + "' target='_blank'>" +  "<strong>" + aDados[a].notTitulo + "</strong>&nbsp;" + "<img src='library/images/system/novosite/NoticiaExternaIcon.PNG' width='16' height='16' alt='' border='0'/>" + "</a>";
                                }
                                else
                                {
                                    // Interna
                                    newDivNoticia += "<a href='#'>" + "<strong>" + aDados[a].notTitulo + "</strong></a>";
                                }
    							
							    newDivNoticia += "<br/>";
                                newDivNoticia += aDados[a].D_A_T_A_I_N_C +  "<br/>";
                                newDivNoticia += aDados[a].notSinopse;
                                
                                if(aDados[a].notLocal == 1)
                                {
                                    // Interna
                                    newDivNoticia += "&nbsp;<a href='#'>Leia mais</a><br/><br/>";
                                }
                                else
                                {
                                    // Externa
                                    newDivNoticia += "&nbsp;<a href='" + aDados[a].notOrigemSiteUrl + "' target='_blank'>Leia mais: " + aDados[a].notOrigemSite + "&nbsp;" + "<img src='library/images/system/novosite/NoticiaExternaIcon.PNG' width='16' height='16' alt='' border='0'/>" + "</a><br/><br/>";
                                }                            
                            }
                            
                            jQuery('#divListaNoticias').append(newDivNoticia);
						}						
						
						
						
//						for (var a = 0; a < aDados.length; a++) 
//						{
//						    jQuery("#divItem" + aDados[a].id).corner("round 3px");
//						}
//						
					}
					catch(err)					
					{
						bRetorno = false;
					}					
				}
				else				
				{
				}
												
			});
		}
		catch(error)
		{
			//alert(err);
		}
    },
                
    postarFormularioCliente: function()
    {
        jQuery('#btnEnviar').attr("disabled", "disabled");
        
//        // Verificar codigoItemAtual
//        // codigo do Item em foco (se for 0: Inclusao, maior que 0: Alteracao)
//        
//        // Adicionar variaveis do formulario principal, nao incluidas neste form
//        var conteudoPostGeral = "&codigoItem=" + jQuery("#txtCodigoItem").val() + "&codigoUsuario=" + jQuery("#txtCodigoUsuario").val();
//        
//        // formata dados do formulario automaticamente para form post
//        var conteudoPost = jQuery('#formEditar').serialize();
//        
//        conteudoPost = m1SiteAdmin.removerViewState(conteudoPost);
//        
//        conteudoPost = conteudoPost + conteudoPostGeral;
//        
//        jQuery.ajax(
//        {
//            type: "POST",
//            url: m1SiteIP + "admin/clientes/clientepostar.aspx",
//            dataType: 'json',
//            contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
//            data: conteudoPost,
//            success: function(retorno)
//            {
//                if (retorno.codigo == post_OK) 
//                {
//                    humanMsg.displayMsg('As informa&ccedil;&otilde;es foram salvas com sucesso.', 400);
//                    
//                    jQuery("#RightPane").load(m1SiteIP + "admin/clientes/listarClientes.aspx", function()
//                    {
//                    });
//                }
//                else 
//                {
//			        jQuery('#btnEnviar').attr("disabled", "");
//					
//                    if (retorno.codigo == post_Teste) 
//                    {
//                        document.write(retorno.mensagem);
//                    }
//                    else 
//                    {
//                        if (retorno.codigo == post_RegistroExiste) 
//                        {
//                            humanMsg.displayMsg('J&aacute; existe um cliente com este endere&cedil;o de e-mail.', 400);
//                        }
//                        else 
//                        {
//                            if (retorno.codigo == post_Falhou) 
//                            {
//                                humanMsg.displayMsg('N&atilde;o foi poss&iacute;vel salvar as informa&ccedil;&otilde;es: ' + retorno.mensagem, 400);
//                            }
//                            else 
//                            {
//                                humanMsg.displayMsg("Retorno n&atilde;o previsto: " + retorno.mensagem);
//                            }
//                        }
//                    }
//                }
//            },
//            error: function(retorno)
//            {
//		        jQuery('#btnSalvar').attr("disabled", "");
//		        jQuery('#btnSalvar1').attr("disabled", "");
//				
//                humanMsg.displayMsg('N&atilde;o foi poss&iacute;vel salvar as informa&ccedil;&otilde;es.', 400);
//            }
//        });
//        
    }
    
};


//  Onload Functions
jQuery(document).ready(function()
{
    m1SiteDefault.init();
})

