$(function(){    
    $('#tabs').tabs();

    $('#tabs .tabs').hide();
    //mostra apenas o conteudo da primeira aba
    $('#tabs .tabs:first').show();

    $('#tabs li a').click(function(){
        var i = $('#tabs li a').index(this);

        $('#tabs .tabs').hide();
        //mostra apenas a aba com indice igual ao do link
        $('#tabs .tabs').eq(i).show();
       
    });

    $('#dialog_link, ul#icons li').hover(
        function() { $(this).addClass('ui-state-hover'); },
        function() { $(this).removeClass('ui-state-hover'); }
    );   

    var i = 0;
    $('#indicacao span a').click(function(){
        
        if(i < 5) {
            $('#indicacao span').append('<input type="text" name="mais-email" onfocus="javascript:this.value=\'\'" onblur="javascript:if (this.value == \'\') {this.value = \'E-mail do amigo\'}" value="E-mail do amigo" />');
        }
        i++;
        return false;        
    }); 
    
});

function correctPNG()
   {
   for(var i=0; i<document.images.length; i++)
      {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
         img.outerHTML = strNewHTML
         i = i-1
         }
      }
   }
window.attachEvent("onload", correctPNG);


