$(document).ready(function(){
	smartRollover();
	pageScroll('.to-top','#container');
	if($('.table-type2')){
		zebra();
	}
	if($("#mssage-mqr")){
		aae();
	}
});

function smartRollover(){  
    if(document.getElementsByTagName) {  
        var images = document.getElementsByTagName("img");  
        for(var i=0; i < images.length; i++) {  
            if(images[i].getAttribute("src").match("_off."))  
            {  
                images[i].onmouseover = function() {  
                    this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));  
                }  
                images[i].onmouseout = function() {  
                    this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));  
                }  
            }  
        }  
    }  
}

function pageScroll(trg,target){
    $(trg).click(function () {
        $(this).blur();
        $('html,body').animate({ scrollTop: $(target).offset().top }, 'fast');
        return false;
    });
}

function zebra(){
	$(".table-type2 tr:odd").addClass("zebra");
}
		
//代入するぽじしょんの値
var posLeft = 600;

function aae(){
	//マーキーの対象
	var mqr = document.getElementById("mqr");
	//繰り返しミリ秒
	var interval = 80;
	//条件判定
	if(posLeft > -1010){
		posLeft -= 4;
		mqr.style.left = posLeft + "px";
		var timer = setTimeout("aae()", interval);
	}else{
		mqr.style.left = "600px";
		//ぽじしょんの値をリセット
		posLeft = 600;
		var timer = setTimeout("aae()", interval);
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
