function eraseCookie(name) {
	createCookie(name,"",-1);
}
 
  
function createCookie(name,value) {
	expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) 
		 return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function Scroll1NL() {
  var pos1 = 0;
  var direction1 = '';
  
  obj=document.getElementById("windowtext3NL");

  pos1       = parseInt (readCookie ('SOD_pos1NL'));
  direction1 = readCookie ('SOD_direction1NL');
  
  if (direction1 == 'up') { 
    pos1 = pos1 - 1;
 
    if (pos1 <= 0 - obj.offsetHeight + 1000) {
 	  direction1 = 'down';
    }
  }
  else {
    pos1 = pos1 + 1;
 
    if (pos1 >= 0) {
  	  direction1 = 'up';
    }	  
  }
  
  obj.style.top = pos1; 
  
  createCookie('SOD_pos1NL',       pos1); 
  createCookie('SOD_direction1NL', direction1); 
   
  window.setTimeout("Scroll1NL();", 30);
}


function Scroll1EN() {
  var pos1 = 0;
  var direction1 = '';
  
  obj=document.getElementById("windowtext3EN");

  pos1       = parseInt (readCookie ('SOD_pos1EN'));
  direction1 = readCookie ('SOD_direction1EN');
  
  if (direction1 == 'up') { 
    pos1 = pos1 - 1;
 
    if (pos1 <= 0 - obj.offsetHeight + 1000) {
 	  direction1 = 'down';
    }
  }
  else {
    pos1 = pos1 + 1;
 
    if (pos1 >= 0) {
  	  direction1 = 'up';
    }	  
  }
  
  obj.style.top = pos1; 
  
  createCookie('SOD_pos1EN',       pos1); 
  createCookie('SOD_direction1EN', direction1); 
   
  window.setTimeout("Scroll1EN();", 30);
}


function Scroll2NL() {
  var pos2 = 0;
  var direction2 = '';
  
  obj=document.getElementById("windowtext2NL");

  pos2       = parseInt (readCookie ('SOD_pos2NL'));
  direction2 = readCookie ('SOD_direction2NL');
  
  if (direction2 == 'up') { 
    pos2 = pos2 - 1;
 
    if (pos2 <= 0 - obj.offsetHeight + 400) {
 	  direction2 = 'down';
      pos2 = pos2 + 1;
    }
  }
  else {
    pos2 = pos2 + 1;
 
    if (pos2 >= 0) {
  	  direction2 = 'up';
      pos2 = pos2 - 1;
    }	  
  }
  
  obj.style.top = pos2; 
  
  createCookie('SOD_pos2NL',       pos2); 
  createCookie('SOD_direction2NL', direction2); 
   
  window.setTimeout("Scroll2NL();", 30);
}


function Scroll2EN() {
  var pos2 = 0;
  var direction2 = '';
  
  obj=document.getElementById("windowtext2EN");

  pos2      = parseInt (readCookie ('SOD_pos2EN'));
  direction2 = readCookie ('SOD_direction2EN');
  
  if (direction2 == 'up') { 
    pos2 = pos2 - 1;
 
    if (pos2 <= 0 - obj.offsetHeight + 400) {

 	  direction2 = 'down';
      pos2 = pos2 + 1;
    }
  }
  else {
    pos2 = pos2 + 1;
 
    if (pos2 >= 0) {
 
  	  direction2 = 'up';
      pos2 = pos2 - 1;
    }	  
  }
  
  obj.style.top = pos2; 
  
  createCookie('SOD_pos2EN',       pos2); 
  createCookie('SOD_direction2EN', direction2); 
   
  window.setTimeout("Scroll2EN();", 30);
}


function Scroll3NL() {
  var pos3 = 0;
  var direction3 = '';
  
  obj=document.getElementById("windowtext5NL");

  pos3       = parseInt (readCookie ('SOD_pos3NL'));
  direction3 = readCookie ('SOD_direction3NL');
  
  if (direction3 == 'up') { 
    pos3 = pos3 - 1;
 
    if (pos3 <= 0 - obj.offsetHeight + 400) {
 	  direction3 = 'down';
      pos3 = pos3 + 1;
    }
  }
  else {
    pos3 = pos3 + 1;
 
    if (pos3 >= 0) {
  	  direction3 = 'up';
      pos3 = pos3 - 1;
    }	  
  }
  
  obj.style.top = pos3; 
  
  createCookie('SOD_pos3NL',       pos3); 
  createCookie('SOD_direction3NL', direction3); 
   
  window.setTimeout("Scroll3NL();", 30);
}


function Scroll3EN() {
  var pos3 = 0;
  var direction3 = '';
  
  obj=document.getElementById("windowtext5EN");

  pos3      = parseInt (readCookie ('SOD_pos3EN'));
  direction3 = readCookie ('SOD_direction3EN');
  
  if (direction3 == 'up') { 
    pos3 = pos3 - 1;
 
    if (pos3 <= 0 - obj.offsetHeight + 400) {

 	  direction3 = 'down';
      pos3 = pos3 + 1;
    }
  }
  else {
    pos3 = pos3 + 1;
 
    if (pos3 >= 0) {
 
  	  direction3 = 'up';
      pos3 = pos3 - 1;
    }	  
  }
  
  obj.style.top = pos3; 
  
  createCookie('SOD_pos3EN',       pos3); 
  createCookie('SOD_direction3EN', direction3); 
   
  window.setTimeout("Scroll3EN();", 30);
}




function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}


function ScrollAll () {

// eraseCookie ('SOD_direction1EN');
// eraseCookie ('SOD_pos1EN');
  
 if (readCookie ('SOD_direction1NL') == null) {
   createCookie('SOD_pos1NL', 0); 
   createCookie('SOD_direction1NL', 'up'); 
 }

 if (readCookie ('SOD_direction1EN') == null) {
   createCookie('SOD_pos1EN', 0); 
   createCookie('SOD_direction1EN', 'up'); 
 }

 if (readCookie ('SOD_direction2NL') == null) {
   createCookie('SOD_pos2NL', 0); 
   createCookie('SOD_direction2NL', 'up'); 
 }

 if (readCookie ('SOD_direction2EN') == null) {
   createCookie('SOD_pos2EN', 0); 
   createCookie('SOD_direction2EN', 'up'); 
 }

 if (readCookie ('SOD_direction3NL') == null) {
   createCookie('SOD_pos3NL', 0); 
   createCookie('SOD_direction3NL', 'up'); 
 }

 if (readCookie ('SOD_direction3EN') == null) {
   createCookie('SOD_pos3EN', 0); 
   createCookie('SOD_direction3EN', 'up'); 
 }

 if (gup ('lang') == 'EN') {
   Scroll1EN ();
   Scroll2EN ();
   Scroll3EN ();
 }
 if (gup ('lang') == 'NL' || gup ('lang') == '' ){	
   Scroll1NL ();
   Scroll2NL ();
   Scroll3NL ();
 }  
}