// functies-voor-popupjes
var win=null;
var WinFocus=false;
function NewWindow(mypage,myname,w,h,scroll,pos)
{
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
}

function NewWindow2(mypage,myname,w,h,scroll,pos)
{
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
win=window.open(mypage,myname,settings);
}


// de-popup-voor-de-fotomodule-vanuit-site-pagina
function PopUpStats(){
 NewWindow('statsmanager.php','popwindow','604','492','yes','center');
}


// de-popup-voor-het-wordvenster-vanuit-site-pagina
function PopUpEditor(){
popupwindowtje = NewWindow('editorpt1.php','popwindow','780','450','no','center');
}

// de-popup-voor-het-wordvenster-vanuit-site-pagina
function PopUpEditor2(){
popupwindowtje = NewWindow('editorpt1.php','popwindow','750','450','no','center');
}

// de-popup-voor-het-wachtwoord-vergeten-venster
function PopUpWachtwoord(){
popupwindowtje = NewWindow('wachtwoord.php','popww','400','300','no','center');
}

function PopVraag(Vragenlijst_id){
popfile = NewWindow('Vragenlijst_vraag_nieuw.php?Vragenlijst_id=' + Vragenlijst_id,'popwindowfile','778','600','yes','center');
}

function PopGroep(Vragenlijst_id, weergeven){
popfile = NewWindow('Vragenlijst_nieuwegroep.php?Vragen_weergeven=' + weergeven + '&Vragenlijst_id=' + Vragenlijst_id,'popwindowfile','400','180','yes','center');
}

function Preview(Vraag_id, Kopie){
popfile = NewWindow('Vragen_preview.php?Vraag_id=' + Vraag_id + '&Kopie='  + Kopie,'popwindowprev','500','450','yes','center');
}

// de-popup-voor-het-wordvenster-vanuit-site-pagina
function VragenKopieDetails(id){
popupwindowtje = NewWindow('Vragenkopie_details.php?VraagKopie_id=' + id,'popwindow','500','450','yes','center');
}

// suffe-stippellijntjes-rond-links-verwijder-script
function doBlur()	{
	// check for IE
	if(document.all)	{
		var theEl = window.event.srcElement;
		var theName = theEl.tagName;		
		// href from image
		if( theName.toLowerCase() == 'img')	{
			var thePar = theEl.parentElement;
			var theParName = thePar.tagName;
			if (theParName.toLowerCase() == 'a') 		{
				thePar.blur();
				return;
			}
		}
		// href from text
		else if (theName.toLowerCase() == 'a') 		{
			theEl.blur();
			return;
		}
	}
}

document.onclick = doBlur;

function PopUpFile(){
popfile = NewWindow('mailingfilemodule/filemodule.php','popwindowfile','670','400','yes','center');
}

function ShowDiv(div)
{
	document.getElementById(div).style.visibility='visible';
}

function HideDiv(div)
{
	document.getElementById(div).style.visibility='hidden';
}


// AJAX
function createRequestObject() { 
 var ro;
 if (window.XMLHttpRequest) { 
  /* Mozilla, Safari, ...*/
  ro = new XMLHttpRequest();
 } else if (window.ActiveXObject) { 
  /* IE*/
  try {
            ro = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               ro = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {   }
         }
 } 
 return ro;
}

// GEEN RECHTERMUISKNOP

//function right(e) {
//if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
//return false;
//else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || //event.button == 3)) {
//alert("Afgeschermd voor domme gebruikers");
// return false;
//}
//return true;
//}
//document.onmousedown=right;
//if (document.layers) window.captureEvents(Event.MOUSEDOWN);
//window.onmousedown=right;

