// JavaScript Document
function OTO_goToURL() { 
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function OTO_openBrWindow(theURL,winName,features) {
  newWin = window.open(theURL,winName,features);
  newWin.focus();
}

function OTO_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function getOb(id) { 
	return document.getElementById(id); 
}

function changeClass(Elem, myClass) {
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	elem.className = myClass;
}

function getPageSize(){
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

 /* Load Image */
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.mainpic.src = imgOn;
   }
}

function getDateInfo(date, wantsClassName) {
	 var as_number = Calendar.dateToInt(date);
	 return DATE_INFO[as_number];
};

// JavaScript Document
function goToURL() { 
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function openBrWindow(theURL,winName,features) {
  newWin = window.open(theURL,winName,features);
  newWin.focus();
}

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function getOb(id) { 
	return document.getElementById(id); 
}

function get_radio_value(elm) {
for (var i=0; i < elm.length; i++)
   {
   if (elm[i].checked)
      {
      return elm[i].value;
      }
   }
}


function changeClass(Elem, myClass) {
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	elem.className = myClass;
}

function changeTest() {
	if(getOb('index_test_1').style.display == '' || getOb('index_test_1').style.display == 'block') {
		getOb('index_test_1').style.display="none";
		getOb('index_test_2').style.display="block";
	}
	else {
		getOb('index_test_1').style.display="block";
		getOb('index_test_2').style.display="none";
	}
}

var index_news_id = 0;
function indexNews(id) {	
	if(id == null) {
		index_news_id++;
		index_news_id = (index_news_id == 5) ? 0 : index_news_id;
		id = index_news_id;
	}
	else {
		clearInterval(news_int);
	}
	
	getOb('index_news').innerHTML = getOb('index_news_'+id).innerHTML;	
	for(var i=0; i<5; i++) {
		changeClass('index_news_list_'+i, 'index_news_list');
	}
	changeClass('index_news_list_'+id, 'index_news_list_hover');
}

function showBlock(id) {	
	if(getOb(id).style.display == '') {
		getOb(id).style.display="none";
		return;
	}
	getOb(id).style.display="";
}








