/*
 *   (C) Copyright Paul Hildebrand 2001 - 2008
 *
 *   $Author: paulh $ 
 *   $Revision: 203 $ 
 *   $Date: 2009-09-13 14:46:57 +0200 (Sun, 13 Sep 2009) $ 
 */
window.onerror=null;

function launchWin(x) {
   var remoteWin = window.open(x,'_blank','menubar=no,toolbar=no,width=510,height=380,resizable=yes,scrollbars=yes,location=no,status=yes');
}

function launchWinP(x) {
   var remoteWin = window.open(x,'_blank','menubar=no,toolbar=no,width=600,height=450,resizable=yes,scrollbars=yes,location=no,status=yes');
}

function launchWinImage(x) {
   var remoteWin = window.open(x,'_blank','menubar=no,toolbar=no,width=430,height=400,resizable=yes,scrollbars=no,location=no,status=no');
}

function launchWinIcq(x) {
   var remoteWin = window.open(x,'_blank','menubar=no,toolbar=no,width=480,height=350,resizable=no,scrollbars=no,location=no,status=no');
}

function launchWinConcert(x) {
   var remoteWin = window.open(x,'_blank','menubar=no,toolbar=no,width=540,height=450,resizable=yes,scrollbars=yes,location=no,status=no');
}

// Het tonen van een link
function l(URL,time,ID,title,fulltitle,browser) 
{
    if(fulltitle) 
	{
		regex=/\\/gi;
		acronym=fulltitle.replace(regex, "");
		fulltitle=" acronym title=\""+acronym+"\" onmouseover=\"window.status='"+fulltitle.replace("'","\\'") +"';return true\" onmouseout=\"window.status='';return true\"";
	}
	target='';

	if(URL=='nieuws')  {URL='/nieuws/'+ID + ".html";}
	if(URL=='interview')  {URL='/interview/'+ID + ".html";}
	if(URL=='zooi')    {URL='/zooi/'+ID+ ".html";}
	if(URL=='poll')    {URL='/poll/'+ID+ ".html";}
	if(URL=='recensie'){URL='/recensie/'+ID+ ".html";}
	if(URL=='forum')   {URL='http://forum.zwaremetalen.com/forum_topic.php?id='+ID; target='target=_blank';}
	
	document.write("<TR valign=top><TD class=left nowrap><a href=\"",URL,"\" class=left ",fulltitle," ",target,">"+ title + "</A></TD><TD nowrap align=right class=date>",time,"</TD></TR>\n");
    if (browser != 'netscape')
	{
	  document.write("<TR><TD COLSPAN=2><IMG SRC=\"/image/spacer.gif\" height=3 width=1></TD></TR>\n");
	}
}
 
//Het tonen van een simpele link
function sl(URL,title,browser) 
{
    if(title) 
	{
		regex=/\\/gi;
		acronym=title.replace(regex, "");
		atitle=" acronym title=\""+acronym+"\" onmouseover=\"window.status='"+title+"';return true\" onmouseout=\"window.status='';return true\"";
	}

	document.write("<TR valign=top><TD class=left nowrap><a href=\"",URL,"\" class=left ",atitle,">",title,"</A></TD></TR>\n");
    if (browser != 'netscape')
	{
	  document.write("<TR><TD COLSPAN=1><IMG SRC=\"/image/spacer.gif\" height=3 width=1></TD></TR>\n");
	}
}

function checkDate(day,month,year)
{
// Standaard zetten we de return waarde op true
retval=true;
if(isNaN(day)||isNaN(month)||isNaN(year))
{
retval=false;
}
else
if(day <=0||month <=0||year <=0)
{
retval=false;
}
else
if(month==2)
{
// Februari heeft maximaal 29 dagen
if(day>29)
{ retval=false;
}
else
if(day==29)
{
// Controleren of het een schrikkeljaar is
if(!((year % 4)==0||(year % 100)==0||(year % 400)==0))
{
retval=false;
}}}
else
if(day>30)
{
// April,Juni,september en november hebben maar 30 dage
if(month==4||month==6||month==9||month==11)
{
retval=false;
}}
return retval;
}

var currentBlock = 1;
var stoppedSwitching = false;
function switchBlock(id, stop) {
	document.getElementById('nrbl1').className = 'numberBlock';
	document.getElementById('nrbl2').className = 'numberBlock';
	document.getElementById('nrbl3').className = 'numberBlock';
	document.getElementById('nrbl4').className = 'numberBlock';
	
	document.getElementById('nrblc1').className = 'numberBlockContent';
	document.getElementById('nrblc2').className = 'numberBlockContent';
	document.getElementById('nrblc3').className = 'numberBlockContent';
	document.getElementById('nrblc4').className = 'numberBlockContent';

	document.getElementById('nrbl' + id).className = 'numberBlockSelected';
	document.getElementById('nrblc' + id).className = 'numberBlockContentSelected';

	if (stop) {
		stoppedSwitching = true;
	}
}

function switchToNext() {
    if (!stoppedSwitching) {
		currentBlock++;
		if (currentBlock > 4) {
			currentBlock = 1;
		}
		switchBlock(currentBlock, false);
	}
}
