function getScrollLeft() { 
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {

  /*WinIE6標準モード稼動オブジェクト差異対応
    WinIE6標準モードとそれ以外で、それぞれ稼動しているオブジェクトを取り出す*/
  docele=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;

  return docele.scrollLeft;

 } else if (window.pageXOffset) {
  return window.pageXOffset;
 } else {
  return 0;
 }
}

function getScrollTop() { 
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {

  /*WinIE6標準モード稼動オブジェクト差異対応
    WinIE6標準モードとそれ以外で、それぞれ稼動しているオブジェクトを取り出す*/
  docele=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;
  
  return docele.scrollTop;

 } else if (window.pageYOffset) {
  return window.pageYOffset;
 } else {
  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;

 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() { 
  pageScroll(0,0,3);
}


/*-------------------------------------------------------------
▼ロールオーバー
-------------------------------------------------------------*/

$(function(){
        $('a img').hover(function(){
                $(this).animate({opacity:0.4},520,function(){
                        $(this).animate({opacity:1},520);
                        });
        },
        function(){
        });
});

/*-------------------------------------------------------------
▼文字カウント
-------------------------------------------------------------*/

   function ShowLength1( str ) {
      document.getElementById("inputlength1").innerHTML = str.length + "文字";
   }
   
   function ShowLength2( str ) {
      document.getElementById("inputlength2").innerHTML = str.length + "文字";
   }
   
   function ShowLength3( str ) {
      document.getElementById("inputlength3").innerHTML = str.length + "文字";
   }
   
   function ShowLength4( str ) {
      document.getElementById("inputlength4").innerHTML = str.length + "文字";
   }
   
   function ShowLength5( str ) {
      document.getElementById("inputlength5").innerHTML = str.length + "文字";
   }
 
   function ShowLength6( str ) {
      document.getElementById("inputlength6").innerHTML = str.length + "文字";
   }
