//ヒストリーバック
function PageBack(){ history.back(); }
//初期表示
function focus_to_flash(){
	//初めて画面が呼ばれた場合はクッキーに書きにいく
	if(load_data() != 1){
		save_data()
	//一度呼ばれた画面の場合は最初のフレームを飛ばす
	}else{
		window.document.top.GotoFrame(295);
		window.document.top.Play();
	}
}
//*****クッキーのデータを取りにいく******
function load_data(){

	theData="";
	theName="Age=";
	theCookie = document.cookie+";";
	start = theCookie.indexOf(theName)
	if(start !=-1){
		end = theCookie.indexOf(";",start);
		theData = unescape(theCookie.substring(start+theName.length,end));
	}
	return theData
}

//*****クッキーに書きにいく*****
function save_data(){

	theName="Age";
	theDay=1;
	setDay= new Date();
	setDay.setTime(setDay.getTime()+(theDay*1000*60*10*1));
	expDay = setDay.toGMTString();
	document.cookie = theName+"="+escape(1)+";expires="+expDay;
}

//ロールオーバー
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_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_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];}
}

//ポップアップ--（フォーカス機能追加）
function MM_openBrWindow(theURL,winName,features) { //v2.0
var winFocus;
winFocus=window.open(theURL,winName,features);
winFocus.focus();
}

//画面拡大POPUP
function popWindow(n) {
switch(n){
        case 1: winOp = new Array("tokuchou_pop1.html",640,500,0,0,0,0,0,0,0,"about1"); break;
        case 2: winOp = new Array("tokuchou_pop2.html",730,600,1,0,0,0,0,0,0,"about2"); break;
        default: alert("Sorry, no detailed information.");return;}
winopStr = "top=10,left=10,width="+winOp[1]+",height="+winOp[2]+",scrollbars="+winOp[3]+",resizable="+winOp[4]+",toolbar="+winOp[5]+",menubar="+winOp[6]+",location="+winOp[7]+",directories="+winOp[8]+",status="+winOp[9]+"";
popWin = window.open(winOp[0],winOp[10],winopStr);
popWin.focus(); return;
}

//相対パスの違いトップページ用
function detailWindow(n) {
switch(n){
        case 1: winOp = new Array("weblesson/pop_life/index.html",466,309,0,0,0,0,0,0,0,"a"); break;
        case 2: winOp = new Array("weblesson/pop_lesson/index.html",780,730,1,1,1,1,1,1,1,"b"); break;
        case 3: winOp = new Array("weblesson/pop_kodawari/index.html",595,320,0,0,0,0,0,0,0,"c"); break;
        case 4: winOp = new Array("weblesson/pop_campaign/index.html",780,630,1,1,0,0,0,0,0,"d"); break;
        case 5: winOp = new Array("../pop_kit/index.html",500,700,1,1,0,0,0,0,0,"e"); break;
        case 6: winOp = new Array("../taiken/kiyaku.html",700,460,1,1,0,0,0,0,0,"f"); break;
        case 7: winOp = new Array("https://www2.eccweblesson.com/call.html",640,540,0,1,0,0,0,0,0,"g"); break;
        case 8: winOp = new Array("airline/pop_kit/index.html",500,540,0,1,0,0,0,0,0,"newwin"); break;
        default: alert("Sorry, no detailed information.");return;}
winopStr = "top=10,left=10,width="+winOp[1]+",height="+winOp[2]+",scrollbars="+winOp[3]+",resizable="+winOp[4]+",toolbar="+winOp[5]+",menubar="+winOp[6]+",location="+winOp[7]+",directories="+winOp[8]+",status="+winOp[9]+"";
popWin = window.open(winOp[0],winOp[10],winopStr);
popWin.focus(); return;
}

//相対パスの違い中ページ用
function detailWindow(n) {
switch(n){
        case 1: winOp = new Array("../weblesson/pop_life/index.html",466,309,0,0,0,0,0,0,0,"newwin"); break;
        case 2: winOp = new Array("../weblesson/pop_lesson/index.html",780,730,1,1,1,1,1,1,1,"newwin"); break;
        case 3: winOp = new Array("../weblesson/pop_kodawari/index.html",595,320,0,0,0,0,0,0,0,"c"); break;
        case 4: winOp = new Array("../pop_campaign/index.html",780,630,1,1,0,0,0,0,0,"newwin"); break;
        case 5: winOp = new Array("../pop_kit/index.html",500,700,1,1,0,0,0,0,0,"newwin"); break;
        case 6: winOp = new Array("../taiken/kiyaku.html",700,460,1,1,0,0,0,0,0,"newwin"); break;
        case 7: winOp = new Array("https://www2.eccweblesson.com/call.html",640,540,0,1,0,0,0,0,0,"g"); break;
        case 8: winOp = new Array("../airline/pop_kit/index.html",500,540,0,1,0,0,0,0,0,"newwin"); break;
        case 9: winOp = new Array("pop_kit/index.html",500,540,1,1,0,0,0,0,0,"newwin"); break;
        case 10: winOp = new Array("whathatsuon.html",830,630,1,1,0,0,0,0,0,"newwin"); break;
        default: alert("Sorry, no detailed information.");return;}
winopStr = "top=10,left=10,width="+winOp[1]+",height="+winOp[2]+",scrollbars="+winOp[3]+",resizable="+winOp[4]+",toolbar="+winOp[5]+",menubar="+winOp[6]+",location="+winOp[7]+",directories="+winOp[8]+",status="+winOp[9]+"";
popWin = window.open(winOp[0],winOp[10],winopStr);
popWin.focus(); return;
}

