var screenWidth;
var curImage;
var totalImage;


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v9.0  
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_setTextOfLayer(objId,x,newText) { //v9.0
  with (document) if (getElementById && ((obj=getElementById(objId))!=null))
    with (obj) innerHTML = unescape(newText);
}


function randomNumber(limit){
	return Math.floor(Math.random()*limit);
}

function randOrd(){
	return (Math.round(Math.random())-0.5); 
} 

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

function hideAll(tagName){
	var tag = document.getElementsByTagName('UL')
	for(x=0; x<tag.length; x++){
	//hide all div layers with the 'nav' attribute	
		if(tag[x].getAttribute(tagName)){
			tag[x].style.display='none';
		}
	}
}

function hideAllDiv(tagName){
	var tag = document.getElementsByTagName('DIV')
	for(x=0; x<tag.length; x++){
	//hide all div layers with the 'nav' attribute	
		if(tag[x].getAttribute(tagName)){
			tag[x].style.display='none';
		}
	}
}

function hideTotalOverlay(){	
	oTotalOverlay=MM_findObj('overLay');
	oTotalOverlay.style.display='none';
}

function showTotalMovie(){
	showOverlay();	
}

function showTotalOverlay(IDF){
	showOverlay();
	showLiteBox(IDF);
}

function showOverlay(){
	var myWidth = 0, myHeight = 0;
	
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
		winHeight=myHeight;
		winWidth=myWidth;
	
	
	oContainer=MM_findObj('container');
	oTotalOverlay=MM_findObj('overLay');
	
	overlayHeight=oContainer.offsetHeight + 500;
	if (overlayHeight<winHeight){
		overlayHeight=winHeight;
	}
	
	oTotalOverlay.style.height=overlayHeight +'px';
	oTotalOverlay.style.display='block';
	screenWidth=oTotalOverlay.offsetWidth;
}


