var el = new Fx.Tween('submenucont', {duration:1200,transition: Fx.Transitions.Expo.easeInOut});
var el2 = new Fx.Tween('toolmenuitems', {duration:500,transition: Fx.Transitions.Expo.easeInOut});



/*var customTips = $$('.ttip');
var toolTips = new Tips(customTips, {
	//this will set how long before
	//the tooltip will wait to show up
	//when you mouseover the element
	//in milliseconds
	showDelay: 200,    //default is 100
 
	//this is how long the tooltip
	//will delay bofore hiding
	//when you leave
	hideDelay: 100,   //default is 100
 
	//this will add a wrapper div
	//with the following class to your tooltips
	//this lets you have different styles of tooltips
	//on the same page
	className: 'anything', //default is null
 
	//this sets the x and y offets
	offsets: {
		'x': 100,       //default is 16
		'y': 16        //default is 16
	},
 
	//this determines whether the tooltip
	//remains staitionary or follows your cursor
	//true makes it stationary
 	fixed: false,      //default is false
 
	//if you call the functions outside of the options
	//then it may "flash" a bit on transitions
	//much smoother if you leave them in here
	onShow: function(toolTipElement){
	    //passes the tooltip element
		//you can fade in to full opacity
		//or leave them a little transparent
    	toolTipElement.fade(.8);
		$('show').highlight('#FFF504');
	},
	onHide: function(toolTipElement){
    	toolTipElement.fade(0);
		$('hide').highlight('#FFF504');
	}
});
*/

var resizecontrolstate = 'down';
var menucontrolstate = 'up';

window.addEvent('domready', function() {

//list of target elements
var list = $$('#collapse li div.collapse');
//list elements to be clicked on
var headings = $$('#collapse li h3');
//array to store all of the collapsibles
var collapsibles = new Array();

headings.each( function(heading, i) {

        //for each element create a slide effect
        var collapsible = new Fx.Slide(list[i], {
                duration: 500,
                transition: Fx.Transitions.linear
        });

        //and store it in the array
        collapsibles[i] = collapsible;

        //add event listener
        heading.onclick = function(){
                collapsible.toggle();
	        //optional accordion
	        for(var j = 0; j < collapsibles.length; j++){
	                if(j!=i) collapsibles[j].slideOut();
	        }
	

                return false;
        }

        //collapse all of the list items
        collapsible.hide();




});

/* 

	var accordion = new Accordion($$('.toggler'),$$('.element'), {
		opacity: 0
	});

*/
 
    /**
     * Set default options, overrideable from later calls.
     */

    /**
     * Assign SqueezeBox to all links with rel="boxed" attribute, the class then reads the "href".
     */
    SqueezeBox.assign($$('a[rel=boxedform]'), {
    	caption: false,
	handler:'iframe'
    });    
    
    SqueezeBox.assign($$('a[rel=boxedformscroll]'), {
    	caption: false,
	handler:'iframe2'
    });    
    
    SqueezeBox.assign($$('a[rel=gogmap]'));

    SqueezeBox.assign($$('a[rel=boxed]'), {
	size: {x: 798, y: 598},
	caption: true,
	closeBtn: false
    });

   
    SqueezeBox.assign($$('a[rel=broschuere]'), {
	size: {x: 798, y: 598},
	caption: false,
	handler:'iframe'
    });



    /**
     * Open some content manually


 
    SqueezeBox.open('http://digitarald.de', {handler: 'iframe'}); // we force the "iframe" handler here ...
 
    SqueezeBox.open($('welcome'), {handler: 'adopt'}); // and here we force "adopt" handler

    SqueezeBox.open('SqueezeBox.css'); // handler defaults to "ajax" for urls
     */
	$('resizecontrol').addEvents({
		'mousedown': function(){
			if (resizecontrolstate == 'down') {
				resizecontrolstate = 'up';
				el.start ('padding-top', '10px');
				this.style.background = "url('arrowdown.gif') no-repeat";
			} else {
				resizecontrolstate = 'down';
				el.start ('padding-top', '199px');
				this.style.background = "url('arrowup.gif') no-repeat";
			};
		}
	});

	var tool1mph = new Fx.Morph('tool1', {duration:500,transition: Fx.Transitions.Expo.easeInOut, link: 'cancel' });
	var tool2mph = new Fx.Morph('tool2', {duration:500,transition: Fx.Transitions.Expo.easeInOut, link: 'cancel' });	
	var tool3mph = new Fx.Morph('tool3', {duration:500,transition: Fx.Transitions.Expo.easeInOut, link: 'cancel' });	
	var tool4mph = new Fx.Morph('tool4', {duration:500,transition: Fx.Transitions.Expo.easeInOut, link: 'cancel' });	

	$('tool1').addEvents({
		'mouseenter': function(){
			tool1mph.start ({
				'width': '140em'				
			});

		},
		'mouseleave': function(){
			tool1mph.start ({
				'width': '35px'
			});
		}
	});

	$('tool2').addEvents({
		'mouseenter': function(){
			tool2mph.start ({
				'width': '140em'								
			});

		},
		'mouseleave': function(){
			tool2mph.start ({
				'width': '35px'
			});
		}
	});

	$('tool3').addEvents({
		'mouseenter': function(){
			tool3mph.start ({
				'width': '165em'						
			});

		},
		'mouseleave': function(){
			tool3mph.start ({
				'width': '35px'
			});

		}
	});

	$('tool4').addEvents({
		'mouseenter': function(){
			tool4mph.start ({
				'width': '198em'						
			});

		},
		'mouseleave': function(){
			tool4mph.start ({
				'width': '35px'
			});

		}
	});
})


var inputs = document.getElementsByTagName("input");
for( var i = 0 ; i < inputs.length ; i++ ) {
 if(inputs[i].type=="text"||inputs[i].type=="password") {
  inputs[i].onfocus = function() {
   if(this.value==this.defaultValue) this.value = '';
  }
  inputs[i].onblur = function() {
   if(this.value=='') this.value = this.defaultValue;
  }
 }
}
Hyphenator.run();