var currentCal = "";

function InitCal()
{
	
	var s1 = getCookie('buttonid');	
	var s2 = getCookie('divcalid');
	var s3 = getCookie('index');	
	
	if(s1 == null || s2 == null || s3==null)
		return;
	
	ToggleCalendar(s1,s2,s3)	
}

if (window.attachEvent){ window.attachEvent("onload", InitCal);}
else
{
	if(window.addEventListener)
	{
		window.addEventListener("load",InitCal,false)
		
	}
}


function generateClassNames() 
{
	if (document.bigimage.src == 'http://' + document.domain + '/images/layout/nophoto.gif')
	{
		document.getElementById('Photos').style.display="none"
	}
	else
	{
		var inputs = document.getElementsByTagName('div')
	   
		for (var i = 0; i < inputs.length; i++) 
		{
			var x = inputs[i];
		    
			if (x.className == "Photo") 
			{
				x.onmouseover = MouseOver
			}
		}
	}
}

/*
function setFontSize(size) {
    var p = document.getElementsByTagName('p');    
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));
        } else {
            var s = 12;
        }
        if (size == 'large') s = 16;
        if (size == 'normal') s = 12;
        if (size == 'small') s = 9;
        p[i].style.fontSize = s + "px"
    }
}
*/

var nophoto = 1

function checkPhoto(img)
{
	if (nophoto == 1)
	{
		document.bigimage.src = img
		nophoto = 0
	}
}
 
function MouseOver()
{
	var inputs = document.getElementsByTagName('div')
  
	for (var i = 0; i < inputs.length; i++) 
	{
		var x = inputs[i]

		if (x.className == "PhotoHover") 
		{
			x.className = "Photo"
		}
	}
	
	return this.className="PhotoHover"
}



function popUp2(img,width,height) 
{
	var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2;

	day = new Date();
	id = day.getTime();
	eval("page" + " = window.open(img, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "');");
}

function popUp(img) 
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(img, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=100,top=150');");
}

function Print()
{
	window.print();
	window.close();
}

function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
} 


function toggleAll(o) 
{
	for (i=0; i<document.forms[0].elements.length; i++) {
		if (document.forms[0].elements[i].type == "checkbox") {
			document.forms[0].elements[i].checked = o.checked;
		}
	}
}



function getCookie(sName)
{
	var aCookie = document.cookie.split('; '), i = aCookie.length, aCrumb;
    while (i--)
    {
         aCrumb = aCookie[i].split('=');
        if (sName == aCrumb[0])
            return typeof aCrumb[1] != 'undefined'? unescape(aCrumb[1]) : null;
    }

    return null;

}

function setCookie(sName, sValue)
{
	var date = new Date();
	date.setTime(date.getTime()+(30*1000));
    document.cookie = sName + '=' + escape(sValue) + '; expires='+date.toGMTString()+'; path=/';

}



function showGalleryPopup(url,width) 
{
	width = width +20;
	var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2;
	var height = screen.height - 40;
	day = new Date();
	id = day.getTime();
	eval("page" + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "');");
}

function CopyError(lang) {

    var msg = "Copy Error";
    switch (lang) {
        case "nl":
            msg = "Kopieren niet toegelaten";
            break;
        case "fr":
            msg = "Copier non authorisé";
            break;
        default:
            msg = "Copy Error";
            break;
    }
    alert(msg);
}



