/* jquery Even */
$(document).ready(function(){
  $("#menu dl:last").addClass("last");
  $("div.propertyBox ul li:even").addClass("even");
  $("div.layoutBox ul li:last").addClass("last");
  
  $("ul#voiceList li:even").addClass("odd");
  $("ul#voiceList li h2:last").addClass("last");
});


/*=== jquery.flatheights ==================================== */
// 要素崩れ防止のため、個別に指定

/*== flatheights propertyBox ============== */
$(document).ready(function(){ /* div要素を2つずつの組に分ける */
    var sets = [], temp = [];
    
    $('div.propertyBox > ul > li').each(function(i) {
        temp.push(this);
        if (i % 2 == 1) {
            sets.push(temp);
            temp = [];
        }
    });

    if (temp.length) sets.push(temp);
    $.each(sets, function() { /* 各組ごとに高さ揃え */
        $(this).flatHeights();
    });
});


/*== flatheights blogList ============== */
$(document).ready(function(){ /* div要素を2つずつの組に分ける */
    var sets = [], temp = [];
    
$('#blogList dl dd').each(function(i) {
  temp.push(this);
  if (i % 2 == 1) {
   sets.push(temp);
   temp = [];
  }
});

    if (temp.length) sets.push(temp);
    $.each(sets, function() { /* 各組ごとに高さ揃え */
        $(this).flatHeights();
    });
});


/*== flatheights VoiceList h2 ============== */
$(document).ready(function(){ /* div要素を2つずつの組に分ける */
    var sets = [], temp = [];

$('ul#voiceList h2').each(function(i) {
  temp.push(this);
  if (i % 2 == 1) {
   sets.push(temp);
   temp = [];
  }
});

    if (temp.length) sets.push(temp);
    $.each(sets, function() { /* 各組ごとに高さ揃え */
        $(this).flatHeights();
    });
});


/*== flatheights VoiceList Box ============== */
$(document).ready(function(){ /* div要素を2つずつの組に分ける */
    var sets = [], temp = [];

$('ul#voiceList li dl dd').each(function(i) {
  temp.push(this);
  if (i % 2 == 1) {
   sets.push(temp);
   temp = [];
  }
});

    if (temp.length) sets.push(temp);
    $.each(sets, function() { /* 各組ごとに高さ揃え */
        $(this).flatHeights();
    });
});
/*=== /jquery.flatheights ==================================== */


/* Link */
$(document).ready( function() {
  $("div.ownedBox .thumbnail a").click( function() {
    var changeSrc = $(this).attr("href");
    $(".target img").fadeOut(
      "slow",
      function() {
        $(this).attr("src", changeSrc);
        $(this).fadeIn();
      }
    );
    return false;
  });
});

function thumbnail(code) {
var s_script = '\
$(document).ready( function() {\
  $("div.ownedBox .thumbnail@no@ a").click( function() {\
    var changeSrc = $(this).attr("href");\
    $(".target@no@ img").fadeOut(\
      "slow",\
      function() {\
        $(this).attr("src", changeSrc);\
        $(this).fadeIn();\
      }\
    );\
    return false;\
  });\
});\
';
s_script = s_script.replace(/@no@/g,code);
eval(s_script);
}