/*
================================
JQuery cookie
$.cookie('the_cookie'); // get cookie
$.cookie('the_cookie', 'the_value'); // set cookie
$.cookie('the_cookie', 'the_value', { expires: 7 }); // set cookie with an expiration date seven days in the future
$.cookie('the_cookie', '', { expires: -1 }); // delete cookie

================================
*/

jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires *1 * 10 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // NOTE Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/*
================================
SIDE NAVIGATION MENU
================================
*/


function initMenu() {
  $('#menu ul').hide();
  //$('#menu ul:first').show();
  $('#menu li a').click(
    function() {
       
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#menu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        checkElement.find('a:first table:first').click();
        return false;
        }
      }
      
    );
  }
$(document).ready(function() {initMenu();});


document.numOfChild = new Array();
function altcolor(id)
    {
        
	    document.numOfChild.push(id);
        for(var i=0;i<document.numOfChild.length;i++)
        {
            document.getElementById(document.numOfChild[i]).style.color = "#FFFFFF";
        }
        document.getElementById(id).style.color = "#F8980E";
    }


var  WBWNavIDs = new Array();


function MBTM_WBW_Navi_isExist(value){
    var isExist = false;
    for(var i=0;i<WBWNavIDs.length;i++){
        
            if (WBWNavIDs[i] == value){
                isExist = true;
            }
    }

    return isExist;
}


function MBTM_WBW_Navi_Add(value){
    
     if ( !MBTM_WBW_Navi_isExist(value)){
         WBWNavIDs.push(value) ;
     }
}
    
function MBTM_WBW_Navi_SwapBg(id){
    
  
   MBTM_WBW_Navi_Add(id);
   
   for(var i=0;i<WBWNavIDs.length;i++){
  

        if(id ==WBWNavIDs[i] )
        {
        
     
        
         if(document.getElementById(WBWNavIDs[i])){
               document.getElementById(id).style.backgroundImage= "url(/Assets/Images/MBTM-wat-bieden_table_bg_dark.gif)";
         }

        
        }
        else
        {
        
        
         if(document.getElementById(WBWNavIDs[i])){
            document.getElementById(WBWNavIDs[i]).style.backgroundImage= "url(/Assets/Images/MBTM-wat-bieden_table_bg_light.gif)";
         }

        
        
        }
   
   }
   
   
}
/* FOR THE VIDEO PAGE*/

var  VIDEOSNavIDs = new Array();


function MBTM_VIDEOS_Navi_isExist(value){
    var isExist = false;
    for(var i=0;i<VIDEOSNavIDs.length;i++){
        
            if (VIDEOSNavIDs[i] == value){
                isExist = true;
            }
    }

    return isExist;
}


function MBTM_VIDEOS_Navi_Add(value){
    
     if ( !MBTM_VIDEOS_Navi_isExist(value)){
         VIDEOSNavIDs.push(value) ;
     }
}
    
function MBTM_VIDEO_Navi_SwapBg(id){
    
  
   MBTM_VIDEOS_Navi_Add(id);
   
   for(var i=0;i<VIDEOSNavIDs.length;i++){
  

        if(id ==VIDEOSNavIDs[i] )
        {
        
     
        
         if(document.getElementById(VIDEOSNavIDs[i])){
               document.getElementById(id).style.backgroundImage= "url(/Assets/Images/videosSideNvi_bg_a.gif)";
         }

        
        }
        else
        {
        
        
         if(document.getElementById(VIDEOSNavIDs[i])){
            document.getElementById(VIDEOSNavIDs[i]).style.backgroundImage= "url(/Assets/Images/videosSideNvi_bg_b.gif)";
         }

        
        
        }
   
   }
   
   
}




/* FOR THE FAQ PAGE*/

var  FAQNavIDs = new Array();


function MBTM_FAQ_Navi_isExist(value){
    var isExist = false;
    for(var i=0;i<FAQNavIDs.length;i++){
        
            if (FAQNavIDs[i] == value){
                isExist = true;
            }
    }

    return isExist;
}


function MBTM_FAQ_Navi_Add(value){
    
     if ( !MBTM_FAQ_Navi_isExist(value)){
         FAQNavIDs.push(value) ;
     }
}
    
