	function popup(url, width, height, name)
	{
		if (!name)
		{
			name = '_popup';
		}

		window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
		return false;
	}

	/**
	* Find a member
	*/
	function find_username(url)
	{
		popup(url, 760, 570, '_usersearch');
		return false;
	}

	/**
	* Mark/unmark checklist
	* id = ID of parent container, name = name prefix, state = state [true/false]
	*/
	function marklist(id, name, state)
	{
		var parent = document.getElementById(id);
		if (!parent)
		{
			eval('parent = document.' + id);
		}

		if (!parent)
		{
			return;
		}

		var rb = parent.getElementsByTagName('input');

		for (var r = 0; r < rb.length; r++)
		{
			if (rb[r].name.substr(0, name.length) == name)
			{
				rb[r].checked = state;
			}
		}
	}
	
var ownUrl = location.href+"";
ownUrl = ownUrl.replace(/https?\:\/\//,"");
 

var ownServer = "";
if ( ownUrl.indexOf("/") > 0 )
ownServer = ownUrl.substring( 0, ownUrl.indexOf("/"));
else ownServer = ownUrl;
//alert(ownServer);

var verbleibendePics = null;
var forumMaxPicWidth = 520;
function smashDownPics( step ) 
{
	if (step==null)
	 {
		setTimeout( "smashDownPics( 0 );", 20);
		return;
	}
	if (verbleibendePics == null)
	verbleibendePics = document.getElementsByTagName("img");
	var newVerbleibendePics = [];
	for (var i=0; i < verbleibendePics.length;i++)
	 {
		var imgA = verbleibendePics[i];
		var imgSrc = imgA.src;
	  	if (imgSrc.indexOf(ownServer) == -1 ) // Bild ist vom anderen Server
		{
			//	alert(imgs[i].src);
			$verbleibtInListe = true;
			
			if ( imgA.complete)
			{
//			 alert( imgA.naturalWidth);
				
				var curWidth = 0; //imgA.naturalWidth * 1;
				var curHeight = 0; // imgA.naturalHeight * 1;
				if (typeof imgA.naturalWidth != "undefined" )
				{
					curWidth = imgA.naturalWidth * 1;
					curHeight = imgA.naturalHeight * 1;
				} else
				{
					curWidth = imgA.width * 1;
					curHeight = imgA.height * 1;
				}
//				alert(curWidth);
				if ( curWidth > 0)
				{
						$verbleibtInListe = false;
						
						
						if (curWidth > forumMaxPicWidth)
						 {
							var newHeight = forumMaxPicWidth / curWidth *  curHeight;
							imgA.width = forumMaxPicWidth;
							imgA.height = newHeight; 
							imgA.style.cursor="pointer";
							imgA.title="Zum Vergroessern klicken";
							//imgA.id = 
							imgA.onclick = new Function ("window.open( '"+imgA.src+"','_blank', 'scrollbars=no,width="+(curWidth+20)+",height="+(curHeight+20)+"');");
							
						}
				}
			}
			if ($verbleibtInListe);
			newVerbleibendePics[newVerbleibendePics.length] = imgA;
		}
	 }
	 verbleibendePics = newVerbleibendePics;
//	alert( verbleibendePics.length );
	 if (verbleibendePics.length > 0)
	 {
		setTimeout( "smashDownPics( "+(step*1+1)+" );", 50 + step * 100 );
		return;
	}
}

function startOnForumBodyLoad()
{
if (location.href.indexOf("fAction,vt")>0)
 smashDownPics();
}
