/*************************************************** vi fsp script *****/
/************************** Copyright (c) 2009 virtual identity AG *****/
/***********************************************************************/
/******************************************************* vi common *****/
/***********************************************************************/
/************************************** author virtual identity AG *****/
/* $LastChangedDate: 2010-06-02 17:15:12 +0200 (Mi, 02 Jun 2010) $ *****/

/***********************************************************************/
/* START: vi helper functions */

/*
 * adds a 1px outline div to all selectboxes in IE
 */
function divToSelectsForIe(domNav){
    $(domNav).wrap('<div class="select-ie-borderfix"></div>');
}

/* END: vi helper functions */
/********************************************************************/
/* START: vi jquery extensions */

jQuery.fn.addHover = function(className){
    className = className || 'hover';
    return this.hover(function(){
        jQuery(this).addClass(className);
    }, function(){
        jQuery(this).removeClass(className);
    });
};

jQuery.fn.ie6PngFix = function(){
    return this.each(function(){
        var $this = jQuery(this);
        if ($this.is("img[src$=.png]")) {
            var src = $this.attr("src");
            var styles = {
                background: "transparent",
                bottom: $this.css("bottom"),
                height: $this.height() + "px",
                left: $this.css("left"),
                position: $this.css("position"),
                right: $this.css("right"),
                top: $this.css("top"),
                width: $this.width() + "px"
            };
            var $pngFix = jQuery("<div />").css(styles).insertAfter($this);
            $pngFix.get(0).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
            $this.remove();
        }
    });
};

/* END: vi jquery extensions */
/***********************************************************************/
