function headerOver(id){
    document.getElementById(id).src="/images/"+id+"_on.jpg";
}
function headerOut(id){
    document.getElementById(id).src="/images/"+id+"_off.jpg";
}
function chartImgSwc(flg){
    if(flg==1){
        document.getElementById("chart_01").src="http://www.news-sec.co.jp/graph_kabuka-vietnam.php?stock_seq=" + document.getElementById("hdn_code").value + "&type=";
        document.getElementById("chart_02").src="http://www.news-sec.co.jp/graph_dekidaka-vietnam.php?stock_seq=" + document.getElementById("hdn_code").value + "&type=";
    }else{
        document.getElementById("chart_01").src="http://www.news-sec.co.jp/graph_kabuka-vietnam.php?stock_seq=" + document.getElementById("hdn_code").value + "&type=M";
        document.getElementById("chart_02").src="http://www.news-sec.co.jp/graph_dekidaka-vietnam.php?stock_seq=" + document.getElementById("hdn_code").value + "&type=M";
    }
}
function chartImgSwc2(flg){
    if(flg==1){
        document.getElementById("chart_01").src="http://www.news-sec.co.jp/graph_kabuka-vietnam-i.php?index_seq=13&type=";
    }else{
        document.getElementById("chart_01").src="http://www.news-sec.co.jp/graph_kabuka-vietnam-i.php?index_seq=13&type=M";
    }
}
function sideSwc(id){
    if(document.getElementById(id).style.visibility==""){
        document.getElementById(id).style.visibility="hidden";
    }else{
        document.getElementById(id).style.visibility="";
    }
}
function cSwc(flg,id){
    if(flg==1){
        document.getElementById(id).style.background="#f2f2f2"
    }else{
        document.getElementById(id).style.background="#ffffff";
    }
}
var topOnl_flg = 1;
function topOnl(){
    if(topOnl_flg < 4){
        document.getElementById("main").src = "http://www.orient-sec.com/images/main_" + topOnl_flg + ".jpg";
        topOnl_flg += 1;
        setTimeout("topOnl()",10000);
    }
}

var flg_clearFf = true;
function clearFf(){
	if(flg_clearFf){
	        setTimeout("clearFf()",500);
		flg_clearFf = false;
	}else{
		document.getElementById("post_").value = "";
		document.getElementById("addr").value = "";
		document.getElementById("strt").value = "";
		flg_clearFf = true;
	}
}


/*-------------------------------------------
  共通JS 関数群
-------------------------------------------*/


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//e-SIGMAログイン画面表示 2007.08.13 ADD
function openwin() {
	window.open("https://espc.jip-jet.ne.jp/login.con?code=249", "", "toolbar=no,location=no,derectories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=1012,height=717,left=0,top=0");
}

//ログイン画面表示
var win = window;
//　JIP追加分１ ここから
function wopen(form) {
window.open("","laposta249","toolbar=yes,location=no,menubar=no,width=800,height=600,scrollbars=yes");
form.submit();
}
// JIP追加分１ ここまで


//お問い合わせ画面表示
function openToiawase() {
  var url
  url = "https://www.orient-sec.com/info/toiawase/index.asp";
  win = open(url,"OrientSyokenLogin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=604,height=600");
  win.focus();
}
//求人画面表示
function openKyujin() {
  var url
  url = "https://www.orient-sec.com/info/toiawase/kyujin.asp";
  win = open(url,"OrientSyokenLogin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=604,height=600");
  win.focus();
}
//口座画面表示
function openKoza() {
  var url
  url = "https://www.orient-sec.com/koza/index.asp";
  win = open(url,"OrientSyokenKoza","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=784,height=600");
  win.focus();
}
//シネマプレゼント 2006.01.31 ADD
function openSinema() {
  var url
  url = "https://www.orient-sec.com/info/present/index.asp";
  win = open(url,"OrientSyokenSinema","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=614,height=500");
  win.focus();
}
/*
 *
 * ◆ worldclock.js
 *
 *    CREATED:  2001-10-23
 *    MODIFIED: 2002-07-20
 *    BY Yuki SHIMAZU
 *
 * ◇参考資料
 * http://www.ueda.info.waseda.ac.jp/~gaku/js/how034.html
 * http://isweb13.infoseek.co.jp/computer/nilab/dl.html
 * http://www.apple.co.jp/hotnews/swatch/index.html
 * http://www.swatch.com/internettime/
 * http://www.ne.jp/asahi/taka/hello/summer.html
 * http://www.inside.ne.jp/js/
 *
 */


