// Rollover
$(function(){
$(".rollover").mouseover(function(){
$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_on$2"));
}).mouseout(function(){
$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/,"$1$2"));
}).each(function(){
$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_on$2"));
});
});
/*
$(function(){
$("#sidebar .nav span").css("display","none");
$("#sidebar .nav dt").click(function(){
$(this).next().slideToggle("fast");
return false;
});
});
*/
$(function(){
   // #で始まるアンカーをクリックした場合に処理
   $('a[href^=#]').click(function() {
      // スクロールの速度
      var speed = 400;// ミリ秒
      // アンカーの値取得
      var href= $(this).attr("href");
      // 移動先を取得
      var target = $(href == "#" || href == "" ? 'html' : href);
      // 移動先を数値で取得
      var position = target.offset().top;
      // スムーススクロール
      $($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, speed, 'swing');
      return false;
   });
});
// フォームに初期で入っている文字
$(function(){
$(".f_name").val("（例）太郎")
.one("focus",function(){
$(this).val("");
}).blur(function(){
if($(this).val()==""){
$(this).val("（例）太郎")
.one("focus",function(){
$(this).val("");
});
}
});
});

$(function(){
$(".l_name").val("（例）日本")
.one("focus",function(){
$(this).val("");
}).blur(function(){
if($(this).val()==""){
$(this).val("（例）日本")
.one("focus",function(){
$(this).val("");
});
}
});
});

$(function(){
$(".mail").val("（例）nihon@example.co.jp")
.one("focus",function(){
$(this).val("");
}).blur(function(){
if($(this).val()==""){
$(this).val("（例）nihon@example.co.jp")
.one("focus",function(){
$(this).val("");
});
}
});
});

$(function(){
$(".ad_number").val("（例）123-0001")
.one("focus",function(){
$(this).val("");
}).blur(function(){
if($(this).val()==""){
$(this).val("（例）123-0001")
.one("focus",function(){
$(this).val("");
});
}
});
});

$(function(){
$(".tel").val("（例）03-123-0000")
.one("focus",function(){
$(this).val("");
}).blur(function(){
if($(this).val()==""){
$(this).val("（例）03-123-0000")
.one("focus",function(){
$(this).val("");
});
}
});
});

$(function(){
$(".ad").val("（例）東京都")
.one("focus",function(){
$(this).val("");
}).blur(function(){
if($(this).val()==""){
$(this).val("（例）東京都")
.one("focus",function(){
$(this).val("");
});
}
});
});
