﻿$(function() {

	$("a.show_advanced").click(function() {
	
		$("#advanced").fadeIn();
	
		return false;
	});
	
	$("a.tisknout").click(function() {
		window.print();
		return false;
	});
	
	$("a.zaujem").click(function() {	
		
		var id = $(this).attr('id').substr(4);				
		var adurl = $(this).attr('href');
		
		$.fumodal({
			title: $(this).text(),
			data: {id: id, adurl: adurl},
			url: base_url + 'ajax/real_zaujem',
			style: true,
			width: 400,
			height: 420
		});										
		
		
		return false;
	});

	$("a.email_real").click(function() {	
	
		var id = $(this).attr('id').substr(4);
		
		$.fumodal({
			title: $(this).text(),
			data: {id: id},
			url: base_url + 'ajax/real_email',
			style: true,
			width: 400,
			height: 300
		});								
	
		return false;	
	});
	
	$("a[rel=show_foto]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	
	
	$("a.show_kalkulacka").click(function() {
		$.fumodal({
			title: 'Kalkulačka',
			content: '<iframe style="width: 790px; height: 450px;" height="600" src="http://www.csas.cz/banka/pages/hypoconf/hconf.jsp"></iframe>',
			style: true,
			width: 820,
			height: 510
		});									
		
		return false;		
	});

});
