
	$(document).ready(function() {	
	
			// ostylowanie pola select
			$('#contact-contact_form').selectbox();

			
			//$('#limit_dzien').keyfilter(/[\d]/);
			
			//bug Opery
			if ($.browser.opera) {
				$('#contact-contact_form').attr('style', 'padding-top: 0px; height: 23px;');
			}
	
			//bug - usawienie szerokosci
			$('#contact-contact_form_container').css('width','402px');
			
			$('#contact-contact_form li')
			.mouseover(function(){
				$(this).addClass('hover')
			})
			.mouseout(function(){
				$(this).removeClass('hover')
			})
			
			// checkbox zgoda
			if (true == $('#fZgoda input').is(':checked')) {
			
					$( '#fZgoda .accept' ).addClass('checked');
			
			}
		
			$('#fZgoda input').change(function(){
				
					if ( true == $(this).is(':checked') ){
					// checkbox jest zaznaczony
							
							$( '#fZgoda .accept' ).addClass('checked');
					
					} else {
					// checkbox jest odznaczony 
							
							$( '#fZgoda .accept' ).removeClass('checked');						
					}
					
			});		
			
			// dla IE
			if($.browser.msie){
				
					$('#fZgoda small').click(function(){
								if ( false == $( '#fZgoda .accept' ).hasClass('checked') ){
								// checkbox jest zaznaczony
										
										$( '#fZgoda .accept' ).addClass('checked');
										$('#fZgoda input').attr('checked','checked');
								
								} else {
								// checkbox jest odznaczony 
										
										$( '#fZgoda .accept' ).removeClass('checked');
										$('#fZgoda input').removeAttr('checked');				
								}
					});
			
			}
			
			//********** radio buttony
			$('.pojRadioButton input').each(function() {
				if (true == $(this).is(':checked')) {
				
						$(this).siblings( '.accept' ).addClass('checked');
				
				}	
			});
		
			$('.pojRadioButton input').change(function(){
				
					$(this).parent().parent().find('label').removeClass('checked');
				
					if ( true == $(this).is(':checked') ){
					// checkbox jest zaznaczony
							
							$(this).siblings( ' .accept' ).addClass('checked');
					
					} else {
					// checkbox jest odznaczony 
							
							$(this).siblings(' .accept' ).removeClass('checked');						
					}
					
			});
			
			// dla IE
			if($.browser.msie || $.browser.opera){
				
					$('.pojRadioButton small').click(function(){
								//alert( $(this).parent().attr('class'));
								
								if ( false == $(this).parent().parent().find('.accept' ).hasClass('checked') ){
								// checkbox jest zaznaczony
										$(this).parent().parent().parent().find('label').removeClass('checked');
										$(this).parent().parent().find('input').click();
										$(this).parent().parent().find(' .accept' ).addClass('checked');
										$(this).parent().parent().find(' input').attr('checked','checked');
								
								}
					});
			
			}
			
			// pokazanie odpowiednich pol w zaleznosci od preferowanej godziny kontaktu			
			$('#contact-contact_form_container li').click( function(){
					var sLiId = $('#contact-contact_form_container li.selected').attr('id');
					var ar = (''+sLiId).split('_');
					var iVal = ar[ar.length-1];
					
					// telefonicznie
					if( iVal == 1){
						
							$('#pojEmailFields').hide();
							$('#pojTelefonFields').show();
					
					// email
					}else{
						
							$('#pojTelefonFields').hide();
							$('#pojEmailFields').show();
						
					}
			})	
			
	});