/*スパム対策*/
<!--
function vspam(im,domain) {
  maddress = "mailto:" + im + "@" + domain;
  window.location.href = maddress;
}
// -->


/*ページスクロール*/
function SmoothScroll(targetID){
  if( !document.getElementById ) {return true;}
  var step=1;  //初速度
  var max=200;  //最高速度
  var accel=1;  //加速度
  var interval=1;  //加速インターバル
  var current_y = document.body.scrollTop  || document.documentElement.scrollTop;
  var element=document.getElementById(targetID);
  if (!element){return true;}
  var target_y = 0;
  for (i = element;i.offsetParent;i=i.offsetParent ){
    target_y += i.offsetTop;
  }
  var count=0;
  if ( current_y > target_y ){ step = -(step); accel = -(accel);}
  var timerid = setInterval( function(){
    if (step<max) step += (count*accel);
    if ( Math.abs(current_y-target_y) < Math.abs(step) ){
      window.scrollTo((document.body.scrollTop  || document.documentElement.scrollTop),target_y);
      clearInterval(timerid);
      return false;
    }else{
      window.scrollBy(0,step);
      current_y += step;
      count++;
    }
  },interval);
  return false;
}


/*ランダムイメージ*/
function RandomBaner(){

	alt = new Array();
	img = new Array();
	title = new Array();

	img[0] = "<a href='http://www.hitorigurashi-japan.com' target='_blank' class='lastbana'><img src='/common/html/banner/theme/baner_hitorigurashi.gif' alt='全国一人暮らしドットコム' /></a>";
	img[1] = "<a href='http://www.singlelife.co.jp' target='_blank' class='lastbana'><img src='/common/html/banner/theme/baner_debut.gif' alt='Debut' /></a>";
	img[2] = "<a href='http://click.linksynergy.com/fs-bin/click?id=2WOmfry7Nuw&offerid=66258.10000073&type=4&subid=0' target='_blank' class='lastbana'><img src='http://www.tsutaya.co.jp/affiliate/bnr/tol04_180_50.gif' alt='TSUTAYA' /></a><img border='0' width='1' height='1' src='http://ad.linksynergy.com/fs-bin/show?id=2WOmfry7Nuw&bids=66258.10000073&type=4&subid=0' class='block' />";
	img[3] = "<a href='http://www.kojima.net/' target='_blank' class='lastbana'><img src='/common/html/banner/theme/baner_kojima.gif' alt='コジマ電気' /></a>";

	n = Math.floor(Math.random()*img.length);
    document.write(img[n]);
}


function newLife()
{
   adWindow=window.open('http://www.living-gallery.com/newlife.html','newWin','width=800,height=800,scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes,menubar=yes,status=yes,left=0,top=0');
}

/*関東キャラバン*/
function caravan(){
	var st = "scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes,menubar=yes,status=yes";
	var wx = 880;
	var wy = 700;
	var x = (screen.width  - wx) / 2;
	var y = ((screen.height - wy) / 2) - 30;
	var newwin = window.open("http://www.living-gallery.com/extra/caravan2010.html","newWin","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}

function natsutoku()
{
   adWindow=window.open('http://www.living-gallery.com/natsutoku.html','newWin','width=850,height=800,scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes,menubar=yes,status=yes,left=0,top=0');
}



/*賃貸まつり*/
function lg_fes(){
	var st = "scrollbars=yes,resizable=yes,toolbar=yes,directories=yes,location=yes,menubar=yes,status=yes";
	var wx = 880;
	var wy = 700;
	var x = (screen.width  - wx) / 2;
	var y = ((screen.height - wy) / 2) - 30;
	var newwin = window.open("http://www.living-gallery-kanto.com/extra/lg_festival.html","newWin","left="+x+",top="+y+",width="+wx+",height="+wy+","+st);
	newwin.focus();
}