function MBTM_FAQ_Navi_SwapBg(id){
    
  
   MBTM_FAQ_Navi_Add(id);
   
   for(var i=0;i<FAQNavIDs.length;i++){
  

        if(id ==FAQNavIDs[i] )
        {
        
     
        
         if(document.getElementById(FAQNavIDs[i])){
               document.getElementById(id).style.backgroundImage= "url(/Assets/Images/faq_bg_dark.gif)";
         }

        
        }
        else
        {
        
        
         if(document.getElementById(FAQNavIDs[i])){
            document.getElementById(FAQNavIDs[i]).style.backgroundImage= "url(/Assets/Images/faq_bg_bright.gif)";
         }

        
        
        }
   
   }
   
   
}



/*
================================
Popup window
================================
*/

// jQuery Alert Dialogs Plugin
//
// Version 1.0
//
// Cory S.N. LaViska
// A Beautiful Site (http://abeautifulsite.net/)
// 29 December 2008
//
// Visit http://abeautifulsite.net/notebook/87 for more information
//
// Usage:
//		jAlert( message, [title, callback] )
//		jConfirm( message, [title, callback] )
//		jPrompt( message, [value, title, callback] )
// 
// History:
//
//		1.00 - Released (29 December 2008)
//
// License:
// 
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
// is copyright 2008 A Beautiful Site, LLC. 
//
(function($) {
	
	$.alerts = {
		
		// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time
		
		verticalOffset: -75,                // vertical offset of the dialog from center screen, in pixels
		horizontalOffset: 0,                // horizontal offset of the dialog from center screen, in pixels/
		repositionOnResize: true,           // re-centers the dialog on window resize
		overlayOpacity: .01,                // transparency level of overlay
		overlayColor: '',               // base color of overlay
		draggable: true,                    // make the dialogs draggable (requires UI Draggables plugin)
		okButton: '&nbsp;OK&nbsp;',         // text for the OK button
		cancelButton: '&nbsp;Cancel&nbsp;', // text for the Cancel button
		dialogClass: null,                  // if specified, this class will be applied to all dialogs
		
		// Public methods
		
		alert: function(message, title, callback) {
			if( title == null ) title = 'Alert';
			$.alerts._show(title, message, null, 'alert', function(result) {
				if( callback ) callback(result);
			});
		},
		
		confirm: function(message, title, callback) {
			if( title == null ) title = 'Confirm';
			$.alerts._show(title, message, null, 'confirm', function(result) {
				if( callback ) callback(result);
			});
		},
			
		prompt: function(message, value, title, callback) {
			if( title == null ) title = 'Prompt';
			$.alerts._show(title, message, value, 'prompt', function(result) {
				if( callback ) callback(result);
			});
		},
		
		// Private methods
		
		_show: function(title, msg, value, type, callback) {
			
			$.alerts._hide();
			$.alerts._overlay('show');
			
			$("BODY").append(
			  '<div id="popup_container">' +
			    '<h1 id="popup_title"></h1>' +
			    '<div id="popup_content">' +
			      '<div id="popup_message"></div>' +
				'</div>' +
			  '</div>');
			
			if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
			
			// IE6 Fix
			var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; 
			
			$("#popup_container").css({
				position: pos,
				zIndex: 99999,
				padding: 0,
				margin: 0
			});
			
			$("#popup_title").text(title);
			$("#popup_content").addClass(type);
			$("#popup_message").text(msg);
			$("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') );
			
			$("#popup_container").css({
				minWidth: $("#popup_container").outerWidth(),
				maxWidth: $("#popup_container").outerWidth()
			});
			
			$.alerts._reposition();
			$.alerts._maintainPosition(true);
			
			switch( type ) {
				case 'alert':
					$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>');
					$("#popup_ok").click( function() {
						$.alerts._hide();
						callback(true);
					});
					$("#popup_ok").focus().keypress( function(e) {
						if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click');
					});
				break;
				case 'confirm':
					$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
					$("#popup_ok").click( function() {
						$.alerts._hide();
						if( callback ) callback(true);
					});
					$("#popup_cancel").click( function() {
						$.alerts._hide();
						if( callback ) callback(false);
					});
					$("#popup_ok").focus();
					$("#popup_ok, #popup_cancel").keypress( function(e) {
						if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
						if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
					});
				break;
				case 'prompt':
					$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
					$("#popup_prompt").width( $("#popup_message").width() );
					$("#popup_ok").click( function() {
						var val = $("#popup_prompt").val();
						$.alerts._hide();
						if( callback ) callback( val );
					});
					$("#popup_cancel").click( function() {
						$.alerts._hide();
						if( callback ) callback( null );
					});
					$("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) {
						if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
						if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
					});
					if( value ) $("#popup_prompt").val(value);
					$("#popup_prompt").focus().select();
				break;
			}
			
			// Make draggable
			if( $.alerts.draggable ) {
				try {
					$("#popup_container").draggable({ handle: $("#popup_title") });
					$("#popup_title").css({ cursor: 'move' });
				} catch(e) { /* requires jQuery UI draggables */ }
			}
		},
		
		_hide: function() {
			$("#popup_container").remove();
			$.alerts._overlay('hide');
			$.alerts._maintainPosition(false);
		},
		
		_overlay: function(status) {
			switch( status ) {
				case 'show':
					$.alerts._overlay('hide');
					$("BODY").append('<div id="popup_overlay"></div>');
					$("#popup_overlay").css({
						position: 'absolute',
						zIndex: 99998,
						top: '0px',
						left: '0px',
						width: '100%',
						height: $(document).height(),
						background: $.alerts.overlayColor,
						opacity: $.alerts.overlayOpacity
					});
				break;
				case 'hide':
					$("#popup_overlay").remove();
				break;
			}
		},
		
		_reposition: function() {
			var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset;
			var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset;
			if( top < 0 ) top = 0;
			if( left < 0 ) left = 0;
			
			// IE6 fix
			if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop();
			
			$("#popup_container").css({
				top: top + 'px',
				left: left + 'px'
			});
			$("#popup_overlay").height( $(document).height() );
		},
		
		_maintainPosition: function(status) {
			if( $.alerts.repositionOnResize ) {
				switch(status) {
					case true:
						$(window).bind('resize', function() {
							$.alerts._reposition();
						});
					break;
					case false:
						$(window).unbind('resize');
					break;
				}
			}
		}
		
	}
	
	// Shortuct functions
	jAlert = function(message, title, callback) {
		$.alerts.alert(message, title, callback);
	}
	
	jConfirm = function(message, title, callback) {
		$.alerts.confirm(message, title, callback);
	};
		
	jPrompt = function(message, value, title, callback) {
		$.alerts.prompt(message, value, title, callback);
	};
	
})(jQuery);



