
$(document).ready(function () {

	$("ul.lavaMenu").lavaLamp({ fx: "easeOutBack", speed: 700 });
	
    $('a').click(function() {
    	this.blur();
    });

});


function toggleMapSize() {
	pageTracker._trackPageview("/contact/clickOnMap");
	
	if($("#directionsMap").css("left") == "0px") {
		$("#directionsMap").stop().animate({left:'-444px'});
		$("#directionsMap").children("img").animate({width:'728px',height:'726px'});
		$.scrollTo($('.contentHeadline'),500);
		$("#linkMapZoomIn").hide();
		$("#linkMapZoomOut").show();
	}
	
	if($("#directionsMap").css("left") == "-444px") {
		$("#directionsMap").stop().animate({left:'0px'});
		$("#directionsMap").children("img").animate({width:'284px',height:'288px'});
		$("#linkMapZoomOut").hide();
		$("#linkMapZoomIn").show();
	}
}


( function( $j ) {
	 
    // plugin definition
    $j.fn.overlabel = function( options ) {
 		
        // build main options before element iteration
        var opts = $j.extend( {}, $j.fn.overlabel.defaults, options );
 
        var selection = this.filter( 'label[for]' ).map( function() {
 			
            var label = $j( this );
            
            var labelClass = label.attr( 'class' ); 
                        
            var id = label.attr( 'for' );
            //alert(id);
            var field = document.getElementById( id );
 			
            if ( !field ) return;
 			
            // build element specific options
            var o = $j.meta ? $j.extend( {}, opts, label.data() ) : opts;
 			//alert(labelClass+'-apply');
            label.addClass( labelClass+'-apply' );
 
            var hide_label = function() { label.css( o.hide_css ) };
            var show_label = function() { this.value || label.css( o.show_css ) };
            
            var changeField = function() {alert(this.value)};
 			
            $j( field )
                 .parent().addClass( o.wrapper_class ).end()
                 .focus( hide_label ).blur( show_label ).each( hide_label ).each( show_label );

			
            return this;
 
        } );
 
        return opts.filter ? selection : selection.end();
    };
 
    // publicly accessible defaults
    $j.fn.overlabel.defaults = {
 
        label_class:   'overlabel', //-apply',
        wrapper_class: 'overlabel-wrapper',
        hide_css:      { 'text-indent': '-10000px' },
        show_css:      { 'text-indent': '0px', 'cursor': 'text' },
        filter:        false
 
    };
 
} )( jQuery );

