/*********************************************/
/*    Dynamische menu en footer              */
/*    Author: Guido Willekens                */
/*    Date: 18/5/2008                        */
/*********************************************/

// Adjust root before putting on the server!!!!

var root = new String();
root = "/";
//root = "/snvNew/";

function drawMenu()
{
	myMenu = new String();
	myMenu = "<ul id='menu'>" +
  		"<li><a href='" + root + "index.htm'>Home</a></li>" +
	  	"<li><a href='" + root + "menubar_overOns/seniornet.htm'>Over ons</a></li>" +
  		"<li><a href='" + root + "menubar_wieIsWie/animatoren.htm'>Wie is wie?</a></li>" +
		"<li><a href='" + root + "snv_opleiding/aanbod.htm'>Ons aanbod</a></li>" +

		"<li><a href='" + root + "menubar_opleidingAanvragen/OpleidingAanvragen.aspx'>Opleiding aanvragen</a></li>" +
  		"<li><a href='http://www.snvl.be/forum/default.asp'>Computerforum</a></li>" +
		"<li><a href='" + root + "menubar_engels/engels.htm'>In English...</a></li>" +
		"<li><a href='" + root + "menubar_grootte/zoomen.htm'>Zoomen</a></li>" +

		"</ul>"; 
		document.write(myMenu);	
}

function drawNavigationMenu(pos)
{
	myMenu = new String(); 
	myMenu = "<h3>Menu</h3><ul>" ;
	myMenu += "<li><a ";
	if (pos == 1) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_opleiding/opleiding.htm'>Opleidingen</a></li>";
	myMenu +=  "<li><a ";
	if (pos == 2) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_onlineLeren/onlineLeren.htm'>On-line leren</a></li>"; 
	myMenu += "<li><a ";
	if (pos == 3) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_ICTnieuws/ICTnieuws.htm'>ICT-nieuwtjes</a></li>";
	myMenu += "<li><a "; 
	if (pos == 4) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_wijntip/wijntip.htm'>Wijntip</a></li>";
	myMenu += "<li><a ";
	if (pos == 5) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_diaShow/diaShow.htm'>Diashow</a></li>";
	myMenu += "<li><a ";
	if (pos == 6) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_spelen/spelen.htm'>Spelen</a></li>";
	myMenu += "<li><a ";
	if (pos == 7) myMenu += "class='current'";
	myMenu += " href='http://www.animatedexplanations.com/' target='_blank'>e-leren</a></li>";
	myMenu += "<li><a ";
	if (pos == 8) myMenu += "class='current'";
	myMenu += " href='" + root + "snv_nuttigeLinks/nuttigeLinks.htm'>Nuttige links</a></li>";
	myMenu += "</ul>"; 
	document.write(myMenu);	
}

function privaat()
{
     login = new String();
	 login = "<p>Priv&eacute</p> " + 
        "<form action='" + root + "snv_documenten/aanmelden.aspx' method='post' > " +
         " <p> Aanmelden als Animator:  </p>" + 
         "<p>  <div align='center'><input name='a' type='image' src='" + root + "imagesCommon/login.png' /> </div></p>" +           
        " </form>";	
		document.write(login);
}

function teamviewer()
{
     tv = new String();
	 tv = "<form action='" + root + "tv/tva.exe'  > " +
         " <p> Aanmelden als overnemer: </p> " + 
         " <p><div align='center'>  <input name='g' type='image' src='" + root + "imagesHome/tva.png' /></div></p> " +         " </form>" +
		 		 "<form action='" + root + "tv/tvb.exe'  > " +
         " <p> Aanmelden als target: </p> " + 
         " <p><div align='center'>  <input name='h' type='image' src='" + root + "imagesHome/tvb.png' /></div></p> " +         " </form>"
		 
		document.write(tv);
}

