/**
 * Bootstrap.js - Bootstrap for all Javascript functionality
 * 
 * @author  Webstores <info at webstores dot nl>
 *           Copyright (c) Webstores internet totaalbureau <http://www.webstores.nl/>
 */

WS.Event.addEvent(window, 'load', function() {
	WS.Util.fixPngBackground($('nobel'), 'resources/img/nobel.png');
	
	if($('gallery')) {
		if($$('.gallery-slide').length > 1) {
			var gCarousel = new Carousel($('gallery'), $$('.gallery-slide'), $$('a.carousel-jumper', 'a.carousel-control'));
		}
		WS.Util.fixPngBackground($('gallery-controls'), 'resources/img/white-50.png');
	}
	
	if($('latest-articles')) {
		if($$('.articles-slide').length > 1) {
			var aCarousel = new Carousel($('latest-articles'), $$('.articles-slide'), $$('a.carousel-jumper', 'a.carousel-control'), {
				duration: 0.33
			//	duration: 3.50
			});
		}
	}
	
	if($('contact-form')) {
		var validation = new WS.Validation('contact-form');
		validation.initialize();
	}
	if($('offerte-form')) {
		var validation2 = new WS.Validation('offerte-form');
		validation2.initialize();
	}
	
	if($('flashcontent1')) {
		var flashvars = {
			lwImg: 'resources/groep1_wachten.jpg',
			lwBgcolor: '255,255,255,255',
			lwBarBgColor: '255,255,255,255',
			lwBarColor: '255,0,255,0',
			lwBarBounds: '143,166,230,65',
			lwlocation: '0',
			lwShowLoadingPercent: 'true',
			lwTextColor: '255,0,0,0',
			iniFile: 'config_groep1.bin',
			progressType: '1',
			swfFile: 'resources/lw_sceneviewer.swf',
			href: location.href,
			name: 'sotester1'
		};
	
		var params = {
			allowNetworking: 'all',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			scale: 'noscale',
			bgcolor: '#FFFFFF'
		};
	
		var attributes = {
			
		};
	
		swfobject.embedSWF('panorama/groep1/twviewer.swf', 'sotester1', '541', '516', '9.0.124', false, flashvars, params, attributes);
	}
	
	if($('flashcontent2')) {
		var flashvars = {
			lwImg: 'resources/groep2_wachten.jpg',
			lwBgcolor: '255,255,255,255',
			lwBarBgColor: '255,255,255,255',
			lwBarColor: '255,0,255,0',
			lwBarBounds: '143,166,230,65',
			lwlocation: '0',
			lwShowLoadingPercent: 'true',
			lwTextColor: '255,0,0,0',
			iniFile: 'config_groep2.bin',
			progressType: '1',
			swfFile: 'resources/lw_sceneviewer.swf',
			href: location.href,
			name: 'sotester2'
		};
	
		var params = {
			allowNetworking: 'all',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			scale: 'noscale',
			bgcolor: '#FFFFFF'
		};
	
		var attributes = {
			
		};
	
		swfobject.embedSWF('panorama/groep2/twviewer.swf', 'sotester2', '541', '516', '9.0.124', false, flashvars, params, attributes);
	}
	
	if($('flashcontent3')) {
		var flashvars = {
			lwImg: 'resources/groep3_wachten.jpg',
			lwBgcolor: '255,255,255,255',
			lwBarBgColor: '255,255,255,255',
			lwBarColor: '255,0,255,0',
			lwBarBounds: '143,166,230,65',
			lwlocation: '0',
			lwShowLoadingPercent: 'true',
			lwTextColor: '255,0,0,0',
			iniFile: 'config_groep3.bin',
			progressType: '1',
			swfFile: 'resources/lw_sceneviewer.swf',
			href: location.href,
			name: 'sotester3'
		};
	
		var params = {
			allowNetworking: 'all',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			scale: 'noscale',
			bgcolor: '#FFFFFF'
		};
	
		var attributes = {
			
		};
	
		swfobject.embedSWF('panorama/groep3/twviewer.swf', 'sotester3', '541', '516', '9.0.124', false, flashvars, params, attributes);
	}
	
	if($('flashcontent4')) {
		var flashvars = {
			lwImg: 'resources/groep4_wachten.jpg',
			lwBgcolor: '255,255,255,255',
			lwBarBgColor: '255,255,255,255',
			lwBarColor: '255,0,255,0',
			lwBarBounds: '143,166,230,65',
			lwlocation: '0',
			lwShowLoadingPercent: 'true',
			lwTextColor: '255,0,0,0',
			iniFile: 'config_groep4.bin',
			progressType: '1',
			swfFile: 'resources/lw_sceneviewer.swf',
			href: location.href,
			name: 'sotester4'
		};
	
		var params = {
			allowNetworking: 'all',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			scale: 'noscale',
			bgcolor: '#FFFFFF'
		};
	
		var attributes = {
			
		};
	
		swfobject.embedSWF('panorama/groep4/twviewer.swf', 'sotester4', '541', '516', '9.0.124', false, flashvars, params, attributes);
	}
	
	if($('flashcontent5')) {
		var flashvars = {
			lwImg: 'resources/groep5_wachten.jpg',
			lwBgcolor: '255,255,255,255',
			lwBarBgColor: '255,255,255,255',
			lwBarColor: '255,0,255,0',
			lwBarBounds: '143,166,230,65',
			lwlocation: '0',
			lwShowLoadingPercent: 'true',
			lwTextColor: '255,0,0,0',
			iniFile: 'config_groep5.bin',
			progressType: '1',
			swfFile: 'resources/lw_sceneviewer.swf',
			href: location.href,
			name: 'sotester5'
		};
	
		var params = {
			allowNetworking: 'all',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			scale: 'noscale',
			bgcolor: '#FFFFFF'
		};
	
		var attributes = {
			
		};
	
		swfobject.embedSWF('panorama/groep5/twviewer.swf', 'sotester5', '541', '516', '9.0.124', false, flashvars, params, attributes);
	}
	
	if($('flashcontent6')) {
		var flashvars = {
			lwImg: 'resources/groep6_wachten.jpg',
			lwBgcolor: '255,255,255,255',
			lwBarBgColor: '255,255,255,255',
			lwBarColor: '255,0,255,0',
			lwBarBounds: '143,166,230,65',
			lwlocation: '0',
			lwShowLoadingPercent: 'true',
			lwTextColor: '255,0,0,0',
			iniFile: 'config_groep6.bin',
			progressType: '1',
			swfFile: 'resources/lw_sceneviewer.swf',
			href: location.href,
			name: 'sotester6'
		};
	
		var params = {
			allowNetworking: 'all',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			scale: 'noscale',
			bgcolor: '#FFFFFF'
		};
	
		var attributes = {
			
		};
	
		swfobject.embedSWF('panorama/groep6/twviewer.swf', 'sotester6', '541', '516', '9.0.124', false, flashvars, params, attributes);
	}
	
});
