jQuery(document).ready
(

	function()
	{		
	
		var shortEvent = 'blur focus change';
		var longEvent = 'blur focus keydown keypress keyup change';
		
		$('input,textarea,select').each
		(
			function()
			{
				var standardValue = "";
				
				switch($(this).attr('name'))
				{
					case 'anrede':
						//nothing to do here
					break;
					
					case 'agb':
						//nothing to do here
					break;
					
					case 'agb2':
						//nothing to do here
					break;
				
					case 'vorname':
						standardValue = "Vorname";
					break;
					
					case 'nachname':
						standardValue = "Nachname";
					break;
					
					case 'email':
						standardValue = "E-Mail";
					break;
					
					case 'gebtag':
						standardValue = "TT";
					break;
					
					case 'gebmonat':
						standardValue = "MM";
					break;
					
					case 'gebjahr':
						standardValue = "JJJJ";
					break;
					
					case 'telefonvorwahl':
						standardValue = "Telefonvorwahl";
					break;	
					
					case 'telefonnummer':
						standardValue = "Telefonnummer";
					break;	
					
					case 'plz':
						standardValue = "PLZ";
					break;
					
					case 'ort':
						standardValue = "Ort";
					break;
					
					case 'strasse':
						standardValue = "Strasse Nr.";
					break;
					
					case 'sicherheitscode':
						standardValue = "Sicherheitscode";
					break;
					
					case 'freunde':
						standardValue = "freund1@domain.de, freund2@domain.de, freund3@domain.de";
					break;
					
					case 'wish1':
						standardValue = "Gib deinen Wunsch ein ...";
					break;
					
					case 'wish2':
						standardValue = "Gib deinen Wunsch ein ...";
					break;
					
					case 'wish3':
						standardValue = "Gib deinen Wunsch ein ...";
					break;
				
					default:
						//nothing to do here (maybe det the value to the name of the input field)
					break;
				};
				
				
				
				if(standardValue)
				{
					if($(this).val() == "")
						$(this).val(standardValue);
					
					$(this).bind
					(
						'focus blur'
						, function(event)
						{
							var timer = new Date();
							var tmp = timer.getTime();
							var input_name = this.name;
							var input_type = this.type;
							var input_value = this.value;
							var event_type = event.type;
							/*
							$.ajax
							(
								{
									type: "GET",
									url: "click_analyse.php?analyse=1&tmp=" + tmp + "&event_type=" + event_type + "&input_type=" + input_type + "&input_value=" + input_value + "&input_name=" +input_name,
									success: function(msg)
									{
									}
								}
							);
							*/
							if(event.type == 'focus')
							{
								if($(this).val() == standardValue)
								$(this).val("");
							}
							
							if(event.type == 'blur')
							{
								if($(this).val() == "")
								$(this).val(standardValue);
							}			
								
						}
					);
					
					
				}
				else
				{
					
					$(this).bind
					(
						'focus blur'
						, function(event)
						{
							var timer = new Date();
							var tmp = timer.getTime();
							var input_name = this.name;
							var input_type = this.type;
							var input_value = this.value;
							var event_type = event.type;
						/*	
							$.ajax
							(
								{
									type: "GET",
									url: "click_analyse.php?analyse=1&tmp=" + tmp + "&event_type=" + event_type + "&input_type=" + input_type + "&input_value=" + input_value + "&input_name=" +input_name,
									success: function(msg)
									{
									}
								}
							);
							*/	
						}
					);
					
				}
				
				
				
						
				
				
			}
		);
	}
);