/*
================================
JS for MBTM Maatwerk Navi 
================================
*/
var  maatwerkNavIDs = new Array();


function MBTM_Maatwerk_Navi_isExist(value){
    var isExist = false;
    for(var i=0;i<maatwerkNavIDs.length;i++){
        
            if (maatwerkNavIDs[i] == value){
                isExist = true;
            }
    }

    return isExist;
}


function MBTM_Maatwerk_Navi_Add(value){
    
     if ( !MBTM_Maatwerk_Navi_isExist(value)){
         maatwerkNavIDs.push(value) ;
     }
}

function MBTM_Maatwerk_Navi_SwapBg(id){
    
  
   MBTM_Maatwerk_Navi_Add(id);


   
   for(var i=0;i<maatwerkNavIDs.length;i++){
  

        if(id ==maatwerkNavIDs[i] )
        {
        
            if(document.getElementById(id)){
            
                document.getElementById(id).style.backgroundImage= "url(/Assets/Images/MBTM-image_03-a.gif)";
            }
            
        }
        else
        {
            if(document.getElementById(maatwerkNavIDs[i])){
            
                document.getElementById(maatwerkNavIDs[i]).style.backgroundImage= "url(/Assets/Images/MBTM-image_03.gif)";

            }
        
        }
   
   }
   
   
}










/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid, callBack,isSkipScroll){

    $("#"+containerid).load(url+ " #bodyContent","", function(){
        
       //alert("callBack="+callBack+"   isSkipScroll="+isSkipScroll); 
       
        if(callBack)eval(callBack);
        if(isSkipScroll != 1){
             $('html, body').animate({scrollTop:0}, 'slow');
        }
    }); 
}

