		function isValidLogin(login) {
			var pattern = new RegExp(/^[\w\d\_\.]{4,}$/);
			return pattern.test(login);
		}
		function isValidPass(pass) {
			var pattern = new RegExp(/^.{6,}$|^$/);
			return pattern.test(pass);
		}		
		function isValidEmailAddress(emailAddress) {
			var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
			return pattern.test(emailAddress);
		}
		function isValidOther(other) {
			var pattern = new RegExp(/^[\w\d\_\.]{1,}$/);
			return pattern.test(other);
		}
		function isValidWiek(wiek) {
			var pattern = new RegExp(/^([1-9]|0[1-9]|[12][0-9]|3[01])\D([1-9]|0[1-9]|1[012])\D(19[0-9][0-9]|20[0-9][0-9])$/);
			return pattern.test(wiek);
		}
		function isValidCyfry(cyfry) {
			var pattern = new RegExp(/^[0-9]{1,2}$/);
			return pattern.test(cyfry);
		}		
		function muzyka_add(str) {
			str = str + str;
			return str;
		}
		function sum(str) {
			var str1 = str.substring(1,2);
			var str2 = str.substring(3,4);
			var l1 = parseInt(str1);
			var l2 = parseInt(str2);
			var sum = l1+l2;
			
			return sum;
		}

//*********************************	
		$(document).ready(function() {
			$('#test4').click(function() {
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size

			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = ($('#' + popID).height() + 80) / 2;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;

			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });

			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

			    return false;
			});
		});
			$(document).ready(function() {
			$('#test5').click(function() {
				$("#popup_name").fadeOut();
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size

			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = ($('#' + popID).height() + 80) / 2;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;

			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });

			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

			    return false;
			});
			$('#test6').click(function() {
				$("#popup_name2").fadeOut();
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size

			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = ($('#' + popID).height() + 80) / 2;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;

			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });

			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

			    return false;
			});
			$('#test7').click(function() {
				$("#popup_name3").fadeOut();
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size

			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = ($('#' + popID).height() + 80) / 2;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;

			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });

			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

			    return false;
			});
			$('#test8').click(function() {
				$("#popup_name4").fadeOut();
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size

			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = ($('#' + popID).height() + 80) / 2;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;

			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });

			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

			    return false;
			});
			//Close Popups and Fade Layer
			$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
			    $('#fade , .popup_block').fadeOut(function() {
			        $('#fade, a.close').remove();  //fade them both out
			    });
			    return false;
			});
			$('#test9').click(function() {
				$("#popup_name5").fadeOut();
			    var popID = $(this).attr('rel'); //Get Popup Name
			    var popURL = $(this).attr('href'); //Get Popup href to define size

			    //Pull Query & Variables from href URL
			    var query= popURL.split('?');
			    var dim= query[1].split('&');
			    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

			    //Fade in the Popup and add close button
			    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

			    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
			    var popMargTop = ($('#' + popID).height() + 80) / 2;
			    var popMargLeft = ($('#' + popID).width() + 80) / 2;

			    //Apply Margin to Popup
			    $('#' + popID).css({
			        'margin-top' : -popMargTop,
			        'margin-left' : -popMargLeft
			    });

			    //Fade in Background
			    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
			    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

			    return false;
			});
			//Close Popups and Fade Layer
			$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
			    $('#fade , .popup_block').fadeOut(function() {
			        $('#fade, a.close').remove();  //fade them both out
			    });
			    return false;
			});
			$('#skipthis').live('click', function() { //When clicking on the close or fade layer...
			    $('#fade , .popup_block').fadeOut(function() {
			        $('#fade, a.close').remove();  //fade them both out
			    });
			    return false;
			});
		});

