﻿/*
---------------------------------------------------------
	smartRollover
	*Modify smartRollover.js
	*http://css-happylife.com/log/javascript/000157.shtml
---------------------------------------------------------
*/

function smartOver() {
    smartRollover('wrapper'); //ロールオーバーを適用させたい箇所のIDを指定
}

function smartRollover(idName) {
    if (document.getElementsByTagName) {
        var images = document.getElementById(idName).getElementsByTagName("img");
        for (var i = 0; i < images.length; i++) {
            if (images[i].getAttribute("src").match(/_off\./)) {
                fileName =  new Array(images[i].getAttribute("src").replace("_off.", "_on."));
                preImages =  new Array();
                for (j = 1; j <= fileName.length; j++) {
                    preImages[j] =  new Image();
                    preImages[j].src = fileName[j]; //「_on」の画像をプリロード
                }
                images[i].onmouseover = function () {
                    this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on.")); //マウスオーバーで_off→_on
                }
                images[i].onmouseout = function () {
                    this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off.")); //マウスが離れたら_on→_off
                }
            }
        }
    }
}

if (window.addEventListener) {
    window.addEventListener("load", smartOver, false);
    //実行
}
else if (window.attachEvent) {
    window.attachEvent("onload", smartOver);
}
else {
    window.onload = smartOver;
}

/*
---------------------------------------------------------
	print
---------------------------------------------------------
*/

str = location.search;
str = str.substring(1,str.length);
str2= str.split("&");
for(var i=0; i<str2.length; i++){
	str3 = str2[i].split("=");
	if(str3[0]=="style" && str3[1]=="print"){
 	document.write('<link href="/common/css/print.css" rel="stylesheet" type="text/css" />');
	}
}



/*
---------------------------------------------------------
	Table
---------------------------------------------------------
*/

jQuery(function(){
  jQuery('table tr:odd').addClass('even');
  jQuery('table tr:even').addClass('odd');
});

/*
---------------------------------------------------------
	Height
---------------------------------------------------------
*/


jQuery(function() {
   jQuery('.photoList li').flatHeights();
});




