var small = true;
var big = false;

$('#portalKarteAnim:visible').live('mouseenter',
	function() {
		if (small) {
			small = false;
			$('#closerDivX').animate(
				{
					height: '52'
				}, 400
			);
			$('#portalKarteAnim').animate(
				{
					width: '325',
					height: '470',
					opacity: '1.0'
				}, 400
			);
			$('#portalKarteImgAnim').animate({
				width: '305',
				height: '405'
			}, 400, 
				function() {
			    	$('#portalKarte').show();
			    	$('#portalKarteAnim').hide();
					big = true;
				}
			);
		}
	}
);

/* $('#portalKarteAnim:visible').live('mouseleave',
	function() {
		if (!big) {
			portalKarteVerkleinern();
		}
	}
);

$('#portalKarte:visible').live('mouseleave',
	function() {
		if (big) {
			portalKarteVerkleinern();
		}
	}
); */

$('#closer').live('click',
	function() {
		portalKarteVerkleinern();
	}
);

function portalKarteVerkleinern() {
	big = false;
   $('#portalKarte').hide();
   $('#portalKarteAnim').show();
	$('#closerDivX').animate(
		{
			height: '8'
		}, 400
	);
	$('#portalKarteAnim').animate(
		{
			width: '160',
			height: '206',
			opacity: '1.0'
		}, 400
	);
	$('#portalKarteImgAnim').animate(
		{
			width: '140',
			height: '186'
		}, 400, 
		function() {
    		small = true;
		}
	);
}


var h3default = 'Bitte wählen Sie';
var sdefault = 'Archivname, Ort, PLZ';

function sfocus(){
	if ($('#portalSearchWord').val() == sdefault)
		$('#portalSearchWord').val('');
	else
		$('#portalSearchWord').select();
};

function sblur(){
};

function ssubmit(){
	if (!$('#portalSearchWord').val().replace(/ /g,'') || $('#portalSearchWord').val() == sdefault) {
		alert('Bitte geben Sie einen Suchbegriff an.');
		$('#portalSearchWord').focus();
		return false;
	}
	return true;
};

function show(text){
	$('#whatH3').html(text);
	return false;
};

function hide(){
	$('#whatH3').html(h3default);
  return false;
};

