		window.addEvent('domready', function(){
			var scroll = new Fx.Scroll('scrollwrapper', {
				wait: false,
				duration: 1500,
				offset: {'x': 0, 'y': 0},
				transition: Fx.Transitions.Quad.easeInOut
			});
			
			//Scroll to bottom left
			window.addEvent('domready', function(){
			scroll.toElement('bottomleftwrapper');
			});
			
// email form 
//		window.addEvent('domready', function(){
//			$('myForm').addEvent('submit', function(e) {
//
//			new Event(e).stop();
//			var log = $('log_res').empty().addClass('ajax-loading');
//			this.send({
//				update: log,
//				onComplete: function() {
//					log.removeClass('ajax-loading');
//				}
//			});
//			});		
//		});
			//Css change
//			var style_1, style_2;
//			 
			/* Style 1 */
//			$('s1').addEvent('click', function(e) {
//				e = new Event(e).stop();
			 
//				if (style_1) style_1.remove();
//				new Asset.css('http://www.3dw.fr/css/style.css', {id: 'style1'});
//				style_1 = $('style1');
			 
//				<!--$('log').setHTML('<a href="css/style.css">style1.css<\/a><\/span>');-->
//			});
			 
			/* Style 2 */
//			$('s2').addEvent('click', function(e) {
//				e = new Event(e).stop();
			 
//				if (style_2) style_2.remove();
//				new Asset.css('http://www.3dw.fr/css/style1.css', {id: 'style2'});
//				style_2 = $('style2');
//			 
//				<!--$('log').setHTML('<a href="css/style1.css">style2.css<\/a><\/span>');-->
//			});
		
			
			$('linkHome').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('bottomleftwrapper');
			});
			
			$('linkPack').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('bottomrightwrapper');
			});
			
			$('linkPortfolio').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('toprightwrapper');
			});
		
		
			$('linkContact').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('topleftwrapper');
			});
			
			$('linkContact2').addEvent('click', function(event) {
			event = new Event(event).stop();
			scroll.toElement('topleftwrapper');
			});
			
			// middle wrappers currently not in use - to enable remove comments
			//$('linkMiddleleft').addEvent('click', function(event) {
			//	event = new Event(event).stop();
			//	scroll.toElement('middleleftwrapper');
			//});
			//$('linkMiddleright').addEvent('click', function(event) {
			//	event = new Event(event).stop();
			//	scroll.toElement('middlerightwrapper');
			//});
			
		}); 
		
			window.addEvent('domready', function(){
			var scroll = new Fx.Scroll('billboardscrollwrapper', {
				wait: false,
				duration: 500,
				offset: {'x': 0, 'y': 0},
				transition: Fx.Transitions.Cubic.easeInOut
			});
			
			//Scroll to intro packet
			window.addEvent('domready', function(){
			scroll.toElement('billboardintrotext');
			});
			
			// Packets
			$('billboardintro').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('billboardintrotext');
			});
			$('billboardpack1').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('paket1');
			});
			$('billboardpack2').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('paket2');
			});
			$('billboardpack3').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('paket3');
			});
			$('billboardpack4').addEvent('click', function(event) {
				event = new Event(event).stop();
				scroll.toElement('paket4');
			});
			
			
			//--language chooser			 
			//var mySlide2 = new Fx.Slide('languages', {mode: 'horizontal'});
			 
			 
			//$('toggle').addEvent('click', function(e){
			//	e = new Event(e);
			//	mySlide2.toggle();
			//	e.stop();
			//});
			
			////toggle languages
			//window.addEvent('domready', function(){
			//	mySlide2.toggle();
			//});
			 
			
			// Portfolio AJAX request
			
			// Portfolio
//			$ES('a', 'clients').addEvent('click', function(e) {
//			e = new Event(e).stop();
//		 	
//			var url = this;
//		 
//			new Ajax(url, {
//				method: 'post',
//				update: $('portfolio_content')
//			}).request();
//			});
//			
		}); 
		
