<!--
// img&CSS directory check

if(self != top) {top.location.href=self.location.href;}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var basho = new String(window.location.href);
var basho_oya = new String(parent.location.href);

if(basho.indexOf("cmcc") != -1){
var hajime = basho.indexOf("cmcc",0);
}else if(basho.indexOf("~s49106-1") != -1){
var hajime = basho.indexOf("~s49106-1",0);
}

var mojiretsu = basho.substring(hajime);
//var saigonomoji = mojiretsu.charAt(mojiretsu.length-1);
var hairetu = mojiretsu.split("/");
var kosuu = hairetu.length;
var kaisou = "";
if (kosuu>=3){
  for (i=3;  i <= kosuu; i++){
  kaisou += "..\/";
  }
}


var osName = navigator.appVersion;
var browser = navigator.appName;
var winIEstylesheet = "css\/style_winIE.css";
var winNNstylesheet = "css\/style_winNN.css";
var macstylesheet = "css\/style_mac.css";
  if (osName.indexOf('Mac')!=-1){
  document.write("<link rel=\"stylesheet\" href=\""+kaisou+macstylesheet+"\" type=\"text\/css\" \/>");
  } else if (osName.indexOf('Win')!=-1){
      if (browser.charAt(0)=="N") {
      document.write("<link rel=\"stylesheet\" href=\""+kaisou+winNNstylesheet+"\" type=\"text\/css\" \/>");
//      } else if  (browser.charAt(0)=="M") {
//      document.write("<link rel=\"stylesheet\" href=\""+kaisou+winIEstylesheet+"\" type=\"text\/css\" \/>");
//      } else{
//      document.write("<link rel=\"stylesheet\" href=\""+kaisou+winIEstylesheet+"\" type=\"text\/css\" \/>");
      }
  }



var preIMG_array = new Array(); //navigation
var preIMG = new Array();  //navigation
var preIMG_array_general = new Array(); //general
var preIMG_general = new Array();  //general

function tsuika(theURL){
 
var img_flag = "";
  for(i=0; i<preIMG_array.length; i++){  //for rollover 
    if (preIMG_array[i] == theURL) {
    img_flag = 1;
    }
  } 
  if (img_flag != 1){
  preIMG_array.unshift(theURL);
  }
}


function tsuika_general(theURL){  //general
var img_flag_general = "";


  for(i=0; i<preIMG_array_general.length; i++){
    if (preIMG_array_general[i] == theURL) {
    img_flag_general = 1;
    }
  } 
  if (img_flag_general != 1){
  preIMG_array_general.unshift(theURL);
  }
}


function NavImg(){
  if (document.images[hairetu[1]]){
  document.images[hairetu[1]].src = kaisou+"img/"+hairetu[1]+"2.gif";
  }
}


function swapIMG(status,img_name){  //navigation
  if (document.images[img_name]){
    if(status == "1" && hairetu[1] != img_name){
    document.images[img_name].src = kaisou+"img/"+img_name+"1.gif";
    }
    if(status == "2" && hairetu[1] != img_name){
    document.images[img_name].src = kaisou+"img/"+img_name+"0.gif";
    }
  }
}



function swapIMG_general(imagename,theURL){  //general
if(document.images)document.images[imagename].src = theURL;
}


function preload_images(){  //navigation
var hanten_img = new Array();
hanten_img[0]='greetings';
hanten_img[1]='our_church';
hanten_img[2]='message';
hanten_img[3]='worship';
hanten_img[4]='news';
hanten_img[5]='gospel';
hanten_img[6]='calendar';
hanten_img[7]='link';
hanten_img[8]='event';

  for (i=0; i < hanten_img.length; i++){
  preIMG[i]= new Image();
  preIMG[i].src = kaisou+'img/'+hanten_img[i]+'1.gif';
  }
}