function ajaxpage2(url, containerid, callBack,isSkipScroll){


var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid , callBack,isSkipScroll)
}
page_request.open('GET', url, true)
page_request.send(null)

}

function loadpage(page_request, containerid,callBack,isSkipScroll){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
    
   
    document.getElementById(containerid).innerHTML=content;
    if(callBack)eval(callBack);
    if(isSkipScroll != 1){
         $('html, body').animate({scrollTop:0}, 'slow');
    }
 }
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}



/*
================================
Flash Video
================================
*/
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
/*
================================
Swap the navigation menu
================================
*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*
================================
Home Page onload 
================================
*/

$(document).ready(function() {
	$(function() {
         $(".slideShowClass").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			visible : 4,
			circular: false
		});
	});
	
	
	
});

/*
================================
Search
================================
*/

    /*
================================
JQuery for search box
================================
*/

$(document).ready(function() {




$('#MBTM_Search_Box').keypress(function(event){

    if(event.keyCode ==13 &&  $(this).val() !=''){
         onSearch('MBTM_Search_Box') //do search
       
    }
});


$('#MBTM_Search_Box').focus(function(event){

    if(this.value =="zoeken"){
         this.value ='';
       
    }
}).blur(function(event){

    if(this.value =="zoeken"){
         this.value ='';
       
    }
});





});




function onSearch(textBoxId){

    var searchQuery = document.getElementById(textBoxId).value;
    
    search(searchQuery);
}
 

function search(searchQuery){

   
    
    var queryStr = new String(searchQuery);
    
    if(queryStr.length == 0)
        return;
        
    
    var queries = new String(($.cookie('the_queries'))? $.cookie('the_queries') : "" );
    
   
    var queriesArr = queries.split("|");
    
    var isExist = false;
    
    for(var index =0; index < queriesArr.length ; index++){
        if(queryStr == queriesArr[index]){
            isExist = true;
            break;
        }
    }
   
    if(!isExist){
        
          queries = queries + "|" + queryStr;
    }
    
    $.cookie('the_queries', queries, { expires: 1 }); 
    
     location.replace("/MBTM_Search.aspx?search=" + queryStr);
    
}
/*
function checkEnter(e, textBoxId){ //e is event object passed from function invocation
    var characterCode;// literal character code will be stored in this variable

    if(e && e.which){ //if which property of event object is supported (NN4)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
    }
    else{
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
    }

    if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
    onSearch(textBoxId) //do search
    return false 
    }
    else{
    return true 
    }

}
*/
/*Show all the history queries*/


function showHistoryQueries(containerID){

    var queries = $.cookie('the_queries');
   
    var searchQueryArr = (queries)? queries.split("|") : [];

    var querysHTML ="<table width=\"192\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"/Assets/Images/MBTM-home3_55.gif\">"
                                        +"<tr> <td width=\"192\">"
                                        +"       <img src=\"/Assets/Images/MBTM-search_03.gif\" width=\"192\" height=\"26\" />"
                                        +"</td></tr>";
    for(var i=0;i< searchQueryArr.length;i++){
        
        var query = new String(searchQueryArr[i]);
        query = query.toLowerCase();
        if( query== 'null' || query == '' || query.length ==0) continue;
        
        
        querysHTML += " <tr>"
                                          +" <td height=\"6\">"
                                               
                                               +"  <table id=\"Maatwerk_Item_1"+query+i+"\" width=\"192\" height=\"68\" border=\"0\" background=\"/Assets/Images/MBTM-image_03.gif\" cellpadding=\"0\" cellspacing=\"0\"  style=\"cursor:pointer\" onclick=\" MBTM_Maatwerk_Navi_SwapBg(this.id);search('"+ query +"'); \" >"
                                                 +"    <tr>"
                                             +"             <td width=\"192\" height=\"8\"> </td>"
                                               +"      </tr>"
                                               +"      <tr>"
                                               +"          <td>           <table width=\"192\" height=\"53\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
                                                +"                 <tr>"
                                                +"                     <td width=\"13\">"
                                                 +"                        &nbsp;"
                                                   +"                  </td>"
                                                   +"                  <td class=\"td2 clientWord \" ><a style=\" margin-left:5px\">"
                                                    + "\'"+ query+ "\'"
                                                    +"                 </td>"
                                                    +"</a>                 <td width=\"16\">"
                                                   +"                      &nbsp;"
                                                    +"                 </td>"
                                                    +"             </tr>"
                                                      +"       </table>"
                                                     +"    </td>"
                                                    +" </tr>"
                                                 +"</table>"                                               
                                             +"</td>  </tr>";
        
    }
     querysHTML +="                     <tr>"
                   +"                          <td height=\"450\">"
                     +"                            &nbsp;"
                     +"                        </td>"
                     +"                    </tr>"
                     +"                    <tr>"
                      +"                       <td>"
                     +"                            <img src=\"/Assets/Images/MBTM-home3_58.gif\" width=\"192\" height=\"17\" />"
                     +"                        </td>"
                     +"                    </tr>"
                     +"                </table>";
                     
      document.getElementById(containerID).innerHTML=querysHTML;
    
}


