var timerID = null
var timerRunning = false

function stopclock(){
    if(timerRunning)
    clearTimeout(timerID)
    timerRunning = false
}

function startclock(){
    stopclock()
    showtime()
}

function showtime(){
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    //var seconds = now.getSeconds()
    var timeValue = "" + ((hours > 12) ? hours - 12 : hours)
    var timeValue1 = "" + ((hours < 10) ? "0" : "") + hours
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue1 += ((minutes < 10) ? ":0" : ":") + minutes
    //timeValue  += ((seconds < 10) ? ":0" : ":") + seconds
    //timeValue1 += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue  += (hours >= 12) ? " P.M." : " A.M."
    document.clock.face.value = timeValue
    document.clock.face.value = timeValue1;
    timerID = setTimeout("showtime()",1000)
    timerRunning = true
}



var bookmarkurl="http://www.website-verzameling.nl/"
var bookmarktitel="Website-verzameling.nl"

function fav(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitel)
}

//dochter functie
function favdochter(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


function chOver(nama) { 
nama.className='struct_itemmoused'
return true; 
} 

function chOut(nama) { 
nama.className='struct_item'
return true; 
} 

function chOver2(nama) { 
nama.className='struct_itemmoused2'
return true; 
} 

function chOut2(nama) { 
nama.className='struct_item2'
return true; 
} 

function chOver3(nama) { 
nama.className='letterbox2'
return true; 
} 

function chOut3(nama) { 
nama.className='letterbox'
return true; 
} 


// form validation

function checkrequired(which) {
    var pass=true;
    for (i=0;i<which.length;i++) {
        var tempobj=which.elements[i];
				alert(tempobj.name);
            if (tempobj.name.substring(0,8)=="required") {
                if (((tempobj.type=="text"||tempobj.type=="textarea")&&
                    tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
                    tempobj.selectedIndex==0)) {
                    pass=false;
										alert(" F O U T ! ");
                    break;
         }
      }
	return pass;
}

if (which.linkterug.checked == false) {
pass=false;
}

if (which.linkurl == "https://www.uw-leuke-website.nu/links.php") {
pass=false;
}
alert(pass + "test");

if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("U heeft één of meerdere velden niet (correct) ingevuld.");
return false;
}
else
return true;
}


// normal form validation
function checkrequirednorm(which) {
    var pass=true;
    for (i=0;i<which.length;i++) {
      var tempobj=which.elements[i];
      if (tempobj.name.substring(0,8)=="required") {
        if (((tempobj.type=="text"||tempobj.type=="textarea")&& tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&& tempobj.selectedIndex==0)) {
          pass=false;
          break;
         }
      }
}


if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("U heeft niet alle velden (correct) ingevuld. Om de suggestie te doen, dient u minimaal de eerste drie velden correct in te vullen.");
return false;
}
else
return true;
}



