function IsImageOk(img) 
{
	// During the onload event, IE correctly identifies any images that
	// weren’t downloaded as not complete. Others should too. Gecko-based
	// browsers act like NS4 in that they report this incorrectly.
	if (!img.complete) 
	{
		return false;
	}

	// However, they do have two very useful properties: naturalWidth and
	// naturalHeight. These give the true size of the image. If it failed
	// to load, either of these should be zero.
	if (typeof img.naturalWidth!= "undefined" && img.naturalWidth== 0) 
	{
		return false;
	}

	// No other way of checking: assume it’s ok.
	return true;
}

document.getElementsByClassName = function(className)
{
		var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
		var allElements = document.getElementsByTagName("*");
		var results = [];

		var element;
		for (var i = 0; (element = allElements[i]) != null; i++) {
			var elementClass = element.className;
			if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
				results.push(element);
		}

		return results;
}


//Call this function onLoad of body tag
function checkImages() 
{
	var images = document.getElementsByClassName("art_img");
	
	for (var i = 0; i < images.length; i++) 
	{
		if (!IsImageOk(images[i])) 
		{
			images[i].src ="http://bios.se/style/saknas.png";
		}
	}
}

function openWin(url)
{
	window.open(url);
}
