$(document).ready(function(){
var bodyid = $("body").attr("id");
	//gloval navi
	$("#headerNew ul.gn li a").mouseover(function(){
		if(!$(this).hasClass("on")){$(this).animate({opacity:1},'fast')};
		}).mouseout(function(){if(!$(this).hasClass("on")){$(this).animate({opacity:0},'fast')}});
	if($("body").hasClass("mansion")){
		$("#headerNew ul.gn li.gn01 a").css("opacity",1).addClass("on");
	}else if($("body").hasClass("kodate")){
		$("#headerNew ul.gn li.gn02 a").css("opacity",1).addClass("on");
	}else if($("body").hasClass("tochi")){
		$("#headerNew ul.gn li.gn03 a").css("opacity",1).addClass("on");
	}else if($("body").hasClass("sell")){
		$("#headerNew ul.gn li.gn04 a").css("opacity",1).addClass("on");
	}else if($("body").hasClass("lease")){
		$("#headerNew ul.gn li.gn05 a").css("opacity",1).addClass("on");
	}else if($("body").hasClass("management")){
		$("#headerNew ul.gn li.gn06 a").css("opacity",1).addClass("on");
	}
	/*
	Blank Link Opener
	=============================================== */
	$('a.blank').click(function(){window.open(this.href, '_blank'); return false;});
	/*
	Kill the line when click on IE
	=============================================== */
	if($.browser.msie){
		$("a,area,map,img").focus(function(){$(this).blur()});
		$("a,area,map,img").live("focus", function(){$(this).blur()});
	};
	$("#column").columnPlugin();
	$("#subBnrs a img").mouseover(function(){$(this).animate({opacity:0.6},'fast')}).mouseout(function(){$(this).animate({opacity:1},'fast')});
	$('#mtSearchArchive div.sprits').pager('div.sprit');
	$("#mtSearchArchive div.sprits").each(function(){
		var k =0;
		$("div.item").each(function(k){
			k = k+1;
			if(k==1||k==2)$(this).addClass("top");
		});
		$(this).find("div.item").heightfix({clear:2});
	});
	$("#mtSearchArchive").find("div.item").mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	})
if(bodyid=="top"){
	var viewCount = 10; //1ページ表示数
	var jsonData = null;
	var i = 0;
	var itemHtml = '';
	var newList  = '';
	var jsonDataURL = "/mansion/mansion.json";
	$.getJSON(jsonDataURL,function(json){
		jsonData = json;
		$.ajaxSetup({cache:false});
		for(var index in json['item']){
			i = i+1;
			if(viewCount>=i){
				var titletrim = json['item'][index]['title'];
				if(titletrim.length>20){titletrim = titletrim.substring(0,19) + "..."}
				itemHtml += '\n<div class="item">\n<div class="iteminner">\n';
				itemHtml += '<p class="img"><img src="' + json['item'][index]['photo'] + '" width="300" alt="" /></p>\n';
				itemHtml += '<div>\n<h3>'+ titletrim +'</h3>\n<p class="txt">'+ json['item'][index]['access'] +'</p>\n</div>\n';
				itemHtml += '<p class="link"><a href="'+ json['item'][index]['file'] +'">物件詳細</a></p>\n';
				itemHtml += '</div>\n</div>\n';
				if(viewCount==i){
					newList += json['item'][index]['title'] +'...';
				}else{
					newList += json['item'][index]['title'] +' , ';
				}
			}else{
				break;
			}
		};
		$("div.imgChange .inner").append(itemHtml);
		$("div.newList p").append(newList);
		topimg(".imgChange .inner .item",5,1); //対象リスト,切替秒,エフェクト秒
	});
	$("div.newList .inner").live("mouseover",function(){
		$(this).css("opacity",0.8)
	}).live("mouseout",function(){
		$(this).css("opacity",1)
	}).live("click",function(){
		location.href = $(this).find("a").attr("href");
	});
	$("#linkArea .buy ul.toptab li a").click(function(){
		if($(this).hasClass("on")){
			return false;
		}else{
			$("#linkArea .buy ul.toptab li a.on").removeClass("on");
			$("#linkArea .buy div.on").removeClass("on");
			$(this).addClass("on");
			$("#linkArea .buy div."+ $(this).parent().attr("class")).addClass("on");
			return false;
		}
	});
	var searchForm = "form#wordsearch";
	var searchInput = ".buysearch input";
	var defword = "地名､駅名､物件名など";
	if($(searchForm).find(searchInput).val()==("")){$(searchForm).find(searchInput).val(defword).addClass("off")};
	$(searchForm).find(searchInput).focus(function(){if($(this).val()==(defword)){$(this).val("").removeClass("off")}});
	$(searchForm).find(searchInput).blur(function(){if($(this).val()==("")){$(this).val(defword).addClass("off")}});
	$(searchForm).submit(function(){
		searchAction()
	});
	$(searchForm).find("a").click(function(){
		searchAction();
	});
	function searchAction(){
		if($(searchForm).find(searchInput).val()==""||$(searchForm).find(searchInput).val()==(defword)){
			alert("入力値をご確認ください");
		}else{
			var k = encodeURIComponent($(searchForm).find(searchInput).val());
			var searchval = "?k="+ k;
			if($("#linkArea ul.toptab li.tab3 a").hasClass("on")){
				location.href = "search/tochi.html"+searchval;
			}else if($("#linkArea ul.toptab li.tab2 a").hasClass("on")){
				location.href = "search/kodate.html"+searchval;
			}else{
				location.href = "search/mansion.html"+searchval;
			}
		}
	}
	$("#chumoku").chumokuPlugin({jsonurl:"/mansion/mansion.json"});
// TOP ここまで //
}
if(bodyid=="staff"){
		$("#staff #mainCol .shibuya div.staffIndex ul li").heightfix({clear:4});
		$("#staff #mainCol .yokohama div.staffIndex ul li").heightfix({clear:4});
}
if(bodyid=="catalog"){
		$("#mantion_catalog_archive").find("div.item").heightfix({clear:2});
}
if(bodyid=="leaseTop"){
		$("body #mainCol").find("div.item").heightfix({clear:2});
	$("div.sprits").each(function(){
		var k =0;
		$("div.item").each(function(k){
			k = k+1;
			if(k==1||k==2)$(this).addClass("top");
		});
		$(this).find("div.item").heightfix({clear:2});
	});
	$("div.sprits").find("div.item").mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	}).click(function(){
		location.href = $(this).find("a").attr("href");
	})
