﻿var open=false;


function check()
{
	//new Effect.Appear('testdiv');
	if(open==false)
	{
		new Effect.Morph('x', {	style: 'width:300px;', 	// CSS Properties
  								duration: 0.5 			// Core Effect properties
						   		}
						);
		
		setTimeout("grow()", 500);
		

		//new Effect.Grow('testdiv', {duration: 3.0, direction: 'top-left'});

		document.getElementById('text').innerHTML="<a href='#' onclick='javascript:check()'><span class='p5'>Close search</span><\/a> ";
		
		new Effect.Appear('pfeil', {duration: 3.0, from: 0, to: 1 });

		open=true;
		return false;
	}
	if(open==true)
	{
		new Effect.Morph('x', {	style: 'width:0px', 	// CSS Properties
  										duration: 0.8 			// Core Effect properties
									}
						);
		
		new Effect.Fold('testdiv');
		
		document.getElementById('text').innerHTML="<a href='#' onclick='javascript:check()'><span class='p5'>Search database</span><\/a> ";

		new Effect.Fade('pfeil', {duration: 1.0, from: 1, to: 0 });
		
		open=false;
		return false;
	}
}

function grow()
{
	new Effect.Grow('testdiv', {duration: 0.5, direction: 'top-right'});
}
