function animStart()

{

	document.getElementById('content').innerHTML='<br><br><br><font face="Verdana, Arial, Helvetica, sans-serif" color="#CC3300" size="2"><b>Egy kis türelmet! </b></font>&nbsp;&nbsp;<br><img src="logos/loading3.gif">';

}



function loadBanner()

{

	new Ajax.Updater('banner','new_look/banner.php', {evalScripts:true});

}



function loadMenu()

{

	new Ajax.Updater('menu','new_look/menu.php', {evalScripts:true});

}



function loadContent()

{

	new Ajax.Updater('content','new_look/menu/news.php', {evalScripts:true});

}



function loadAdvertising()

{

	new Ajax.Updater('advertising','new_look/advertising.php', {evalScripts:true});

}



// for menu



function movein(which){

//which.style.background='#81acac';

}



function moveout(which){

//which.style.background='#acd7d7';

}



group_counter=0;



function show_groups()

{

	 var effect_1 = null;

	group_counter++;

	if (group_counter==1)	 

	{

   		effect_1 = Effect.SlideDown('groups',{duration:0.8}); 

		group_counter=-1;

	}

	else effect_1 = Effect.SlideUp('groups',{duration:0.8}); 

}



program_counter=0;



function show_programs()

{

	 var effect_1 = null;

	program_counter++;

	if (program_counter==1)	 

	{

   		effect_1 = Effect.SlideDown('programs',{duration:0.8}); 

		program_counter=-1;

	}

	else effect_1 = Effect.SlideUp('programs',{duration:0.8}); 

}



life_counter=0;



function show_life()

{

	 var effect_1 = null;

	life_counter++;

	if (life_counter==1)	 

	{

   		effect_1 = Effect.SlideDown('life',{duration:0.8}); 

		life_counter=-1;

	}

	else effect_1 = Effect.SlideUp('life',{duration:0.8}); 

}



// for groups



are_members=0;



function show_members()

{

	var effect_1 = null;

	are_members++;

	if (are_members==1)	 

	{

   		effect_1 = Effect.SlideDown('members',{duration:0.8}); 

		are_members=-1;

	}

	else effect_1 = Effect.SlideUp('members',{duration:0.8});  



}



are_downloads=0;



function show_downloads()

{

	var effect_1 = null;

	are_downloads++;

	if (are_downloads==1)	 

	{

   		effect_1 = Effect.SlideDown('downloads',{duration:0.8}); 

		are_downloads=-1;

	}

	else effect_1 = Effect.SlideUp('downloads',{duration:0.8});  



}



// for pictures



function popup_window_sc( url, id, width, height )

		{

		  popup = window.open( url, id, 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + '' );

		  popup.focus();

		}





function import_pictures(id)

{	

	for (i='2000';i<='2020';i++) cat_counter[i]=0;

	url='new_look/menu/pictures.php?category_id='+id;

	//window.location.href=url;

	new Ajax.Updater('content',url, {evalScripts:true});

}



cat_counter=new Array();

for (i='2000';i<='2020';i++) cat_counter[i]=0;



function show_categories(id,that)

{

	 var effect_1 = null;

	cat_counter[id]++;	

	if (cat_counter[id]==1)	 

	{

   		effect_1 = Effect.SlideDown(id,{duration:0.8}); 

		cat_counter[id]=-1;

	}

	else effect_1 = Effect.SlideUp(id,{duration:0.8});  



}



/// for events





function import_event(id)

{	

	for (i='2000';i<='2020';i++) events_counter[i]=0;

	url='new_look/menu/events.php?event_id='+id;

	new Ajax.Updater('content',url, {evalScripts:true});

}



events_counter=new Array();

for (i='2000';i<='2020';i++) events_counter[i]=0;



function show_events(id,that)

{

	 var effect_1 = null;

	events_counter[id]++;	

	if (events_counter[id]==1)	 

	{

   		effect_1 = Effect.SlideDown(id,{duration:0.8}); 

		events_counter[id]=-1;

	}

	else effect_1 = Effect.SlideUp(id,{duration:0.8});  



}



// for guestbook

function add_guestbook(name, comment)

{

	//alert(name+" "+comment);

	var pars='name='+name+'&comment='+comment;

	new Ajax.Updater('status','new_look/menu/add_to_g.jax.php', {method:'get', parameters: pars});

	animStart();reset_counters();new Ajax.Updater('content','new_look/menu/guestbook.php');

}



//general



count_displayed_news=0;



function reset_counters()

{

	for (i='2000';i<='2020';i++) events_counter[i]=0;

	for (i='2000';i<='2020';i++) cat_counter[i]=0;

	count_displayed_news=0;

}



//for news filter

function hide_show(a)

{

	if (count_displayed_news==0)

	{

		count_displayed_news=1;

		Element.show('archiev');

		a.innerHTML='Mutasd csak az aktuális híreket';

	}

	else

	{

		count_displayed_news=0;

		Element.hide('archiev');

		a.innerHTML='Mutass minden hírt';

	}

}


/*--------------------------------------------------------------------------*/
				/* overlay div */
				
function show_overlay()
{
	
	var arrayPageSize = getPageSize();
	$('overlay_div').style.width = arrayPageSize[0]+'px';
	$('overlay_div').style.height = 1450+'px';//arrayPageSize[1]+'px';
		
	
	$('overlay_div').style.top = '0px';
	$('overlay_div').style.left= '0px';
	hideSelectBoxes();
	hideFlash();	
	Element.show('overlay_div');
}

function hide_overlay()
{	
	Element.hide('overlay_div');	
	showSelectBoxes();
	showFlash();
}
				
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.com
//
function getPageScroll(){

	var xScroll, yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}

	arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
}

// -----------------------------------------------------------------------------------

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.com
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

//	console.log("xScroll " + xScroll)
//	console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
//	console.log("pageWidth " + pageWidth)

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function showSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideSelectBoxes(){
	var selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}

// ---------------------------------------------------

function showFlash(){
	var flashObjects = document.getElementsByTagName("object");
	for (i = 0; i < flashObjects.length; i++) {
		flashObjects[i].style.visibility = "visible";
	}

	var flashEmbeds = document.getElementsByTagName("embed");
	for (i = 0; i < flashEmbeds.length; i++) {
		flashEmbeds[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideFlash(){
	var flashObjects = document.getElementsByTagName("object");
	for (i = 0; i < flashObjects.length; i++) {
		flashObjects[i].style.visibility = "hidden";
	}

	var flashEmbeds = document.getElementsByTagName("embed");
	for (i = 0; i < flashEmbeds.length; i++) {
		flashEmbeds[i].style.visibility = "hidden";
	}

}