//ページをプリントする
//指定方法（javascript:printPage();）
function printPage() { print(document); }

//ページトップに戻る
//指定方法（javascript:jumpToPageTop();）
function getScrollLeft() { // 020225
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollLeft;
 } else if (window.pageXOffset) {
  return window.pageXOffset;
 } else {
  return 0;
 }
}

function getScrollTop() { // 020225
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollTop;
 } else if (window.pageYOffset) {
  return window.pageYOffset;
 } else {
  return 0;
 }
}

function getScrollWidth() { // 010317
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollWidth;
 } else if (window.innerWidth) {
  return window.innerWidth;
 }
 return 0;
}

function getScrollHeight() { // 010317
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollHeight;
 } else if (window.innerHeight) {
  return window.innerHeight;
 }
 return 0;
}

var pageScrollTimer;
function pageScroll(toX,toY,frms,cuX,cuY) { // 020314
 if (pageScrollTimer) clearTimeout(pageScrollTimer);
 if (!toX || toX < 0) toX = 0;
 if (!toY || toY < 0) toY = 0;
 if (!cuX) cuX = 0 + getScrollLeft();
 if (!cuY) cuY = 0 + getScrollTop();
 if (!frms) frms = 6;

 if (toY > cuY && toY > (getAnchorPosObj('end','enddiv').y) - getInnerSize().height) toY = (getAnchorPosObj('end','enddiv').y - getInnerSize().height) + 1;
 cuX += (toX - getScrollLeft()) / frms; if (cuX < 0) cuX = 0;
 cuY += (toY - getScrollTop()) / frms;  if (cuY < 0) cuY = 0;
 var posX = Math.floor(cuX);
 var posY = Math.floor(cuY);
 window.scrollTo(posX, posY);

 if (posX != toX || posY != toY) {
  pageScrollTimer = setTimeout("pageScroll("+toX+","+toY+","+frms+","+cuX+","+cuY+")",16);
 }
}

function jumpToPageTop() { // 020301
  pageScroll(0,0,5);
}

//お気に入りに追加
function AddLikePage(){
	window.external.AddFavorite("http://www.xxxx.co.jp", "サイト名");
}

// レイヤー表示・レイヤー非表示
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//プルダウンメニューtype1
//id="navi+n"にclass="Show" class="Hidden"を追記する
/*
var timerID="";
function mn(n){
	if(timerID!=""){
		clearTimeout(timerID);
	}
	var val = n;
	dlt2();
	document.getElementById(val).className='Show';
}
function dlt(){
	timerID=setTimeout("dlt2()",250);
}
function dlt2(){
	for (i=1;i<4;i++){
		var val2 = "navi" + i;
		document.getElementById(val2).className='Hidden';
	}
}
*/

//プルダウンメニューtype2
//id="menu+n"のあるタグのstyle要素のvisibility="hidden"を書き換える
var timerID="";
function mn(n){
if(timerID!=""){
	clearTimeout(timerID);
}
var val = n;
dlt2();
document.getElementById(val).style.visibility="visible";
document.getElementById(val).style.zIndex="1";
}
function dlt(){
timerID=setTimeout("dlt2()",500);
}
function dlt2(){
for (i=1;i<2;i++){
	var val2 = "menu" + i;
	document.getElementById(val2).style.visibility="hidden";
	document.getElementById(val2).style.zIndex="0";
	}
}

