
(function (){
		   
	var f = 
	{
		setLink: function(w,h,u,url)
		{
			var lw = w/2;
			var lh = h/2;
			
			$("#"+u).attr("onKeyPress","return false")
					.attr("onClick","return false")
					.click
					(function(e)
						{
							var x = screen.width/2 - lw;
							var y = screen.height/2 - lh;
							var rand = "archivewindow";
							window.open(url, rand, 'width='+w+', height='+h+',left='+x+',top='+y+' menubar=no, toolbar=no, scrollbars=no, location=no, resizable=yes');
							return false;
						}
					)
		},
		
		init: function()
		{
			
			
			$(document).ready
			(
				function()
				{
					var val = $("body").attr("id");
					var val2 = "";
					var val3 = f.pan[val][0];
					var val4 = f.pan[val][1];
					
					for(var i=1; i<=4; i++)
					{
						var _val = "menu"+i;
						if(val4 != _val)
						{
							val2 += "#"+_val+",";
						};
					};
					val2 = val2.slice(0,-1);
				/*	
					if(navigator.userAgent.indexOf("MSIE 6") == -1)
					{
						$(val2).mouseover(function(){
  							$(this).animate(
    						{opacity:1},
   							 {duration: "fast"}
  							);
						})
						.mouseout(function(){
  							$(this).animate(
    						{opacity:0},
   							 {duration: "fast"}
  							);
						});
					}else
					{
				*/		$(val2).mouseover(function(){
  							$(this).css(
    						{opacity:1}
  							);
						})
						.mouseout(function(){
  							$(this).css(
    						{opacity:0}
						);
						});
				//	};
					
					$(val3+" a").replaceWith("<div id='"+val4+"' title='"+ $(val3+' a').attr('title') +"'></div>");
					$("#"+val4).css({opacity:1});
					
					if($("#totop"))
					{	
						$("head").append("<script type='text/javascript' src='./js/jquery.scrollTo-1.4.2-min.js'></script>");
						
						$("#totop a").click(function(){$.scrollTo("body", "slow");})
									.mouseover(function()
										   {
											 $("#totop img").animate
												(
    											{opacity:0.5},
   												{duration: "fast"}
												);
											}
									)
									.mouseout(function()
										   {
											 $("#totop img").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									)
									.attr("onKeyPress","return false")
									.attr("onClick","return false");
						var ua = navigator.userAgent;
						if(ua.indexOf("MSIE")!=-1)
						{
							var num =ua.indexOf("MSIE ") + 5;					
							if(ua.charAt(num) <= 7)
							{
								$("#totop a").attr("href","javascript:void(0)");			
							}
						};
					};
					
					if($("span.spr"))
					{
						for(var i = 0; i<$("span.spr").length; i++)
						{
							var vl = $("span.spr:eq("+i+")").text();
							$("span.spr").parent()[i].title=vl;
						};
					};
					
					
					
					f.initFuncs[val]();

				}			  
			);
		},
		
		initFuncs:
		{
			top:function()
			{
				var w = 982;
				var h = 499;
				f.setLink(w,h,"jla06","./archives/jla06.html");
				f.setLink(w,h,"jla07","./archives/jla07.html");
				f.setLink(w,h,"jla07aus","./archives/jla07aus.html");
				f.setLink(w,h,"jla08","./archives/jla08.html");
				f.setLink(w,h,"jla09","./jla09/index.html");
				
				$("#jla09").mouseover(function()
										   {
											 $("#jla09 span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#jla09 span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									);
					
				$("#jla10").mouseover(function()
										   {
											 $("#jla10 img").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#jla10 img").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									);				
				$("#jla08").mouseover(function()
										   {
											 $("#jla08 span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#jla08 span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									);
				$("#jla07").mouseover(function()
										   {
											 $("#jla07 span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#jla07 span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									);
				$("#jla07aus").mouseover(function()
										   {
											 $("#jla07aus span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#jla07aus span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									)
							.attr("onKeyPress","return false")
							.attr("onClick","return false");
							
							
				$("#jla06").mouseover(function()
										   {
											 $("#jla06 span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#jla06 span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									)
							.attr("onKeyPress","return false")
							.attr("onClick","return false");
				
			},
			aliance:function()
			{
				
			},
			about:function()
			{
				$("#banner1 a").mouseover(function()
										   {
											 $("#banner1 img").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("#banner1 img").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									);
			},
			ad:function()
			{

				
				$("p.btn1 a").mouseover(function()
										   {
											 $("p.btn1 a span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("p.btn1 a span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									)
							.click
								(function(e)
									{
										var url = "http://www.sanyobussan.co.jp/profile/cm1.html";
										var lw = 500/2;
										var lh = 520/2;
										var x = screen.width/2 - lw;
										var y = screen.height/2 - lh;
										var rand = "movwindow";
										window.open(url, rand, 'width=520, height=500,left='+x+',top='+y+' menubar=no, toolbar=no, scrollbars=no, location=no, resizable=yes');
										return false;
									}
								)
							.attr("onKeyPress","return false")
							.attr("onClick","return false");
							
				$("p.btn2 a").mouseover(function()
										   {
											 $("p.btn2 a span").animate
												(
    											{opacity:0.7},
   												{duration: "fast"}
												);
											}
									)
							.mouseout(function()
										   {
											 $("p.btn2 a span").animate
												(
    											{opacity:1},
   												{duration: "fast"}
												);
											}
									)
							.click
								(function(e)
									{
										var url = "http://www.sanyobussan.co.jp/profile/cm2.html";
										var lw = 500/2;
										var lh = 520/2;
										var x = screen.width/2 - lw;
										var y = screen.height/2 - lh;
										var rand = "movwindow";
										window.open(url, rand, 'width=520, height=500,left='+x+',top='+y+' menubar=no, toolbar=no, scrollbars=no, location=no, resizable=yes');
										return false;
									}
								)
							.attr("onKeyPress","return false")
							.attr("onClick","return false");
				
				
			}
		},
		
		pan:
		{
			top:["#m1","menu1"],
			aliance:["#m2","menu2"],
			about:["#m3","menu3"],
			ad:["#m4","menu4"]
		}
	};
	
	f.init();
})();

$(document).ready
			(
				function()
				{			

$("a#menu1").click(function()
					{
						var url = $("a#menu1").attr("href");
  							swfName("aexternal").JS2AS(url);
					})
			.attr("onKeyPress","return false")
			.attr("onClick","return false");
					
					
				});

					
//ブラウザに対応した呼び出し方のための関数
function swfName(str) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[str];
}else {
return document[str];
}
}
