
function correctPNG() //handle PNG transparency in IE 6
{
 for(var i=0; i < document.images.length; i++)
 {
  var img = document.images[i];
  var imgName = img.src.toUpperCase();
    
  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
  {
   var imgID = (img.id) ? "id='" + img.id + "' " : "";
   var imgClass = (img.className) ? "class='" + img.className + "' " : "";
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
   var imgStyle = "display:inline-block;" + img.style.cssText;
   
   if (img.align == "left") imgStyle = "float:left;" + imgStyle;
   
   if (img.align == "right") imgStyle = "float:right;" + imgStyle;
   
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;		
   
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
   img.outerHTML = strNewHTML
   i = i-1
  }
 }
}

function startList(idStr) //correct onmouseover event for ListItems in IE 6
{
	if (document.all&&document.getElementById) 
	{
		navRoot = document.getElementById(idStr);
		
		for ( i = 0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI") 
			{
				node.onmouseover = function() 
				{
					this.className += " over";
				}
				node.onmouseout = function() 
				{
					this.className = this.className.replace(" over", "");
				}
			}
		}
	}
}

function actPic( active )
{
	var pic = document.getElementById('bigFoto');
        if(document.all)
	{
		pic.style.filter = 'blendTrans(duration=0.7)';
		pic.filters.blendTrans.Apply();
		pic.filters.blendTrans.Play();
	}
	pic.src = active;
}

function hideCheckboxTable( tableElement )
{
 if( tableElement )
 {
  tableElement.style.position = 'absolute';
  tableElement.style.visibility = 'hidden';
 }
}

function showCheckBoxTable( str )
{
 var str = str.toLowerCase();
 
 var arr = ["bedrijfsuitje","bootcamp","kinderfeestje","locatieverhuur"];
 
 for(var i=0; i < arr.length; i++ )
 {
  hideCheckboxTable( document.getElementById( arr[i]+'Onderdelen' ) );
  hideCheckboxTable( document.getElementById( arr[i]+'Opties' ) );
 }
 
 var tableOnderdelen = document.getElementById( str + 'Onderdelen' );
 var tableOpties     = document.getElementById( str + 'Opties' );
 
 if( tableOnderdelen )
 {
  tableOnderdelen.style.position = 'relative';
  tableOnderdelen.style.visibility  = 'visible';
 }
 
 if( tableOpties )
 {
  tableOpties.style.position = 'relative';
  tableOpties.style.visibility  = 'visible';
 }
}

var ihtml;
function setupScroll(im)
{
  
  fg_image_index = 0;
  bg_image_index = (fg_image_index + 3) % im.length;
  
  ihtml = "<div id=\"fotodiv0\" class=\"foto\"><img id=\"foto_" + (0) + "\" src=\"" + im[fg_image_index] + "\"/></div>";
  ihtml += "<div id=\"fotodiv1\"  class=\"foto\"><img id=\"foto_" + (1) + "\"src=\"" + im[fg_image_index+1] + "\"/></div>";
  ihtml += "<div id=\"fotodiv2\" class=\"foto\"><img id=\"foto_" + (2) + "\"src=\"" + im[fg_image_index+2] + "\"/></div>";
  ihtml+="</div>";

  $('contentRight').innerHTML = ihtml;
  image_list = im;
  div_list =  $$("#contentRight div");
}

var image_list;
var div_list;
var fg_image_index = 0;
var bg_image_index = 0;
var div_index = 0;

function scrollImagesVertically ()
{
    
    mydiv = $('fotodiv'+div_index);
    //div_list[div_index].style.backgroundImage = 'url('+image_list[bg_image_index] +')';
    if(mydiv)
    mydiv.style.backgroundImage = 'url('+image_list[bg_image_index] +')';

    temp = $('foto_'+div_index);
    if (temp)
    {
    new Effect.Fade(temp, {duration:4, afterFinish: function (obj)
        {temp.src = image_list[fg_image_index];
        new  Effect.Appear(temp) }});
        }
    fg_image_index = bg_image_index;
    bg_image_index++;
    bg_image_index = bg_image_index % image_list.length;
    div_index++;
    div_index = div_index % 3;
        
    setTimeout(scrollImagesVertically,4200);
}


function convertCurrency ( kroon )
{
    var item = $('rate').selectedIndex;
    var rate = $('rate').options[item].value;
    var res =  ( $F('hoeveel') * rate / kroon );
    
    $('resultaat').innerHTML = res.toFixed(2);
}

window.onload = function()
{ 
//  var supported = /MSIE ((5\.5)|(6))/.test(navigator.userAgent) && navigator.platform == "Win32";
//  
//  if( supported )
//  {
//   startList('nav');
//   startList('navBottom');
//   correctPNG();
//  }
 
 //showCheckBoxTable( 'bedrijfsuitje' );
 //enableTooltips();
  
  $('vuur_img').appear({ duration: 5.0, from: 0.0, to: 1.0 });
  scrollImagesVertically();

 
}