/*
================================
 URL REWRITE
================================
*/


function urlRewrite(url){
    //  /niews/neiws-item-1.aspx  to  /niews.aspx?name=neiws-item-1.aspx
    
    //  /niews/test/neiws-item-1.aspx  to  /niews.aspx?name=neiws-item-1.aspx
    
    var url = new String(url);
    var index = url.indexOf("/",1);
    
     var newUrl =url.substring(0,index) + ".aspx?name="+url.slice(index+1);
    //location.replace( url.substring(0,index) + ".aspx?name="+url.slice(index+1));

	window.location.href = newUrl ;
    
}


/*
================================
    Show the Summary and  hide the Content
    
    By default in each of  WBE content page, the content will be shown, the summary is hidden.
    
    in the index page of WZU and WIUD, it will call the showSummary or showContent meessage after the page is loaded up.
================================
*/


function showSummary(summaryId,contentId){
 
    var oSummary = document.getElementById(summaryId);
    var oContent = document.getElementById(contentId);    
    var oBottomColumn = document.getElementById('bottomTable');
    var oVsummary = document.getElementById('VideoSummaryContent'); 
    
    if(oSummary && oContent && oBottomColumn){
    
        oContent.innerHTML='';
        oVsummary.innerHTML='';
        
        oBottomColumn.style.display ="block";
        oSummary.style.display ="block";
        oContent.style.display ="none";
    }
    
}

function showVideoSummary(summaryId,contentId,vSummaryId,placeHodlerId){
  
    var oSummary = document.getElementById(summaryId);
    var oContent = document.getElementById(contentId);
    var oVsummary = document.getElementById(vSummaryId);      
    var oPlaceHodler = document.getElementById(placeHodlerId);
    
    if(oSummary && oContent && oVsummary && oPlaceHodler){
        
        oPlaceHodler.style.display ="block";
        oVsummary.style.display ="block";
        
        oSummary.innerHTML='';
        oContent.innerHTML='';
        oSummary.style.display ="none";
        oContent.style.display ="none";
        
    }
    
}




function showContent(summaryId,contentId){

    var oSummary = document.getElementById(summaryId);
    var oContent = document.getElementById(contentId);
     var oVsummary = document.getElementById('VideoSummaryContent');
    
    if(oSummary && oContent && oVsummary){
        
	oVsummary.innerHTML='';

        oSummary.innerHTML='';
                
        oSummary.style.display ="none";
        oContent.style.display ="block";
        oVsummary.style.display ="none";
    }
    
}



/*
 ==================================
 FAQ drop down
 ==================================	
 */


function initFAQMenu() {
$('#menuFaq ul').hide();
    $('#menuFaq ul:first').show();
    $('#menuFaq li a').click(

    function() {
        $(this).next().slideToggle('normal');	
      }
    );
  }
  
$(document).ready(function() {initFAQMenu();});


/*
 ==================================
GoogleMap
 ==================================	
 */


    var map
    function initializeGMap() {
    
       if(!document.getElementById("map_canvas"))
        return;
        
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(52.364322,4.870661), 16);
        map.setUIToDefault();
        map.setMapType(G_HYBRID_MAP)
        var blueIcon = new GIcon(G_DEFAULT_ICON);
        blueIcon.image = "http://www.moreballs.com//Assets/Images/GmapIcon.gif";
		 blueIcon.iconSize = new GSize(90,49);
		 		    markerOptions = { icon:blueIcon };
          map.addOverlay(new GMarker(map.getCenter(), markerOptions));
      }
    }