//フラッシュ書き出し用
function writeFlashHTML( arg )
{
  
  /**
   * 引数から属性を抽出する
   */
   
  var parm = []
  
  //すべての引数を順番に
  for( i = 0 ; i < arguments.length ; i++ )
  {
    //属性名と属性値をあらわす文字列を配列parmへセットする(半角空白は除去)
    parm[i] = arguments[i].split(' ').join('').split('=')
    
    //有効な属性名があれば属性値で変数化( 無効な名前は無視 )
    switch (parm[i][0])
    {
      case '_swf'     : var _swf     = parm[i][1] ; break ; // フラッシュのURL
      case '_quality' : var _quality = parm[i][1] ; break ; // 画質
      case '_loop'    : var _loop    = parm[i][1] ; break ; // 繰り返し
      case '_bgcolor' : var _bgcolor = parm[i][1] ; break ; // 背景色
      case '_wmode'   : var _wmode   = parm[i][1] ; break ; // 背景透明(WinIEのみ)
      case '_play'    : var _play    = parm[i][1] ; break ; // 自動再生
      case '_menu'    : var _menu    = parm[i][1] ; break ; // 右クリックメニュー
      case '_scale'   : var _scale   = parm[i][1] ; break ; // 幅高さが%の時の縦横比等
      case '_salign'  : var _salign  = parm[i][1] ; break ; // 表示領域内表示位置
      case '_height'  : var _height  = parm[i][1] ; break ; // ムービーの高さ
      case '_width'   : var _width   = parm[i][1] ; break ; // ムービーの幅
      case '_hspace'  : var _hspace  = parm[i][1] ; break ; // まわりの余白(水平方向)
      case '_vspace'  : var _vspace  = parm[i][1] ; break ; // まわりの余白(垂直方向)
      case '_align'   : var _align   = parm[i][1] ; break ; // 表示位置
      case '_class'   : var _class   = parm[i][1] ; break ; // クラス
      case '_id'      : var _id      = parm[i][1] ; break ; // ID名
      case '_name'    : var _name    = parm[i][1] ; break ; // ムービー名
      case '_style'   : var _style   = parm[i][1] ; break ; // スタイル
      case '_declare' : var _declare = parm[i][1] ; break ; // 読み込まれるだけで実行しない
      default        :;
    }
  }
  

  // タグ用文字列生成
  var htm = ""
  
  htm+="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'"
  htm+="        codebase='http://download.macromedia.com/pub/shockwave/"
                    htm+="cabs/flash/swflash.cab'"
  if(!!_width)   htm+="        width    = '" + _width   + "'"
  if(!!_height)  htm+="        height   = '" + _height  + "'"
  if(!!_hspace)  htm+="        hspace   = '" + _hspace  + "'"
  if(!!_vspace)  htm+="        vspace   = '" + _vspace  + "'"
  if(!!_align)   htm+="        align    = '" + _align   + "'"
  if(!!_class)   htm+="        class    = '" + _class   + "'"
  if(!!_id)      htm+="        id       = '" + _id      + "'"
  if(!!_name)    htm+="        name     = '" + _name    + "'"
  if(!!_style)   htm+="        style    = '" + _style   + "'"
  if(!!_declare) htm+="                    " + _declare  
  htm+=">"
  if(!!_swf)     htm+="<param  name     = 'movie'   value ='" + _swf     + "'>"
  if(!!_quality) htm+="<param  name     = 'quality' value ='" + _quality + "'>"
  if(!!_loop)    htm+="<param  name     = 'loop'    value ='" + _loop    + "'>"
  if(!!_bgcolor) htm+="<param  name     = 'bgcolor' value ='" + _bgcolor + "'>"
  if(!!_play)    htm+="<param  name     = 'play'    value ='" + _play    + "'>"
  if(!!_menu)    htm+="<param  name     = 'menu'    value ='" + _menu    + "'>"
  if(!!_scale)   htm+="<param  name     = 'scale'   value ='" + _scale   + "'>"
  if(!!_salign)  htm+="<param  name     = 'salign'  value ='" + _salign  + "'>"
  if(!!_wmode)   htm+="<param  name     = 'wmode'   value ='" + _wmode   + "'>"
  htm+=""
  htm+="<embed                          "
  htm+="        pluginspage='http://www.macromedia.com/go/getflashplayer'"
  if(!!_width)   htm+="        width    = '" + _width   + "'"
  if(!!_height)  htm+="        height   = '" + _height  + "'"
  if(!!_hspace)  htm+="        hspace   = '" + _hspace  + "'"
  if(!!_vspace)  htm+="        vspace   = '" + _vspace  + "'"
  if(!!_align)   htm+="        align    = '" + _align   + "'"
  if(!!_class)   htm+="        class    = '" + _class   + "'"
  if(!!_id)      htm+="        id       = '" + _id      + "'"
  if(!!_name)    htm+="        name     = '" + _name    + "'"
  if(!!_style)   htm+="        style    = '" + _style   + "'"
  htm+="        type     = 'application/x-shockwave-flash' "
  if(!!_declare) htm+="                    " + _declare  
  if(!!_swf)     htm+="        src      = '" + _swf     + "'"
  if(!!_quality) htm+="        quality  = '" + _quality + "'"
  if(!!_loop)    htm+="        loop     = '" + _loop    + "'"
  if(!!_bgcolor) htm+="        bgcolor  = '" + _bgcolor + "'"
  if(!!_play)    htm+="        play     = '" + _play    + "'"
  if(!!_menu)    htm+="        menu     = '" + _menu    + "'"
  if(!!_scale)   htm+="        scale    = '" + _scale   + "'"
  if(!!_salign)  htm+="        salign   = '" + _salign  + "'"
  htm+="></embed>"
  htm+="</object>"

  //書き出し処理
  document.write(htm)
  
}