// Statusbar
window.status = statusbalk;

function snelkiezen(waar)
{
	eval("parent" + ".location = '" + waar.options[waar.selectedIndex].value + "'");
}

function verander_kleur(dit, optie)
{
	if(optie == 0)
	{
		dit.style.backgroundColor = "#D6ECF9";
	}
	else if(optie == 1)
	{
		dit.style.backgroundColor = "";
	}
}

function bevestig(dit, bericht)
{
    if (bericht == '' || typeof(window.opera) != 'undefined')
	{
        return true;
	}

    return confirm(bericht);
}

function forums_topic(titel, plaatje, tid, auteur_id, auteur, reacties, laatste_post, paginas, titel_alt)
{
   output = '<tr>';
   output += '<td width=32 nowrap bgcolor="#E9F6FE" class="forums" align="center" style="border-left: #306DB0 1px solid">';
   output += '<img src="' + url + 'images/forums/' + plaatje + '.gif" border=0>';
   output += '</td>';
   output += '<td width="40%" align="left" bgcolor="#E9F6FE" class="forums" onmouseover="verander_kleur(this, 0)" onmouseout="verander_kleur(this, 1)" onclick="window.location=\'' + url + 'forums/topic/' + tid + '/laatste\'">';
   output += '<a href="' + url + 'forums/topic/' + tid + '/laatste" title="' + titel_alt + '">' + titel + '</a> ' + paginas;
   output += '</td>';
   output += '<td width="20%" bgcolor="#D6ECF9" class="forums" align="center">';
   output += '<a href="' + url + 'leden/profiel/' + auteur_id + '">' + auteur + '</a>';
   output += '</td>';
   output += '<td width="10%" bgcolor="#E9F6FE" class="forums" align="center">';
   output += reacties;
   output += '</td>';
   output += '<td width="30%" bgcolor="#D6ECF9" class="forums" align="right" style="border-right: #306DB0 1px solid">';
   output += '<small>' + laatste_post + '</small>';
   output += '</td>';
   output += '</tr>';

   document.write(output);
}

function ledenlijst(bgcolor, id, gebruikersnaam, posts, geregistreerd_op)
{
   output = '<tr>';
   output += '<td width="40%" bgcolor=' + bgcolor + '>';
   output += '<a href="' + url + 'leden/profiel/' + id + '">' + gebruikersnaam + '</a>';
   output += '</td>'; 
   output += '<td width="30%" align="center" bgcolor=' + bgcolor + '>';
   output += posts;
   output += '</td>';
   output += '<td width="30%" align="center" bgcolor=' + bgcolor + '>';
   output += geregistreerd_op;
   output += '</td>';
   output += '</tr>';

   document.write(output);
}
	

var maxWidth = 550;
	
var picsHeight = new Array();
var picsWidth = new Array();
	
function image_collect()	{	
	for(i=0; i<document.images.length; i++)
	{
		image = document.images[i];
		if(image.id == 'topic')		{
			if(image.complete)	{
				image_resize(image);
			}
			else	{
				document.images[i].onload = image_resize;
			}	
		}
	}
}
	
function image_resize(image)	{
	if(!image)	{
		var image = window.event.srcElement;
	}
		
	if(image.width > maxWidth)
	{
		picsWidth[image.src] = image.width;
		picsHeight[image.src] = image.height;
			
		image.style.border = "dashed 1px black";
		image.style.cursor = "pointer";
		image.style.cursor = "hand";
		image.height = Math.floor(image.height/(image.width/maxWidth));
		image.width = maxWidth;
		image.alt = 'Originele grootte: ' + picsWidth[image.src] + 'x' + picsHeight[image.src];
	}
}
	
function image_fullscreen(e)	{
	scrollbars = 0;
	
	src = e.src;	
	width = picsWidth[ src ];
	height = picsHeight[ src ];
	
	if(width > maxWidth)
	{
		loc = url + "image.php?src=" + escape(src) + "&width=" + width + "&height=" + height;
	
		if(width > screen.availWidth)	
		{
			width = screen.availWidth;
			scrollbars = 1;
			}

		if(height > screen.availHeight)	
		{
			height = screen.availHeight;
			scrollbars = 1;
		}

		fullscr = window.open(loc, "_blank","toolbar=no,location=no,menubar=no,fullscreen="+scrollbars+",channelmode="+scrollbars+",scrollbars="+scrollbars+",status=no,left=0,top=0,width="+width+",height="+height);		
	}
}