		/*function toggle_comment_form(this_id,form_id){
			
			if ($(this_id).hasClass('op')) $(form_id).slideUp('slow');
			else $(form_id).slideDown('slow');
			$(this_id).toggleClass('op')
		}*/
$(document).ready(function(){
	

		$('#top_search .text, form textarea, form .text, select').focus(
				function(){ 
					$(this).addClass('focused');
				}
		);

		$('#top_search .text, form textarea, form .text, select').blur(
				function(){ 
					$(this).removeClass('focused');
				}
		);

		$('#main .information .more').click(
				function(){ 
					if ($('#main .information .invisible').hasClass('switch')) $('#main .information .invisible').slideUp('slow');
					else $('#main .information .invisible').slideDown('slow') 
						
					$('#main .information .invisible').toggleClass('switch')
					$('#main .information .more').toggleClass('hide');
				}
		);
		

		$('.toggle_comment_form').click(
			function(){
				var ids='#'+$(this).attr('title')
				
				
				if ($(this).hasClass('op')) $(ids).slideUp('slow');
				else {
					$(ids).slideDown('slow');
					var wf=$(ids).width()-265;
					if (jQuery.browser.msie)wf=$(ids).width()-270;
					$(ids).find('.confirm').width(wf);
				}
				$(this).toggleClass('op')
			}
		
		);
		
		
		$('.#left .add_org_form .add').click(
			function(){
				var elem=$(this.parentNode).find(' .hidden:first');
				elem.slideDown('fast').removeClass('hidden');
				if ($(this.parentNode).find(' .hidden:first').length==0) $(this).css('display','none');
			}
		);
		$('#left .org .map_btn').click(
			function(){
				if ($('#left .org .map').hasClass('opened')) $('#left .org .map').slideUp('slow');
				else $('#left .org .map').slideDown('slow');
				$('#left .org .map').toggleClass('opened')
			}
		)

		$("#categories  .selector div").click(function () 
				{
				  if (this.className!="active"){
						if (this.id=='open_cat_b') $("#categories .hide").fadeIn("slow");
						else $("#categories .hide").fadeOut("slow");
						$("#categories  .selector div").toggleClass('active');
						}
					
		});
		
		$(".additional_content .key").click(function () 
				{
				  if ($(this.parentNode).hasClass('opened'))
					{
							$(this).next().slideUp("slow")
						}
					else	$(this).next().slideDown("slow");
					$(this.parentNode).toggleClass('opened');
					
		});
		$('.companies_list .company_item ').hover(
				function(){ 
					$(this).addClass('hover')
				}, 
				function(){
					$(this).removeClass('hover');
				}
			);
		
		//var str=$('.main_shorties .shorty .picture').html();
		$('.main_shorties .shorty .picture, .shorties .shorty .picture , .article .picture, ul.photos li ').each(function(){
			var str=$(this).html();
			$(this).html('<table cellpadding="0" cellspacing="0" border="0" class="shadow"><tr><td class="tl"></td><td class="t"></td><td class="tr"></td></tr><tr><td class="l"></td><td>'+str+'</td><td class="r"></td></tr><tr><td class="bl"></td><td class="b"></td><td class="br"></td></tr></table>');
		});
		$('.org ul.photos li').hover(
			function(){ 
					$(this).find('.loop').addClass('cl')
					$(this).find('.loop').show('fast')
				}, 
				function(){
					$(this).find('.loop').removeClass('cl')
					$(this).find('.loop').hide('fast')
				}
		);
	
	$('.org ul.photos li a').lightbox({
	
			show_helper_text:false,show_linkback:false
	
	});


		$('.org ul.photos .shadow').each(
			function(){
					var ml=($(this).parent().width()-$(this).width())/2;
					var mt=($(this).parent().height()-$(this).height())/2;

					$(this).css('margin-left',ml);
					$(this).css('margin-top',mt);
			}
		);
		var fheight=$('#footer').height();
		$('#main').css("margin-bottom", -fheight-45);
		$('#footer_place').height(fheight+55);
	});
		
			
			


