/* Element erscheinen lassen */
var tmpID = "";
function displayInformations( id, tmpID )
{
	//alert( "hi" + tmpID );
	if( (tmpID) && (tmpID != id))
	{
		document.getElementById( "detailTR_"+tmpID ).style.display = 'none';
		//new Effect.toggle( "detailTR_"+tmpID , 'appear' );
	}
	document.tmpID = id;
	var containerTR = "detailTR_"+id;
	var containerTD = "detailTD_"+id;
	var url = "carDetail.php?id="+id+"";
	new Ajax.Updater( containerTD, url);
	
	if(document.getElementById( containerTR ).style.display == 'none')
	{
		document.getElementById( 'arrowWindow_'+id ).src="images/design/arrowDown.png";
		new Effect.toggle( containerTR , 'appear' );
		//moveWindow( container );
	}
	else
	{
		document.getElementById( 'arrowWindow_'+id ).src="images/design/arrowRight.png";
		new Effect.toggle( containerTR , 'appear' );
	}
	
	//timeout um kontaktdaten vor zu laden...
	window.setTimeout("fillContact( "+id+",'' )", 200);
	
	return true;
}
/* Element ausblenden */
function closeInformations( DIVTOCLOSE )
{
	new Effect.toggle( DIVTOCLOSE , 'slide' );
	return true;
}

/* Element verschiebbar machen */
function moveWindow( DIVID )
{
	moveWin = new Draggable( DIVID );
	return false;
}
/*  Element erscheinen lassen */
function elementAppear( id, carId )
{

				//backgroundImage('bgImageTD', document.getElementById('bigImage').src);
				document.getElementById('bigImage'+carId).src = document.getElementById( id ).src
				//myElement = new Effect.Appear( 'bigImage'+carId,{duration:1, from:0, to:1});
				 
				return true;
}

/* Hintergrundgrafik eines Elementes austauschen */
function backgroundImage( id, src )
{
	//alert("=>"+src);
	document.getElementById(id).style.backgroundImage="url('"+src+"')";
}

function fillContact( carsId, carContactEmail )
{
//alert( carsId + " - " + carContactEmail );
	var container = "contactContainer"+carsId;
	var url = "./carContact.php?id="+carsId+"&carContactEmail="+carContactEmail+"&on=true";
	new Ajax.Updater( container, url);
	return true;
}
