$(document).ready(function() {
	
	jQuery.each(jQuery.browser, function(i) {
	   if($.browser.msie){
	      
	   }
	
	else{
	    $('.hundvalj').fadeTo('fast',0.35);
		$('.op50').fadeTo('fast',0.05);


		$('.hundvalj').mouseenter(function() {
			$(this).fadeTo('fast',1);
		});

		$('.hundvalj').mouseleave(function() {
			$(this).fadeTo('fast',0.35);
		});
	
	
	   }
	 });
	
	
	    $('.attachment-thumbnail').fadeTo('fast',0.35);


		$('.attachment-thumbnail').mouseenter(function() {
			$(this).fadeTo('fast',1);
		});

		$('.attachment-thumbnail').mouseleave(function() {
			$(this).fadeTo('fast',0.35);
			});

	
	$('.dogdrop').click(function() {
		$('#hundar').slideToggle('fast');
	});
	
	$('#hundar').mouseleave(function() {
		$('#hundar').slideUp('fast');
	});
	
	
	$('.kulldrop').click(function() {
		$('#kullar').slideToggle('fast');
	});
	
	$('#kullar').mouseleave(function() {
		$('#kullar').slideUp('fast');
	});
	
	
	
	$('.togl_mh').click(function(){
		$('[class^="dognfo"]').slideUp('fast');
		$('.dognfo_mh').slideToggle('fast');
	});
	
	$('.togl_tavla').click(function(){
		$('[class^="dognfo"]').slideUp('fast');
		$('.dognfo_tavla').slideToggle('fast');
	});
	
	$('.togl_bilder').click(function(){
		$('[class^="dognfo"]').slideUp('fast');
		$('.dognfo_bilder').slideToggle('fast');
	});
	
	$('.togl_hund').click(function(){
		$('[class^="dognfo"]').slideUp('fast');
		$('.dognfo_dog').slideToggle('fast');
	});
	
	
	
	
	
	(function($) {
		var imgList = [];
		$.extend({
			preload: function(imgArr, option) {
				var setting = $.extend({
					init: function(loaded, total) {},
					loaded: function(img, loaded, total) {},
					loaded_all: function(loaded, total) {}
				}, option);
				var total = imgArr.length;
				var loaded = 0;

				setting.init(0, total);
				for(var i in imgArr) {
					imgList.push($("<img />")
						.attr("src", imgArr[i])
						.load(function() {
							loaded++;
							setting.loaded(this, loaded, total);
							if(loaded == total) {
								setting.loaded_all(loaded, total);
							}
						})
					);
				}

			}
		});
	})(jQuery);

	$(function() {

		$.preload([
			"http://tornedarlings.se/wp-content/themes/ktornedarlings/grafik/hundar/ellen.png",
			"http://tornedarlings.se/wp-content/themes/ktornedarlings/grafik/hundar/sune.png",
			"http://tornedarlings.se/wp-content/themes/ktornedarlings/grafik/hundar/alli.png",
			"http://tornedarlings.se/wp-content/themes/ktornedarlings/grafik/hundar/phoebe.png"
		], {
			init: function(loaded, total) {},
			loaded: function(img, loaded, total) {},
			loaded_all: function(loaded, total) {}
		});

	});
	
	
	
	
	
	
	
	
	
	
	(function ($) {
	if (!$) return;
	$.fn.extend({
	    fixPNG: function(sizingMethod, forceBG) {
	            if (!($.browser.msie)) return this;
	            var emptyimg = "blank.gif"; //Path to empty 1x1px GIF goes here
	            sizingMethod = sizingMethod || "scale"; //sizingMethod, defaults to scale (matches image dimensions)
	            this.each(function() {
	                    var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
	                            imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
	                            src = (isImg) ? imgname : imgname.substring(5,imgname.length-2);
	                    this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
	                    if (isImg) this.src = emptyimg;
	                    else this.style.backgroundImage = "url(" + emptyimg + ")";
	            });
	            return this;
	    }
	});
	})(jQuery);
});
