//External Link
$(function(){
  $('a[href^="http"]').not('[href^="http://www.omotesando-implant.jp/"]').attr({ target: "_blank" });
  //$('a[href^="http"]').not('[href^="http://oic.localhost/"]').attr({ target: "_blank" });
});

$(function() {
  $('.top_news dt:even,.top_news dd:even').css("background-color", "#F8F9F3");
});

// Fade Navi
$(function(){
  $('#gnavi li a,.contact li a').each(function(index,dom){
    $(dom).hover(function(){
      $(dom).find('img').fadeTo("400", 0);
    },
    function(){
      $(dom).find('img').fadeTo("200", 1);
    });
  });
});

$(function(){
  $('#frontpage .child').css({'display':'none'});
  $('#frontpage .menu li.parent>a').click(function(){
    $(this).next().slideToggle("normal");
    return false;
  });
});

$(function(){
  $('#side .menu a').not('.logo_side a').each(function(){
    var current = $(this).attr('href');
    if(current == location.pathname){
      $(this).addClass('active');
	}
  });
});


/*
$(function(){
  $('.menu li a').hover(function(){
  $(this).animate({
  color:'#836c13',
  backgroundColor:'#ECEBDC'},60);
  },function(){
  $(this).animate({
  color:'#B29526',
  backgroundColor:'#F5F4EE'},400);
  });
});
*/

// Image Rollover
$(function(){
  $("img[src*='RO']").not("[src*='_on.']").each(function(){
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    $(this).hover(
      function(){this.src = imgsrc_on;},
      function(){this.src = imgsrc;}
    );
  });
});

// Scroll Top
$(function(){
  $('a[href^=#]').click(function() { 
  var href= this.hash; 
  var $target = $(href == '#top' ? 'body' : href);
    if($target.size()) {
      var top = $target.offset().top;
      $($.browser.safari ? 'body' : 'html').animate({scrollTop:top}, 600, 'swing');
    }
  return false;
  });
});

$(function(){
$('#gnavi a').each(function(){
var current = $(this).attr('href');
if(current == location.pathname){
$(this).find('img').css("opacity" , "0");
}
});
});
