// bewaken maximale lengte van veld
function ismaxlength(obj){

	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "";
	var naam=obj.getAttribute? obj.getAttribute("name") : "";

	if (obj.getAttribute && obj.value.length>mlength) {
		obj.value=obj.value.substring(0,mlength);
	}
	document.getElementById('kaart'+naam).value=obj.value;
}

//schuif div
function moveItem() {
}

function initKaart() {
	document.getElementById('kaartformvoorkant').style.visibility="visible";
	document.getElementById('kaartformachterkant').style.visibility="hidden";
}

function kantToggle() {

	//alert("Toggle!");

	if (document.getElementById('kaartformvoorkant').style.visibility=="visible") {
		achterkantTonen();
	} else {
		voorkantTonen();
	}

}

function voorkantTonen() {
	
	//alert("Voorkant!");

	document.getElementById('kaartformachterkant').style.visibility="hidden";
	document.getElementById('kaartformvoorkant').style.visibility="visible";

	//document.getElementById('pijlrechts').style.visibility="visible";
	//document.getElementById('pijllinks').style.visibility="hidden";
}

function achterkantTonen() {

	//alert("Achterkant!");

	document.getElementById('kaartformvoorkant').style.visibility="hidden";
	document.getElementById('kaartformachterkant').style.visibility="visible";

	//document.getElementById('pijlrechts').style.visibility="hidden";
	//document.getElementById('pijllinks').style.visibility="visible";

	/*var voorkant=document.getElementById('kaartformvoorkant');
	var achterkant=document.getElementById('kaartformachterkant');

	var curr_width = parseInt(voorkant.style.width); // removes the "px" at the end
	var curr_pos = parseInt(achterkant.style.left); // removes the "px" at the end

	while (curr_width>10) {
		//alert("Achter: " + curr_width);
		curr_width=curr_width-10;
   	voorkant.style.width = curr_width + "px";
		curr_pos=parseInt(achterkant.style.left)-1;
		//achterkant.style.left= (curr_pos + "px");
   	achterkant.style.width = (454-curr_width) + "px";
		//document.write("nu:"+curr_width);
		for (i=1;i<10000;i++) {
			j=134566*43746645;			
		}
	}*/
}
