var my_client = new UserClient( ) ;
var flash_version = 6 ;
var is_installed = false ;

if (my_client.opera && navigator.plugins["Shockwave Flash"]) {
	var sp = navigator.plugins["Shockwave Flash"].description.indexOf("Flash") ;
	var ep = navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ") ;
	var usr_ver = parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+6, ep)) ;
	if (usr_ver >= flash_version) {
		var is_installed = true ;
	}
}
else if (my_client.Win && my_client.ie) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n') ;
	document.write('on error resume next \n') ;
	document.write('contentVersion = 6 \n') ;
	document.write('is_installed = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion))) \n') ;
	document.write('</SCR' + 'IPT\> \n') ;
	if (my_client.ie4) {
		var is_installed = false ;
	}
}
else if (my_client.Mac && my_client.ie) {
	if (!my_client.ie4 && navigator.plugins["Shockwave Flash"]) {
		var sp = navigator.plugins["Shockwave Flash"].description.indexOf("Flash") ;
		var ep = navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ") ;
		var usr_ver = parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+6, ep)) ;
		if (usr_ver >= flash_version) {
			var is_installed = true ;
		}
	}
}
else if (my_client.nn && navigator.plugins["Shockwave Flash"]) {
	var sp = navigator.plugins["Shockwave Flash"].description.indexOf("Flash") ;
	var ep = navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ") ;
	var usr_ver = parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+6, ep)) ;
	if (usr_ver >= flash_version) {
		var is_installed = true ;
	}
}

function UserClient( ) {

	this.nav_name = navigator.appName ;
	this.nav_agnt = navigator.userAgent ;
	this.nav_ver = navigator.appVersion ;

	this.Win = (this.nav_agnt.indexOf("Win",0) != -1) ;
	this.Mac = (this.nav_agnt.indexOf("Mac",0) != -1) ;

	this.ie = (this.nav_name == "Microsoft Internet Explorer") ;
	this.ie4 = (this.nav_ver.indexOf('MSIE 4') > 0) ;
	this.nn = (this.nav_name == "Netscape") ;
	this.opera = (this.nav_agnt.indexOf("Opera", 0) != -1) ;
	this.safari = (this.nav_agnt.indexOf("Safari", 0) != -1) ;

}


function flash()
{
var flashs = [];
flashs['nomal']   = 'top_Normal.swf';
flashs['xmass']   = 'top_xmass.swf';
flashs['newyear'] = 'top_NewYear.swf';

var eyecatchs = [];
eyecatchs['nomal']   = 'eyecatch_Normal.jpg';
eyecatchs['xmass']   = 'eyecatch_xmass.jpg';
eyecatchs['newyear'] = 'eyecatch_newyear.jpg';

var select = GetTime();

if(is_installed)
  {
  document.write(
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="760" height="200">' +
'<param name="movie" value="http://www.ohnoya.co.jp/share/swf/' + flashs[select] + '" />' +
'<param name="quality" value="high" />' +
'<embed src="http://www.ohnoya.co.jp/share/swf/' + flashs[select] + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="760" height="200"></embed>' +
'</object>');
 }
else
  {
 document.write('<a href="70th/index.shtml"><img src="/share/images/top/' + eyecatchs[select] + '" alt="こころをかたちに" /></a>');
	}
}

function eyecatch()
{
var flashs = [];
flashs['nomal']   = 'top_Normal.swf';
flashs['xmass']   = 'top_xmass.swf';
flashs['newyear'] = 'top_NewYear.swf';

var eyecatchs = [];
eyecatchs['nomal']   = 'eyecatch_Normal.jpg';
eyecatchs['xmass']   = 'eyecatch_xmass.jpg';
eyecatchs['newyear'] = 'eyecatch_newyear.jpg';

var select = GetTime();

document.write('<a href="70th/index.shtml"><img src="/share/images/top/' + eyecatchs[select] + '" alt="こころをかたちに" /></a>');
}

function GetTime()
{
var yyyy,mm,dd,HH,MM,SS;
var date = new Date();

yyyy = date.getYear();
if(yyyy < 2000)
  { yyyy += 1900; }
mm = ((mm = date.getMonth() +1) > 9) ? mm + "" : "0" + mm;
dd = ((dd = date.getDate())     > 9) ? dd + "" : "0" + dd;
HH = ((HH = date.getHours())    > 9) ? HH + "" : "0" + HH;
MM = ((MM = date.getMinutes())  > 9) ? MM + "" : "0" + MM;
SS = ((SS = date.getSeconds())  > 9) ? SS + "" : "0" + SS;

var now = (yyyy+mm+dd+HH+MM+SS);

var season = (now >= "20091203140000" && now <= "20091225165959") 
           ? 'xmass'
           : (now >= "20100101000000" && now <= "20100115170000") 
           ? 'newyear'
           : 'nomal'
           ;

return season;
}
