Cufon.replace('nav a', {
    textTransform :'uppercase'
});
Cufon.replace('h1', {
    textTransform :'uppercase'
});
Cufon.replace('h2', {
    textTransform :'uppercase'
}); 

$(document).ready(function() 
{
        $('.slideshow').cycle ({
                fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        });
        
        $('.body-slide').cycle ({
                fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        });
        
        $('#gallery a').lightBox ();
        
        if ($ ("nav li.selected").length > 0)
        {
                $ ("nav li.selected").next ().remove ();              
            
        }
        
        if ($ ("nav li.selected").prev ().hasClass ('bar'))
        {
                $ ("nav li.selected").prev ().remove ();   
        }
        
        var height = $ (window).height ();
        //$('.body-slide').css ('height', (height > $ ('#container').height () + 20 ? height : $ ('#container').height () + 20) + 'px');
        //$('.body-slide img').css ('height', (height > $ ('#container').height () + 20 ? height : $ ('#container').height () + 20) + 'px');
        
        
        /*tooltip*/
        
        var tooltip = "";
        tooltip += "<div id='ToolTipDiv'>";
        tooltip += "<table cellspacing='0' cellpadding='0' style='table-layout: fixed'>";
        tooltip += "<tr>";
        tooltip += "<td class='leftSide lt'></td>";
        tooltip += "<td colspan='2' class='centerSide top'></td>";
        tooltip += "<td class='rightSide rt'></td>";
        tooltip += "</tr>";
        tooltip += "<tr>";
        tooltip += "<td class='leftSide left'></td>";
        tooltip += "<td class='image'></td>";
        tooltip += "<td class='text'><div></div></td>";
        tooltip += "<td class='rightSide right'></td>";
        tooltip += "</tr>";
        tooltip += "<tr>";
        tooltip += "<td class='leftSide lb'></td>";
        tooltip += "<td colspan='2' class='centerSide bottom'></td>";
        tooltip += "<td class='rightSide rb'></td>";
        tooltip += "</tr>";
        tooltip += "</table>";
        tooltip += "</div>";
        
        $("body").append(tooltip);
          $("tr[title]").each(function(key, elem) {
            $(elem).hover(function(e) {
              $("body").mousemove(function(e) {
                var tipY = e.pageY - $("#ToolTipDiv").height()/2;
                var tipX = e.pageX + 16;
                $("#ToolTipDiv").css({'top': tipY, 'left': tipX});
              });
              $("#ToolTipDiv")
                .stop(true,true)
                .fadeIn("fast").css("z-index", "999");
              $("#ToolTipDiv td.text div")
                .html($(elem).attr('title'));
              if($(elem).attr("rel") != "")$("#ToolTipDiv td.image").html($(elem).attr('rel'));
              $(elem).removeAttr('title');
            }, function() {
              $("#ToolTipDiv")
                .stop(true,true)
                .fadeOut("fast").css("z-index", "0");
                $("#ToolTipDiv td.image").html("");
              $(elem).attr('title', $("#ToolTipDiv td.text div").html());
            });
          });
}); 

function correctPNG() 
{
       var arVersion = navigator.appVersion.split("MSIE")
       var version = parseFloat(arVersion[1])
       if ((version >= 5.5) && (document.body.filters)) 
       {
              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.onload = correctPNG;
