function setYear(){
	var d_obj = new Date();
	document.write(d_obj.getFullYear());
}


function rollover() {
	
	//information();
	border_none();
	IE_logo_link();
	selectAction();
	
	if (!document.getElementById) return

	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i=0;i<aImages.length;i++) { 
			if (aImages[i].className == 'rollover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);

			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;

			aImages[i].onmouseover = function() {
			sTempSrc = this.getAttribute('src');
			this.setAttribute('src', this.getAttribute('hsrc'));
			} 

			aImages[i].onmouseout = function() {
			if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_'+ftype, ftype);
			this.setAttribute('src', sTempSrc);
			}
		}
	}
}
/*
function information(){

	XML = createObj();

	XML.open("POST","xml/info.xml");
	XML.setRequestHeader( "If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
	XML.send(null);
	
	XML.onreadystatechange = function(){
		
		if(XML.readyState != 4){
			document.getElementById("topics").innerHTML = "XMLロード中..."
		}
		if(XML.readyState == 4 && XML.status == 200){
			var XmlData = XML.responseXML;
			var topicsDate = XmlData.getElementsByTagName('date')[0].firstChild.nodeValue;
			var description = XmlData.getElementsByTagName('description')[0].firstChild.nodeValue;
			document.getElementById("topics").innerHTML = topicsDate+"<br />"+description;
		}
	}
}
*/
function createObj(){

	if(window.XMLHttpRequest){
		Ajax = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		try {
			Ajax = new ActiveXObject("Msxm21.XMLHTTP");
		} catch(e) {
			Ajax = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return Ajax;
}


function setPng(){
	
	var alpha = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='images/logo.png')";

	if(document.all){
		document.getElementById("logo").style.width = "253px";
		document.getElementById("logo").style.height = "252px";
		document.getElementById("logo").style.filter = alpha;
		document.getElementById("logo").firstChild.style.display = "none";
		
	}
}

function border_none(){
	var all_link = document.links;
	for(i=0;i<all_link.length;i++){

	//	alert(all_link[i].parentNode.childNodes[1].nodeName);
		

		all_link[i].onfocus = function(){
			this.blur();
		}
	}
}

function IE_logo_link(){

	if(document.getElementById("logo")){
		if(navigator.appVersion.indexOf("MSIE") != -1){
			document.getElementById("logo").onclick = function(){
				location.href = "top.html";
			}
		}
	}

}

function show_swf(page){

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="200" id="'+page+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="swf/'+page+'.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="swf/'+page+'.swf" quality="high" wmode="transparent" bgcolor="#000000" width="800" height="200" name="coverflow" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');

}



function selectAction(){

	if(navigator.appName == "Opera"){
		rootDiv = document.getElementsByTagName("div")[0];
		targetDiv = rootDiv.getElementsByTagName("div")[0];
		targetDiv.style.marginTop = "-1px";
		targetDiv.style.paddingTop = "1px";
	}

	if(!document.getElementById("select")){
		return;
	}
	document.getElementById("select").style.position = "absolute";
	document.getElementById("select").style.top = topPlace+"px";
	
	if(navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1){
		slideInterval = 30;
	}else{
		slideInterval = 1;
	}
	moveInterval();
	//alert(targetheight);
}

function moveInterval(){
	setInterval(ladySet,slideInterval);
}
var slideInterval = "";
var Movescroll = topPlace;
if(navigator.userAgent.indexOf("MSIE 6") != -1){
	var topPlace = 453;
}else{
	var topPlace = 450;
}
var target = topPlace;

function ladySet(){


	if(document.body.scrollTop){
		Movescroll = document.body.scrollTop;
	}else{
		Movescroll = document.documentElement.scrollTop;
	}
	
	
	if(document.body.scrollHeight){
		maxscroll = document.body.scrollHeight;
	}else{
		maxscroll = document.documentElement.scrollHeight;
	}
	if(Movescroll < topPlace){
		Movescroll = topPlace;
	}

	target += (Movescroll-target)/5;
	if(target > (maxscroll-topPlace-280)){
		target = maxscroll-topPlace-280;
	}
	document.getElementById("select").style.top = target+"px";

}

window.onload = rollover;