$(document).ready(function() {
	
	var $slides = $("#destaque");
	var $slidePlay = $("#play");
	var $slidePause = $("#pause");
	var $slideNext = $("#next");
	var $slidePrev = $("#prev");
	var $slideControls = $("#controls");
	
	
  $('A[rel="external"]').click( function() {
    window.open( $(this).attr('href') );
    return false;
  });
  
    $('#balao, #formaweb img').hover(
    function() {
        $('#balao').show();
    }, function() {
    $('#balao').hide();
    });
        $('#balao > *').hover(
    function() {
        $('#balao').show();
    }, function() {
        $('#balao').show();
    });
    
  if($slides.size() > 0) {
		if($slidePause.size() > 0) {
			$slidePause.click(function() {
				$slides.cycle('pause');
				return false;
			});
		}
		if($slidePlay.size() > 0) {
			$slidePlay.click(function() {
				$slides.cycle('resume');
				return false;
			});
		}
	    
	    $('#slideshow').hover(function() {
	    	$slideControls.fadeIn();
		}, function() {
			$slideControls.fadeOut(); 
		});
	    
	    $slides.cycle({
	        fx:     'fade',
	        speed:   1500,
	        timeout: 4000,
	        next:   $slideNext.selector,
	        prev:   $slidePrev.selector
	    });
	}
  
  $("#qTip").css('Filter','Alpha(Opacity=90)');
  $("#qTip").css('-moz-opacity','0.9');
  $("#qTip").css('opacity','0.90');
  
  $("#destaque").corner("10px");
  $("#planos_h").corner("10px");
  $("#p_dom").corner("10px");
  $("#central").corner("10px");
  $("#mapaSite").corner("10px");
  $("#blog").corner("10px");
  $("#depoimentos").corner("10px");
  $("#pagamento").corner("10px");
  
  $("#hospedagem").corner("10px");
  $("#empresa2").corner("10px");
  $("#revenda").corner("10px");
  $("#empresa").corner("10px");
  $("#promocoes").corner("10px");
  $("#streaming").corner("10px");
  $("#vps").corner("10px");
  $("#blog").corner("10px");
  $("#dedicados").corner("10px");
  $("#dominios").corner("10px");
  $("#estrutura").corner("10px");
  $("#central").corner("10px");
  		
  		
  $(".tbs_win a").click( function() {
    $(".tbs_lin a").removeClass("m_sel");
    $(".tbs_win a").addClass("m_sel");
    
    $("#table_lin").fadeOut(500, function() {
        $("#table_win").fadeIn(2000);
    });
  });
  
  $(".tbs_lin a").click( function() {
    $(".tbs_win a").removeClass("m_sel");
    $(".tbs_lin a").addClass("m_sel");

    $("#table_win").fadeOut(500, function()
    {
        $("#table_lin").fadeIn(2000);    
    });
    
  });
  		
  $("#dominio").keypress( function() {
  	var domval = $(this).val();
  	$("#mdominio").text(domval);
  });
  
  $("#tld").change(function () {
		var str;
		var custo;
		$("select option:selected").each(function () {
			str = $(this).text();
			if (str=='.com.br') {
				custo = '50,00';
			}
			if (str=='.com') {
				custo = '30,00';
			}
			if (str=='.net') {
				custo = '30,00';
			}
			if (str=='.org') {
				custo = '30,00';
			}
			if (str=='.info') {
				custo = '30,00';
			}
			if (str=='.biz') {
				custo = '30,00';
			}
			if (str=='.ws') {
				custo = '30,00';
			}
		});
		$("#custo").text(custo);
		$("#mtld").text(str);
	})
	.change();

  
});
function calc(){
		jQuery('#msg').html('<img src="img/load.gif" alt="" />');
		$.ajax({
			type: 'POST',
			url: 'int/dedicados_calc.php',
			data: jQuery('form').serialize(),
			success: function(msg){
				jQuery('#msg').html(msg);
				}
			})
}

function mostra(div){
  $(div).animate({
    height: 'show',
    opacity: 'show'
  }, 1000);
}
function esconde(div){
  $(div).animate({
    height: 'hide',
    opacity: 'hide'
  }, 1000);
}

function form(nome) {
	document.getElementById(nome).submit();
}