var prev = $.cookie('ram');
var arr = new Array();
arr.push("images/main_title.jpg", "images/main_title_1.jpg", "images/main_title_2.jpg");

function getSrc() {
	if(prev != null) {
		getRandom();
	} else {
		prev = Math.floor(Math.random()*arr.length);
		getRandom();
	}
	//alert(prev);
}

function getRandom() {
	n = Math.floor(Math.random()*arr.length);
	while(prev == n) {
		n = Math.floor(Math.random()*arr.length);
	}
	document.write( "<img src='" + arr[n] + "' width='960' height='510' alt='新興出版社啓林館 子どもたちの未来のために' />");
	
	$.cookie('ram', n, {expires:3});
}

