
function byID(id)
{
	var obj;
	if (document.getElementById) obj = document.getElementById(id);
	else if (document.all) obj = document.all[id];
	else if (document.layers) {
		obj 	  = document.layers[id];
		obj.style = document.layers[id];	
	}
	return obj;	
}

function correct()
{
    var windowWidth = 0;
    if(typeof( window.innerWidth ) == 'number') {
    	windowWidth = window.innerWidth - 18;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    	windowWidth = document.documentElement.clientWidth;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	windowWidth = document.body.clientWidth;
    }
    
  var tmpA = 0;
  	var tmpB = 0;
  	var tmpRest = 0;
  	var a = 0;


	if (1001 > windowWidth) {
		byID("bg_left").style.display = "none";
		byID("bg_right").style.display = "none";	
	} else if (1920 <= windowWidth) {
		byID("bg_left").style.width = "461px";
		byID("bg_right").style.width = "459px";
		byID("container").style.width = "1920px";
	} else {					
		tmpRest = windowWidth - 1000;
		if ((tmpRest % 2) == 1) { a = 1; }			
		tmpA = tmpRest / 2;
		byID("bg_left").style.width = tmpA + "px";
		byID("bg_right").style.width = (tmpA + a) + "px";
		byID("container").style.width = windowWidth + "px";	
	}
}

function getElementsByClassName(classname,tag) {
 if(!tag) tag = "*";
 var anchs =  document.getElementsByTagName(tag);
 var total_anchs = anchs.length;
 var regexp = new RegExp('\\b' + classname + '\\b');
 var class_items = new Array()
 
 for(var i=0;i<total_anchs;i++) { 
  var this_item = anchs[i];
  if(regexp.test(this_item.className)) {
   class_items.push(this_item);
  }
 }
 return class_items;
}


function show(id)
{
  var elems = getElementsByClassName('middle');
  
  
	for (i = 0; i < elems.length; i++) 
	{
		elems[i].style.display = "none"; 
	}	
  
  byID(id).style.display = "block";
  
  return false; 
}

function start()
{
  var elems = getElementsByClassName('middle');
	elems[0].style.display = "block";
}
