/* $Id: airtrust.js,v 1.12 2009-05-15 13:17:33 pcharasimiuk Exp $ */

$(document).ready(function() {
	/*
	//TODO: nie dziala w IE (pokazuje tylko raz)
	$('#screen_m').hover(
		function (e) {$('#screen_f').show();},
		function (e) {}
	);
	$('#screen_f').hover(
		function (e) {return true;},
		function (e) {$('#screen_f').hide('puff',{},250);}
	);
	*/
	
	$('.offer form .buttons .but_order').click(function (e) {
		e.preventDefault();
		$(this).parents("form").find("input[name='operation']").val("wydanie")
		$(this).parents("form").get(0).submit();
	});
	$('.offer form .buttons .but_renew').click(function (e) {
		e.preventDefault();
		$(this).parents("form").find("input[name='operation']").val("odnowienie")
		$(this).parents("form").get(0).submit();
	});
		
	$('#top_nav a, #bottom_nav a, #partners a').click(function (e) {
		e.preventDefault();
		$('#ajax_loader').show();
		$('#ajax_content').load(this.href + '?media=ajax', function(data){
			$('#ajax_loader').hide();
			$('#ajax_content div.innerContent').dialog({ 
				closeOnEscape: true, 
				dialogClass: 'subPage', 
				modal:true, 
				height: 530, 
				width: 630, 
				shadow:true,
				close: function() {
					$(this).remove();
				}
			});
		});
	});
});