var pngAlpha = CheckBrowser();

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
//Locations_Amsterdam Slideshow
var fadeimages=new Array();
fadeimages[0]=["images/repres_01.jpg", "", ""]; 
fadeimages[1]=["images/repres_02.jpg", "", ""]; 
fadeimages[2]=["images/repres_03.jpg", "", ""]; 
fadeimages[3]=["images/repres_04.jpg", "", ""]; 
fadeimages[4]=["images/repres_05.jpg", "", ""]; 
fadeimages[5]=["images/repres_06.jpg", "", ""]; 
fadeimages[6]=["images/repres_07.jpg", "", ""]; 
fadeimages[7]=["images/repres_08.jpg", "", ""]; 

//fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""]; //image with link syntax
//fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"]; //image with link and target syntax



//Sourcing Slideshow
var fadeimages4=new Array();
fadeimages4[0]=["images/inkoop_01.jpg", "", ""]; 
fadeimages4[1]=["images/inkoop_02.jpg", "", ""];


 
var fadebgcolor="white";

var fadearray=new Array(); //array to cache fadeshow instances
var fadeclear=new Array(); //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById); //modern dom browsers
var iebrowser=document.all;

//document.onload tasks start
window.onload = function() 
{
    if (!pngAlpha)
	{
	    document.getElementById("LowerLeftBorderImg").style.display = "inline";
	}

	//MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?');
	
    if (document.getElementById("EEE_Home")) 
    {
        var EEE_Out_Home = "Images/EEE_Out_Home.png";
        var EEE_Over_Home = "Images/EEE_Over_Home.png";
        var EEE_Down_Home = "Images/EEE_Down_Home.png";

        if (!pngAlpha)
        {
            document.getElementById("EEE_Home").src = EEE_Out_Home;
        }        
        
        document.getElementById("EEE_Home_Overlay").style.display = "none";
		
        document.getElementById("EEE_Home").onmouseover = function() 
        {
            if (pngAlpha == true)
            {
                this.filters(0).src = EEE_Over_Home;
            }
            else
            {
                this.src = EEE_Over_Home;
            }
        }
        
        document.getElementById("EEE_Home").onmouseout = function() 
        {
            if (pngAlpha == true)
            {
                this.filters(0).src = EEE_Out_Home;
            }
            else
            {    
                this.src = EEE_Out_Home;
            }
        }
        
        document.getElementById("EEE_Home").onmousedown = function() 
        {
            if (pngAlpha == true)
            {
                this.filters(0).src = EEE_Down_Home;
            }
            else
            {
                this.src = EEE_Down_Home;
            }
        }
        
        document.getElementById("EEE_Home").onmouseup = function() 
        {
            if (document.getElementById("EEE_Home_Overlay").style.display != "block") 
            {
	            document.getElementById("EEE_Home_Overlay").style.display = "block";
	            document.getElementById("EEE_Home").style.top = "50px";
	            document.getElementById("EEE_Home").style.right = "710px";
	            document.getElementById("EEEPanel").style.display = "block";
	            document.getElementById("NewsPanel").style.display = "none";
	            document.getElementById("Visualfilm").style.display = "none";
            }
            else 
            {
	            document.getElementById("EEE_Home_Overlay").style.display = "none";
	            document.getElementById("EEE_Home").style.top = "22px";
	            document.getElementById("EEE_Home").style.right = "77px";
	            document.getElementById("EEEPanel").style.display = "none";
	            document.getElementById("NewsPanel").style.display = "block";
	            document.getElementById("Visualfilm").style.display = "block";
            }
        }
    }

    if (document.getElementById("EEE_Content")) 
    {
        EEE_Out_Content = "Images/EEE_Out_Content.png";
        EEE_Over_Content = "Images/EEE_Over_Content.png";
        EEE_Down_Content = "Images/EEE_Down_Content.png";
        
        if (!pngAlpha)
        {
            document.getElementById("EEE_Content").src = EEE_Out_Content;
        } 
        
        document.getElementById("EEE_Content_Overlay").style.display = "none";
		
        document.getElementById("EEE_Content").onmouseover = function() 
        {
            if (pngAlpha == true)
            {    
                this.filters(0).src = EEE_Over_Content;
            }
            else
            {
                this.src = EEE_Over_Content;                
            }
            
        }
        
        document.getElementById("EEE_Content").onmouseout = function() 
        {
            if (pngAlpha == true)
            { 
                this.filters(0).src = EEE_Out_Content;
            }
            else
            {
                this.src = EEE_Out_Content;
            }
            
        }
        document.getElementById("EEE_Content").onmousedown = function() 
        {
            if (pngAlpha == true)
            {
                this.filters(0).src = EEE_Down_Content;
            }
            else
            {
                this.src = EEE_Down_Content;
            }
        }
        document.getElementById("EEE_Content").onmouseup = function() 
        {
            if (document.getElementById("EEE_Content_Overlay").style.display != "block") 
            {
	            document.getElementById("EEE_Content_Overlay").style.display = "block";
	            document.getElementById("EEE_Content").style.bottom = "110px";
	            document.getElementById("EEE_Content").style.left = "210px";
	            document.getElementById("Visualfilm").style.display = "none";
            }
            else 
            {
	            
	            document.getElementById("EEE_Content_Overlay").style.display = "none";
	            document.getElementById("EEE_Content").style.bottom = "20px";
	            document.getElementById("EEE_Content").style.left = "200px";
	            document.getElementById("Visualfilm").style.display = "block";  
            }
        }
    }

    if (!document.getElementsByTagName) return; 
    var anchors = document.getElementsByTagName("a"); 
    for (var i=0; i<anchors.length; i++) { 
        var anchor = anchors[i]; 
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") 
            anchor.target = "_blank"; 
    } 

    document.onkeydown = function(e) {
        var e = (e) ? e : event;
        if (e.ctrlKey && e.shiftKey && e.keyCode == 86) {
            var url = "http://validator.w3.org/check?verbose=1&uri=";
            url += encodeURIComponent(window.location.href);
            window.location.href = url;
        }
    }
    
    MM_reloadPage(true);
}
//document.onload tasks end


