$(document).ready(function(){
	
	$('#flashin').flash(
        { src: '/img/flash/'+act_nr+'.swf',
          width: 674,
          height: 286,
		  wmode: 'transparent',
		  expressInstall: false 
		  },  
        { version: 10 }
	)
	
	$('#map').flash(
        { src: '/img/flash/map.swf',
          width: 705,
          height: 464,
		  flashvars: { lang: lang, cid: cid, active_flat: active_flat, color: color },
		  expressInstall: false 
		  },  
        { version: 10 }
	)
	
	$("a[rel=gallery_group]").fancybox({
		'padding'         	: 0,
		'overlayOpacity'	: 0,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">'+ title + '&nbsp;</span>';
		}
	});
	

	$("#searchbox").autocomplete( url + "?act=live.search&pid="+cid  );
	

	 $('input').keydown(function(e){
        if (e.keyCode == 13) {
            Search('searchForm')
            return false;
        }
    });
	


})


function getResults()
{
	//alert(url)
	$.get(url + "?act=live.search",{query: $("#searchbox").val(), pid: cid }, function(data){
		
		$("#lsContainer").show("blind");
	
		$("#lsResults").html(data);
		$("#lsResults").show("blind");
	});
}

function getCatalogPhotos(cid,p){
	
	$("#photos").css('display','block');
	$("#photos").fadeOut("fast")
	
	$.ajax({
		type: "GET",
		url: "index.php?act=catalog.photos",
		data: "cid="+cid+"&pa="+p,
		success: function(html){
				
			$("#photos").html(html);
			$("#photos").fadeIn("slow")
		//	$("#photos").show('slide', {direction: 'left'}, 1000);

		}
	});

}