// preload 
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

//betoltendo hatterek
	var bgarray=new Array(
						"images/index_01.jpg",
						"images/index_02_0.jpg",
						"images/index_02_1.jpg",
						"images/index_02_2.jpg",
						"images/index_02_3.jpg",
						"images/index_03.jpg",
						"images/index_04.gif",
						"images/index_04-over.gif",
						"images/index_05.gif",
						"images/index_05-over.gif",
						"images/index_06.gif",
						"images/index_07.gif",
						"images/index_07-over.gif",
						"images/index_08.gif",
						"images/index_09.gif",
						"images/index_09-over.gif",
						"images/index_10.gif",
						"images/index_11.gif",
						"images/index_12.gif",
						"images/index_13.gif"
						);
						
	var loadedImage=0;
	var totalImage=document.images.length;
	var loadedBG=0;
	var totalBG=bgarray.length;
	var bgimg=new Array();
	
	//betoltom a kepeket
	for (j=0; j<totalBG; j++)
	{
		bgimg[j]=new Image();
		bgimg[j].src=bgarray[j];
	}
	
	//eltunteti a preloadert
	function hideLoader()
	{
		document.body.style.overflow="auto";
		document.body.removeChild(document.getElementById("loader"));
		document.getElementById('Table_01').style.display='';
	}
	
	
	function imgComplete()
	{
		loadedImage=0;
		for (i=0; i<totalImage; i++)
			if (document.images[i].complete) loadedImage++;
		preloading();
	}
	
	
	function preloading()
	{
		//explorerben
		if (navigator.appName=="Microsoft Internet Explorer")
		{
			document.onreadystatechange=function()
			{
				if (document.readyState=="complete") setTimeout("hideLoader()",1000);
					else setTimeout("preloading()",500);
			}
		}
		//mas bongeszokben
		else
		{
			loadedBG=0;
			for (j=0; j<totalBG; j++)
				if (bgimg[j].complete) loadedBG++;
		
			//ha betoltotte a hattereket es kepeket eltunteti a preloadert
			if (loadedBG<totalBG) setTimeout("preloading()",500);
			else if (loadedImage<totalImage) setTimeout("imgComplete()",500);
				else setTimeout("hideLoader()",1000);
		}
	}
// preload images 	

// preload images 	
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		
		index_02_over = newImage("images/index_02-over.gif");
		index_03_over = newImage("images/index_03-over.gif");
		index_04_over = newImage("images/index_04-over.gif");

		
		preloadFlag = true;
	}
}

// Start Emerigos logo
function eon2(a)
	{
	document.getElementById('emeon').style.opacity=a/10;
	document.getElementById('emeon').style.filter='alpha(opacity='+a*10+')';
	if (a<10) setTimeout("eon2("+(a+1)+")",25);
	}

function eon(a)
	{
	document.getElementById('emeoff').style.opacity=a/10;
	document.getElementById('emeoff').style.filter='alpha(opacity='+a*10+')';
	if (a>0) setTimeout("eon("+(a-1)+")",20);
		else
		{
		document.getElementById('emeoff').style.display='none';
		document.getElementById('emeon').style.display='';
		document.getElementById('emeon').style.opacity=0;
		document.getElementById('emeon').style.filter='alpha(opacity=0)';
		eon2(0);
		}
	}
	
function eoff2(a)
	{
	document.getElementById('emeoff').style.filter='alpha(opacity='+a*10+')';
	document.getElementById('emeoff').style.opacity=a/10;
	if (a<10) setTimeout("eoff2("+(a+1)+")",25);
	}

function eoff(a)
	{
	document.getElementById('emeon').style.filter='alpha(opacity='+a*10+')';
	document.getElementById('emeon').style.opacity=a/10;
	if (a>0) setTimeout("eoff("+(a-1)+")",20);
		else
		{
		document.getElementById('emeon').style.display='none';
		document.getElementById('emeoff').style.display='';
		document.getElementById('emeoff').style.filter='alpha(opacity=0)';
		document.getElementById('emeoff').style.opacity=0;
		eoff2(0);
		}
	}

function changecolor(theid)
{
	document.getElementById(theid).style.backgroundColor='#FFFFFF';
	document.getElementById(theid).style.color='#000000';
	document.getElementById(theid).style.fontWeight='normal';
	document.getElementById(theid).style.borderColor='#86aab5';
	document.getElementById(theid).style.filter='alpha(opacity=90)';
	document.getElementById(theid).style.opacity='0.90';
}

function switchback(theid)
{
	document.getElementById(theid).style.backgroundColor='#f1f3f4';
	document.getElementById(theid).style.color='#000000';
	document.getElementById(theid).style.fontWeight='normal';
	document.getElementById(theid).style.filter='alpha(opacity=70)';
	document.getElementById(theid).style.opacity='0.70';
	document.getElementById(theid).style.borderColor='#86aab5';
}

bg0=new Image();
bg0.src='images/index_01.jpg';
bg1=new Image();
bg1.src='images/index_02_0.jpg';
bg2=new Image();
bg2.src='images/index_02_1.jpg';
bg3=new Image();
bg3.src='images/index_03.jpg';


function valt(a)
{
if(a.style.backgroundColor=='')
	a.style.backgroundColor='#FF9933';
else
	a.style.backgroundColor='';
}
