/*
  -------------------------------------------------------------------------
	                       Caillou Communications / SiteLabel
						         Center PopUp Window
						       webmaster@sitelabel.com
						     http://www.sitelabel.com
    -------------------------------------------------------------------------  
*/

/*  Open Window Centered by define windows properties with onClick="NewWindow(this.href,'Admin','800','600','yes','center');return false" */

var win=null;
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=50;TopPosition=30}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
   if (btn[i].checked) {cnt = i; i = -1;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}

/*
	Copyright 2007 SiteLabel - All rights reserved.
*/

/*
  -------------------------------------------------------------------------
	                       Caillou Communications / SiteLabel
						           Image Preloader
						       webmaster@sitelabel.com
						     http://www.sitelabel.com
    -------------------------------------------------------------------------  
*/

/*  Preload Images */

<!--
function loadimage() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=loadimage.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->

/*
	Copyright 2007 SiteLabel - All rights reserved.
*/
/*
  -------------------------------------------------------------------------
	                       Caillou Communications / SiteLabel
						           Alert PopUp
						       webmaster@sitelabel.com
						     http://www.sitelabel.com
    -------------------------------------------------------------------------  
*/

/*  Alert PopUp */

<!--
function alertMessage(Alert) { //v1.0
  alert(Alert);
}//-->

/*
	Copyright 2007 SiteLabel - All rights reserved.
*/

/*
	Copyright 2007 SiteLabel - All rights reserved.
*/
/*
  -------------------------------------------------------------------------
	                       Caillou Communications / SiteLabel
						           Staus Bar Text
						       webmaster@sitelabel.com
						     http://www.sitelabel.com
    -------------------------------------------------------------------------  
*/

/*  Status Bar Text */

function statusBarText(stsbartxt) { //v1.0
  status=stsbartxt;
  document.SL_returnValue = true;
}

<!--
function JumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
/*  GO TO URL */

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

        function startCallback() {
document.getElementById('status').innerHTML = '<img src="../../../Picture_Library/uploading.gif" /><br><font size="1" face="Tahoma"><strong>Uploading...</strong></font>'; 
            return true;
        }

        function completeCallback(response) {
            // make something useful after (onComplete)
document.getElementById('status').innerHTML = ''; 
        }


function confirmOrder(){

       msg = "Wilt u zich echt voor deze cursus inschrijven?"
       return confirm(msg);
}


OverlayMessage = function ( container )
    {
    // Terminology:
    // +-----------------+
    // |wrapper          |
    // |+---------------+|
    // ||container      ||
    // ||   +-------+   ||
    // ||   |overlay|   ||
    // ||   +-------+   ||
    // ||               ||
    // |+---------------+|
    // +-----------------+

    // Get the parent.
    var parent = container.parentNode;

    // Make the wrapper div.
    var wrapper = document.createElement( 'div' );
    wrapper.style.cssText = container.style.cssText;
    parent.insertBefore( wrapper, container );

    // Move the container into the wrapper.
    parent.removeChild( container );
    wrapper.appendChild( container );
    container.style.cssText = 'position: relative; width: 100%; height: 100%;';

    // Add the overlay div.
    this.overlay = document.createElement( 'div' );
    wrapper.appendChild( this.overlay );
    this.visibleStyle = 'position: relative; top: -20%; background-color: ' + OverlayMessage.backgroundColor + '; width: 98%; height:98%; text-align: center; font-family: Verdana; font-size: 11px; color: #FFFFFF; margin-left: auto; margin-right: auto; padding: 2em; border: 1px solid ' + OverlayMessage.borderColor + '; z-index: 100; opacity: .90; filter: alpha(opacity=50);';
    this.invisibleStyle = 'display: none;';
    this.overlay.style.cssText = this.invisibleStyle;
    };


OverlayMessage.backgroundColor = '#FFFFFF';
OverlayMessage.borderColor = '#000000';


OverlayMessage.prototype.Set = function ( message )
    {
    this.overlay.innerHTML = message;
    this.overlay.style.cssText = this.visibleStyle;
    };


OverlayMessage.prototype.Clear = function ()
    {
    this.overlay.style.cssText = this.invisibleStyle;
    };


OverlayMessage.SetBackgroundColor = function ( color )
    {
    OverlayMessage.backgroundColor = color;
    };


OverlayMessage.SetBorderColor = function ( color )
    {
    OverlayMessage.borderColor = color;
    };
	
	
function addField(field){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file = 'add_field.php?field='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + field , true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('other').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function createLink(){
document.getElementById('submenu_url').innerHTML = "<input name='submenu' type='checkbox' id='submenu' value='1' onclick='destroyLink();' /><input name='pg_url' type='text' id='pg_url' size='45' />"; 
}
function destroyLink(){
document.getElementById('submenu_url').innerHTML = "<input name='submenu' type='checkbox' id='submenu' value='1' onclick='createLink();' checked='checked' />"; 
}

function confirmRemovePic(){

       msg = "Wilt u dit plaatje echt verwijderen?"
       return confirm(msg);
}

function removeImage(Item,picID){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var itemid = 'removepic.php?Item='; //This is the path to the file we just finished making *
       var pic = '&picID='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', itemid + Item + pic + picID, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('changeimage').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}


/* Menu  */
	   c=0
		du="";
	   function a(dv,n){		
		    
		   for(i=1;i<=n;i++){			
			   if(i==dv ){
				   if(du!=dv){
				      document.getElementById('mdiv'+i).style.display="inline"
					   du=dv
					}else{
					   du=""
					   document.getElementById('mdiv'+i).style.display="none"
					}
			   }else{
				     document.getElementById('mdiv'+i).style.display="none"				  					
			   }				
				
			}		
		}
		
	function reveza(qq){
	  document.getElementById(qq).className="itens_menu_r"
	}
	function volta(qq){
	  document.getElementById(qq).className="itens_menu"
	}

function onArchive(page){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file = 'archive.php?x=on&pageID='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + page , true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('arc_'+page).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function offArchive(page){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file = 'archive.php?x=off&pageID='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + page , true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('arc_'+page).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}