//*********************************	
		$().ready(function(){
	        $(".edit_kom_form").hide();
	        $("#edit_kom").click(function(){
	        	$(".edit_kom_form").toggle();
	        	return false;
	        });
			showStatus("",0);	        
	    });
		$().ready(function (){
			//facebook widget
			$('.widget_social').hover(function(){
				
					$('.widget_social').stop(true, false).animate({right:"0"},"medium");
				},function(){
					$('.widget_social').stop(true, false).animate({right:"-205"},"medium");
				},500);
		});
		$().ready(function(){		
			$("#type").css({"background":"#FFCCCC"});
			$("#type").keyup(function(){
				if($("#type").val()==''){
					$("#type").css({"background":"#FFCCCC"});
				} else {
					$("#type").css({"background":"#fff"});	
				}
			});
	        $(".statusbarclose").click(function(){
	        	$(".statusbar").hide(); 
	        });
	        $(".friendsbar").hide();
	        $(".statusbarchat").click(function(){
		        $(".friendsbar").toggle();       	
	        });
	        $("#friendslogin").click(function(){
	        	$(".friendsbar").hide();
	        });
	    	$('.close_friendsbar').click(function(){
	    		$(".friendsbar").hide();
	    	});	        
		});
		$().ready(function(){
			if($("#cat").val()=="0"){
				$("#cat").css({"background":"#FFCCCC"});
			}
			$("#cat").change(function(){
				if($("#cat").val()=="0"){
					$("#cat").css({"background":"#FFCCCC"});
				} else {
					$("#cat").css({"background":"#fff"});	
				}				
			});	
		});
		$().ready(function(){
			if($("#description").html()==""){
				$("#description").css({"background":"#FFCCCC"});
			}
			$("#description").keyup(function(){
				if($("#description").val()==""){
					$("#description").css({"background":"#FFCCCC"});
				} else {
					$("#description").css({"background":"#fff"});	
				}				
			});	
		});
		$().ready(function(){
			$("#price").css({"background":"#FFCCCC"});
			$("#price").keyup(function(){
				if($("#price").val()==''){
					$("#price").css({"background":"#FFCCCC"});
				} else {
					$("#price").css({"background":"#fff"});	
				}
			});
		});
//*********************************
		$().ready(function(){
			var i=2;
			var max;
			var data;
			$.get("bus.php",{max:"0"},function(mx){
				$("#ilosc").html(mx);
				max = mx;
			});					
			$("#fotki_p").click(function(){
				$("#fotki_p").attr("value",i--);
				$.get("bus.php", {url: $("#fotki_p").attr("value")},function(data){
					$("#wbusie").attr("src","file/club_w/Gozo/med_"+data);	
				});			
				if(i<=0){
					i = max;
				}
				return false;				
			});						
			$("#fotki_n").click(function(){
				$("#fotki_n").attr("value",i++);
				$.get("bus.php",{url:$("#fotki_n").attr("value")},function(data){
					$("#wbusie").attr("src","file/club_w/Gozo/med_"+data);		
				});
				if(i>max) {
					i = 1;
				}				
				return false;
			});		
		});	
//*********************************		
		$().ready(function(){
			var data='';
			$("#login").keyup(function(){
				if($("#login").attr("value")!=""){
					$.get("reg.php",{log:$("#login").attr("value")},function(data){
						if(data!='0') {
							$("#login_err").html("Your username already exists, choose another one...");
							$("#login_error").css({ "background-image": "url('./img/validno.png')" }); 
						} else {
							$("#login_err").html("");
						}
					});	
				} else $("#login_error").css({ "background-image": "url('./img/validno.png')" });					
			});
			$("#email").keyup(function(){
				//alert($("#email").attr("value"));
				if($("#email").attr("value")!=""){
					$.get("reg.php",{em:$("#email").attr("value")},function(data){
						if(data!='0') {
							$("#email_err").html("Your email already exists, choose another...");
							$("#email_error").css({ "background-image": "url('./img/validno.png')" });
						} else {
							$("#email_err").html("");
						}
					});						
				} else $("#email_error").css({ "background-image": "url('./img/validno.png')" });		
			});				
		});
//*********************************		
		/*$().ready(function(){
			var data, data2;
			$("#events").change(function(){
				if($(this).is(":checked")){
					$.get("cal.php",{events:'ev'},function(data){
						$(".calendar").load("cal.php");
						alert(data);
					});
				}else{

				}
			});
			$("#parties").change(function(){
				if($(this).is(":checked")){
					$.get("cal.php",{parties:'pa'},function(data2){
						$(".calendar").text('xxx');
						alert(data2);
					});
				}else{

				}
			});			
		});*/
//*********************************
		$(document).ready(function() {
			$("#logb").click(function() {
				return false;
			});
		});			
