function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function tooltip(obj,str)
{   
    ttobj=document.getElementById('ttdiv');
	if(obj){
	var posx = findPosX(obj);
	var posy = findPosY(obj);
	
	ttobj.style.top= (posy-10) + 'px';
	ttobj.style.left= (posx+35) + 'px';
	ttobj.innerHTML= ''+str+'';
	ttobj.style.display='block'
	}
	else{
	  ttobj.style.display='none'
	}
}

function swapimg(obj,newimg,act){
	x=document.getElementById(obj);
	if(!x.oSrc){
	x.oSrc=x.src;
	}
	if(act){
	  if(!document.swapact){
	    document.swapact=x;
		//alert('act');
	  }
	  else{
		ox=document.swapact;
		ox.src=ox.oSrc;
		document.swapact=x;
	  }
	}
	x.src=newimg;
  }
  
  function swapback(idname){
    obj=document.getElementById(idname);
    //alert(document.swapact)
    if(document.swapact!=obj){
	  obj.src=obj.oSrc;
	}
  }
  
  function setClass(idname,stylename){
	   obj=document.getElementById(idname);
	   obj.className=''+stylename+'';
  }
  
  function hidediv(id) {
    obj = document.getElementsByTagName("div");
    obj[id].style.display = 'none';
}

function showdiv(id) {
    obj = document.getElementsByTagName("div");
    obj[id].style.display = 'block';
}

function showhide(id){
  obj = document.getElementsByTagName("div");
  if(obj[id].style.display=='block'){
    hidediv(id);
  }
  else{
    showdiv(id);
  }
}
  

  function countryover(cid){
    if(document.actcountry){
	  hidediv('country'+document.actcountry);
	}
	document.actcountry=cid;
	showdiv('country'+cid);
  }
  
  function countryout(){
	if(document.actcountry){
	  hidediv('country'+document.actcountry);
	}
  }


function menuover(num){
    if(document.actmenu){
	  hidediv('menusub'+document.actmenu);
	}
	document.actmenu=num;
	showdiv('menusub'+num);
  }
  
  function menuout(){
	if(document.actmenu){
	  hidediv('menusub'+document.actmenu);
	}
  }

  
  function cformcheck(theform){

    if(!validRequired(theform.iremark,"Opmerking"))
	  return false;

    if(!validEmail(theform.iemail,"Email",1))
	  return false;

    if(!validRequired(theform.iinitials,"Voorletters"))
	  return false;
	  
    if(!validRequired(theform.isurname,"Achternaam"))
	  return false;

    if(!validRequired(theform.iaddress,"Adres"))
	  return false;

    if(!validRequired(theform.izipcode,"Postcode"))
	  return false;

    if(!validRequired(theform.icity,"Woonplaats"))
	  return false;

	  
	return true;
  }

  function cformcheck(theform){

    if(!validRequired(theform.istory,"Opmerking"))
	  return false;

    if(!validEmail(theform.iemail,"Email",1))
	  return false;

    if(!validRequired(theform.iinitials,"Voorletters"))
	  return false;
	  
    if(!validRequired(theform.isurname,"Achternaam"))
	  return false;


    if(!validRequired(theform.icity,"Woonplaats"))
	  return false;

	  
	return true;
  }  