window.onresize=ppp;
window.onload=ppp;

// get element of page by id (cross-browser)
function elementById(Name) {
	if(navigator.appName.indexOf("Microsoft")!=-1) {
	// IE
		if(!eval('document.all("'+Name+'")')) return 0; else return document.all(Name);
  	}
  	else {
	// NN & others
    		if(!eval('document.'+Name))  {
			if (document.getElementById) {
				return eval('document.getElementById("'+Name+'")');
			} else
			return 0;
    		}
    		else
		return eval('document.'+Name);
	}
}
// set element property (cross-browser)
function setProp(Name, Param, Val) {
    		if(!eval('document.'+Name))  {
			if (document.getElementById) {
				eval('document.getElementById("'+Name+'").style.'+Param+'='+Val);
			} else
			return 0;
    		}
    		else
		eval('document.'+Name+'.'+Param+'='+Val);
}
// get element property (cross-browser)
function getProp(Name, Param)
{
	if(!eval('document.'+Name))
	{
		if (document.getElementById)
		{
			return eval('document.getElementById("'+Name+'").style.'+Param);
		} 
		else return 0;
    }
    else return eval('document.'+Name+'.'+Param);
}
function resizewww ()
{
	if (document.documentElement.clientWidth<990)
	{
		setProp('global', 'width', '"990px"');
		setProp('footer', 'width', '"910px"');
	}
	else
	{
		setProp('global', 'width', '"auto"');
		setProp('footer', 'width', '"auto"');
	}
	return 0;
}
function ppp()
{
	resizewww ();

	www = (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
	www = Math.floor((www-375)/15)*15;
	if (www<615)
	{
		www = 615;
	}
	var www2 = www.toString()+"px";
	setProp('spiral','width','"'+www2+'"');
	if (screen.availWidth>1280)
	{
		setProp('header','background','"url(/images/logo2.jpg) right top no-repeat"');
	}
	else setProp('header','background','"url(/images/logo3.jpg) right top no-repeat"');
	return 0;
}
// menu over
function menuMouseOver(num)
{
	setProp('sub'+num, 'display', "''");
	setProp('b'+num, 'background', "'url(/images/b"+num+"u.gif) 0 0 no-repeat'");
}
// menu out
function menuMouseOut(num)
{
	setProp('sub'+num, 'display', "'none'");
	setProp('b'+num, 'background', "'url(/images/b"+num+".gif) 0 0 no-repeat'");
}
// menu timer
function menuMouseTimer(num)
{
	if (!eval('sub'+num))
	{
		setProp('sub'+num, 'display', "'none'");
	}
}