

jQuery.fn.fadeIn = function(speed, callback) { 
    return this.animate({opacity: 'show'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeOut = function(speed, callback) { 
    return this.animate({opacity: 'hide'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeTo = function(speed,to,callback) { 
    return this.animate({opacity: to}, speed, function() { 
        if (to == 1 && jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
};

(function ($) {
    
    Drupal.behaviors.imina_map ={
        attach: function(context,settings){
            $('div.map').hide();
        }
        
        
    }
    
    Drupal.behaviors.imina_slideshow = {
        attach: function (context, settings) {
            //prepare for cycle
            $('.slideshow').children().not('img').remove();
            $('.slideshow').wrapInner('<div class="content" />');
            
            //run cycle
            
            $('.slideshow .content').after('<div id="slideshow-nav" />').cycle(
            { 
                fx:     'fade', 
                timeout: 0,
                speed:  'fast',
                pager:   '#slideshow-nav',
                // callback fn that creates a thumbnail to use as pager anchor 
                pagerAnchorBuilder: function(idx, slide) { 
                    return '<li><a href="#"><img class="shadow-black" src="' + slide.src + '" height="60" /></a></li>'; 
                } 
            });
            
        }
    }
    
    Drupal.behaviors.imina_caption = {
        attach: function (context, settings) {
            //prepare for cycle
            $('.caption').each(function(){
                var imgWidth = $('img', this).width();
                $(this).width(imgWidth);
            }); 
        }
    }
    
    
    Drupal.behaviors.imina_placeholder = {
        attach: function (context, settings) {
            //search input
            if($('#edit-search-block-form--2').val() == ''){
                $('#edit-search-block-form--2').val(Drupal.t('Search...'));
            }
            $('#edit-search-block-form--2').focus(function(){
                if($(this).val() == Drupal.t('Search...')){
                    $(this).val('');
                }
            });
            
            //newsletter
            $('newsletter-form')
            if($('.newsletter-form .form-text').val() == ''){
                $('.newsletter-form .form-text').val(Drupal.t('Enter your email address'));
            }
            $('.newsletter-form .form-text').focus(function(){
                if($(this).val() == Drupal.t('Enter your email address')){
                    $(this).val('');
                }
            });
        }
    }
    

}(jQuery));

;