// まず今が何年か調べる
var today = new Date();
var year = today.getYear();
if (year < 1900) { year += 1900; }

// ローカル時間とグリニッジ標準時の差を分で表示
var tz_offset = today.getTimezoneOffset();

// 各都市の時差を格納
var tz_ldn = 7 * 60;    // GMT +-0
//var tz_tyo = 9 * 60;    // GMT  +9
//var tz_lax = -8 * 60;   // GMT  -8
//var tz_nyc = -5 * 60;   // GMT  -5


//
// ◆各都市の表示欄の色づけ
//
cities = Array(1);
cities[0] = "ldn";
//cities[1] = "tyo";
//cities[2] = "lax";
//cities[3] = "nyc";

document.writeln("<style type=text/css>");

// いまの時刻を取得（たぶん1000ミリ秒単位）
var now  = new Date();
var n_t  = now.getTime();

for ( i=0; i<1; i++ ) {

    if (cities[i] == "ldn")         { var str = printtime(n_t,tz_ldn); }
//    else if (cities[i] == "tyo")    { var str = printtime(n_t,tz_tyo); }
//    else if (cities[i] == "lax")    { var str = printtime(n_t,tz_lax); }
//    else if (cities[i] == "nyc")    { var str = printtime(n_t,tz_nyc); }

    var hour = str.substring(0,2);

    /*
     * ○時刻ごとの背景色設定
     * 白 ....... 6-16
     * 薄い青 ... 16-18, 5-6
     * 青 ....... 18-20, 4-5
     * 濃い青 ... 20-4
     */

    if ( 6 <= hour && hour < 16 ) {
        document.writeln("input." + cities[i] + " { background:#eee }");
    } else if ( (16 <= hour && hour < 18) || (5 <= hour && hour < 6) ) {
        document.writeln("input." + cities[i] + " { background:#ccf }");
    } else if ( (18 <= hour && hour < 20) || (4 <= hour && hour < 5) ) {
        document.writeln("input." + cities[i] + " { background:#77c;color:#ddd }");
    } else {
        document.writeln("input." + cities[i] + " { background:#448;color:#ddd }");
    }
}

document.writeln("</style>");


// ◆メインルーチン
function update_watch() {
    // いまの時刻を取得（たぶん1000ミリ秒単位）
    var now  = new Date();
    var n_t  = now.getTime();

    document.getElementById("viet").innerHTML = "ホーチミン（現地時刻）:"+printtime(n_t,tz_ldn);
//    document.getElementById("tyo").innerHTML = "TYO:"+printtime(n_t,tz_tyo);
//    document.getElementById("lax").innerHTML = "LAX:"+printtime(n_t,tz_lax);
//    document.getElementById("nyc").innerHTML = "NYC:"+printtime(n_t,tz_nyc);

    setTimeout('update_watch()', 999);        // 1000msec = 1sec（秒）
}



// ◆表示・サマータイム処理
function printtime(now_time, timezone) {
    var hour, min, sec;

    var pos_t = now_time + (tz_offset + timezone) * 60 * 1000;

    var t = new Date();
    t.setTime(pos_t);
    hour = t.getHours();
    min  = t.getMinutes();
    sec  = t.getSeconds();

    // 「XX時00分00秒」で、かつ、XX が「4,5,6,16,18,20」のうち
    // いずれかであるときにページをリロード
    // この処理により時間ごとの背景色が自動的に変わる
    if ( (hour==4||hour==5||hour==6||hour==16||hour==18||hour==20) && min==0 && sec==0 ) {
        window.location.reload();
    }

    if (hour < 10) {
        hour = "0" + hour;
    }
    if (min < 10) {
        min = "0" + min;
    }
    if (sec < 10) {
        sec = "0" + sec;
    }

    return hour + ":" + min + ":" + sec;
//    return hour + ":" + min;
}

// ◆インターネットタイムの処理
function internettime() {
    var c = new Date();
    var gmt = c.toGMTString();
    var d = gmt.indexOf(":")

    var h = eval( gmt.slice(d-2,d) );
    var m = eval( gmt.slice(d+1,d+3) );
    var s = eval( gmt.slice(d+4,d+6) );

    // LONDON と BIEL（SWATCH本社所在地／PARISとtime zoneが同じ）の 時差は１時間（3600秒）
    var beat = (h * 3600 + m * 60 + s + 3600) / 86.4;

    if (beat >= 1000) beat = beat - 1000;
    beat = Math.floor(beat);

    var zero = "";
    if (beat < 100) zero = "0";
    if (beat < 10) zero = "00";

    return "@" + zero + beat;
}