function CheckBrowser()
{
    var browser = new BrowserDetect();
    
    // if IE5.5+ on Win32, then display PNGs with AlphaImageLoader
    if ((browser.isIE55 || browser.isIE6x) && browser.isWin32) 
    {
    	return true;
    } 	
    // else, if the browser can display PNGs normally, then do that
    else //if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin && browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac && browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isDreamcast)) 
    {
	    return false;
    }
}

// Browser Detect  v2.1.6
// documentation: http://www.dithered.com/javascript/browser_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
function BrowserDetect() 
{
    var ua = navigator.userAgent.toLowerCase(); 

    // browser engine name
    //this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
    //this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

    // browser name
    this.isKonqueror   = (ua.indexOf('konqueror') != -1); 
    this.isSafari      = (ua.indexOf('safari') != - 1);
    this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
    this.isOpera       = (ua.indexOf('opera') != -1); 
    this.isIcab        = (ua.indexOf('icab') != -1); 
    this.isAol         = (ua.indexOf('aol') != -1); 
    this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
    this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
    this.isFirefox     = (ua.indexOf('firefox/') != -1 || ua.indexOf('firebird/') != -1);
    this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );

    // spoofing and compatible browsers
    //this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
    //this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);

    // rendering engine versions
    //this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
    //this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
    //this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );

    // browser version
    this.versionMinor = parseFloat(navigator.appVersion); 

    // correct version number
    if (this.isGecko && !this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
    }
    else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
    }
    else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
    }
    else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
    }
    else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
    }
    else if (this.isOmniweb) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
    }
    else if (this.isOpera) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
    }
    else if (this.isIcab) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
    }

    this.versionMajor = parseInt(this.versionMinor); 

    // dom support
    //this.isDOM1 = (document.getElementById);
    //this.isDOM2Event = (document.addEventListener && document.removeEventListener);

    // css compatibility mode
    //this.mode = document.compatMode ? document.compatMode : 'BackCompat';

    // platform
    this.isWin    = (ua.indexOf('win') != -1);
    this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
    this.isMac    = (ua.indexOf('mac') != -1);
    this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
    this.isLinux  = (ua.indexOf('linux') != -1);

    // specific browser shortcuts
    this.isNS4x = (this.isNS && this.versionMajor == 4);
    this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
    this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
    this.isNS4up = (this.isNS && this.versionMinor >= 4);
    this.isNS6x = (this.isNS && this.versionMajor == 6);
    this.isNS6up = (this.isNS && this.versionMajor >= 6);
    this.isNS7x = (this.isNS && this.versionMajor == 7);
    this.isNS7up = (this.isNS && this.versionMajor >= 7);

    this.isIE4x = (this.isIE && this.versionMajor == 4);
    this.isIE4up = (this.isIE && this.versionMajor >= 4);
    this.isIE5x = (this.isIE && this.versionMajor == 5);
    this.isIE55 = (this.isIE && this.versionMinor == 5.5);
    this.isIE5up = (this.isIE && this.versionMajor >= 5);
    this.isIE6x = (this.isIE && this.versionMajor == 6);
    this.isIE6up = (this.isIE && this.versionMajor >= 6);

    this.isIE4xMac = (this.isIE4x && this.isMac);
}

