$(document).ready(function() {
    $("a.fancy").fancybox({
        'padding'               : 5,
		'titlePosition'         : 'inside'
    });

	$("a.fancy_html").fancybox({
        'padding'               : 5,
		'autoDimensions'		: false,
		'autoScale'				: false,
		'height'				: 900,
		'titlePosition'         : 'inside'
    });

	/*
	** bottom menu align center
	**/
	$("div.menu").css("margin-left", (((980 - $("div.menu").width()) - 35) / 2) + "px" );

	hideMainBox();
});

function twitter_custom_share(t, u) {
	window.open('http://twitter.com/home?status='+encodeURIComponent(t+' - '+u),'share_twitter','toolbar=0,status=0,location=1, width=650,height=600,scrollbars=1');
	return false;
}

function sendForm() {
	$.ajax({
		type: 'POST',
		data: $('#formariadne').serialize(),
		url: '/ariadne_fonala/feliratkozas/',
		success: function(data){
			if ( data == 'sikeres-feliratkozas' ) {
				window.location = '/ariadne-fonala/sikeres-feliratkozas/';
				return false;
			}
			$('#ariadne_messages').html(data);
		}
	});
}

function sendProgramForm(url) {
	$.ajax({
		type: 'POST',
		data: $('#form_jelentkezes').serialize(),
		url: url,
		success: function(data){
			if ( data == 'sikeres-feliratkozas' ) {
				window.location = '/programok/sikeres-feliratkozas/';
				return false;
			}
			$('#jelentkezes_messages').html(data);
		}
	});
}

var a = {
src: '/gfx/avantgarde.swf'
	,ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18]
};
sIFR.activate(a);
sIFR.replace(a, {
	selector: 'h6'
	,wmode: 'transparent'
	,css: {
		'.sIFR-root': { 'color': '#ffc600', 'cursor': 'pointer', 'font-size': '14px', 'background-color': 'transparent' },
		'a': { 'color': '#ffc600', 'text-decoration': 'none' },
		'a:hover': { 'color': '#ffc600', 'text-decoration': 'none' }
	}
});

var h1 = {
src: '/gfx/avantgarde.swf'
	,ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18]
};
sIFR.activate(h1);
sIFR.replace(h1, {
	selector: 'h1'
	,wmode: 'transparent'
	,css: {
		'.sIFR-root': { 'color': '#196700', 'font-size': '26px', 'background-color': 'transparent' }
	}
});

var h3 = {
src: '/gfx/avantgarde.swf'
	,ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18]
};
sIFR.activate(h3);
sIFR.replace(h3, {
	selector: 'h3'
	,wmode: 'transparent'
	,css: {
		'.sIFR-root': { 'color': '#ffffff', 'font-size': '24px', 'background-color': 'transparent' },
		'a': { 'color': '#ffffff', 'text-decoration': 'none' },
		'a:hover': { 'color': '#ffffff', 'text-decoration': 'none' }
	}
});

var h4 = {
src: '/gfx/avantgarde.swf'
	,ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18]
};
sIFR.activate(h4);
sIFR.replace(h4, {
	selector: 'h4'
	,wmode: 'transparent'
	,css: {
		'.sIFR-root': { 'color': '#196700', 'font-size': '24px', 'background-color': 'transparent' }
	}
});

var h5 = {
src: '/gfx/avantgarde.swf'
	,ratios: [6, 1.41, 9, 1.35, 15, 1.29, 21, 1.25, 22, 1.22, 27, 1.24, 29, 1.21, 34, 1.22, 41, 1.21, 45, 1.2, 46, 1.21, 59, 1.2, 68, 1.19, 69, 1.2, 96, 1.19, 97, 1.18, 102, 1.19, 103, 1.18, 107, 1.19, 108, 1.18, 112, 1.19, 114, 1.18, 116, 1.19, 120, 1.18, 121, 1.19, 1.18]
};
sIFR.activate(h5);
sIFR.replace(h5, {
	selector: 'h5.sifr'
	,wmode: 'transparent'
	,css: {
		'.sIFR-root': { 'color': '#c8193a', 'font-size': '24px', 'background-color': 'transparent' }
	}
});

/*
** Főoldal korábbi írásaim
**/
var is_ie = 0;
is_ie = getIEVersionNumber();

function changeMonths(){
	if ( $("#other_months").css("display") == "none" ) $('#other_months').show();
	else $('#other_months').hide();

	if (is_ie == 0) cloudsFF();
	else cloudsIE();

}

function changeMainBox(){

	if ( $("#blogomrol_text").css("display") == "none" ) {
		$.cookie('hide_blogomrol_text', null);
		$('#blogomrol_text').show();
		$('#blogomrol_icon').attr('src', '/gfx/icos/ico1.png');
	} else {
		$.cookie('hide_blogomrol_text', '1');
		$('#blogomrol_icon').attr('src', '/gfx/icos/ico3.png');
		$('#blogomrol_text').hide();
	}

	if (is_ie == 0) cloudsFF();
	else cloudsIE();

}
function hideMainBox() {
	if ( !$.cookie('hide_blogomrol_text') )
		return false;
	changeMainBox();
}

/*
** clouds-right position
**/
function cloudsFF() {
	$("div#clouds-right").css("top", $("div.clouds").position().top + 3 + "px");
}

function cloudsIE() {
	$("div#clouds-right").css("margin-top", ($("div.clouds").position().top) + 3 + "px");
}

/*
** Calendar
**/
function getCalendar(time) {
    $.ajax({
        url: '/'+_lang+'/ajax/calendar/'+time,
        success: function(msg) {
			$('#calendar_container').html(msg);
		}
    });
}

/*
** Könyvek szavazás
**/
function setVote(lid, vote) {
	$.ajax({
	url: '/'+_lang+'/ajax/vote/'+lid+'/'+vote,
	success: function(msg){
		if (msg) {
			$('#itemvote').html(msg);
		}
	}
	});
}

