
 $(document).ready(function(){	
//		popup();
		gallery();
/*                if($(".rotator").length) {
	          rotate_show($(".rotator #q1"));
        	 }
*/		
	});
	
  $(window).resize(function(){	

	}); 
  
  function popup(){
	    $(".twocols .mapprev").click(function(){
				t = ($(window).height()-$(".flashmap").height())/2;
				w = $(window).width();
				st = $(window).scrollTop();
				t=t+st;
				
				l = (w-$(".flashmap").width())/2;				
				if(t<0) t = 0;
				
				if(w<$(".main").width()) w = $(".main").width();
				$(".flashmap").css("margin-top",t+"px");
				$(".flashmap").css("margin-left",l+"px");
				$(".flashmap").css("display","block");								  
			});
		$(".flashmap .close a").click(function(){
				$(this).parents(".flashmap").css("display","none");								  
			});
	  }



function rotate_next(obj){	
		ids = $(obj).attr("id");
		ids = ids.replace("q","")*1;
		//alert(ids);
		if(ids<$(".rotator img").length) {
			idn = ids+1;
			rotate_show(".rotator #q"+idn);
			}
		else rotate_show(".rotator #q1");
	}
	
	function rotate_close(obj){	
		setTimeout(function() { $(obj).fadeOut(700, function(){rotate_next(obj);} ); }, 4000);
		}
	function rotate_show(obj){		
		$(obj).fadeIn(700,rotate_close(obj));		
		}
		
  function gallery(){
	  $(".gall_links .lnk").click(function(){
			$(this).parents(".gall_links").find(".lnk.act").removeClass("act");
			$(this).toggleClass("act");
			src = $(this).find(".sq span").html();
			$(".gall_pict").html(src);
		});	  
	  }		