if(screen.availWidth > 1024)
{
	LogoPosition = '70%';
	BgPosition = '73%';
	MainWidth = '100%';
	scrn = screen.availWidth;
}
else if(screen.availWidth == 1024)
{
	LogoPosition = '65%';
	BgPosition = '73%';
	MainWidth = '100%';
	scrn = screen.availWidth;
}
else
{
	LogoPosition = '660px';
	BgPosition = '670px';
	MainWidth = '1000px';
	scrn = 1024;
}

function Out(link)
{
	link.style.background='url(/img/design/menu.jpg)';
	link.style.opacity='1';
	link.style.filter='alpha(opacity=100)';
}

function Over(link)
{
	link.style.background='black';
	link.style.opacity='0.4';
	link.style.filter='alpha(opacity=40)';
}

function menu(action)
{
	rmenu = '';
	for(i = 0; i < Menu_Title.length; i ++)
	{
		if(action == 1)
		{
			rmenu += '<div id="menu" onMouseover="Over(this);" onMouseout="Out(this);" onClick="location.href=\''+Menu_Link[i]+'\';"> \
							<div id="menu_pad"> \
								'+Menu_Title[i]+' \
								</div> \
							</div>';
		}
		else
		{			rmenu += '<span onClick="location.href=\''+Menu_Link[i]+'\';" style="cursor:pointer;">'+Menu_Title[i]+' </span> | ';
		}
	}
	return rmenu;
}

function headers(image,text)
{
	if(image == '') add = '';
	else add = '<td width="35px"><img src="/img/design/'+image+'"></td>';
	return '<table id="menu_header"><tr>'+add+'<td><b style="color:B32828">'+text+'</b></td></tr></table>';
}

function fund_image(start,end,lan)
{
	img = '';
	for(i = start; i < end; i ++)
	{		img += '<a href="/'+lan+'/graph/'+i+'/"><img src="/img/graph/graph_'+i+'_'+lan+'.jpg" style="margin-bottom:8px;" border="0"></a><br>';	}
	return img;
}

function preloadImage(img)
{
	var image = new Image();
	image.src = img;
	return image;
}

function getKey(e)
{
	key=event.keyCode;
	ctrl=event.ctrlKey;
	if(key==46 && ctrl)
	{
		location.href= '/admin/';
	}
}

function ImagePreload()
{
	if (images.length > 0)
	{
		for(i = 0; i < images.length; i ++)
		{
			imgPreload[i] = preloadImage(url+images[i]);
		}
		if(graph.length > 0)
		{
			g_c = graph.length + i;
			e = 0;

			for(q = i; q < g_c; q ++)
			{				imgPreload[q] = preloadImage(graph[e]);
				e ++;
			}
		}
	}
}

document.onkeydown = getKey;
