
// ÏÎÊÀÇ ÑÏÅÖÏÐÅÄËÎÆÅÍÈÉ
var show_spec = false;
function showSpec(show)
{
	show_spec = show;
	var divS = $("divS");
	var divS_ = $("divS_");
	var divSa = $("divSa");
	var divSpec = $("divSpec");
	
	if(show)
	{
		divS.style.visibility = "hidden";
		divS_.style.visibility = "hidden";
		divSa.style.visibility = "visible";
		divSpec.style.visibility = "visible";
	}
	else
	{
		divSa.style.visibility = "hidden";
		divS_.style.visibility = "visible";
		divSpec.style.visibility = "hidden";
	}
}	

function hideSpec(e)
{
	var e = e || windows.event;
	var obj = e.target || e.srcElement;
	showSpec(true);
	do
	{
		obj = obj.parentNode;
		if(obj.id == "divSpec")	return;
	}
	while(obj.tagName);	
	showSpec(false);
}

function omoSpec(over)
{
	var divS = $("divS");
	var divS_ = $("divS_");
	
	if(over)
	{
		divS.style.visibility = "hidden";
		divS_.style.visibility = "visible";
	}
	else if(!show_spec)
	{
		divS_.style.visibility = "hidden";
		divS.style.visibility = "visible";
	}
}	


// ÏÐÎÊÐÓÒÊÀ ØÎÑÑÅ
var startScroll=null;
function scrollRoad(right)
{
	startScroll = setInterval('portScroll('+right+',3)',1);	
}
function portScroll(to,step)
{
	var _div = $('road');	
	if(to)
		_div.scrollLeft += step;
	else
		_div.scrollLeft -= step;

	return _div.scrollLeft;
}
function stopScroll()
{
	clearInterval(startScroll);
}


// ÂÑÏËÛÂÀØÊÀ ØÎÑÑÅ
function showRoadText(obj, id, show)
{
	var _div = $('roadText'+id);
	if(!show)
	{
		_div.style.visibility = 'hidden';	
		return;
	}
	var posX = absPosition(obj).x - $('road').scrollLeft;
	if(posX > absPosition($('divMain')).x+990-250) posX = absPosition($('divMain')).x+990-250-1;
	if(posX < absPosition($('divMain')).x) posX = absPosition($('divMain')).x;
	_div.style.left = posX + 'px';
	_div.style.top = 92+24+'px';
	_div.style.visibility = 'visible';
}

function screenSize() 
{
	var w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
	var h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
	return {w:w, h:h};
}
function setdivbgb()
{
	$('divbgb').style.backgroundPosition = "center "+(screenSize().h-370)+"px";
}

