var starteffects = {
	init: function() {
		var logo = new Fx.Style('logo', 'opacity', {duration:700});
		var image01fade = new Fx.Style('image01', 'opacity', {duration:800});
		var image01roll = new Fx.Style('image01', 'width', {duration:50});
		var image02fade = new Fx.Style('image02', 'opacity', {duration:800});
		var image02roll = new Fx.Style('image02', 'width', {duration:50});
		var image03fade = new Fx.Style('image03', 'opacity', {duration:800});
		var image03roll = new Fx.Style('image03', 'width', {duration:50});
		var image04fade = new Fx.Style('image04', 'opacity', {duration:800});
		var image04roll = new Fx.Style('image04', 'width', {duration:50});
		var imageleftfade = new Fx.Style('imageleft', 'opacity', {duration:500});
		var imageleftroll = new Fx.Style('imageleft', 'width', {duration:50});
		var menu = new Fx.Style('menu', 'opacity');
		var small_links = new Fx.Style('small_links', 'opacity');
		
		logo.start(0,1).chain(function() {
			image01fade.start(0,1);
			image01roll.start(0,165).chain(function() {
				image02fade.start(0,1);
				image02roll.start(0,165).chain(function() {
					image03fade.start(0,1);
					image03roll.start(0,165).chain(function() {	
						image04fade.start(0,1);
						image04roll.start(0,165).chain(function() {
							menu.start(0,1);
							small_links.start(0,1);
						});
					});
				});
			});
		});
	}
};

var contenteffects = {
	init: function() {
		var logo = new Fx.Style('logo', 'opacity', {duration:700});
		var image01fade = new Fx.Style('image01', 'opacity', {duration:800});
		var image01roll = new Fx.Style('image01', 'width', {duration:50});
		var image02fade = new Fx.Style('image02', 'opacity', {duration:800});
		var image02roll = new Fx.Style('image02', 'width', {duration:50});
		var image03fade = new Fx.Style('image03', 'opacity', {duration:800});
		var image03roll = new Fx.Style('image03', 'width', {duration:50});
		var image04fade = new Fx.Style('image04', 'opacity', {duration:800});
		var image04roll = new Fx.Style('image04', 'width', {duration:50});
		var imageleftfade = new Fx.Style('imageleft', 'opacity', {duration:500});
		var imageleftroll = new Fx.Style('imageleft', 'width', {duration:50});
		var contentfade = new Fx.Style('contentbox', 'opacity', {duration:500});
		var contentroll = new Fx.Style('contentbox', 'width', {duration:50});
		var menu = new Fx.Style('menu', 'opacity');
		var small_links = new Fx.Style('small_links', 'opacity');
		
		logo.start(0,1).chain(function() {
			image01fade.start(0,1);
			image01roll.start(0,165).chain(function() {
				image02fade.start(0,1);
				image02roll.start(0,165).chain(function() {
					image03fade.start(0,1);
					image03roll.start(0,165).chain(function() {	
						image04fade.start(0,1);
						image04roll.start(0,165).chain(function() {
							imageleftfade.start(0,1);
							imageleftroll.start(0,337).chain(function() {
								contentfade.start(0,1);
								contentroll.start(0,337).chain(function() {
									menu.start(0,1);
									small_links.start(0,1);
								});
							});
						});
					});
				});
			});
		});
	}
};

var contactForm = {
	
	startform: function(){
		$('contactformsubmit').onclick = function(){
			contactForm.contactFormSubmit();
			return false;
		};
	},
	
	contactFormSubmit: function() {
		
		if ($('contactname').value != '' && $('contactemail').value != '' && $('contactmessage').value != '' && $('contactphone').value != '') {
			var mySendRequest = new Ajax('/ajax-send-contactform.php', {
				postBody: 	{	'name': $('contactname').value,
							'company': $('contactcompany').value,
							'email': $('contactemail').value,
							'phone': $('contactphone').value, 
							'message': $('contactmessage').value
						}
			}).request();
			
			
			var myFx2 = new Fx.Style('contactform', 'opacity');
		
			
			myFx2.start(1,0).chain(function(){
				$('contactform').setHTML('<table width="100%" height="100%" border="0" id="contactformtable"><tr><td align=center valign=center>Vielen Dank!</td></tr></table>');
				myFx2.start(0,1);
			});
			
			
			
			
		} else {
			
			contactForm.showerrorBox();
		
		}
		
		return false;
	},
	
	showerrorBox: function() {
		var myFx = new Fx.Style('errorbox', 'opacity').start(0,0.8);
	
	},
	hideerrorBox: function() {
			var myFx = new Fx.Style('errorbox', 'opacity').start(0.8,0);
	}
};

function image1() {
	imagefx1 = new Slideshow('showcase1', {duration: [800, 4000], hu: 'Image/showcase/', images: ['a1.jpg','b1.jpg','c1.jpg','d1.jpg','e1.jpg'], height: 448, width: 165, type: 'wipe'});
}
function image2() {
	imagefx2 = new Slideshow('showcase2', {duration: [800, 4000], hu: 'Image/showcase/', images: ['a2.jpg','b2.jpg','c2.jpg','d2.jpg','e2.jpg'], height: 448, width: 165, type: 'wipe'});
}
function image3() {
	imagefx3 = new Slideshow('showcase3', {duration: [800, 4000], hu: 'Image/showcase/', images: ['a3.jpg','b3.jpg','c3.jpg','d3.jpg','e3.jpg'], height: 448, width: 165, type: 'wipe'});
}
function image4() {
	imagefx4 = new Slideshow('showcase4', {duration: [800, 4000], hu: 'Image/showcase/', images: ['a4.jpg','b4.jpg','c4.jpg','d4.jpg','e4.jpg'], height: 448, width: 165, type: 'wipe'});
}

function smallimage1(topic, delay) {
	
	(function(){ var imagefx1 = new Slideshow('showcase1', {duration: [800, 5000], hu: 'Image/showcase/' + topic + '/small/', images: ['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg'], height: 120, width: 165, type: 'push'})}).delay(delay);
}
function smallimage2(topic, delay) {
	(function(){ var imagefx2 = new Slideshow('showcase2', {duration: [800, 5000], hu: 'Image/showcase/' + topic + '/small/', images: ['2.jpg','3.jpg','4.jpg','5.jpg','1.jpg'], height: 120, width: 165, type: 'push'})}).delay(delay);
}
function smallimage3(topic, delay) {
	(function(){ var imagefx3 = new Slideshow('showcase3', {duration: [800, 5000], hu: 'Image/showcase/' + topic + '/small/', images: ['3.jpg','4.jpg','5.jpg','1.jpg','2.jpg'], height: 120, width: 165, type: 'push'})}).delay(delay);
}
function smallimage4(topic, delay) {
	(function(){ var imagefx4 = new Slideshow('showcase4', {duration: [800, 5000], hu: 'Image/showcase/' + topic + '/small/', images: ['4.jpg','5.jpg','1.jpg','2.jpg','3.jpg'], height: 120, width: 165, type: 'push'})}).delay(delay);
}
function bigimage(topic, delay) {
	(function(){ var imagefx5 = new Slideshow('showcase5', {duration: [800, 5000], hu: 'Image/showcase/' + topic + '/', images: ['5.jpg','1.jpg','2.jpg','3.jpg','4.jpg'], height: 317, width: 337, type: 'wipe'})}).delay(delay);
}

function openWebsite(url) {
	location.href = url;
}

