
// Tokod.hu - JS

function FontSize(sts)
	{

	divname = $('textcnt');
	divtitle = $('titlecnt');
	fontsize =  divname.getStyle('fontSize');

	if (sts == 'bigger') {
		if (fontsize == '11px') {divname.setStyle({fontSize: '12px'}); divtitle.setStyle({fontSize: '13px'});}
		if (fontsize == '12px') {divname.setStyle({fontSize: '13px'}); divtitle.setStyle({fontSize: '14px'});}
		if (fontsize == '13px') {divname.setStyle({fontSize: '14px'}); divtitle.setStyle({fontSize: '15px'});}
		if (fontsize == '14px') {divname.setStyle({fontSize: '15px'}); divtitle.setStyle({fontSize: '16px'});}
	}
	else {
		if (fontsize == '12px') {divname.setStyle({fontSize: '11px'}); divtitle.setStyle({fontSize: '12px'});}
		if (fontsize == '13px') {divname.setStyle({fontSize: '12px'}); divtitle.setStyle({fontSize: '13px'});}
		if (fontsize == '14px') {divname.setStyle({fontSize: '13px'}); divtitle.setStyle({fontSize: '14px'});}
		if (fontsize == '15px') {divname.setStyle({fontSize: '14px'}); divtitle.setStyle({fontSize: '15px'});}
	}
	}

function Search()
	{
		var skey = $F('skeyword');
		var sl = skey.length;
			if (skey == 'Keresés...') {
				alert('A keresett szónak legalább 3 karakternek kell lennie!');
			}
			else if (sl > 2) {
				document.location.replace('/kereso/?keyword='+skey);
			}
			else {
				alert('A keresett szónak legalább 3 karakternek kell lennie!');
			}
	}

function HeaderSlide()
	{

	var divsts = $('header_picture_m').getStyle('display');
	var lastimg = $F('lastimg');

	var url = '/external/header.php?lastimg='+lastimg;

	if (divsts == 'block') {
		new Ajax.Updater('header_picture_f', url, {method: 'get', evalScripts: true, onComplete: function() {Effect.Fade('header_picture_m', { duration: 2.0 });}});
	}
	else {
	    new Ajax.Updater('header_picture_m', url, {method: 'get', evalScripts: true, onComplete: function() {Effect.Appear('header_picture_m', { duration: 2.0 });}});
	}
	}

new PeriodicalExecuter(function() {HeaderSlide();}, 20);


/* Ajax main load */
function AjaxWait(divname){
	var imgpos = $(divname);
	imgpos.innerHTML = "<div align=\"center\"><img src=\"/gfx/tokod/images/ajax-loader.gif\" style=\"border:0px; margin-top: 10px; margin-bottom: 14px;\" / ></div>";
}


function calendarCngMonth(sts, actmonth)
	{


	var url = '/external/calendar.php?sts='+sts+'&actmonth='+actmonth;


		new Ajax.Updater('calendar_main', url, {method: 'post', evalScripts: true, onLoading: AjaxWait("calendar_loader")});

	}
