//JavaScript
/*
v0.1
update 2008.10.27
*/

function rollOver(){
	var allimg = document.getElementsByTagName('img');
	for(i=0; i<allimg.length; i++){
		if(allimg[i].src.indexOf('_off') >= 0){
			preloadImg(allimg[i].src.replace('_off', '_on'));
			allimg[i].onmouseover = function(){
				this.setAttribute("src", this.src.replace('_off', '_on'));
			}
			allimg[i].onmouseout = function(){
				this.setAttribute("src", this.src.replace('_on', '_off'));
			}
		}
	}
}


function preloadImg(o) {
    alert(newWidth);
	var i = new Image;
	i.src = o;
}

window.onload = rollOver;
$(function() {
resizeImg();
    $(window).resize(function() {
        resizeImg()
    });
});
var resizeImg = function() {
    var newHeight, newWidth;
    newHeight = $(window).height();
    newWidth = $(window).width();
    if (newWidth <= 800) {
        $("object").css('width',"800px");
    } else {
    $("object").css('width', "100%");
    }
    if (newHeight <= 550) {
        $("object").css('height', "550px");
    } else {
    $("object").css('height', "100%");
    }
}

