/* ------------------------------------------
* Filename: visual.js
* Update: 2009-11-11
* Author: riix
------------------------------------------ */

function hover(obj) {
 switch(obj.className) {
  case "over":
   obj.className="";
   break;
  default:
   obj.className="over";
   break;
 }
}

function toggle(idx,j){
 for(i = 1; i <= j ; i++ ){
  document.getElementById('toggle'+i).className = "hide";
 }
 document.getElementById('toggle'+idx).className = "show";
}

function resizePopup(w,h) {
 var clintAgent = navigator.userAgent;
 if ( clintAgent.indexOf("MSIE") != -1 ) {
      window.resizeBy(w-document.body.clientWidth, h-document.body.clientHeight);
    } else {
      window.resizeBy(w-window.innerWidth, h-window.innerHeight);
    }
}

function toggleFaq(idx,j){
 for(i = 1; i <= j ; i++ ){
  document.getElementById('q'+i).className = "show";
  document.getElementById('a'+i).className = "hide";
 }
 document.getElementById('q'+idx).className = "hide";
 document.getElementById('a'+idx).className = "show";
}

function sitemap() {
 var object = document.getElementById('sitemap');
 if (object.className == 'hide') {
   object.className = 'show';
  } else {
   object.className = 'hide';
  }
}

function content_print(sid){
	var initBody = document.body.innerHTML;
	window.onbeforeprint = function(){
		document.body.innerHTML = document.getElementById(sid).innerHTML;
	}
	window.onafterprint = function(){
		document.body.innerHTML = initBody;
	}
	window.print();
}

function fileDownload(url) 
{
	document.location.href=url;
	window.setTimeout("document.location.reload()",1000);
}