function showLiteBox(IDF){

	oLiteBox=MM_findObj('liteBox');
	oLiteBox.style.display='block';
	
	var ScrollTop = document.body.scrollTop;	
	if (ScrollTop == 0)
	{
		if (window.pageYOffset)
			ScrollTop = window.pageYOffset;
		else
			ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	oLiteBox.style.top=ScrollTop +60 +'px';
	oLiteBox.style.left=(screenWidth/2)-350 +'px';
	
	oFrame=MM_findObj("framePopup");
	if(oFrame){
		
		if(IDF){
			
			if (IDF==0){

				window.frames["framePopup"].location.href="popupF.php";
			}else{
				
				window.frames["framePopup"].location.href="popupP.php?IDF="+IDF;
				
			}
		}else{
			window.frames["framePopup"].location.href="popupA.php";
		}

	}

}

function hideLiteBox(){
	hideTotalOverlay();
	oLiteBox=MM_findObj('liteBox');
	oLiteBox.style.display='none';
}

function setPopup(direction){
	if (direction!=99){
		othisPopup=	MM_findObj("popupPage"+ (popupPage));
		othisPopup.style.display='none';	
		oPopupGreen=MM_findObj("popupNextGreen");
		oPopupGreen.style.display='none';
		
		popupPage=popupPage + direction;				
	
		oPopup=	MM_findObj("popupPage"+ (popupPage));
		oPrevPopup=MM_findObj("popupPage"+ (popupPage-1));
		oNextPopup=MM_findObj("popupPage"+ (popupPage+1));
		if (oPopup){
			oPopup.style.display='block';
		}	
		if (oPrevPopup){
			MM_findObj('popupPrev').style.display='block';
		}else{
			MM_findObj('popupPrev').style.display='none';	
		}
		if (oNextPopup){
			MM_findObj('popupNext').style.display='block';
		}else{
			MM_findObj('popupNext').style.display='none';
			oPopupGreen.style.display='block';		
		}
	}else{
		oPopup=	MM_findObj("popupPage"+ (popupPage));
		oPopup.style.display='none';
		MM_findObj('popupNext').style.display='none';
		MM_findObj('popupPrev').style.display='none';
		oPopupGreen=MM_findObj("popupNextGreen");
		oPopupGreen.style.display='none';
		oPopup=	MM_findObj("popupPage99");
		oPopup.style.display='block';
		
	}
}

function uploadDoc(){
	MM_findObj('fileLoader').style.display='block';
	MM_findObj('fileDownload').style.display='none';
	MM_findObj('frmImage').submit()	
}

function setUploadedDoc(hCode, docName, oObject, gotoURL){

	parent.MM_findObj("s"+oObject).value=docName;
	document.location.href='uploadDocument.php?HashCode='+ hCode+'&type=' + oObject +'&docName=' + docName;
}

<!--
	function formCheck(direction){
		flagError=0;	
	if(direction==2){
		oGreen=MM_findObj("popupNextGreen")
		if (oGreen){
			oGreen.style.display='none'	;
		}
	}
	
	oJobAlert=MM_findObj("reason2");
	if (oJobAlert){
		
		if(oJobAlert.checked)	{
			oVacatureType=MM_findObj("boxVacatureType")	
			if (oVacatureType){
					oVacatureType.style.display='block';
			}
			oPraktijkgroep=MM_findObj("boxPraktijkgroep")	
			if (oPraktijkgroep){
					oPraktijkgroep.style.display='block';
			}
			oStaf=MM_findObj("boxStaf")	
			if (oStaf){
					oStaf.style.display='block';
			}			
		}else{
			oVacatureType=MM_findObj("boxVacatureType")	
			if (oVacatureType){
					oVacatureType.style.display='none';
			}
			oPraktijkgroep=MM_findObj("boxPraktijkgroep")	
			if (oPraktijkgroep){
					oPraktijkgroep.style.display='none';
			}
			oStaf=MM_findObj("boxStaf")	
			if (oStaf){
					oStaf.style.display='none';
			}
		}
	}

	if(arVerplicht[popupPage]!=""){
			arForm=arVerplicht[popupPage].split(",");
			
			for (var i=0; i<arForm.length; i++){
				if (arForm[i]!=''){
					
					oName='s' + arForm[i];
					oItem=MM_findObj(oName);
					oName='box'+arForm[i];
					oError=MM_findObj(oName);
					oName='form'+arForm[i];
					oBlock=MM_findObj(oName);
	
					if (oItem.value==''){				
						oError.style.color='#ff0000';
						flagError=1
					}else{
						oError.style.color='#000000';
					}
					if (arForm[i]=='Email'){
						var a=oItem.value.indexOf('@')
						var p=oItem.value.indexOf('.')
						if (a==-1 || p==-1){
							oError.style.color='#ff0000';				
							flagError=1
						}else{
							oError.style.color='#000000';
						}
					}
					
					if (arForm[i]=='Postcode'){
						oPostCode=MM_findObj('sPostcode');				
						if (IsNumeric(oPostCode.value.substring(0,4))&& oPostCode.value.length>=4){
							oError.style.color='#000000';
						}else{
							oError.style.color='#ff0000';	
							flagError=1	
						}				
					}
				}
			}	
			if (flagError==1){
				MM_findObj("errorBox"+popupPage).style.display="block"	;
			}else{
				MM_findObj("errorBox"+popupPage).style.display="none"	;	
			}
	}

		
		arForm2=new Array();
		for (var i=0; i<arForm2.length; i++){
			oName = "b" + arForm2[i];
			oItem=MM_findObj(oName);
			flagSel=0
			for (var j=0; j<oItem.length;j++){
				if (oItem[j].checked){
					flagSel=1;			
				}
			}
			oName='formErr'+arForm2[i];;
			oError=MM_findObj(oName);
			oName='form'+arForm2[i];;
			oBlock=MM_findObj(oName);
			if (flagSel==0){
				oError.style.display='block';	
				oBlock.style.borderLeft='5px solid #ff0000';
				oBlock.style.backgroundColor='#CCCCCC'
				flagError=1
			}else{
				oError.style.display='none';
				oBlock.style.borderLeft='5px solid #eeeeee';
				oBlock.style.backgroundColor='#eeeeee'
			}
		}
		
		oButton=MM_findObj('formButton')
		
		oItem=MM_findObj('formErrorBlock')	
		if (flagError==1){
			
		}else{
			if(direction==2){				
				document.frmSave.submit();	
			}else{
				setPopup(direction);
			}
		}
	}
	
	function setHash(hashID){
		oItem=MM_findObj('sHash');
		oItem.value=hashID;			
	}
	
	function setGroup(){
		hideAllMenu('functieMenuTag');
		oItem=MM_findObj('sIDFunctieGroep');
		sValue=oItem.options[oItem.selectedIndex].value;
		if (sValue!=''){
			oName='functieGroep'+ sValue;
			oItem=MM_findObj(oName);
			oItem.style.display='block';
		}
	}
	function hideAllMenu(tagName){
	var tag = document.getElementsByTagName('DIV')
	for(x=0; x<tag.length; x++){
		//hide all div layers with the 'nav' attribute	
			if(tag[x].getAttribute(tagName)){
				tag[x].style.display='none';
			}
		}
	}
	
	function showAllMenu(tagName){
	var tag = document.getElementsByTagName('DIV')
	for(x=0; x<tag.length; x++){
		//hide all div layers with the 'nav' attribute	
			if(tag[x].getAttribute(tagName)){
				tag[x].style.display='block';
			}
		}
	}
	
	function setTotalSelected(IDGroup, oBox){
		
		oItem=MM_findObj('sIDFunctieGroep');
		if(oBox.checked){
			arFG[IDGroup][1] = arFG[IDGroup][1]+1
		}else{
			arFG[IDGroup][1] = arFG[IDGroup][1]-1
		}
		if (arFG[IDGroup][1]!=0){
			oItem.options[IDGroup].text=arFG[IDGroup][0]+' ('+arFG[IDGroup][1]+')';
			oItem.options[IDGroup].style.color='#0092d3';
		}else{
			oItem.options[IDGroup].text=arFG[IDGroup][0]
			oItem.options[IDGroup].style.color='#000000';			
		}
	}
	
	function IsNumeric(sText){
		   var ValidChars = "0123456789.";
		   var IsNumber=true;
		   var Char;		
		 
		   for (i = 0; i < sText.length && IsNumber == true; i++) 
			  { 
			  Char = sText.charAt(i); 
			  if (ValidChars.indexOf(Char) == -1) 
				 {
				 IsNumber = false;
				 }
			  }
		   return IsNumber;
   
   }
   
   function setPG(oSub){
	   
	   oSub=MM_findObj(oSub);
	   if(oSub){
		   if(oSub.style.display=='block'){
			  oSub.style.display='none'; 
		   }else{
			   hideAllDiv("PG");
			oSub.style.display='block';
		   }
	   }
   }
   
   function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
   
   function setPerson(numPerson){
	   oBox=MM_findObj("peopleBox");
	   oBox.style.display='block';
	   
	   MM_findObj('peopleImg').style.backgroundImage='url(/images/cms/250/'+arPeople[numPerson]['Afbeelding']+')';
	   MM_findObj('peopleName').innerHTML=arPeople[numPerson]['Voornaam']+" "+arPeople[numPerson]['Achternaam'];
	   MM_findObj('peopleFunctie').innerHTML=arPeople[numPerson]['Functie'];
	   MM_findObj('peopleEmail').innerHTML=arPeople[numPerson]['Email'];
	   MM_findObj('peopleTelefoon').innerHTML=arPeople[numPerson]['Telefoon'];
	   MM_findObj('peopleText').innerHTML=arPeople[numPerson]['Text'];
	   if (arPeople[numPerson]['LinkedIn']!=''){
	   	MM_findObj('peopleLinkedIn').innerHTML="<div style='float:left;margin-right:5px;'><a href='" +arPeople[numPerson]['LinkedIn']+"' target='_blank'><img src='/images/linkedIn_25.png' border='0'></a></div>";
	   }
	   if (arPeople[numPerson]['Twitter']!=''){
	   	MM_findObj('peopleTwitter').innerHTML="<div style='float:left;margin-right:5px;'><a href='" +arPeople[numPerson]['Twitter']+"' target='_blank'><img src='/images/twitter_25.png' border='0'></a></div>";
	   }
   }

function playMovie(movieName){
	if (movieName==""){
	movieName='DLAMovie.flv';
	}
	showOverlay();
	//oImage = MM_findObj('pageImage');
	//oImage.style.display='none';
	oMovie= MM_findObj('movieFLV');
	oMovie.style.display='block';

	var ScrollTop = document.body.scrollTop;	
	if (ScrollTop == 0)
	{
		if (window.pageYOffset)
			ScrollTop = window.pageYOffset;
		else
			ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	oMovie.style.top=ScrollTop +60 +'px';
	oMovie.style.left=(screenWidth/2)-350 +'px';

	//oMainImage=MM_findObj("mainImage");
	//oMainImage.style.height="518px";
	//MM_findObj("imageCorner").style.marginTop="500px";
	//MM_findObj("playButton").style.display="none";

	
	jwplayer().load('/flv/'+movieName);
	
	
}

function hideMovie(){
	jwplayer().stop();
	oMovie= MM_findObj('movieFLV');
	oMovie.style.left='-10000px';
	hideTotalOverlay();	
}

function setPeopleTab(iType){
	oType=MM_findObj('functieType'+iType);
	if(oType.style.display=='block'){
		oType.style.display='none';
	}else{
		hideAllDiv('functieType');
		oType.style.display='block';
	}
}

function setVestigingOnMap(numV){
	oV=MM_findObj("countryStip"+numV)
	if(oV){
		oV.style.backgroundColor='#000000'	
	}
}

function setVestigingOnMapOut(numV){
	oV=MM_findObj("countryStip"+numV)
	if(oV){
		oV.style.backgroundColor='#FF0000'	
	}
}

function showUploaded(numUploaded){
	hideAllMenu("uploaded");
	MM_findObj("upload"+numUploaded).style.display='block';
}

function showUploadAll(){
	showAllMenu("uploaded");
}
//-->
