
var blank = new Image();
blank.src = '/images/spacer.gif';
 
$(document).ready(function() {


    // break out of frame
   if (parent != self) {
        top.location.href = document.location.href;  
   }  

    // FIX PNG
    var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
    if (badBrowser) {
        // get all pngs on page
        $('img[src$=.png]').each(function() {
           if (!this.complete) {
              this.onload = function() {
                fixPng(this)
            };
           } else {
              fixPng(this);
           }
        });
    }
    
    // MODIFY LINKS
    // OPEN ALL EXTERNAL/DOC LINKS IN NEW WINDOW
    //$('a').attr("href:contains('/dyn/'").bind('click',function(e) {
    /*
    $("a[@href *= '/dyn/']").bind('click',function(e) {
        window.open(this.href);
        return false;
    });
    */
    $('a').each(function() {
        var href = $(this).attr('href');
        if(!href.match(/^\/dyn\//) && !$(this).hasClass('localLink')) {
            $(this).click(function(e) {
                window.open(href);
                return false;
            });
        }
    });
    



    // init slidehow
    $("#slides").sfSlideShow({ controlPanel: 0, speed: 5000 });

    /*
    $("#googleiframe").contents().find("a").each(function() {
        $(this).click(function() {
            top.location = this.href;
            return false;
       });
       a.text('STRAMA');
    });
    */

});



function fixPng(png) {
    // get src
    var src = png.src;
    // set width and height
    if (!png.style.width) { png.style.width = $(png).width(); }
    if (!png.style.height) { png.style.height = $(png).height(); }
    // replace by blank image
    png.onload = function() { };
    png.src = blank.src;
    // set filter (display original image)
    png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}