function numberToZoom(level)
{map.setCenter(new GLatLng(52.364322,4.870661),level);}


function isActiveTopMenu(imageId){
    
    //id=                     /wat-bieden-wij.aspx
    //http://www.moreballs.com/wat-bieden-wij.aspx
    //http://www.moreballs.com/wat-bieden-wij.aspx?name=jongleren.aspx
    //http://www.moreballs.com/wat-bieden-wij.aspx?name=jongleren/wolact.aspx
    
    
   var strUrl = new String(window.location.pathname + window.location.search);
   
   var tempID = strUrl;
   
   var isActive = false;
    
   var indexQ = strUrl.indexOf('?')
   if( indexQ >0){
        tempID = strUrl.slice(0,indexQ);
   }
   
    
    
    var imgUrlID = null;
    
    switch(imageId){
        case 'imgWZU':{
           imgUrlID = '/wat-zoekt-u.aspx';
           break;
        }
        case 'imgWIUD':{
           imgUrlID = '/wat-is-uw-doel.aspx';
           break;
        }
        
        case 'imgWBW':{
           imgUrlID = '/wat-bieden-wij.aspx';
           break;
        }
        
        case 'imgMAATWERK':{
           imgUrlID = '/maatwerk.aspx';
           break;
        }
        case 'imgREFERENTIES':{
           imgUrlID = '/referenties.aspx';
           break;
        }
        case 'imgWZW':{
           imgUrlID = '/wie-zijn-wij.aspx';
           break;
        }
        case 'imgCONTACT':{
           imgUrlID = '/contact.aspx';
           break;
        }
        
        
    }
    
    if(imgUrlID == tempID){
         isActive=  true;
    }
    
    return isActive;

}

function activeImage(imageId){
   
     switch(imageId){
        case 'imgWZU':{
            $('#imgWZU')[0].src ='/Assets/Images/MBTM-home2_08_a.gif';//active
           break;
        }
         case 'imgWIUD':{
            $('#imgWIUD')[0].src ='/Assets/Images/MBTM-home2_09.gif';//active
           break;
        }
        
         case 'imgWBW':{
            $('#imgWBW')[0].src ='/Assets/Images/MBTM-home2_10.gif';//active
           break;
        }
        
         case 'imgMAATWERK':{
            $('#imgMAATWERK')[0].src ='/Assets/Images/MBTM-home_11.gif';//active
           break;
        }
        
         case 'imgREFERENTIES':{
            $('#imgREFERENTIES')[0].src ='/Assets/Images/MBTM-home2_12.gif';//active
           break;
        }
        
         case 'imgWZW':{
            $('#imgWZW')[0].src ='/Assets/Images/MBTM-home2_13.gif';//active
           break;
        }
        
         case 'imgCONTACT':{
            $('#imgCONTACT')[0].src ='/Assets/Images/MBTM-home2_14.gif';//active
           break;
        }
    }
}

function deactiveImage(imageId){
   
     switch(imageId){
        case 'imgWZU':{
            if(!isActiveTopMenu('imgWZU')){
                $('#imgWZU')[0].src ='/Assets/Images/MBTM-home_08_a.gif';//normal
            }
           break;
        }
        case 'imgWIUD':{
            if(!isActiveTopMenu('imgWIUD')){
                $('#imgWIUD')[0].src ='/Assets/Images/MBTM-home_09.gif';//normal
            }
           break;
        }
        case 'imgWBW':{
            if(!isActiveTopMenu('imgWBW')){
                $('#imgWBW')[0].src ='/Assets/Images/MBTM-home_10.gif';//normal
            }
           break;
        }
        case 'imgMAATWERK':{
            if(!isActiveTopMenu('imgMAATWERK')){
                $('#imgMAATWERK')[0].src ='/Assets/Images/MBTM-home2_11.gif';//normal
            }
           break;
        }
        case 'imgREFERENTIES':{
            if(!isActiveTopMenu('imgREFERENTIES')){
                $('#imgREFERENTIES')[0].src ='/Assets/Images/MBTM-home_12.gif';//normal
            }
           break;
        }
        case 'imgWZW':{
            if(!isActiveTopMenu('imgWZW')){
                $('#imgWZW')[0].src ='/Assets/Images/MBTM-home_13.gif';//normal
            }
           break;
        }
        case 'imgCONTACT':{
            if(!isActiveTopMenu('imgCONTACT')){
                $('#imgCONTACT')[0].src ='/Assets/Images/MBTM-home_14.gif';//normal
            }
           break;
        }
    }
}