//*********************************
		$(document).ready(function() {
			$("#adv_search_div").hide();
			
			$("#adv_search").click(function() {
				$("#adv_search_div").toggle();
			});
		});	
		$(document).ready(function(){
			$('#sendb').click(function(){
				if ($("#dec").is(":checked")) {
					return true;
				} else {
					$("#dec_err").html("You must accept the terms...");
					return false;
				}
			});
		});
		$(document).ready(function(){
			$('#sendb').click(function(){
				if (($("#gender1").is(":checked")) || ($("#gender2").is(":checked"))) {
					return true;
						$("#gender_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#gender_error").css({ "background-image": "url('./img/validno.png')" });
						return false; 
					} 
			});
		});		
		$(document).ready(function() {
			$("#search").keyup(function(){
				var imie = $("#search").val();
				if(imie != 0) {
					if(isValidOther(imie)) { 
						$("#imie_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#imie_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#imie_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#search").keyup(function(){
				var imie = $("#search").val();
				if(imie != 0) {
					if(isValidOther(imie)) { 
						$("#search_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#search_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#search_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#city").keyup(function(){
				var imie = $("#city").val();
				if(imie != 0) {
					if(isValidOther(imie)) { 
						$("#city_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#city_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#city_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#country").keyup(function(){
				var imie = $("#country").val();
				if(imie != 0) {
					if(isValidOther(imie)) { 
						$("#country_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#country_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#country_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#lang").keyup(function(){
				var imie = $("#lang").val();
				if(imie != 0) {
					if(isValidOther(imie)) { 
						$("#lang_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#lang_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#lang_error").css({ "background-image": "none" }); 
				}
			});
		});				
		$(document).ready(function() {
			$("#login").keyup(function(){
				var login = $("#login").val();
				if(login != 0) {
					if(isValidLogin(login)) { 
						$("#login_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#login_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#login_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#pass").keyup(function(){
				var pass = $("#pass").val();
				if(pass != 0) {
					if(isValidPass(pass)) { 
						$("#pass_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#pass_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#pass_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#pass2").keyup(function(){
				var pass = $("#pass").val();
				var pass2 = $("#pass2").val();
				if(pass != 0) {
					if (pass == pass2) {
						if (isValidPass(pass)) {
							$("#pass2_error").css({
								"background-image": "url('./img/validyes.png')"
							});
						}
						else {
							$("#pass2_error").css({
								"background-image": "url('./img/validno.png')"
							});
						}
					} else {
						$("#pass2_error").css({
							"background-image": "url('./img/validno.png')"
						});						
					}
				} else {
					$("#pass2_error").css({ "background-image": "none" }); 
				}
			});
		});			
		$(document).ready(function() {
			$("#email").keyup(function(){
				var email = $("#email").val();
				if(email != 0) {
					if(isValidEmailAddress(email)) { 
						$("#email_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#email_error").css({ "background-image": "url('./img/validno.png')" });
					} 
				} else {
					$("#email_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#imie").keyup(function(){
				var imie = $("#imie").val();
				if(imie != 0) {
					if(isValidOther(imie)) { 
						$("#imie_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#imie_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#imie_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#nazwisko").keyup(function(){
				var nazwisko = $("#nazwisko").val();
				if(nazwisko != 0) {
					if(isValidOther(nazwisko)) { 
						$("#nazwisko_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#nazwisko_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#nazwisko_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#miasto").keyup(function(){
				var miasto = $("#miasto").val();
				if(miasto != 0) {
					if(isValidOther(miasto)) { 
						$("#miasto_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#miasto_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#miasto_error").css({ "background-image": "none" }); 
				}
			});
		});		
		$(document).ready(function() {
			$("#kraj").keyup(function(){
				var kraj = $("#kraj").val();
				if(kraj != 0) {
					if(isValidOther(kraj)) { 
						$("#kraj_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#kraj_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#kraj_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#muzyka").keyup(function(){
				var muzyka = $("#muzyka").val();
				if(muzyka != 0) {
					if(isValidOther(muzyka)) { 
						$("#muzyka_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#muzyka_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#muzyka_error").css({ "background-image": "none" }); 
				}
			});
		});	
		$(document).ready(function() {
			$("#wiek").keyup(function(){
				var wiek = $("#wiek").val();
				if(wiek != 0) {
					if(isValidWiek(wiek)) { 
						$("#wiek_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#wiek_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#wiek_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(function(){
			$("#choose_music").click(function(){
				$("#muzyka").toggle(400);
			});
			$("#muzyka a").each(function(intIndex){
				$(this).bind("click", function(){
					var str = $(this).text();					
					if($("#muzyka_f").val()==='Please choose your favourite music by clicking on the music types below. Your choice of music will be updated in this box automatically.'){
						$("#muzyka_f").val(str);
					} else {
						$("#muzyka_f").val($("#muzyka_f").val()+str);	
					}
				});
			});
		});
//***************	
		$(document).ready(function() {
			$("#company").keyup(function(){
				var wart = $("#company").val();
				if(wart != 0) {
					if(isValidOther(wart)) { 
						$("#company_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#company_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#company_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#address").keyup(function(){
				var wart = $("#address").val();
				if(wart != 0) {
					if(isValidOther(wart)) { 
						$("#address_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#address_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#address_error").css({ "background-image": "none" }); 
				}
			});
		});
		//email juz byl
		$(document).ready(function() {
			$("#title").keyup(function(){
				var wart = $("#title").val();
				if(wart != 0) {
					if(isValidOther(wart)) { 
						$("#title_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#title_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#title_error").css({ "background-image": "none" }); 
				}
			});
		});	
		$(document).ready(function() {
			$("#desc").keyup(function(){
				var wart = $("#desc").val();
				if(wart != 0) {
					if(isValidOther(wart)) { 
						$("#desc_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#desc_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#desc_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#exp").keyup(function(){
				var wart = $("#exp").val();
				if(wart != 0) {
					if(isValidOther(wart)) { 
						$("#exp_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#exp_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#exp_error").css({ "background-image": "none" }); 
				}
			});
		});
		$(document).ready(function() {
			$("#date").keyup(function(){
				var wart = $("#date").val();
				if(wart != 0) {
					if(isValidOther(wart)) { 
						$("#date_error").css({ "background-image": "url('./img/validyes.png')" }); 
					} else {
						$("#date_error").css({ "background-image": "url('./img/validno.png')" }); 
					} 
				} else {
					$("#date_error").css({ "background-image": "none" }); 
				}
			});
		});							
//****************
		$(document).ready(function() {
			$('#market_place').hide();
		});
		$(document).ready(function() {
			$('#ogloszenia').css("cursor","pointer");
			$('.choosefriend').css("cursor","pointer");
			$('#top_text').css("cursor","pointer"); 
			$('#ogloszenia').click(function(){
				$('#top_products').hide();
				$('#market_place').show();	
				$('#ogloszenia').css('background', 'url("images/panelactive.gif") repeat-x');
				$('#top_text').css('background', 'url("images/panelunactive.gif") repeat-x');
			});
		});
		$(document).ready(function() {
			$('#top_text').click(function(){
				$('#market_place').hide();
				$('#top_products').show();
				$('#ogloszenia').css('background', 'url("images/panelunactive.gif") repeat-x');
				$('#top_text').css('background', 'url("images/panelactive.gif") repeat-x');				
			});
		});

		$(document).ready(function() {
			$('#job_list').hide();
		});
		$(document).ready(function() {
			$('#job_offers').css("cursor","pointer");
			$('#real_estate').css("cursor","pointer"); 
			$('#job_offers').click(function(){
				$('#real_list').hide();
				$('#job_list').show();	
				$('#job_offers').css('background', 'url("images/panelactive.gif") repeat-x');
				$('#real_estate').css('background', 'url("images/panelunactive.gif") repeat-x');
			});
		});
		$(document).ready(function() {
			$('#real_estate').click(function(){
				$('#job_list').hide();
				$('#real_list').show();
				$('#job_offers').css('background', 'url("images/panelunactive.gif") repeat-x');
				$('#real_estate').css('background', 'url("images/panelactive.gif") repeat-x');				
			});
		});		

		$(document).ready(function() {
			$('#pics').hide();
		});
		$(document).ready(function() {
			$('#hottest_pics').css("cursor","pointer");
			$('#recent_eve').css("cursor","pointer"); 
			$('#hottest_pics').click(function(){
				$('#events_promo').hide();
				$('#pics').show();	
				$('#hottest_pics').css('background', 'url("images/panelactive.gif") repeat-x');
				$('#recent_eve').css('background', 'url("images/panelunactive.gif") repeat-x');
			});
		});
		$(document).ready(function() {
			$('#recent_eve').click(function(){
				$('#pics').hide();
				$('#events_promo').show();
				$('#hottest_pics').css('background', 'url("images/panelunactive.gif") repeat-x');
				$('#recent_eve').css('background', 'url("images/panelactive.gif") repeat-x');				
			});
		});		
//**************** obrazek glowna

		$(document).ready(function() {
			$('#obrazek1').hover(function(){
				var link = $(this).attr('src').replace('min',"med");
				$('#mainimg').attr("src",link);				
			});
		});

		$(document).ready(function() {
			$('#obrazek2').hover(function(){
				var link = $(this).attr('src').replace('min',"med");
				$('#mainimg').attr("src",link);				
			});
		});

		$(document).ready(function() {
			$('#obrazek3').hover(function(){
				var link = $(this).attr('src').replace('min',"med");
				$('#mainimg').attr("src",link);				
			});
		});
		
		$(document).ready(function() {
			$('#obrazek4').hover(function(){
				var link = $(this).attr('src').replace('min',"med");
				$('#mainimg').attr("src",link);				
			});
		});		
//****************



//****************
	    $(function() {
	    	$('#r1').lightBox();
	    	$('#r2').lightBox();
	        $('#ogl .lb').lightBox();
			
			$('#pass_key').click(function(){
				$('#pass_key').val('');
				$("#pass_key").keyup(function(){
					var wart = $("#pass_key").val();
					var str = $("#sum").html();					
					if(wart > 0) {
						if(isValidCyfry(wart)) {
							if(sum(str)==parseInt(wart)){
								$("#key_error").css({ "background-image": "url('./img/validyes.png')" });	
							} else {
								$("#key_error").css({ "background-image": "url('./img/validno.png')" });
							}
						} else {
							$("#key_error").css({ "background-image": "url('./img/validno.png')" }); 
						} 
					} else {
						$("#key_error").css({ "background-image": "none" }); 
					}
				});			
			});
			$('#pass_key').blur(function(){
				if($('#pass_key').val()===''){
					$('#pass_key').val('Write answer for the sum');
				}
			});			
	    });	
		$(function() {
		$('#news a').lightBox({fixedNavigation:true});
		
		});

$(function() {
		$('#party a').lightBox({fixedNavigation:false});
		
		});

		
function zmien2()
{
	
document.form2.rental_1.disabled=false;
	document.form2.rental_2.disabled=false;
	document.form2.price.disabled=true;
}

function zmien()
{
	
document.form2.rental_1.disabled=true;
	document.form2.rental_2.disabled=true;
	document.form2.price.disabled=false;
}

function zmien3()
{
	
document.form2.rental_1.disabled=true;
	document.form2.rental_2.disabled=false;

}

function zmien4()
{
	
document.form2.rental_1.disabled=false;
	document.form2.rental_2.disabled=true;

}

//*****************************************************
var ilosc = null;
function StatusBar(sel,options)
{
    var _I = this;       
    var _sb = null;
    // options
	ilosc = $('.friendsbar').attr('ile');
	if(ilosc){    
	    this.elementId = "_showstatus";
	    this.prependMultiline = true;   
	    this.showCloseButton = true; 
	    this.afterTimeoutText = null;
	 
	    this.cssClass = "statusbar";
	    this.highlightClass = "statusbarhighlight";
	    this.errorClass = "statuserror";
	    this.closeButtonClass = "statusbar_buttons";
	    this.additive = false;   
	 
	    $.extend(this,options);
	 
	    if (sel)
	      _sb = $(sel);
	 
	    // create statusbar object manually
	    if (!_sb)
	    {
	    		
		    _sb = $("<div id='_statusbar' class='" + _I.cssClass + "'>" +
		            "<div class='" + _I.closeButtonClass +  "'>" +
		            (_I.showCloseButton ? "<div class='statusbarchat'><table><tr><td valign='middle'><img src=images/chat.gif /></td><td valign='middle'> chat (" + ilosc + ")</td></tr></table></div><div class='statusbarclose_tousun'></div></div></div>" : "") )//<img src=images/delete.gif />
		            .appendTo(document.body)                   
		            .show();
	    }
	   
	    this.show = function(message,timeout,isError)
	    {            
	        if (_I.additive)       
	        {
	            var html = "<div style='margin-bottom: 2px;' >" + message + "</div>";
	            if (_I.prependMultiline)
	                _sb.prepend(html);
	            else
	                _sb.append(html);            
	        }
	        else
	        {
	 
	            if (!_I.showCloseButton)    
	                _sb.text(message);
	            else
	            {            
	                var t = _sb.find("div.statusbar_buttons");                
	                _sb.text(message).prepend(t);
	            }
	        }               
	 
	        _sb.show();        
	 
	        if (timeout)
	        {
	            if (isError)
	                _sb.addClass(_I.errorClass);
	            else
	                _sb.addClass(_I.highlightClass);
	 
	            setTimeout( 
	                function() {
	                    _sb.removeClass(_I.highlightClass); 
	                    if (_I.afterTimeoutText)
	                       _I.show(_I.afterTimeoutText);
	                },
	                timeout);
	        }                
	    }  
	    this.release = function()
	    {
	        if(_statusbar)
	            $(_statusbar).remove();
	    }
	}
}
// use this as a global instance to customize constructor

// or do nothing and get a default status bar
var _statusbar = null;

function showStatus(message,timeout,additive,isError)
{
	ilosc = $('.friendsbar').attr('ile');
	if(ilosc){ 
	    if (!_statusbar)
	        _statusbar = new StatusBar(null,{showCloseButton: true, 
	            afterTimeoutText: status })
	    _statusbar.show(message,timeout,additive,isError);
	}
}