function drawFooter()
{
	myFooter = new String();
	myFooter = "Copyright &copy; Seniornet Vlaanderen &nbsp;" +
		" | <a href='mailto:webmaster@seniornetvlaanderen.be'>Webmaster</a>" +
		"&nbsp;&nbsp;|<a href='" + root + "footer_contact/Contact.aspx'>Contacteer ons</a>";
	document.write(myFooter);
}

// Om spamrobots te misleiden: 
function antispam(naam,domein,tekst)
{
	adres = new String();
	adres = naam + "&#64" + domein;
	document.write("<a href = 'mailto:" + adres + " '>" + tekst + "</a>");
	
}

// Kan op elke pagina via menu opgeroepen
var bookmarkUrl="http://www.seniornetvlaanderen.be/index.htm"
var bookmarkTitle="Seniornet Vlaanderen, digitaal vormingsplatform"

function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkUrl,bookmarkTitle)
}

/*********************************************/
/*    Utilities voor cookies                  */
/*    Author: Guido Willekens                */
/*    Date: 10/10/2008                       */
/*********************************************/

// Datum weergave
function initArray() {
 	for(i=0;i<initArray.arguments.length; i++)
  	this[i] = initArray.arguments[i];
}
function getFullYear(d) {
	yr = d.getYear();
	if (yr < 1000) yr+=1900; return yr;
}
var today = new Date();
var exp = new Date(today.getTime()+ 365 * 24 * 60 *60 * 1000); // Voor cookies
var maand=new initArray("januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december");
var dag= new initArray("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");

/*                    <script language="JavaScript">
	<!--
	document.write("<i>"+dag[today.getDay()]+" "+today.getDate()+" "+maand[today.getMonth()]+" "+getFullYear(today)+"</i>");
	 //-->
        		</script> */



// Gebruik van cookies

function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}

function SetCookie (name, value, expires, path, domain, secure) {
if (escape (value) == "1") { return null } ;
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


function doRefresh(){
location.reload();
}

/*********************************************/
/*    Utilities voor imagepopups              */
/*********************************************/

function Large(obj,tekst,zijkant)
{
    // Eigenschappen van Large
	var breedte = 500;
	var hoogte = 375;
	var offset = 10;
	
	var imgbox=document.getElementById("imgbox");
    imgbox.style.visibility='visible';
    var img = document.createElement("img");    
    img.src=obj.src;
    img.style.width= breedte + 'px';
    img.style.height=hoogte + 'px';
    
    if(img.addEventListener){
        img.addEventListener('mouseout',Out,false);
    } else {
        img.attachEvent('onmouseout',Out);
    }             
    imgbox.innerHTML=tekst;    
    imgbox.appendChild(img); 
	if( zijkant == 'links')
	{
    imgbox.style.left=(getElementLeft(obj)) + offset +'px';
	}
	else
	{
	imgbox.style.left= (getElementLeft(obj)) - breedte + obj.width - offset +'px';
	}
    imgbox.style.top=(getElementTop(obj)) + offset + 'px';     
}  

function Out()
{
    document.getElementById("imgbox").style.visibility='hidden';
}

function getElementLeft(elm) 
{
    var x = 0;

    //set x to elm’s offsetLeft
    x = elm.offsetLeft;

    //set elm to its offsetParent
    elm = elm.offsetParent;

    //use while loop to check if elm is null
    // if not then add current elm’s offsetLeft to x
    //offsetTop to y and set elm to its offsetParent

    while(elm != null)
     {
        x = parseInt(x) + parseInt(elm.offsetLeft);
        elm = elm.offsetParent;
     }
     
     return x;
}

function getElementTop(elm) 
{
    var y = 0;

    //set x to elm’s offsetLeft
    y = elm.offsetTop;

    //set elm to its offsetParent
    elm = elm.offsetParent;

    //use while loop to check if elm is null
    // if not then add current elm’s offsetLeft to x
    //offsetTop to y and set elm to its offsetParent

    while(elm != null)
     {
        y = parseInt(y) + parseInt(elm.offsetTop);
        elm = elm.offsetParent;
     }
     
     return y;
}