function CheckFlash(imgUrl, movieClass, movieUrl, movieWidth, movieHeight)
{
    var htmlMovie = "<div class='" + movieClass + "' id='Visualfilm' ><script type='text/javascript'>AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','" + movieWidth + "','height','" + movieHeight + "','id','FLVPlayer','src','FLVPlayer_Progressive','flashvars','&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=" + movieUrl + "&autoPlay=true&autoRewind=true','quality','high','scale','noscale','name','FLVPlayer','salign','lt','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','FLVPlayer_Progressive','wmode','transparent' );</script><noscript><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + movieWidth + "' height='" + movieHeight + "' id='FLVPlayer' style='z-index:6'><param name='movie' value='FLVPlayer_Progressive.swf' /><param name='salign' value='lt' /><param name='quality' value='high' /><param name='scale' value='noscale' /><param name='wmode' value='transparent'/><param name='FlashVars' value='&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=" + movieUrl + "&autoPlay=true&autoRewind=true' /><embed src='FLVPlayer_Progressive.swf' flashvars='&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=" + movieUrl + "&autoPlay=true&autoRewind=true' quality='high' scale='noscale' width='" + movieWidth + "' height='" + movieHeight + "' name='FLVPlayer' salign='LT' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' /></object></noscript></div>";
    var htmlImage = "<img id='Visualfilm' class='Visual' src='" + imgUrl + "' />";
    
    if (MM_CheckFlashVersion('7,0,0,0')) 
    {
        document.write(htmlMovie);
    } 	
    else 
    {
	    if (confirm('Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?'))
        {
            window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
  	        document.write(htmlMovie);
        }
        else
        {	    
	        document.write(htmlImage);
	    }
    }
}


function MM_CheckFlashVersion(reqVerStr)
{
    with(navigator)
    {
        var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
        var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
        if (!isIE || !isWin)
        {  
            var flashVer = -1;
            if (plugins && plugins.length > 0)
            {
                var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
                desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
                if (desc == "") 
                {
                    flashVer = -1;
                }
                else
                {
                    var descArr = desc.split(" ");
                    var tempArrMajor = descArr[2].split(".");
                    var verMajor = tempArrMajor[0];
                    var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
                    var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
                    flashVer =  parseFloat(verMajor + "." + verMinor);
                }
            }
            // WebTV has Flash Player 4 or lower -- too low for video
            else if (userAgent.toLowerCase().indexOf("webtv") != -1) 
            {
                flashVer = 4.0;
            }
            
            var verArr = reqVerStr.split(",");
            var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
      
            if (flashVer < reqVer)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        else
        {
            return true;
        }
    }
}
    
function MM_reloadPage(init) 
{  
    //reloads the window if Nav4 resized
    if (init==true) with (navigator) 
    {
        if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
        {
            document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; 
        }
    }
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
    {
        location.reload();
    }
}






//Fade Show functions
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers

var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all

function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}

var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2

if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')

if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}

fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}


fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}

fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}


fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