$(document).ready(function(){

    $('.slideBgTd').hover(
        function(){
           
            $(this)[0].background ="/Assets/Images/MBTM-home2_32_a.gif"        
        },
        function(){
            $(this)[0].background ="/Assets/Images/MBTM-home2_32.gif"   
        }    
    );

    // imgWZU

    if(isActiveTopMenu('imgWZU')){        
          activeImage('imgWZU');            
    }
        
    $('#imgWZU').hover(
        function(){
            activeImage('imgWZU');            
        },
        function(){
            deactiveImage('imgWZU');
        }    
    );
    
     $('#imgWZU').click(function(){
        activeImage('imgWZU');
     });
     
     
     // imgWIUD

    if(isActiveTopMenu('imgWIUD')){        
          activeImage('imgWIUD');            
    }
        
    $('#imgWIUD').hover(
        function(){
            activeImage('imgWIUD');            
        },
        function(){
            deactiveImage('imgWIUD');
        }    
    );
    
     $('#imgWIUD').click(function(){
        activeImage('imgWIUD');
     });
     
      // imgWBW

    if(isActiveTopMenu('imgWBW')){        
          activeImage('imgWBW');            
    }
        
    $('#imgWBW').hover(
        function(){
            activeImage('imgWBW');            
        },
        function(){
            deactiveImage('imgWBW');
        }    
    );
    
     $('#imgWBW').click(function(){
        activeImage('imgWBW');
     });
    
    
      // imgMAATWERK

    if(isActiveTopMenu('imgMAATWERK')){        
          activeImage('imgMAATWERK');            
    }
        
    $('#imgMAATWERK').hover(
        function(){
            activeImage('imgMAATWERK');            
        },
        function(){
            deactiveImage('imgMAATWERK');
        }    
    );
    
     $('#imgMAATWERK').click(function(){
        activeImage('imgMAATWERK');
     });
     
         // imgREFERENTIES

    if(isActiveTopMenu('imgREFERENTIES')){        
          activeImage('imgREFERENTIES');            
    }
        
    $('#imgREFERENTIES').hover(
        function(){
            activeImage('imgREFERENTIES');            
        },
        function(){
            deactiveImage('imgREFERENTIES');
        }    
    );
    
     $('#imgREFERENTIES').click(function(){
        activeImage('imgREFERENTIES');
     });
     
     
      // imgWZW

    if(isActiveTopMenu('imgWZW')){        
          activeImage('imgWZW');            
    }
        
    $('#imgWZW').hover(
        function(){
            activeImage('imgWZW');            
        },
        function(){
            deactiveImage('imgWZW');
        }    
    );
    
     $('#imgWZW').click(function(){
        activeImage('imgWZW');
     });
     
     // imgCONTACT

    if(isActiveTopMenu('imgCONTACT')){        
          activeImage('imgCONTACT');            
    }
        
    $('#imgCONTACT').hover(
        function(){
            activeImage('imgCONTACT');            
        },
        function(){
            deactiveImage('imgCONTACT');
        }    
    );
    
     $('#imgCONTACT').click(function(){
        activeImage('imgCONTACT');
     });
     
     
});

/*
================================
home flash video
================================
*/


 function getVcastr(idPrefix) {
     
      if (navigator.appName.indexOf("Microsoft") != -1) {
      return window[idPrefix+"_vcastr3"];
      } else {
      return document[idPrefix+"_vcastr3"];
      }
      }
  
  
/*
================================
Combo List
================================
*/

function onComboChange(){
   
    location.replace(document.getElementById("itemsList").value);
}
      

