//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/  JavaScript - common.js                              _/
//_/  Version : 1.0                                       _/
//_/  Last Updated : 2007/1/3                             _/
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

var ckHours = 24;
var ckPath = "/"
var ckFontSizeName = "ckfontsize";
var curFontSize = 100;

if (navigator.cookieEnabled) {
	ckFs = getCookie(ckFontSizeName);
	if (ckFs != null && ckFs != ""){
  	curFontSize = eval(ckFs);
  	document.getElementsByTagName('html')[0].style.fontSize = curFontSize + "%";
	}
}

function callScript(scr) {
	document.write('<script type="text/javascript" src="'+ scr +'"></script>');
}

function hideElements(pref) {
	children = document.getElementsByTagName("div") || document.all;
	for(i=0;i<children.length;i++) {
		child = children[i];
		if (child.id.indexOf(pref) != -1) {
			child.style.display = "none";
		}
	}
}

function show(target){
	obj = getObject(target);
	if (obj.style.display == "") obj.style.display = "none";
	
	if (obj.style.display == "none") {
		obj.style.display = "block";  
	} else {
    obj.style.display = "none";
	}
}

function setFontSize(num){
	curFontSize = curFontSize + num*20;
	document.getElementsByTagName('html')[0].style.fontSize = curFontSize + "%";
	if (navigator.cookieEnabled) {
		setCookie(ckFontSizeName,curFontSize,ckHours);
		location.reload();
	}
}

function getObject(id) {
  if ((navigator.userAgent.indexOf("Opera",0) != -1)?1:0){
  	obj=document.getElementById(id);
  }else if (document.all){
  	obj = document.all[id];
  }else if (document.getElementById){
  	obj = document.getElementById(id);
  }else if (document.layers){
  	obj = document.layers[id];
  }
  return obj;
}

function setCookie(name, value, hours){
  var expire = "";
  if (hours != null) {
    expire = new Date((new Date()).getTime() + hours * 3600000 * 24);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire + ";path="+ckPath;
}

function getCookie(name){
  var cookieValue = "";
  var search = name + "=";
  if (document.cookie.length > 0) { 
    offset = document.cookie.indexOf(search);
    if (offset != -1) { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function deleteCookie(name){
  if (getCookie(name)){
    document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT;path="+ckPath;
  }
}

function newsmailWin() {
	var url = 'https://www.c-direct.ne.jp/irsd/cd/initInvestorRegist.do?gsCode=10103591&mode=3&localeLang=jp';
	var w = 760,h = 600;
	op = "width=" + w + ",height=" + h + ",top=10,left=10,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no" ;
	wo = window.open(url,'map',op);
	wo.focus();
}