/*
	Script: ValidCow
	Version: 0.0.4
	Description:
		ValidCow is a form validation script which is non-invasive and should pass all (X)HTML standards. It utilizes only the class
		attribute to collect information about what to validate. It will only validate the form when the submit button is pressed.
	Author: Russell Chappell - http://www.2freelancers.com
	Copyright: Russell Chappell 2008
	License: None
	Useage:
		var myForm = new ValidCow(formName[, options]);
	Options:
		1. (prefix) 	- Default("val_") 				- String 	- Prefix value of the class to run the tests on. Example <input class="myprefix_" />
		2. (styles) 	- Default(['valid', 'error']) 	- Object 	- The classes to apply to the form element when element fails to validate
		3. (msgShow) 	- Default(true) 				- Boolean 	- Turns messages on or off to show after the form element on fail
		4. (msgColor)	- Default('#ff0000')			- String	- Hex colour of the messages
		5. (msgValues)	- Default(see code)				- Object	- Messages to show when form element fails
	Events:
		1. (onInitialize)	- Function -	Fires when the class is initialized
		2. (onFormValid)	- Function -	Fires when the form is valid
		3. (onFormInvalid)	- Function -	Fires when the form is invalid
	Class Values:
		Input - text, password
			class="(prefix)-(required true or false)-(validator)-(min length int)-(max lenght int)"
			Example: class="val_true-email-1-100" - This will valide using the email validator
		Textarea -
			class="(prefix)-(required true or false)-(validator)-(min length int)-(max lenght int)"
			Example: class="val_true-email-1-100" - This will valide using the email validator
		Radio -
			class="(prefix)-(required true or false)"
			Example: class="val_true" - This will check all radio options in a group and will fail if at least one is not selected
		Checkbox -
			class="(prefix)-(required true or false)"
			Example: class="val_true" - This will check that the box is selected or not
		Select -
			class="(prefix)-(required true or false)"
			Example: class="val_true" - This will check that the box is selected or not		
	Validators:
		general, alpha, email, numeric, alphanumeric, postalcode, zipcode,
		http, ipaddress, lzfulldate, lzmonth, lzday, fulldate, month, day, year, fullYear,
		integer, float, currency
		Note: Add Your own validators by extending the class
*/
		
		

