function ro() {
  var d = document;
  if(d.images){
    if(!d.MM_p) d.MM_p=new Array();
    var anchorFields = d.getElementsByTagName('A');
    for ( var i =0; i <anchorFields.length ; i++  ) {
      var anchor = anchorFields[i];
      if ( !anchor.firstChild ) continue;
      if ( !anchor.firstChild.src ) continue;
      if ( new String(anchor.firstChild.src).match(/-out-/) ) {
        var src_on  = new String(anchor.firstChild.src).replace(/-out-/,'-on-') ;
        anchor.onmouseover = function () {this.firstChild.src = this.firstChild.src.replace(/-out-/,'-on-')};
        anchor.onmouseout  = function () {this.firstChild.src = this.firstChild.src.replace(/-on-/,'-out-')};
        d.MM_p[i] = new Image;
        d.MM_p[i].src = src_on;
      }
    }
  }
}

function ow(url,myWidth,myHeight,myWin){

  if(!myWidth ) myWidth=640
  if(!myHeight) myHeight=300
  if(!myWin   ) myWin='_blank'
  myWin=window.open( url,myWin,"resizable=yes,scrollbars=yes,width="+myWidth+",height="+myHeight);
  myWin.focus();
}

$(function(){
  ro();
  $(".svcin_tb tr:even").addClass("svcin_tb_gray");
  $(".company_tb tr:even").addClass("company_tb_gray");
  $("a[href*='#']").slideScroll();
 });

$.fn.slideScroll = function(options){
  var c = $.extend({
    interval: 10, // 変化はあんまりないかも
    easing: 2.0, // 0.4 ~ 2.0 くらいまで
    comeLink: false
  },options);
  var d = document;
  // timerとposのscopeを$.fn.slideScroll内に限定する
  var timer;
  var pos;
  // スクロール開始時の始点を得る
  function currentPoint(){
    var current = {
      x: d.body.scrollLeft || d.documentElement.scrollLeft,
      y: d.body.scrollTop || d.documentElement.scrollTop
    }
    return current;
  }
  function setPoint(){
    var h = d.documentElement.clientHeight;
    var w = d.documentElement.clientWidth;
    var maxH = d.documentElement.scrollHeight;
    var maxW = d.documentElement.scrollWidth;
    pos.top = ((maxH-h)<pos.top && pos.top<maxH) ? maxH-h : pos.top;
    pos.left = ((maxW-w)<pos.left && pos.left<maxW) ? maxW-w : pos.left;
  }
  function nextPoint(){
    var x = currentPoint().x;
    var y = currentPoint().y;
    var sx = Math.ceil((x - pos.left)/(5*c.easing));
    var sy = Math.ceil((y - pos.top)/(5*c.easing));
    var next = {
      x: x - sx,
      y: y - sy,
      ax: sx,
      ay: sy
    }
    return next;
  }
  function scroll(){
    timer = setInterval(function(){
      nextPoint();
      if(Math.abs(nextPoint().ax)<1 && Math.abs(nextPoint().ay)<1){
        clearInterval(timer);
        window.scroll(pos.left,pos.top);
      }
      window.scroll(nextPoint().x,nextPoint().y);
    },c.interval);
  }
  function comeLink(){
    if(location.hash){
      if($(location.hash) && $(location.hash).length>0){
        pos = $(location.hash).offset();
        setPoint();
        window.scroll(0,0);
        if($.browser.msie){
          setTimeout(function(){
            scroll();
          },50);
        }else{
          scroll();
        }
      }
    }
  }
  if(c.comeLink) comeLink();
  $(this).each(function(){
    if(this.hash && $(this.hash).length>0
      && this.href.match(new RegExp(location.href.split("#")[0]))){
      var hash = this.hash;
      $(this).click(function(){
        pos = $(hash).offset();
        clearInterval(timer);
        setPoint();
        scroll();
        return false;
      });
    }
  });
}

function FormSubmit(c,pk,sk) {
  document.form1.c.value=c;
  document.form1.pk.value=pk;
  document.form1.sk.value=sk;
  document.form1.submit();
}


