/* jQuery(function($){
	$.datepicker.regional['de'] = {
		closeText: 'schließen',
		prevText: '&#x3c;zurück',
		nextText: 'Vor&#x3e;',
		currentText: 'heute',
		monthNames: ['Januar','Februar','März','April','Mai','Juni',
		'Juli','August','September','Oktober','November','Dezember'],
		monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
		'Jul','Aug','Sep','Okt','Nov','Dez'],
		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
		weekHeader: 'Wo',
		dateFormat: 'dd.mm.yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['de']);
}); */



function checkval(){

   inputs = $('input[type="text"].req');
   inputs.each(function(){
      item = $(this);
      if(isDefault(item))
	  item.attr('value','');
   });
}


function isDefault(item){
   item.def = item.attr('title');
   if(item.attr('value') == item.def){
           return true;
       }else{
	   return false;
       }
}


$(document).ready(function(){


    //Datepicker
    // $( ".datepicker" ).datepicker({ dateFormat: 'dd.mm.yy' });
      $( ".datepicker" ).datepicker({
                            dateFormat: 'dd.mm.yy',
                            showOn: "button",
                            buttonImage: "fileadmin/images/cal.png",
                            buttonImageOnly: true
                    });

  //   $( ".datepicker" ).datepicker( "option", "dateFormat", 'dd.mm.yy' );


      // Inputs width Lables in it
       inputs = $('input[type="text"]');

       inputs.each(function(i,item){

          item = $(this);
          item.def = item.attr('title');

          if(item.attr('value') == "" || isDefault(item))
           {
                item.attr('value',item.def);
                item
                    .focus(function(){
                        //console.log('myVar: ', $(this).attr('value'));
                        if(isDefault($(this))){
                                $(this).attr('value','');
                            }
                    })
                    .blur(function(){
                        //console.log('myVar: ', $(this).attr('value'));
                        if($(this).attr('value') == ""){
                            $(this).attr('value',$(this).attr('title'));
                        }
                    });
           }
       });

   


 }); 




	







//
//
//window.addEvent('domready', function() {
//
//    /**
//    * ### INPUTTEXT ###
//    **/
//   inputs = $$('input[type="text"]');
//   inputs.each(function(item){
//
//       item.lable =  item.getNext();
//       if(item.lable != null)
//       {
//	    item.text = item.lable.get('text');
//       }else{
//	   item.text = "";
//       }//alert(text);
//
//
//	if(item.get('value') == "")
//	{
//	    item.set('value',item.text);
//	    item.addClass('inputtext');
//	}
//
//	    item.addEvents({
//		    'blur':function(){
//			    if(this.getProperty('value') == '' ){
//				    this.addClass('inputtext');
//				    this.setProperty('value',item.text );
//			    }
//		    },
//		    'focus':function(){
//			    if( this.hasClass('inputtext') ){
//				    this.removeClass('inputtext');
//				    this.setProperty('value','');
//			    }
//		    }
//	    });
//    });
//
//
//
//
//
//
///*Kalender setup*/
//
//    		Calendar.setup({
//        		inputField     :    "AnreisetagK",     // id of the input field
//        		ifFormat       :    "%d.%m.%Y",        // format of the input field
//       		 	button         :    "cal1",            // ID of the image
//        		singleClick    :    true
//    		});
//
//			Calendar.setup({
//        		inputField     :    "AbreisetagK",     // id of the input field
//        		ifFormat       :    "%d.%m.%Y",        // format of the input field
//       		 	button         :    "cal2",            // ID of the image
//        		singleClick    :    true
//    		});
//
//	if( $('anreisetag_input') && $('anreisetag_input') ){
//		Calendar.setup({
//        		inputField     :    "anreisetag_input",     // id of the input field
//        		ifFormat       :    "%d.%m.%Y",        // format of the input field
//       		 	button         :    "anreisetag_cal",            // ID of the image
//        		singleClick    :    true
//    		});
//
//			Calendar.setup({
//        		inputField     :    "abreisetag_input",     // id of the input field
//        		ifFormat       :    "%d.%m.%Y",        // format of the input field
//       		 	button         :    "abreisetag_cal",            // ID of the image
//        		singleClick    :    true
//    		});
//	}
//
//
//
//});
//
//