//leaseトップ
}
if(bodyid=="new"){
/*
	var viewCount = 12; //1ページ表示数
	var jsonData = null;
	var i = 0;
	var m = 0;
	var n = 0;
	var area1Html = '';
	var area2Html = '';
	var area3Html = '';
	var jsonDataURL = "/mansion/mansion.json";
	$.getJSON(jsonDataURL,function(json){
		jsonData = json;
		$.ajaxSetup({cache:false});
		for(var index in json['item']){
			if((json['item'][index]['area']).match("東京都")){
				i = i + 1;
				if(viewCount>=i){
					area1Html += '\n<div class="item">';
					area1Html += '<p class="img"><img src="' + json['item'][index]['photo'] + '" height="150" alt="" /></p>\n';
					area1Html += '<h3>'+ json['item'][index]['title'] +'</h3>\n';
					var priceval = json['item'][index]['price'];
					var priceval = addFigure(priceval);
					area1Html += '<p class="price"><strong>'+ priceval +'</strong>万円</p>\n';
					var bodyvalue = (json['item'][index]['body']).replace(/<br \/>/,'');
					bodyvalue = bodyvalue.replace(/\n/g,'');
					if(bodyvalue.length>60){bodyvalue = bodyvalue.substring(0,59) + "..."}
					area1Html += '<p class="txt">'+ bodyvalue +'</p>\n';
					area1Html += '<p class="link"><a href="'+ json['item'][index]['file'] +'">物件詳細</a></p>\n';
					area1Html += '</div>\n';
				}
			}
			if((json['item'][index]['area']).match("神奈川県")){
				m = m + 1;
				if(viewCount>=m){
					area2Html += '\n<div class="item">';
					area2Html += '<p class="img"><img src="' + json['item'][index]['photo'] + '" height="150" alt="" /></p>\n';
					area2Html += '<h3>'+ json['item'][index]['title'] +'</h3>\n';
					var priceval = json['item'][index]['price'];
					var priceval = addFigure(priceval);
					area2Html += '<p class="price"><strong>'+ priceval +'</strong>万円</p>\n';
					var bodyvalue = (json['item'][index]['body']).replace(/<br \/>/,'');
					bodyvalue = bodyvalue.replace(/\n/g,'');
					if(bodyvalue.length>60){bodyvalue = bodyvalue.substring(0,59) + "..."}
					area2Html += '<p class="txt">'+ bodyvalue +'</p>\n';
					area2Html += '<p class="link"><a href="'+ json['item'][index]['file'] +'">物件詳細</a></p>\n';
					area2Html += '</div>\n';
				}
			}
			if((json['item'][index]['area']).match("千葉県・埼玉県")){
				n = n + 1;
				if(viewCount>=n){
					area3Html += '\n<div class="item">';
					area3Html += '<p class="img"><img src="' + json['item'][index]['photo'] + '" height="150" alt="" /></p>\n';
					area3Html += '<h3>'+ json['item'][index]['title'] +'</h3>\n';
					var priceval = json['item'][index]['price'];
					var priceval = addFigure(priceval);
					area3Html += '<p class="price"><strong>'+ priceval +'</strong>万円</p>\n';
					var bodyvalue = (json['item'][index]['body']).replace(/<br \/>/,'');
					bodyvalue = bodyvalue.replace(/\n/g,'');
					if(bodyvalue.length>60){bodyvalue = bodyvalue.substring(0,59) + "..."}
					area3Html += '<p class="txt">'+ bodyvalue +'</p>\n';
					area3Html += '<p class="link"><a href="'+ json['item'][index]['file'] +'">物件詳細</a></p>\n';
					area3Html += '</div>\n';
				}
			}
		};
		$("div.area1NewList").append(area1Html);
		$("div.area2NewList").append(area2Html);
		$("div.area3NewList").append(area3Html);
	}).complete(function(){
	});
*/
	$('div.fourthFloatList').each(function(){$(this).find(".item h3").heightfix({clear:4});});
	$('div.fourthFloatList').each(function(){$(this).find(".item p.txt").heightfix({clear:4});});
	$("#mainCol div.item").live("mouseover",function(){
		$(this).css("opacity",0.8)
	}).live("mouseout",function(){
		$(this).css("opacity",1)
	}).live("click",function(){
		location.href = $(this).find("a").attr("href");
	});
// 新着情報 ここまで //
}
if(bodyid=="leaseTop"){
	var viewCount = 20; //1ページ表示数
	var jsonData = null;
	var i = 0;
	var leaseNewHtml = '';
	var jsonDataURL = "/lease/lease.json";
	$.getJSON(jsonDataURL,function(json){
		jsonData = json;
		$.ajaxSetup({cache:false});
		for(var index in json['item']){
				i = i + 1;
				if(viewCount>=i){
					leaseNewHtml += '\n<div class="item">';
					leaseNewHtml += '<p class="img"><img src="' + json['item'][index]['photo'] + '" height="150" alt="" /></p>\n';
					leaseNewHtml += '<h3>'+ json['item'][index]['title'] +'</h3>\n';
					leaseNewHtml += '<p class="sub">'+ json['item'][index]['sub'] +'</p>\n';
					var priceval = json['item'][index]['price'];
					var priceval = addFigure(priceval);
					leaseNewHtml += '<p class="price"><span>賃料</span><strong>'+ priceval +'</strong>万円</p>\n';
					var bodyvalue = (json['item'][index]['body']).replace(/<br \/>/,'');
					bodyvalue = bodyvalue.replace(/\n/g,'');
					if(bodyvalue.length>60){bodyvalue = bodyvalue.substring(0,59) + "..."}
					leaseNewHtml += '<p class="txt">'+ bodyvalue +'</p>\n';
					leaseNewHtml += '<p class="link"><a href="'+ json['item'][index]['file'] +'">物件詳細</a></p>\n';
					leaseNewHtml += '</div>\n';
				}
		};
		$("div.leaseNewList").append(leaseNewHtml);
	}).complete(function(){
		$('div.fourthFloatList').each(function(){$(this).find(".item h3").heightfix({clear:4});});
		$('div.fourthFloatList').each(function(){$(this).find(".item p.txt").heightfix({clear:4});});
	});
	$("#mainCol div.item").live("mouseover",function(){
		$(this).css("opacity",0.8)
	}).live("mouseout",function(){
		$(this).css("opacity",1)
	}).live("click",function(){
		location.href = $(this).find("a").attr("href");
	});
// 賃貸トップ ここまで //
}
});
/*  ================================================================================
Slide
================================================================================  */
function slide(box) {
var slide={
box:box,
speed :700,
pwid:648,
effect:"swing",
next:"p.next a",
prev:"p.prev a"
}
var navi  = box+' ul.navi';
var photo = box+' div.main_slide ul';
var ni = 0;var tw = 0;var i = 0;var mp = 0;
$(navi).find('img').mouseover(function(){$(this).animate({opacity:0.65},'fast');}).mouseout(function(){$(this).animate({opacity: 1.0},'fast');});
$(photo+' li').each(function(i){i++;
$(this).addClass("p"+i);
tw = tw + slide.pwid;
});
$(photo).css('width',tw);
$(navi).find('li').append('<span></span>');
$(navi).find('li').each(function(i){
	i++;
	$(this).addClass("p"+i);
	if(i==1){$(this).addClass("now")}
	$(this).click(function(){
	if(!$(this).hasClass('now')){
	var np = $(this).attr('class');
	$(photo).hide();
		$(photo).find('li').each(function(i){
		mp = $(this).attr('class');
		var n = 0-i*slide.pwid;
		if(mp==np){
if ($.browser.msie && $.browser.version == 7.0||$.browser.msie && $.browser.version == 8.0){
	$(photo).css('left',n+'px').show();
}else{
	$(photo).css('left',n+'px').fadeIn(slide.speed);
}
	};
	});
	};
	$(navi).find('li').each(function(){$(this).removeClass('now');});
	$(this).addClass('now');
	fe();
	return false;
	});
	fe();
});
$($(box).find(slide.next)).click(function(){
$(navi).find('li').each(function(i){i++;if($(this).hasClass('now')){ni=i+1};});
$(navi).find('li').each(function(i){
i++;
$(this).removeClass('now');
if(i==ni){$(this).addClass('now')
var now = (i-1)*slide.pwid;
$(photo).animate({left:0-now},slide.speed,slide.effect);
};
});
fe();
return false;
});
$($(box).find(slide.prev)).click(function(){
$(navi).find('li').each(function(i){i=i+0;if($(this).hasClass('now')){ni=i};});
$(navi).find('li').each(function(i){
i++;
$(this).removeClass('now');
if(i==ni){$(this).addClass('now')
var now = (i-1)*slide.pwid;
$(photo).animate({left:0-now},slide.speed,slide.effect);
};
});
fe();
return false;
});
function fe(){
$(navi).find('li').each(function(i){
i++;
if($(this).hasClass('now')){ni=i};
if(ni==i){
$(box).find(slide.next).css('display','none');
}else{
$(slide.box).find(slide.next).css('display','block');
}
});
if(ni==1){
$(box).find(slide.prev).css('display','none');
}else{
$(box).find(slide.prev).css('display','block');
};
};
}
/*  ================================================================================
	jQuery Google Map @ API3 ver
	2011 Kazuya Abe // http://ossi.co.jp/
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=panoramio"></script>
	<script type="text/javascript">
	$(function(){
		//住所指定
		$('#Box').gmap({address:'東京都中央区日本橋蛎殻町2-7-5',zoom:15,pano:true});
		//座標指定
		$('#Box').gmap({lat:'35.68348',lng:'139.7860018',zoom:15,pano:true});
	});
	</script>
================================================================================  */
(function($){
$.fn.gmap = function(options){
var options = jQuery.extend({
address:"",
zoom:17,
lat:'35.68348',
lng:'139.7860018',
icon:'/services/sale/sampleimage/mappoint.png', //空にするとGoogleデフォ表示
pano:false //パノラミオ ture or false;
},options);
var geocoder;
var map;
var mapdiv = $(this).get(0);
geocoder=new google.maps.Geocoder();
if(geocoder){
	if(options.address==""){
			var myOptions={
			zoom:options.zoom,
			center: new google.maps.LatLng(options.lat,options.lng),
			mapTypeId: google.maps.MapTypeId.ROADMAP,
			scaleControl: true,
			mapTypeControl: true
			};
			var map = new google.maps.Map(mapdiv,myOptions);
			var marker = new google.maps.Marker({
				icon:options.icon,
				position: myOptions.center,
				map:map
			});
			pano(map);
	}else{
	geocoder.geocode({'address':options.address},function(results,status){
		if(status==google.maps.GeocoderStatus.OK){
			var LL=results[0].geometry.location;
			var LLStr=new String(LL);
			LLStr=(LLStr.replace(/\(/ig,'')).replace(/\)/ig,'');
			var latlngStr=LLStr.split(',',2);
			var lat=latlngStr[0];
			var lng=latlngStr[1];
			var latlng=new google.maps.LatLng(lat,lng);
			var myOptions={
			zoom:options.zoom,
			center: new google.maps.LatLng(lat,lng),
			mapTypeId: google.maps.MapTypeId.ROADMAP,
			scaleControl: true,
			mapTypeControl: true
			};
			var map = new google.maps.Map(mapdiv,myOptions);
			var marker = new google.maps.Marker({
				icon:options.icon,
				position: myOptions.center,
				map:map
			});
			pano(map);
		}else{
			$(mapdiv).html("<p>「"+options.address + "」は見つかりませんでした。</p>");
		}
	})
	}
	function pano(map){
		if(options.pano==true){
			panophoto = new google.maps.panoramio.PanoramioLayer();
			panophoto.setMap(map);
		}
	}
}
};
})(jQuery);
/*  ================================================================================
返済 月々～
$('dl.loan').loanAns({money:3500,kinri:1.075,kikan:30});
================================================================================  */
(function($){
$.fn.loanAns=function(options){
var options = jQuery.extend({
money:'3000',
kinri:'1.075',
kikan:'35'
},options);
var list = $(this);
var keisan1 = options.kinri / 12 / 100;
var keisan2 = Math.pow(1+keisan1,options.kikan*12);
var ans = options.money * 10000 * keisan1 * keisan2 / ( keisan2 - 1);
//ans = Math.round(ans);
ans = Math.floor(ans);
ans = new String(ans).replace(/,/g, "");
while(ans != (ans = ans.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
return this.each(function(){
$(list).find(".ans span").append(ans);
$(list).find(".kinri span").append(options.kinri);
$(list).find(".kikan span").append(options.kikan);
});
};
})(jQuery);
/*  ================================================================================
キーワード検索
================================================================================  */
function TopSearchBox(){
	var searchForm = "form#wordsearch";
	var searchInput = ".buysearch input";
	var defword = "地名､駅名､物件名など";
	if($(searchForm).find(searchInput).val()==("")){$(searchForm).find(searchInput).val(defword).addClass("off")};
	$(searchForm).find(searchInput).focus(function(){if($(this).val()==(defword)){$(this).val("").removeClass("off")}});
	$(searchForm).find(searchInput).blur(function(){if($(this).val()==("")){$(this).val(defword).addClass("off")}});
	$(searchForm).submit(function(){
		searchAction()
	});
	$(searchForm).find("a").click(function(){
		searchAction();
	});
	function searchAction(){
		if($(searchForm).find(searchInput).val()==""||$(searchForm).find(searchInput).val()==(defword)){
			alert("入力値をご確認ください");
		}else{
			var k = encodeURIComponent($(searchForm).find(searchInput).val());
			var searchval = "?k="+ k;
			var bodyClass = $("body").attr("class");
			if(bodyClass=="tochi"){
				location.href = "/search/tochi.html"+searchval;
			}else if(bodyClass=="kodate"){
				location.href = "/search/kodate.html"+searchval;
			}else if(bodyClass=="lease"){
				location.href = "/search/lease.html"+searchval;
			}else{
				location.href = "/search/mansion.html"+searchval;
			}
		}
	}
}
/*  ================================================================================
ラベル制御
================================================================================  */
$(document).ready(function(){
$(".kensaku_form ul.tree li label").live("click",function(){
		$(this).find("input").each(function(){
			var tv = $(this).get(0).checked;
			if(tv==true){
				$(this).parent().parent().parent("li").addClass("checked");
				$(this).parent().parent().parent().find("ul input").each(function(){$(this).attr("checked","checked").attr("disabled","disabled").parent().parent().addClass("disabled")});
			}else{
				$(this).parent().parent().parent("li").removeClass("checked");
				$(this).parent().parent().parent().find(".checked").each(function(){$(this).removeClass("checked");});
				$(this).parent().parent().parent().find("ul input").each(function(){$(this).attr("checked",false).attr("disabled",false).parent().parent().removeClass("disabled")});
			}
	});
});
});
/*
　数字カンマ付与
____________________________________________________________________________________________________________________*/
function addFigure(str) {
var num = new String(str).replace(/,/g, "");
while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
return num;
}
/*
	heightfix JavaScript MIT-style license.
	2011 Kazuya Abe // http://ossi.co.jp/
	$('#gallery ul.index li').heightfix();	：	一番高い要素に揃える
	$('#gallery ul.index li').heightfix({clear:5});		5個ずつ高さ揃え
	$('#gallery ul.index li').heightfix({tc:'turn'});	:	折り返し	class="turn"
	$('#gallery ul.index li').heightfix({sc:'start'});	:	各行開始	class="start"
______________________________________________________________________________________________________________________*/
(function($,s){
var s=0;
$.fn.heightfix=function(options){
var options = jQuery.extend({
clear: 9999,
tc:'turn',
sc:'start'
},options);
var m=0; var n=0; s++;
if(options.clear==0||options.clear==null){clear=9999};
$(this).each(function(i){i++;
if(i%options.clear==0){$(this).addClass(options.tc);}
if(i%options.clear==1){n++; $(this).css('clear','both').addClass(options.sc)}
$(this).addClass('heightfixgroup'+ s + n);
});
for(m=1;m<=n;m++){var mt=0;
$(".heightfixgroup"+s+m).each(function(){
var thisHeight = $(this).height();
if(thisHeight>mt){mt=thisHeight};
});
$(".heightfixgroup"+s+m).height(mt);
};
};
})(jQuery);
/*
　recomendLoad
____________________________________________________________________________________________________________________*/
(function($){
$.fn.recomendLoad = function(options){
	var options = jQuery.extend({
		jsonurl:"/mansion/mansion.json",
		viewcount:3,
		keyword:"",
		parking:false,
		lease:false,
		entrytitle:""
	},options);
	var list = $(this);
	var itemHtml = "";
	var m = 0;
	var jsonData = null;
	var thishref = location.href;
	function rnd(min,max,num){
		var a=new Array();
		for (var i=min;i<=max;i++){
		a[i]=i;
		}
		for (var i=min;i<=(min+num-1);i++){
		var p1 = i+Math.floor(Math.random()*(max-i+1));
		var p2 = a[i];
		a[i]=a[p1];
		a[p1]=p2;
		}
		c="";
		for (var i=min;i<=(min+num-1);i++){
		c+=(c=="")?	a[i]:","+a[i];
		}
		return c;
	}
	$.getJSON(options.jsonurl,function(json){
		jsonData = json;
		$.ajaxSetup({cache:false});
		itemHtml +=	'<div class="inner">\n<h2>この物件を見た人はこんな物件も見ています。</h2>\n';
		for(var index in json['item']){
//			var t = json['item'][index]['title'];
			var f = json['item'][index]['file'];
			if(f!=thishref){
				var k = json['item'][index]['address'];
				if(k.match(options.keyword)){
					m = m + 1;
					itemHtml +=	'<div class="item hide">\n<h3>'+ (json['item'][index]['title']) + '</h3>\n';
					itemHtml +=	'<p class="img"><img src="'+ (json['item'][index]['photo']) + '" height="168" alt="" /></p>\n';
					if(options.parking==true){
					itemHtml +=	'<p class="price">賃料<strong>'+ addFigure(json['item'][index]['price']) + '</strong>円</p>\n';
					}else if(options.lease==true){
					itemHtml +=	'<p class="price">賃料<strong>'+ addFigure(json['item'][index]['price']) + '</strong>万円</p>\n';
					}else{
					itemHtml +=	'<p class="price"><strong>'+ addFigure(json['item'][index]['price']) + '</strong>万円</p>\n';
					}
					var bodyvalue = (json['item'][index]['body']).replace(/<br \/>/,'');
					bodyvalue = bodyvalue.replace(/\n/g,'');
					if(bodyvalue.length>41){bodyvalue = bodyvalue.substring(0,42) + "..."}
					itemHtml += '<p class="txt">'+ bodyvalue +'</p>\n';
					itemHtml +=	'<p class="link"><a href="'+ (json['item'][index]['file']) + '">物件詳細</a></p>\n';
					itemHtml +=	'</div>\n';
				}
			}
		};
		if(m>=options.viewcount){
						return false;
		}
	}).complete(function(){
		itemHtml +=	'</div>\n';
		if(m==0){$(list).remove()}else{
		$(list).html(itemHtml);
		var c = rnd(1,m,options.viewcount);
		var resArray = c.split(",");
		for(var i=0 ; i < resArray.length ; i++ ) {
			$(list).find("div.item:nth("+ (resArray[i]-1) +")").show().addClass("show");
		}
		$(list).find("div.show:last").addClass("end");
		$(list).find("div.item").mouseover(function(){
			$(this).addClass("hover");
		}).mouseout(function(){
			$(this).removeClass("hover");
		}).click(function(){
			location.href = $(this).find("a").attr("href");
		})
		}
	});
}
})(jQuery);
/*
　注目物件
____________________________________________________________________________________________________________________*/
(function($){
$.fn.chumokuPlugin = function(options){
var options = jQuery.extend({
	jsonurl:"/mansion/mansion.json",
	maxview:10
},options);
var contentType = $("body").attr("class");
var list = $(this);
var searchid = "";
var itemHtml = "";
var i = 0;
var m = 0;
var jsonData = null;
return this.each(function(){
	$.getJSON(options.jsonurl,function(json){
		jsonData = json;
		$.ajaxSetup({cache:false});
		for(var index in json['item']){
			if(json['item'][index]['chumoku']){
				m = m + 1;
				itemHtml +=	'<div class="item">\n<h3>'+ (json['item'][index]['title']) + '</h3>\n';
				itemHtml +=	'<p class="img"><img src="'+ (json['item'][index]['photo']) + '" height="150" alt="" /></p>\n';
				if(contentType=="kodate"||contentType=="tochi"){
						if(contentType=="kodate"){
							itemHtml += '<span class="sub">'+ (json['item'][index]['sub']) +'</span>';
						}
					itemHtml +=	'<div class="clrFix">\n<p class="m2">土地面積<br/>'+ (json['item'][index]['menseki']) + 'm<sup>2</sup></p>\n';
				}else{
					itemHtml +=	'<div class="clrFix">\n<p class="m2">専有面積<br/>'+ (json['item'][index]['menseki']) + 'm<sup>2</sup></p>\n';
				}
				itemHtml +=	'<p class="price"><strong>'+ addFigure(json['item'][index]['price']) + '</strong>万円</p>\n</div>\n';
				var bodyvalue = (json['item'][index]['body']).replace(/<br \/>/,'');
				bodyvalue = bodyvalue.replace(/\n/g,'');
				if(bodyvalue.length>59){bodyvalue = bodyvalue.substring(0,60) + "..."}
				itemHtml +=	'<p class="txt">'+ bodyvalue + '</p>\n';
				itemHtml +=	'<p class="link"><a href="'+ (json['item'][index]['file']) + '">物件詳細</a></p>\n';
				itemHtml +=	'</div>\n';
			}
			if(m>=options.maxview){
				return false;
			}
		};
	}).complete(function(){
		if(m==0){
		$(list).remove()
		}else{
		$(list).append(itemHtml)
		$(list).find("div.item").heightfix({clear:2});
		$(list).find("div.item").mouseover(function(){
			$(this).addClass("hover");
		}).mouseout(function(){
			$(this).removeClass("hover");
		}).click(function(){
			location.href = $(this).find("a").attr("href");
		})
		}
	});
	});
};
})(jQuery);
/*
　物件コラム
____________________________________________________________________________________________________________________*/
(function($){
$.fn.columnPlugin = function(options){
	var options = jQuery.extend({
	xml:"/services/sale/rss.xml",
	maxview:3
	},options);
	var list = $(this);
	var itemHtml = "";
	return this.each(function(){
		$.get(options.xml,function(data){
			$.ajaxSetup({cache:false});
			$('entry',data).each(function(i){
			i = i+1;
			var title = $('title',this).text();
			var url   = $('url', this).text();
			var text  = $('body',this).text();
			if(title.length>14){title = title.substring(0,13) + "..."}
			if(text.length>35){text = text.substring(0,34) + "..."}
			if(i==options.maxview){
			itemHtml += '<dl class="endchild">\n<dt>' + title +'</dt>\n';
			}else{
			itemHtml += '<dl>\n<dt>' + title +'</dt>\n';
			}
			itemHtml += '<dd><a href="' + url + '">'+ text +' [続きを読む]</a></dd>\n</dl>\n';
			});
		}).complete(function(){
			$(list).append(itemHtml)
			$("#mainCol div#column h2").mouseover(function(){
				$(this).css("opacity",0.7);
			}).mouseout(function(){
				$(this).css("opacity",1);
			});
			$("#mainCol div#column h2").click(function(){
				location.href= '/services/sale/';
			});
		});
	});
}
})(jQuery);
/*
	Image Rote / Jquery JavaScript MIT-style license.
	2011 Kazuya Abe // http://ossi.co.jp/
______________________________________________________________________________________________________________________*/
function topimg(mv,second,speed){
var tm = "topimg";
tm += Math.floor(Math.random() * length) + 1;
	var second = (second*1000)+(speed*1000);
	var speed  = speed*1000;
	var totalimg = $(mv).size();
	var mv = mv;
	var ran = Math.floor(Math.random()*totalimg);
//	var ran = 0;
	var i = 0;
	var ran2 = null;
	$(mv).css("opacity",0);
	$(mv+":nth("+ran+")").addClass("now").animate({opacity:1},speed);
	if(totalimg>=1){
			tm = setInterval(mvchange,second);
		}else{
			$(mv).addClass("now").animate({opacity:1},speed);
	}
	function mvchange(){
		$(mv).each(function(i){
			if($(this).hasClass("now")){
				ran2 = i;
			};
			i++;
		});
		var ran = Math.floor(Math.random()*totalimg);
		if(ran==ran2){
			mvchange()
		}else{
			clearInterval(tm);
			$(mv+".now").addClass("old").removeClass("now");
			$(mv+":nth("+ran+")").addClass("now").animate({opacity:1},{duration:speed,easing:"swing",complete:function(){
				$(mv+".old").css("opacity",0).removeClass("old");
				tm = setInterval(mvchange,second);
			}});
		}
	}
}
/*
　staffLoad
____________________________________________________________________________________________________________________*/
(function($){
$.fn.staffLaod = function(options){
	var options = jQuery.extend({
		jsonurl:"/staff/staff.json",
		t1:"渋谷本社",
		t2:"賃貸営業課",
		staff:"",
		viewcount:1
	},options);
	var list = $(this);
	var itemHtml = "";
	var m = 0;
	var n = 0;
	var n2 = 0;
	var n3 = 0;
	var n4 = 0;
	var l = 0;
	var jsonData = null;
	function rnd(min,max,num){
		var a=new Array();
		for (var i=min;i<=max;i++){
		a[i]=i;
		}
		for (var i=min;i<=(min+num-1);i++){
		var p1 = i+Math.floor(Math.random()*(max-i+1));
		var p2 = a[i];
		a[i]=a[p1];
		a[p1]=p2;
		}
		c="";
		for (var i=min;i<=(min+num-1);i++){
		c+=(c=="")?	a[i]:","+a[i];
		}
		return c;
	}
	var staffCount = 0;
	$.getJSON(options.jsonurl,function(json){
		jsonData = json;
		$.ajaxSetup({cache:false});
		for(var index in json['item']){
			if((json['item'][index]['tenpo2']).match("仲介営業部")&&(json['item'][index]['tenpo']).match("渋谷本社")){
				n  = n +1;
			}else	if((json['item'][index]['tenpo2']).match("仲介営業部")&&(json['item'][index]['tenpo']).match("横浜営業所")){
				n2 = n2+1;
			}else	if((json['item'][index]['tenpo2']).match("賃貸")&&(json['item'][index]['tenpo']).match("渋谷")){
				n3 = n3+1;
			}else{
				n4 = n4+1;
			}
		}
		if(n >0){var viewMan  = rnd(1,n,1)}
		if(n2>0){var viewMan2  = rnd(1,n2,1)}
		if(n3>0){var viewMan3  = rnd(1,n3,1)}
		if(n4>0){var viewMan4  = rnd(1,n4,1)}
		for(var index in json['item']){
			if(options.staff==""){
			//スタッフランダム
				if(options.t2=="仲介営業部"){
					var t2 = json['item'][index]['tenpo2'];
						if(t2=="仲介営業部"){
						//仲介
						var t1 = json['item'][index]['tenpo'];
						if(options.t1=="渋谷本社"){
							//渋谷
							if(t1=="渋谷本社"){
								m = m + 1;
								if(viewMan == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:03-5489-0825<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
							}
							}
						}else{
							//横浜
							if(t1=="横浜営業所"){
								m = m + 1;
								if(viewMan2 == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:045-316-6910<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
								}
							}
						}
					}
				}else{
					var t2 = json['item'][index]['tenpo2'];
						if(t2.match("賃貸")){
					//賃貸
						var t1 = json['item'][index]['tenpo'];
						if(options.t1=="渋谷本社"){
							//渋谷
							if(t1=="渋谷本社"){
								m = m + 1;
								if(viewMan3 == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:03-5489-0823<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
								}
							}
						}else{
							//横浜
							if(t1=="横浜営業所"){
								m = m + 1;
								if(viewMan4 == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:045-316-6909<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
							}
							}
						}
					}
				}
			}else{
			//スタッフ固定
			var staffvalue = json['item'][index]['tenpo'] +':'+ json['item'][index]['name1'] +'（'+ json['item'][index]['name2']+'）';
				if(options.staff.match(staffvalue)){
					if(options.t2=="仲介営業部"){
						var t2 = json['item'][index]['tenpo2'];
						if(t2=="仲介営業部"){
							var t1 = json['item'][index]['tenpo'];
							if(options.t1=="渋谷本社"){
								//渋谷
								if(t1=="渋谷本社"){itemHtml += '<p class="staff">電話番号:03-5489-0825<br />\n';}
							}else{
								//横浜
								if(t1=="横浜営業所"){itemHtml += '<p class="staff">電話番号:045-316-6910<br />\n';}
							}
						}
					}else{
						var t2 = json['item'][index]['tenpo2'];
							if(t2.match("賃貸")){
						//賃貸
							var t1 = json['item'][index]['tenpo'];
							if(options.t1=="渋谷本社"){
								//渋谷
								if(t1=="渋谷本社"){itemHtml += '<p class="staff">電話番号:03-5489-0823<br />\n';	}
							}else{
								//横浜
								if(t1=="横浜営業所"){itemHtml += '<p class="staff">電話番号:045-316-6909<br />\n';}
							}
						}
					}
				var staffCount = 1;
				itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
				itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
				itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
				}
			if(staffCount==0){
				for(var index in json['item']){
				if(options.t2=="仲介営業部"){
					var t2 = json['item'][index]['tenpo2'];
						if(t2=="仲介営業部"){
						//仲介
						var t1 = json['item'][index]['tenpo'];
						if(options.t1=="渋谷本社"){
							//渋谷
							if(t1=="渋谷本社"){
								m = m + 1;
								if(viewMan == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:03-5489-0825<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
							}
							}
						}else{
							//横浜
							if(t1=="横浜営業所"){
								m = m + 1;
								if(viewMan2 == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:045-316-6910<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
								}
							}
						}
					}
				}else{
					var t2 = json['item'][index]['tenpo2'];
						if(t2.match("賃貸")){
					//賃貸
						var t1 = json['item'][index]['tenpo'];
						if(options.t1=="渋谷本社"){
							//渋谷
							if(t1=="渋谷本社"){
								m = m + 1;
								if(viewMan3 == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:03-5489-0823<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
								}
							}
						}else{
							//横浜
							if(t1=="横浜営業所"){
								m = m + 1;
								if(viewMan4 == m){
								l = l + 1;
								itemHtml += '<p class="staff">電話番号:045-316-6909<br />\n';
								itemHtml +=	'物件担当:'+ json['item'][index]['name1'] +'</p>\n';
								itemHtml += '<p class="staff"><a href="'+ json['item'][index]['href'] +'"><img src="'+json['item'][index]['photo']+'" alt="" width="170" height="170" /></a></p>\n';
								itemHtml += '<p class="staff com">'+ json['item'][index]['detail'] +'</p>\n';
							}
							}
						}
					}
				}
				};
			}
			}
			if(l>=options.viewcount){
				return false;
			};
		};
	}).complete(function(){
		$(list).append(itemHtml);
	});
}
})(jQuery);
/*
	ポップアップ
______________________________________________________________________________________________________________________*/
(function($) {
$.fn.openwin = function(settings) {
settings = jQuery.extend({
option		: {
width		: false,
height		: false,
top			: false,
left		: false,
menubar		: "no",
toolbar		: "no",
location	: "no",
status		: "no",
resizable	: "no",
scrollbars	: "no",
directories	: "no",
titlebar	: "yes",
fullscreen	: "no"
},
target		: "_blank",
blur		: false,
focus		: false
}, settings);
this.click(function() {
var options = [];
if($(this).attr("rel")) {
var rel = $(this).attr("rel").split(",");
var reloption = {};
for(var i in rel) {
var a = rel[i].split("=");
reloption[a[0]] = a[1];
}
}
for(var k in settings.option) {
var v = settings.option[k];
if(reloption) {
if(reloption[k]) {
v = reloption[k];
}
}
if(v != false) {
options.push(k + "=" + v);
}
}
var target = settings.target;
if(reloption) {
if(reloption["target"]) {
target = reloption["target"];
}
}
var win = window.open($(this).attr("href"), target, options.join(","));
if(settings.blur == true) {
win.blur();
}
if(settings.focus == true) {
win.focus();
}
return false;
});
}
})(jQuery);
$(document).ready(function(){
if($.browser.msie && $.browser.version == 6.0||$.browser.msie && $.browser.version == 7.0){
$('ul.ans_sns li.twitter a,ul.ans_sns li a').click(function(){
window.open(this.href, '_blank');
return false;
});
}else{
var tipX = (screen.width  - 604) / 2;
var tipY = (screen.height - 500) / 2;
$('ul.ans_sns li.twitter a,ul.ans_sns li a').openwin({option:{width:604,height:500,left:tipX,top:tipY,scrollbars:"yes",location:"no",directories:"no"},target:"tipspop",focus:true});
return false;
}
});
/*
	スクロール
______________________________________________________________________________________________________________________*/
jQuery.fn.extend({
scrollTo : function(speed, easing) {
if(!$(this)[0].hash || $(this)[0].hash == "#") {
return false;
}
return this.each(function() {
var targetOffset = $($(this)[0].hash).offset().top;
$('html,body').animate({scrollTop: targetOffset}, speed, easing);
});
}
});
$(document).ready(function(){
//$('#pageTop a,ul.pageUnq li a,#service #menuCol dd a[href*="#a"]').click(function() {
$('#pgUp a,#nav span a').click(function() {
$(this).scrollTo(1000);
return false;
});
});
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 *
 * Open source under the BSD License.
 *
 * Copyright ﾂｩ 2008 George McGinley Smith
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list
 * of conditions and the following disclaimer in the documentation and/or other materials
 * provided with the distribution.
 *
 * Neither the name of the author nor the names of contributors may be used to endorse
 * or promote products derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

