// JavaScript Document
function globalNnavi(mode){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="760" height="148" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">\n');
document.write('<param name="movie" value="http://www.amayahome.com/image/global_navi.swf" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="wmode" value="transparent" />\n');
document.write('<param name="bgcolor" value="#ffffff" />\n');
document.write('<param name="flashvars" value="menumode='+mode+'">\n');
document.write('<embed src="http://www.amayahome.com/image/global_navi.swf" quality="high" bgcolor="#ffffff" width="760" height="148" name="navigator" align="middle" play="true" loop="false" quality="high" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashvars="menumode='+mode+'" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>\n');
document.write('<\/object>\n');
}

function photocubic(){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="191" height="172" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">\n');
document.write('<param name="movie" value="http://www.amayahome.com/image/photocubic.swf" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="#ffffff" />\n');
document.write('<embed src="http://www.amayahome.com/image/photocubic.swf" quality="high" bgcolor="#ffffff" width="191" height="172" name="navigator" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>\n');
document.write('<\/object>\n');
}

function pr(){
var imglist = new Array("top9.swf","top10.swf");
var selectnum = Math.floor((Math.random()*100)) % imglist.length;
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="416" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">\n');
document.write('<param name="movie" value="http://www.amayahome.com/image/'+imglist[selectnum]+'" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="#ffffff" />\n');
document.write('<embed src="http://www.amayahome.com/image/'+imglist[selectnum]+'" quality="high" bgcolor="#ffffff" width="416" height="300" name="navigator" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>\n');
document.write('<\/object>\n');
}

function nextmore(mode,id){
	if (document.getElementById){
		if(mode=='body'){
			document.getElementById('body'+id).style.display = "block";
			document.getElementById('more'+id).style.display = "none";
			location.href = '#'+id;
            return true;
		}else if(mode=='more'){
			document.getElementById('body'+id).style.display = "none";
			document.getElementById('more'+id).style.display = "block";
			location.href = '#'+id;
            return true;

		}
	}
}
function showHide(entryID, entryLink, htmlObj) {
    extTextDivID = ('Text' + (entryID));
    extLinkDivID = ('Link' + (entryID));
    if( document.getElementById ) {
        if( document.getElementById(extTextDivID).style.display ) {
            if( entryLink != 0 ) {
                document.getElementById(extTextDivID).style.display = "block";
                document.getElementById(extLinkDivID).style.display = "none";
                htmlObj.blur();
            } else { 
                document.getElementById(extTextDivID).style.display = "none";
                document.getElementById(extLinkDivID).style.display = "block";
            }
        } else {
            location.href = entryLink;
            return true;
        }
    } else {
        location.href = entryLink;
        return true;
    }
}
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];}
}
function openwindowMap(url,width,height)
{
	sw = screen.availWidth;
	sh = screen.availHeight;
	wl = (sw - width)/2;
	wt = (sh - height)/2;
	window.open(url, '_blank','width='+width+',height='+height+',scrollbars=yes,left='+wl+',top='+wt);
}
function openwindowAdc(url,width)
{
	sw = screen.availWidth;
	sh = screen.availHeight;
	height = sh;
	wl = (sw - width)/2;
	wt = (sh - height)/2;
	window.open(url, '_blank','width='+width+',height='+height+',scrollbars=yes,left=0,top=0');
}
function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();		//印刷をします
	}
}
function changeBlock(mode,id){
	if (document.getElementById){
		if(mode=='entry'){
			document.getElementById('entry'+id).style.display = "block";
			document.getElementById('comment'+id).style.display = "none";
			document.getElementById('trackback'+id).style.display = "none";
			location.href = '#'+id;
            return true;
		}else if(mode=='comment'){
			document.getElementById('entry'+id).style.display = "none";
			document.getElementById('comment'+id).style.display = "block";
			document.getElementById('trackback'+id).style.display = "none";
			location.href = '#'+id;
            return true;
		}else if(mode=='trackback'){
			document.getElementById('entry'+id).style.display = "none";
			document.getElementById('comment'+id).style.display = "none";
			document.getElementById('trackback'+id).style.display = "block";
			location.href = '#'+id;
            return true;
		}
	}
}
function copyright(){
	myD = new Date();
	myYear = myD.getFullYear();
	document.write('<p>Copyright(C)'+myYear+' Sunrise Japan Group, all right reserved.</p>\n');
}


/**
 * scroll
 */


var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var Moz = navigator.userAgent.indexOf("Gecko") != -1;
var Vmajor = parseInt(navigator.appVersion);
var Vminor = parseFloat(navigator.appVersion);

var MacIE4 = ((Mac && navigator.appVersion.indexOf('MSIE 4.',0) != -1));
var MacIE3 = ((Mac && navigator.appVersion.indexOf('MSIE 3.',0) != -1));

function getScrollLeft() { 
 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() { 
 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() { 
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollWidth;
 } else if (window.innerWidth) {
  return window.innerWidth;
 }
 return 0;
}

function getScrollHeight() { 
 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) { 
 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;

 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 JumpTop() {
 if (!MacIE3 && !MacIE4 && !NN && window.scrollTo || NN && (Vminor >= 4.75) && window.scrollTo) {
  pageScroll(0,0,6);
 } else {
  location.hash = "top";
 }
}


