
/*
*
*	メニュー用ロールオーバー
*
*
*/

	function rollover(id, type) {
		
		/*
		if(type==1) {
			new Rico.Effect.FadeTo(id, 0, 200, 35);
		} else {
			new Rico.Effect.FadeTo(id, 1.0, 200, 35);
		}
		*/
		if(type==1) {
			if(typeof $opacity == "function") {
				$opacity(id, 100, 0, 600);
			} else {
				new Rico.Effect.FadeTo(id, 0, 200, 35);
			}
		} else {
			if(typeof $opacity == "function") {
				$opacity(id, 0, 100, 600);
			} else {	
				new Rico.Effect.FadeTo(id, 1.0, 200, 35);
			}
		}
		

		
	}  
	
	
	
	
	
	
/**
*
*	画像ポップアップ
*
*
*
*/

	function popupImage(img,type,width,height)
	{
		//画像読み込み
		$('popup_content').innerHTML = '<img src="' + img + '" id="image" width="' + width + '" height="' + height + '">';
		
		//画像サイズ取得
		
		var image_size = Element.getDimensions('image');
		//width = image_size.width;
		//height = image_size.height;

		//width  = $('image').width;
		//height = $('image').height;
		
		
		//ウィンドウを中央へ
		var size = Element.getDimensions('top');
		var w_width = size.width;

		if(type == 1) {
			var plus = 250;
			var imagetop = 700;
		} else {
			var plus = 550;
			var imagetop = 950;
		}		
		
		var w_height = Element.getHeight('main') + plus;
		var left = (w_width - width) / 2 - 95;
		var top  = document.documentElement.scrollTop + (w_height - height) / 2;

		//背景の大きさを調節して表示
		$('screen').style.width   = size.width + 'px';
		$('screen').style.height  = w_height + 'px';
		$('screen').style.left    = '0px';
		$('screen').style.top     = '0px';
		$('screen').style.display = 'block';
		
		//ポップアップ表示
		$('popup').style.left     = left + 'px';
		$('popup').style.top      = imagetop + 'px';
		$('popup').style.width    = (1.3*width) + 'px';
		$('popup').style.height   = (1.3*height) + 'px';

		//$('popup').style.width = 'auto';
		//$('popup').style.height = 'auto';
		//画像拡大
		$('image').width = width * 1.3;
		$('image').height = height * 1.3;
		
					
		new Effect.Grow("popup", {
							duration: 0.3,
							beforeStartInternal: function(effect) {
									$('popup').style.visibility='visible';
							},
							afterFinish: function(effect){
								new Effect.Parallel(
									[new Effect.Scale("image", 100*(10/13), {scaleFromCenter:true}),
									 new Effect.Scale("popup", 100*(10/13), {scaleFromCenter:true})],
								{duration: 0.1, afterFinish: function(effect){}});
							}
							});
		
	

	}
	
/**
*
*	画像消去
*
*
*
*/

	function popupClose()
	{
		var style = '-moz-opacity'.camelize();
		
		$('screen').style.display = 'none';
		
		//$('popup').style.filter = 'alpha(opacity=0)';
		//$('popup').style.style = '0.0';
		//$('popup').style.opacity = '0.0';
		$('popup').style.visibility = 'hidden';
		
	}

/**
*
*	画像ポップアップ
*
*
*/
var is_popup = 0;
function popup(img, top)
{
	//スクリーン
	var screen   = document.createElement("div");
	var objBody = document.getElementsByTagName("body").item(0);   
	
	objBody.appendChild(screen);
	screen.id = "back_screen";
	screen.style.height = $('main').offsetHeight + 250;
	screen.style.width  = "100%";
	$opacity(screen.id, 0, 75, 100);
	
	
	var timeout = setTimeout(function(){
	
	
		clearTimeout(timeout); 
		if(is_popup == 0){
			if($('popup')) {
				var popup = $('popup');
				
				$("popup").style.display = 'block';
			} else {
				var popup   = document.createElement("div");
					objBody.appendChild(popup); 
			} 
				
			popup.id = "popup";
			popup.style.width = "100%";
			popup.style.left = '0px';
			popup.innerHTML = '<img src="' + img + '">';
			if(top){
				popup.style.top = top;
			}
			$opacity("popup", 0, 100, 400);
			
		
			
			  
			is_popup = 1;
		}
	}, 150);
	
	
	return;
}

/**
*
*	バナーページ用ポップアップ
*
*/
var large=0;

function codePopup(url, top)
{
	//スクリーン
	var screen   = document.createElement("div");
	var objBody = document.getElementsByTagName("body").item(0);   
	
	objBody.appendChild(screen);
	screen.id = "back_screen";
	screen.style.height = $('main').offsetHeight + 250;
	screen.style.width  = "100%";
	$opacity(screen.id, 0, 75, 100);
	
	var timeout = setTimeout(function(){
	
	
		clearTimeout(timeout); 
		if(is_popup == 0){
			if($('popup')) {
				var popup = $('popup');
				
				$("popup").style.display = 'block';
			} else {
				var popup   = document.createElement("div");
					objBody.appendChild(popup); 
			} 
				
			popup.id = "popup";
			popup.style.width = "100%";
			popup.style.left = '0px';
			popup.style.top = document.body.scrollTop + 200 + "px";
			if(url.indexOf('_s', 0) != -1){
				var frame_class = ' class="large"';
			}
			if(large) {
				if(large==1) {
					frame_class = ' class="large"';
				}
			}
			popup.innerHTML = '<iframe src="' + url + '"' + frame_class + ' frameborder="0">';
			if(top){
				popup.style.top = top;
			}
			$opacity("popup", 0, 100, 400);
			
		
			
			  
			is_popup = 1;
		}
	}, 250);
	
	
	return;
}


function popupClose()
{
	if(is_popup == 1) {
		$opacity("popup", 100, 0, 400);
		$("popup").style.display = 'none';
		var timeout = setTimeout(function(){$("popup").style.display = 'none'; clearTimeout(timeout); }, 600);
		is_popup = 0;
		var screen = $('back_screen');
		var objBody = document.getElementsByTagName("body").item(0);   
		objBody.removeChild(screen);
		
	}
	
}


window.onload = function(){
					var objBody = document.getElementsByTagName("body").item(0);
					objBody.onclick = function(){popupClose();}
					
					var link = new Array();
					link =  document.getElementsByTagName('a');
					
					i = 0;
					while(link[i]) {
						if(link[i].id > 0) {
							link[i].href="javascript:;";
							link[i].target = '_self';
						}
						i++;
					}
				}