var ValidCow = new Class({
	options: {
		prefix: 'val_',
		styles: {
			valid: 'valid',
			error: 'error'
		},
		msgShow: true,
		msgColor: '#ff0000',
		msgValues: {
			textFailFilter: 'Please enter a valid',
			textFailRequired: 'This is a required field',
			textFailMinMax: 'Please enter a character length between ',
			radioFailedRequired: 'You must select an option'
		},
		onInitialize: Class.empty,
		onFormValid: Class.empty,
		onFormInvalid: Class.empty
	},
	initialize: function(myForm, options){
		this.fireInitialize();
		if(!myForm) { return (false); }
		this.setOptions(options);
		this.formElements = $(myForm).getElements('*[class^='+this.options.prefix+']');
		this.theForm = myForm;
		this.success = true;
		
		$(myForm).addEvent('submit', function(e) {
			if(!this.validate()){
				new Event(e).stop();
			}
		}.bind(this));
		
		$(myForm).addEvent('reset', function(e) {
			this.resetForm();
		}.bind(this));
		
		this.formElements.each(function(el) {
			el.msg = new Element('span');
			el.msg.inject(el, 'after');
			el.msg.setStyle('color', this.options.msgColor);
		}.bind(this));
		
	},
	setMessage: function(el, message, showName, val1, val2) {
		this.success = false;
		var num1 = (val1 == null) ? false : val1;
		var num2 = (val2 == null) ? false : val2;
		var showname = (showName == false) ? '' : showName;
		if(this.options.msgShow == true) {
			if(num1 != false && num2 != false) {
				el.msg.set('text', ' '+message+val1+' and '+val2);
			} else {
				el.msg.set('text', ' '+message+showname);
			}
		}
	},
	validate: function() {
		this.formElements.each(function(el) {
			this.clearClasses(el);
			el.myParams = el.getProperty('class').replace(this.options.prefix,"").split("-");
			el.myFilter = el.myParams[1];
			el.myType = (el.get('tag') == 'input') ? el.getProperty('type') : el.get('tag');
			switch (el.myType) {
				case "text":
					this.validate_text(el);
					break;
				case "password":
					this.validate_text(el);
					break;
				case "textarea":
					this.validate_text(el);
					break;
				case "radio":
					this.validate_radio(el);
					break;
				case "checkbox":
					this.validate_checkbox(el);
					break;
				case "select":
					this.validate_select(el);
					break;
			}
		}.bind(this));
		
		if(this.success == true) { 
			this.fireValid();
			return(true);
		} else { 
			this.fireInvalid();
			return(false); 
		};
	},
	validate_min_max: function(el) {
		if(el.myParams[2] == null || [el.myParams[2], el.myParams[3]].contains('false')) { 
			return (true);
		} else {
			if(el.value.length >= el.myParams[2] && el.value.length <= el.myParams[3]) { return (true); } else { return (false); }
		}
	},
	validate_text: function(el) {
		var valid = true;
		if(el.myParams[0] == 'true') {
			if(el.value.trim() == "") {
				valid = false;
				this.setMessage(el, this.options.msgValues.textFailRequired, false);
			}
			if(this.validate_min_max(el) == false && valid == true) {
				valid = false;
				this.setMessage(el, this.options.msgValues.textFailMinMax, false, el.myParams[2], el.myParams[3]);
			}
			if(this.validate_by_filter(el.myParams[1], el.value) == false && valid == true) {
				valid = false;
				switch(el.myFilter) {
					case "email":
						this.setMessage(el, this.options.msgValues.textFailFilter, ' Email Address');
						break;
					default :
						this.setMessage(el, this.options.msgValues.textFailFilter, ' value');
						break;
				}
			}
		}
		if(valid == true) {
			el.addClass(this.options.styles.valid);
		} else {
			el.addClass(this.options.styles.error);
		}
	},
	validate_radio: function(el) {
		var valid = true;
		if(el.myParams[0] == 'true') {
			var boxValid = false;
			var radioBoxes = $(this.theForm).getElements('input[name^='+el.name+']');
			radioBoxes.each(function(radio) {
				if(radio.getProperty('checked')) {
					boxValid = true;
				}
			}.bind(this));
			if(boxValid == false) {
				valid = false;
			}
		}
		if(valid == true) {
			el.addClass(this.options.styles.valid);
		} else {
			el.addClass(this.options.styles.error);
			this.setMessage(el, this.options.msgValues.radioFailedRequired, false);
		}
	},
	validate_checkbox: function(el) {
		var valid = true;
		if(el.myParams[0] == 'true') {
			if(!el.getProperty('checked')) {
				valid = false;
				this.setMessage(el, this.options.msgValues.textFailRequired, false);
			}
		}
		if(valid == true) {
			el.addClass(this.options.styles.valid);
		} else {
			el.addClass(this.options.styles.error);
		}
	},
	validate_select: function(el) {
		var valid = true;
		if(el.myParams[0] == 'true') {
			if(!el.getProperty('selected')) {
				valid = false;
				this.setMessage(el, this.options.msgValues.textFailRequired, false);
			}
		}
		if(valid == true) {
			el.addClass(this.options.styles.valid);
		} else {
			el.addClass(this.options.styles.error);
		}
	},
	validate_by_filter: function(type, value) {
		return this.validators[type].test(value);
	},
	validators: {
		general:		/^[\.\:\,\;\*\(\!\?\'\)\/\\\$\%\&\+\-\_\#\'\@\w\d\s]+$/i, /* ' */
		alpha: 			/^[a-z\s-_]+$/i, 
		email:			/^([a-z0-9_-]+)(\.[a-z0-9_-]+)*@([a-z0-9_-]+)(\.[a-z0-9_-]+)*[\.]([a-z0-9_-]+)$/i,
		captcha: 		/^[\.\:\,\;\*\(\!\?\'\)\/\\\$\%\&\+\-\_\#\'\@\w\d\s]+$/i, /* ' */
		numeric:		/^\d+$/,
		alphanumeric:	/^[a-z\d]+$/i,

		postalcode:		/^([a-z]\d[a-z])[\s|-]?(\d[a-z]\d)$/i,
		zipcode:		/^\d{5}(-\d{4})?$/,
		
		http:			/^((http|https|ftp):\/\/)?([a-z0-9_-]+)(\.[a-z0-9_-]+)+(\/\w+)*(\.[a-z0-9_-]+)*$/i,
		ipaddress:		/^(\d{1,3})(\.\d{1,3}){3}$/,
		
		lzfulldate: 	/^(0[1-9]|1[012])\/(0[1-9]|[12][0-9]|3[01])\/(?:18|19|20|21)\d\d$/,
		lzmonth:		/^(0[1-9]|1[012])$/,
		lzday:			/^(0[1-9]|[12][0-9]|3[01])$/,
		fulldate:		/^([1-9]|1[012])\/([1-9]|[12][0-9]|3[01])\/(?:18|19|20|21)\d\d$/,
		month:			/^([1-9]|1[012])$/,
		day:			/^([1-9]|[12][0-9]|3[01])$/,
		year:			/^\d{2}$/,
		fullYear:		/^(?:18|19|20|21)\d\d$/,
	
		integer:		/^-?\d{1,3}(,?\d{3})*(\.00)?$/,
		float:			/^([0-9]\d*\.|0\.)[0-9]*\d+$/,
		currency:		/^(\$|\-|\$\-)?\d{1,3}([,]?\d{3})*(\.\d{2})?$/
	},
	resetForm: function() {
		this.formElements.each(function(el) {
			el.myParams = el.getProperty('class').replace(this.options.prefix,"").split("-");
			el.myType = (el.get('tag') == 'input') ? el.getProperty('type') : el.get('tag');
			switch (el.myType) {
				case "text":
					el.value = "";
					break;
				case "password":
					el.value = "";
					break;
				case "textarea":
					el.value = "";
					break;
				case "radio":
					el.checked = "unchecked";
					break;
				case "checkbox":
					el.checked = "unchecked";
					break;
				case "select":
					el.value = "";
					break;
			}
			this.clearClasses(el);
		}.bind(this));
	},
	clearClasses: function(el) {
		el.removeClass(this.options.styles.valid).removeClass(this.options.styles.error);
		el.msg.empty();
	},
	fireInitialize: function() {
		this.fireEvent("onInitialize");
		return(true);
	},
	fireValid: function() {
		this.fireEvent("onFormValid");
		return(true);
	},
	fireInvalid: function() {
		this.fireEvent("onFormInvalid");
		return(false);
	}
});
ValidCow.implement(new Options, new Events);
		