var state = 'none'; 

function showhide(layer_ref) { 

if (state == 'block') { 
state = 'none'; 
} 
else { 
state = 'block'; 
} 
if (document.all) {
eval( "document.all." + layer_ref + ".style.display = state"); 
} 
if (document.layers) {
document.layers[layer_ref].display = state; 
} 
if (document.getElementById &&!document.all) { 
hza = document.getElementById(layer_ref); 
hza.style.display = state; 
} 
} 



// functies voor titel..
function Smilieinvoegen(Smilie)
{
    document.form1.comment.value += Smilie+" ";
    document.form1.comment.focus();
}


function SmilieinvoegenTopic(Smilie)
{
    document.nieuwtopic.bericht.value += Smilie+" ";
    document.nieuwtopic.bericht.focus();
}

// functie voor smilies
function opmaakinvoegen(Command)
{
    document.edit.titel.value += Command;
    document.edit.titel.focus();
}

// functie voor smilies
function opmaaktextarea(Command)
{
    document.edit.bericht.value += Command;
    document.edit.bericht.focus();
}

// datum en jaar voor copyright
var today = new Date();
var y0 = today.getFullYear();

// controle form
function emailvalidation(entered, alertbox){

with (entered){
apos=value.indexOf("@"); 
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {if (alertbox) {alert(alertbox);}return false;}
else {return true;}
}
} 

function wachtwoordvalidation(entered, min, max, alertbox){
with (entered){
if ((value.length<min) || (value.length>max))
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 

//submenu
function toonmenu(item,view, src)
{
men=document.getElementById(item);

if(view==1)
{
men.style.display='';
if(src) src.style.background=none;
}
else
{
men.style.display='none';
if(src) src.style.background=none;
}
}



// top pagina
function naarboven() {
	window.scrollTo(0,0);
}


// afdrukken op printvriendelijke pagina
var AutoPrint = true;
function PrintPagina(){
if (document.getElementById != null){
var html = '<HTML>\n<HEAD>\n<style type="text/css">body {	font-family:tahoma;font-size:10px;color:#5f5f5f;} TABLE,tr,td {font-family:tahoma;font-size:10px;color:#5f5f5f; }</style>\n';
if (document.getElementsByTagName != null){
var headTags = document.getElementsByTagName("head");
if (headTags.length < 0)
html += headTags[0].innerHTML;}
html += '\n</HE' + 'AD>\n<BODY>\n';
var PrintKlaarElem = document.getElementById("PrintKlaar");
if (PrintKlaarElem != null){
html += PrintKlaarElem.innerHTML;}
html += '\n</BO' + 'DY>\n</HT' + 'ML>';
var printWin = window.open("","PrintPagina");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (AutoPrint)printWin.print();}}

// toevoegen tot favorieten
var url="http://www.voetbalpro.com";
var title="voetbalpro.com voetbalnieuws";
function favorieten(){
if(document.all)
window.external.AddFavorite(url,title)
}
// Andrew Urquhart : CountDown Timer : http://andrewu.co.uk/clj/countdown/
function CD_UD(s,id){CD_OBJS[id].innerHTML=s};

function CD_T(id,e){
var n=new Date();
var p=1E3-n.getMilliseconds();
	setTimeout("CD_T('"+id+"',"+e+")",p);
	CD_D(+n,id,e)};

function CD_D(n,id,e){
	var ms=e-n;
	if(ms<=0) ms*=-1;
	var d=Math.floor(ms/864E5);
	ms-=d*864E5;
	var h=Math.floor(ms/36E5);
	ms-=h*36E5;
	var m=Math.floor(ms/6E4);
	ms-=m*6E4;
	var s=Math.floor(ms/1E3);
	CD_UD(d+" dag"+(d==1?" ":"en ")+CD_ZP(h)+"u "+CD_ZP(m)+"m "+CD_ZP(s)+"s ",id)};
	
function CD_ZP(i){return(i<10?"0"+i:i)};
function CD_Init(){var pref="countdown";
	var objH=1;
	if(document.getElementById||document.all){for(var i=1;objH;++i){var id=pref+i;objH=document.getElementById?document.getElementById(id):document.all[id];
	if(objH&&(typeof objH.innerHTML)!='undefined'){var s=objH.innerHTML;
	var dt=new Date(s);
	if(!isNaN(dt)){CD_OBJS[id]=objH;
	CD_T(id,dt.valueOf());
	if(objH.style){objH.style.visibility="visible"}}else {objH.innerHTML=s+"<a href=\"http://andrewu.co.uk/clj/countdown/\" title=\"Countdown Error:Invalid date format used,check documentation (see link)\">*</a>"}}}}};
	var CD_OBJS=new Object();
	if(window.attachEvent){window.attachEvent('onload',CD_Init)}else if(window.addEventListener){window.addEventListener("load",CD_Init,false)}else {window.onload=CD_Init};

