$(document).ready(function(){
	$('a').focus(function(){
		$(this).blur();
	});
	var a = 0;
	var current = 0;	
	$(".gallery li").each(function(){a++;});
	$(".gallery ul").css("width", a*500 );
	if(a<2){
		$(".navigation .right").css("background-image", "url(images/right-unactive.jpg)");
	}else{
		$(".navigation .right").click(function(){
			if(current+1<a){
				$(".navigation .left").css("background-image", "url(images/left-active.jpg)");
				$(".gallery ul").animate({
			left: -(current+1)*477},{queue:false,duration:500});
			current++;
			if(current+1==a)$(".navigation .right").css("background-image", "url(images/right-unactive.jpg)");
			}
		});
		$(".navigation .left").click(function(){
			if(current>0){
				$(".navigation .right").css("background-image", "url(images/right-active.jpg)");
				$(".gallery ul").animate({
			left: -(current-1)*477},{queue:false,duration:500});
			current--;
			if(current==0)$(".navigation .left").css("background-image", "url(images/left-unactive.jpg)");
			}
		});
	}
	$('.cheten').click(function(){				
		$(this).children('td').children('a').each(function(){
			window.open(this.href);
			return false;
		});
	});
$('.necheten').click(function(){				
		$(this).children('td').children('a').each(function(){
			window.open(this.href);
			return false;
		});
	});
//	$('#lc').click(function(){
//			var form = jQuery('<div style="border:0; width: 640px; height: 410px; overflow: hidden;margin:0; padding:0;"><div style="width: 480; height: 30px; background-color: #ffffff;"><img src="images/x.png" style="float: right; cursor: pointer;" onclick="remove();" /></div><iframe style="z-position: 30;" width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=d&amp;source=s_d&amp;saddr=Unknown+road&amp;daddr=&amp;hl=en&amp;geocode=Fb4rigIdDCtkAQ&amp;mra=mr&amp;sll=42.626065,23.34466&amp;sspn=0.04105,0.077248&amp;ie=UTF8&amp;ll=42.608569,23.339939&amp;spn=0.04422,0.072956&amp;z=13&amp;output=embed"></iframe></div>').attr('id', 'form');
//			var formb = jQuery('<div></div>').attr('id', 'formb');
//			form.css('opacity', 0);
//			form.css('overflow', 'hidden');
//			form.css('position', 'fixed');			
//			form.css('z-index', 105);
//			form.css('top', 78);
//			form.css('left', 258);
//			form.css('border', "0px");
//			formb.css('border', "0px");					
//			formb.css('top', 0);
//			formb.css('left', 0);
//			formb.css('position', 'fixed');
//			formb.css('background-image', 'url(images/pp.png)');		
//			formb.css('background-color', 'transparent');		
//			formb.css('width', '100%');		
//			formb.css('padding', 0);		
//			formb.css('margin', 0);		
//			formb.css('height', '100%');		
//			formb.css('opacity', 0);		
//			formb.css('z-index', 104);									
//			$('body').append(form);
//			$('body').append(formb);
//			$('#formb').animate({  		
// 		'opacity': 0.7
// 	}, { queue:false, duration:500, easing: 'linear'});	
// 	$('#form').animate({  		 		
// 		'opacity': 1,
// 		'top'	: 78,
// 		'left'	: 258
// 	}, { queue:false, duration:500, easing: 'linear'});
//	return false;
//	});	http://maps.google.com/maps?f=d&source=s_d&saddr=Unknown+road&daddr=&hl=en&geocode=Fb4rigIdDCtkAQ&mra=mr&sll=42.626065,23.34466&sspn=0.04105,0.077248&ie=UTF8&ll=42.608569,23.339939&spn=0.04422,0.072956&z=13&output=embed
	$('#lc').click(function(){
		window.open ("http://maps.google.com/maps?f=d&source=s_d&saddr=Unknown+road&daddr=&hl=en&geocode=Fb4rigIdDCtkAQ&mra=mr&sll=42.626065,23.34466&sspn=0.04105,0.077248&ie=UTF8&ll=42.608569,23.339939&spn=0.04422,0.072956&z=13&output=embed", "mywindow", "location=1,status=1,scrollbars=1");
	}
	);
	$('.ramka').click(function(){
		$(this).children('a').each(function(){
			window.open(this.href);
			return false;
		});
	});
	if($('.locleft').height()<$('.locright').height())
	{
		$('.locleft').css('height', $('.locright').height());
	}
});
function remove()
	{
	var a = document.getElementById("form");
	var b = document.getElementById("formb");
//	alert(a);
	document.body.removeChild(b);
	document.body.removeChild(a);
	}