function getIEVersion()
{
    var ua = navigator.userAgent;
    var MSIEOffset = ua.indexOf("MSIE ");
    if (MSIEOffset == -1) {
        return 0;
    } else {
        return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
    }
}

var iev=getIEVersion();

function preImages(path)
{
	var imgs=new Array(
	path+"images/tools0a.png",
	path+"images/tools1a.png",
	path+"images/tools2a.png",
	path+"images/menu/about-a.png",
	path+"images/menu/clients-a.png",
	path+"images/menu/contacts-a.png",
	path+"images/menu/corporate-a.png",
	path+"images/menu/custom-a.png",
	path+"images/menu/news-a.png",
	path+"images/menu/vacancies-a.png",
	path+"images/printer-a.png",
	path+"images/pg/tl.png",
	path+"images/pg/tr.png",
	path+"images/pg/bl.png",
	path+"images/pg/br.png",
	path+"images/pg/next.png",
	path+"images/pg/prev.png",
	path+"images/pg/next-a.png",
	path+"images/pg/prev-a.png"
	);
	preloadImages(imgs);
	return true;
}

function tover(el,n)
{//	document.body.style.cursor='pointer';	el.src='/images/tools'+n+'a.png';
}

function tout(el,n)
{//	document.body.style.cursor='default';
	el.src='/images/tools'+n+'.png';
}

var ss='';

function mover(nm)
{	if(iev>0)
	{		if(nm=='corporate'||nm=='custom'||nm=='contacts')document.body.style.cursor='pointer';		document.getElementById('mi_'+nm).src='/images/menu/'+nm+'-a.png';
	}else
	{
		document.getElementById('m_'+nm).style.display='none';
		document.getElementById('m_'+nm+'_a').style.display='inline-block';
	}
}

function mout(nm,mode)
{	if(iev>0)
	{		if(nm=='corporate'||nm=='custom'||nm=='contacts')document.body.style.cursor='default';
		if(mode==0)document.getElementById('mi_'+nm).src='/images/menu/'+nm+'.png';
		else document.getElementById('mi_'+nm).src='/images/menu/'+nm+'-l.png';
	}else
	{
		document.getElementById('m_'+nm+'_a').style.display='none';
		document.getElementById('m_'+nm).style.display='inline-block';
	}
}

function rcanvas()
{	if(document.createElement('canvas').getContext)
	{		var m=document.getElementById('middle');
		var m2=document.getElementById('middle2');
		m.innerHTML+='<canvas id="gcan0"></canvas>';
		m2.innerHTML+='<canvas id="gcan1"></canvas><canvas id="gcan2"></canvas>';
		var cnv,cnvctx,i;
		for(i=0;i<3;i++)
		{
			cnv=document.getElementById('gcan'+i);
			cnvctx=cnv.getContext('2d');
			gradient=cnvctx.createLinearGradient(0,0,0,cnv.height);
			gradient.addColorStop(0,'#6d4d37');
			gradient.addColorStop(1,'#b84745');
			cnvctx.fillStyle=gradient;
			cnvctx.fillRect(0,0,cnv.offsetWidth,cnv.offsetHeight);
		}
		m.removeChild(document.getElementById('gpim0'));
		m2.removeChild(document.getElementById('gpim1'));
		m2.removeChild(document.getElementById('gpim2'));
	}
}

function bank_click(w)
{	document.getElementById(w+'bank_a').style.display='none';
	document.getElementById(w+'bank_ha').style.display='inline';
	document.getElementById(w+'bank_m').style.display='block';
	if(iev>0&&iev<7)
	{		var s=document.getElementById('super');
		s.style.height='99%';		s.style.height='100%';
	}
}

function bank_hclick(w)
{
	document.getElementById(w+'bank_m').style.display='none';
	document.getElementById(w+'bank_ha').style.display='none';
	document.getElementById(w+'bank_a').style.display='inline';
	if(iev>0&&iev<7)
	{
		var s=document.getElementById('super');
		s.style.height='99%';
		s.style.height='100%';
	}
}

function hlprinter(el)
{	el.src='/images/printer-a.png';
}

function dhlprinter(el)
{
	el.src='/images/printer.png';
}

function pg_ra_over(t)
{	document.getElementById('pg_ra').src='/images/pg/next-a.png';
	t.style.color='#ff5f68';
}

function pg_ra_out(t)
{
	document.getElementById('pg_ra').src='/images/pg/next.png';
	t.style.color='#fffda4';
}

function pg_la_over(t)
{
	document.getElementById('pg_la').src='/images/pg/prev-a.png';
	t.style.color='#ff5f68';
}

function pg_la_out(t)
{
	document.getElementById('pg_la').src='/images/pg/prev.png';
	t.style.color='#fffda4';
}