function preload_images_general(){  //general
preIMG_array_general.reverse();
for (i=0; i<preIMG_array_general.length; i++){
  preIMG_general[i]= new Image();
  preIMG_general[i].src = preIMG_array_general[i];
 } 
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_openBrWindow(theURL,winName,features) { //v2.0
window.name='oya';
window.open(theURL,winName,features);
}


function open_custom_win(open_url,wName,wWidth,wHeight){
sWidth = screen.availWidth;
sHeight = screen.availHeight;
x=(sWidth-wWidth)/2;
y=(sHeight-wHeight)/2;
z=window.open(open_url,wName,"menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width="+wWidth+",height="+wHeight);
z.moveTo(x,y);
}


function open_photo_gallery(wName) {
wWidth = 600;
wHeight = 380;
sWidth = screen.availWidth;
sHeight = screen.availHeight;
x=(sWidth-wWidth)/2;
y=(sHeight-wHeight)/2;
z=window.open(kaisou+'j/photo_gallery/index.html',wName,"menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width="+wWidth+",height="+wHeight);
z.moveTo(x,y);
}



function resize_move(){
  window.resizeTo('720',window.screen.availHeight);
  window.moveTo('0','0');
}


var setsumei_array = new Array(); //linkpage setsumei id
function setsumei_tsuika(idname){
var setsumei_flag = "";
  for(i=0; i<setsumei_array.length; i++){
    if (setsumei_array[i] == idname) {
    setsumei_flag = 1;
    }
  } 
  if (setsumei_flag != 1){
  setsumei_array.unshift(idname);
  }
// document.write(setsumei_array[0]);
}



function setsumei_show_hide(obj){

  if(document.getElementById){
  var setsumei_obj = document.getElementById('setsumei'+obj).style;
  var arrow_obj = document.getElementById('arrow'+obj);

  }else if(document.all){
  var setsumei_obj = document.all('setsumei'+obj).style;
  var arrow_obj = document.all('arrow'+obj);
  }else if(document.layers){
  document.layers['arrow'+obj].style.visibility = "hide";
  }

  if(document.layers == null){  
    if(setsumei_obj.display == "block"){
    setsumei_obj.display = "none";
    arrow_obj.src = "img/open.gif";
    }else{ 
    setsumei_obj.display = "block";
    arrow_obj.src = "img/close.gif";
    }
  }

}

function all_show_hide(status){

if(status == "open"){
var disp ="block";	
var arrow_img = "img/close.gif";
}else if (status == "close"){
var disp ="none";	
var arrow_img = "img/open.gif";
}

  if(document.getElementById){
    for (i=0; i<setsumei_array.length; i++){
    document.getElementById('setsumei'+i).style.display = disp;
    }
    for (j=0; j<setsumei_array.length; j++){
    document.getElementById('arrow'+j).src = arrow_img;
    }
  }else if(document.all){
    for (i=0; i<setsumei_array.length; i++){
    document.all('setsumei'+setsumei_array[i]).style.display = disp;
    }
	for (j=0; j<setsumei_array.length; j++){
    document.all('arrow'+j).src = arrow_img;

    }
//  }else if(document.layers){
//    for (i=0; i<setsumei_array.length; i++){
//    document.layers['setsumei'+setsumei_array[i]].style.display = "none";
//    }
//    for (j=0; j<setsumei_array.length; j++){
//    document.all('arrow'+j).src = "img/open.gif";
//    }	
}


}


function open_custom_win(open_url,wName,wWidth,wHeight){
window.name='oya';
sWidth = screen.availWidth;
sHeight = screen.availHeight;
x=(sWidth-wWidth)/2;
y=(sHeight-wHeight)/2;
z=window.open(open_url,wName,"menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width="+wWidth+",height="+wHeight);
z.moveTo(x,y);
}



//function hyouji(){ //test
//document.frm1.text1.value= preIMG_array;
//document.frm1.text2.value= kaisou+'img\/'+preIMG_array[0];

//}

//setTimeout("hyouji()",1000);
















//-->
