// Fade

function mt(mit, ertek)
	{
	obj = document.getElementById(mit);
	if (obj.value == ertek)
		{
		obj.value='';
		}
	else
		{
		if (obj.value.length == 0)
			{
			obj.value = ertek;
			}
		}	
	}

function mouseCheck(e, mit, mid, getmodule)
	{
    if (e.button == 2)
		{
		obj = document.getElementById('szerk_div_tarto');
		obj2 = document.getElementById('szerkesztodiv');
		obj2.innerHTML = '<iframe id="editor_frame" src="fckeditor/editor.php?Skin=twinidum&'+mid+'='+getmodule+'"></iframe>';
		obj.style.display = '';
		}
	}

function changefadeio(opacity,id)
	{
	var objcf_dkj = document.getElementById(id); 
	try
		{
	objcf_dkj.style.filter = 'alpha(opacity='+opacity+')';
	objcf_dkj.style.opacity = opacity/100;
	objcf_dkj.MozOpacity = opacity/100;
		}
	catch (err)
		{}
	}

function opacity(id,fadeStart,fadeEnd,millisec)
	{
	var speed = Math.round(millisec / 100);
	var clock = 0;
	if (fadeStart > fadeEnd)
		{
		for(i=fadeStart;i>=fadeEnd;i--)
			{
			setTimeout("changefadeio("+i+",'"+id+"')",(clock*speed));
			clock++;
			}
		}
	if (fadeStart < fadeEnd)
		{
		for(i=fadeStart;i<=fadeEnd;i++)
			{
			setTimeout("changefadeio("+i+",'"+id+"')",(clock*speed));
			clock++;
			}
		}
	}

var browserName = navigator.appName;

function indexrunning()
	{
	objmcont_dkj = document.getElementById('photohabit_cont');
	if (navigator.appName == 'Microsoft Internet Explorer')
		{
		if (document.documentElement.clientHeight <= 530)
			{
			objmcont_dkj.style.top = '0px';
			objmcont_dkj.style.marginTop = '0px';
			}
		else
			{
			objmcont_dkj.style.top = '50%';
			objmcont_dkj.style.marginTop = '-265px';
			}
		if (document.documentElement.clientWidth <= 820)
			{
			objmcont_dkj.style.left = '0px';
			objmcont_dkj.style.marginLeft = '0px';
			}
		else
			{
			objmcont_dkj.style.left = '50%';
			objmcont_dkj.style.marginLeft = '-410px';
			}
		}
	else
		{
		if (window.innerHeight <= 530)
			{
			objmcont_dkj.style.top = '0px';
			objmcont_dkj.style.marginTop = '0px';
			}
		else
			{
			objmcont_dkj.style.top = '50%';
			objmcont_dkj.style.marginTop = '-265px';
			}
		if (window.innerWidth <= 820)
			{
			objmcont_dkj.style.left = '0px';
			objmcont_dkj.style.marginLeft = '0px';
			}
		else
			{
			objmcont_dkj.style.left = '50%';
			objmcont_dkj.style.marginLeft = '-410px';
			}
		}
	}
window.onresize=indexrunning;

function opmenu()
	{
	for (i=1;i<gal_kat_name.length;i++)
		{
		if (akt_cat != gal_kat_name[i])
			{
			var cat_id = gal_kat_name[i].substring(4,gal_kat_name[i].length);
			objcat = document.getElementById(cat_id);
			objcat.style.filter = 'alpha(opacity=30)';
			objcat.style.opacity = 0.3;
			objcat.MozOpacity = 0.3;
			objcat.onmouseover = new Function("high_menu('"+cat_id+"');");
			objcat.onmouseout = new Function("opacity('"+cat_id+"',80,30,500);");
			}
		var i=i+0;
		}
	}
function high_menu(felsoid)
	{
	document.getElementById(felsoid).style.filter = 'alpha(opacity=80)';
	document.getElementById(felsoid).style.opacity = 0.8;
	document.getElementById(felsoid).MozOpacity = 0.8;
	}


function index_button()
	{
	objcat = document.getElementById('enter');
	objcat.style.filter = 'alpha(opacity=30)';
	objcat.style.opacity = 0.3;
	objcat.MozOpacity = 0.3;
	objcat.onmouseover = new Function("high_menu('enter');");
	objcat.onmouseout = new Function("opacity('enter',80,30,500);");
	document.getElementById('photohabit_cont').style.display = 'none';
	}