/*--------------------------------------------------/
/                                                   /
/   javascript.js                                   /
/                                                   /
/   www.foto-ohde.de                                /
/                                                   /
/   02.11.2009                                      /
/													/
/---------------------------------------------------/
/													/
/   Diverse Funktionen                   			/
/													/
/--------------------------------------------------*/

$(document).ready(function() {

	
	
	
	$('#mehr_infos_anzeigen').click(function() {
		  $('#mehr_infos').slideToggle('400', function() {
		    // Animation complete.
		  });
		});
	
	
	
	
	$('select[name="usrAusgabeseite"]').change(function() {document.getElementById('gehezuseite').submit();});
	
	

	
	
	


//$("#login_container").corner("bl br 6px");    	

$(".inputbutton_wrapper01").corner("6px");

$(".inputbutton_wrapper02").corner("6px");





$("a.button01").corner("6px");

$("a.button02").corner("6px");	
	
$("a.button03").corner("6px");

$("a.button04").corner("6px");

$("a.button05").corner("6px");

$("a.button06").corner("6px");

$("a.button07").corner("6px");




/*--------------------------------------------------/
/                                                   /
/   Formular Fotoanfrage: privat || gewerblich      /
/   Formularfelder ein- bzw. ausblenden.            /
/                                                   /
/--------------------------------------------------*/


if ($('#gewerblich').attr('checked')) {

	$('.formular_gewerbliche_nutzung').show();
	
	$('.formular_private_nutzung').hide();

}


if ($('#privat').attr('checked')) {

	$('.formular_gewerbliche_nutzung').hide();
	
	$('.formular_private_nutzung').show();

}


$('#privat').click(function() {

	$('.formular_gewerbliche_nutzung').hide();
	
	$('.formular_private_nutzung').fadeIn();

} );


$('#gewerblich').click(function() {

	$('.formular_private_nutzung').hide();
	
	$('.formular_gewerbliche_nutzung').fadeIn();

} );



/*

if ($('#internetnutzung_ja').attr('checked')) {

	$('.formular_internetnutzung').hide();
	


}


$('#internetnutzung_nein').click(function() {
	
	$('.formular_internetnutzung').fadeIn();

} );


$('#internetnutzung_ja').click(function() {

	$('.formular_internetnutzung').fadeOut();
	
	

} );

*/

/*--------------------------------------------------/
/                                                   /
/   Links überschreiben -> Fotoanzeige in Thickbox  /
/                                                   /
/--------------------------------------------------*/

$('#thumbnails li a[title]').each(function () {
	
	$(this).addClass('thickbox');

	var intFotoNummer = $(this).attr('title');

	$(this).attr('href', '/ajax.php5?usrController=foto&usrFotoNummer=' + intFotoNummer + '&height=540&width=760');

} );



/*--------------------------------------------------/
/                                                   /
/   Formularfeld 'Gehe zu Seite'                    /
/   und Formularfeld 'Suchen':                      /
/   bei Klick ins Input Feld Inhalt löschen         /
/                                                   /
/--------------------------------------------------*/

$('#usrAusgabeseite').click( function() {

	$(this).attr('value', '');

} );


$('#usrSuchbegriffe').click( function() {

	$(this).attr('value', '');

} );



/*--------------------------------------------------/
/                                                   /
/   Homepage: Diashow anpassen                      /
/                                                   /
/--------------------------------------------------*/

$('#diashow').innerfade( { speed: 3000,
                           timeout: 4000,
                           type: 'sequence',
                           containerheight: '330px'
                          } );




/*--------------------------------------------------/
/                                                   /
/   Thumbnails: Tooltip zeigt Fotonummer und        /
/   Bildkommentar an.                               /
/                                                   /
/--------------------------------------------------*/

function thumbnailTooltip() {

	xOffset = 0;
	yOffset = 10;

	$("img.preview").hover( function(e) {
	   
		var t = $(this).attr("name");
                
		$("body").append("<p id='tooltip'>"+ t +"</p>");

		$("#tooltip").css("width","200px").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn(0);

		},

		function() {

			$("#tooltip").remove();

		}

	);


	$("img.preview").mousemove( function(e) {

		$("#tooltip").css("width","200px").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px");

		}

	);

};

thumbnailTooltip();




/*--------------------------------------------------/
/                                                   /
/   Suchbegriffe: Suchbegriffe für jeden Buchstaben /
/   in separaten Tabs anzeigen.                     /
/                                                   /
/--------------------------------------------------*/

/*
$(function() {
	
	$("#tabsSuchbegriffeBuchstaben").tabs();
		
});
*/




} ); 








