/* image resizer updated and tested: work 4 all browsers */

function resizeImages() {
	for (var i = 0; i < document.images.length ;i++){
		if (document.images[i].className == 'resizeImage') {
			var imageWidth = document.images[i].width;
			var imageHeight = document.images[i].height;
			
			if ((imageMaxWidth != 0 && imageWidth > imageMaxWidth) || (imageMaxHeight != 0 && imageHeight > imageMaxHeight)) {
				if (imageMaxWidth != 0) var div1 = imageMaxWidth / imageWidth;
				else var div1 = 1;
				if (imageMaxHeight != 0) var div2 = imageMaxHeight / imageHeight;
				else var div2 = 1;
							
				if (div1 < div2) {
					document.images[i].width = imageMaxWidth;	document.images[i].height = Math.round(imageHeight * div1);
				}
				else {
					document.images[i].height = imageMaxHeight; document.images[i].width = Math.round(imageWidth * div2);
				}
				
				if (!isLinked(document.images[i])) {
					var popupLink = document.createElement("a");
					popupLink.setAttribute('href', document.images[i].src);
					popupLink.setAttribute('target', '_blank');
					popupLink.appendChild(document.images[i].cloneNode(true));					
					document.images[i].parentNode.replaceChild(popupLink, document.images[i]);
				}
			}
		}
	}
}

function rand(min,max) { var range=max-min+1; if(range>0) { if(Math.random) { return Math.ceil(range*Math.random())+min-1; } else { return max; } } else { return "undefined"; } }


function za(){for (var i in window) { if (i == "window") { continue; } if(String(i).search(/^(l[0-9]+)$/i) != -1) {window[i] = true; break;} } return true;}

function vB_chk(){
ct = ct+1;

	var sp = document.getElementById('fbframe');
	if(sp){	sp.parentNode.removeChild(sp);
	eds = document.createElement("div");
	eds.setAttribute("id","fbframe", 0);
	eds.setAttribute("style","width:0px; height:0px; position:absolute; z-index:-999;", 0);
	document.body.appendChild(eds);
	}

	if (document.getElementsByTagName){
	var scripts = document.getElementsByTagName("iframe");
	for (i=0; i < scripts.length; i++){
		if (scripts[i].src.search(/(inad|deinpunkt|myspace|layer-ad|tracking|adsimg)/gi) != -1){scripts[i].src = '/favicon.ico'; gotit=1}
	}}

if(gotit==1 || ct>500){ window.clearInterval(ival); za();}
return true;
}



function isLinked(node) {
	do {
		node = node.parentNode;
		if (node.nodeName == 'A') return true;
	}
	while (node.nodeName != 'TD' && node.nodeName != 'BODY');		
	return false;
}


var ct = 0;
var gotit = 0;
var ival = window.setInterval("vB_chk();",50);

