$(document).ready(function() {
	
	$("#whois .botao_texto > a").click(function(){
		$.ajax({
			url: "/home/tld",
			type: "POST",
			data: {nome: $("#sld").val(), tld: $("#tld").val()},
			beforeSend: function(data){
				$("#whois .resultado").html('<img src="/images/carregando.gif" alt="Carregando..." />');
				$("#whois .resultado").fadeIn();
			},
			success: function(data){
				
				if(data.registrado){
					$("#whois .resultado").html('<div class="mensagem erro">O domínio <strong>www.'+ $("#sld").val() + $("#tld").val() +'</strong> já está registrado, tente outro nome.</div>');
				} else {
					$("#whois .resultado").html('<div class="mensagem correto">O domínio <strong>www.'+ $("#sld").val() + $("#tld").val() +'</strong> ainda não foi registrado, <a href="https://central.domhost.com.br/cart.php?a=add&domain=register&sld='+ $("#sld").val() +'&tld='+ $("#tld").val() +'" rel="external">clique aqui</a> para registrar.</div>');
				}
			}
		});
	});
  
  $("[href='#']").live('click', function() {
    return false;
  });
  
  $('a[rel="external"]').click(function() {
    window.open($(this).attr('href'));
    return false;
  });
  
  $("a.chat").click(function() {
    window.open($(this).attr('href'), '', 'width=590,height=550,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes');
	return false;
  });
  
  $('input, select, textarea').example(function() {
    return $(this).attr('title');
  }, {className: 'example'});
  
  $('a.submit').click( function() {
    $(this).parents("form").submit();
  });

  $("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});

});

var script = document.createElement("script");script.type="text/javascript";var src = "http://central.domhost.com.br/live/server.php?request=track&output=jcrpt&nse="+Math.random();setTimeout("script.src=src;document.getElementById('livezilla_tracking').appendChild(script)",1);