//Rollover
function imgRollover(imgName, path){
	if(document.images){
		document.getElementById(imgName).src = path + "img/" + imgName + "_o.gif";
	}
}
//RollOut
function imgRollout(imgName, path){
	if(document.images){
		document.getElementById(imgName).src = path + "img/" + imgName + ".gif";
	}
}
function swfRollOver(imgName){
	if(document.images){
		document.getElementById(imgName).src = "img/" + imgName + "_o.gif";
	}
}
function swfRollOut(targetPj){
	
	document.getElementById(targetPj).src = "img/" + targetPj + ".png";
}
//
//
//
//=================================================================== jQuery Set
//
//
$( document ).ready( function (){
	//
	//
	//-------------------------------------------------[Preload]
	//
	if($('#developPJ').children().is('.structureNaviBox')){
		preImages = new Array("../../shared/img/sp01_strnavi-box_rpt.gif", "../../shared/img/sp01_strnavi-box_top.gif", "../../shared/img/sp01_strnavi-box_btm.gif");
		preloadn  = new Array();
		for (i=0; i<preImages.length; i++) {
			preloadn[i] = new Image();
			preloadn[i].src = preImages[i];
		}
	}
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[#localContentAreaが#localNaviの高さに満たない場合に#localContentAreaの高さを変更]
	//
	var localContentsHeight = $('#localContentArea').height();
	var localNaviHeight = $('#localNavi').height();
	//
	if($('#developPJ').children().is('#localContentArea')){// <-----(#developPJ内に#localContentAreaがあれば実行)
		if(localContentsHeight < localNaviHeight){
			newLCAHeight = localNaviHeight;
			$('#localContentArea').css('height',newLCAHeight);
		}
	}
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[#localNaviでセレクト項目が最後のリストの場合のマージン設定]
	//
	//
	
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[pngfix.js]
	//
	$("img[@src$=png], #developPJ").pngfix({});
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[mapSlideView]
	//
	$('#projectMapBTN,#projectMapIMG').click(function(){
		$('#projectMapIMG').slideToggle(500, function(){
			if($('#mapView').is(':visible')){
				$('#mapClose').css('display','block');
				$('#mapView').css('display','none');
			}else{
				$('#mapClose').css('display','none');
				$('#mapView').css('display','block');
			}
		});
	});
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[scrollfollow.js]
	//
	if($('#developPJ').children().is('#localContentArea')){// <-----(#developPJ内に#localContentAreaがあれば実行)
		$( '#localNavi' ).scrollFollow({
			duration: 1000,
			container: 'localContentArea',
			easing: 'easeOutExpo'
		});
	}
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[pageTop]
	//
	if($('#developPJ').children().is('#localContentArea')){// <-----(#developPJ内に#localContentAreaがあれば実行)
		$('#ptop').click(function (){
			$(this).blur();
			$('html,body').animate({scrollTop:0}, 1000, 'easeOutExpo');
			return false;
		});
	}
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[photoEnlarge]
	//
	//
	//var widthDf = $('.includeIMG').width();// <-----(widthCheck用)
	var widthMax = 653;//コンテンツ幅
	var widthDef = $('#map1').width();
	var heightDef = $('#map1').height();
	var heightEnlarge = $('#map2').height();
	//
	$('.includeIMG').toggle(function(){
		if($(this).width()　==　widthDef){// <-----(2度押し防止)
			$('#map1').fadeOut(250);
			$(this).css('margin-left',0);
			$(this).animate({width:widthMax,height:heightEnlarge},500,
			function(){
				$('#map2').fadeIn(1000);
				//var widthDf2 = $('.includeIMG').width();// <-----(widthCheck用)
				//$('#name2').text(widthDf2).show();// <-----(widthCheck用)
			});
		}
	},
	function(){
		if($(this).width()　==　widthMax){// <-----(2度押し防止)
			$('#map2').fadeOut(500, function(){
				$('.includeIMG').animate({width:widthDef,height:heightDef},500,
					function(){
						$('#map1').fadeIn(300);
						$(this).css('margin-left','20px');
						//var widthDf = $('.includeIMG').width();// <-----(widthCheck用)
						//$('#name').text(widthDf).show();// <-----(widthCheck用)
					});
			});
		}
	});
	//$('#name').text(widthDf).show();// <-----(widthCheck用)
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[flatheights.js]
	//
	//projectTop
	if($('#structureNavi').children().is('.structureNaviBoxArea')){// <-----(#structureNaviに.structureNaviBoxAreaがあれば実行)
		$('.structureNaviBox_btm > .cap').css('padding-bottom','7px');// <-----(paddingがリセットされるバグ回避)
		$('.structureNaviBox_btm').flatHeights();
	}
	//
	//projectContents
	if($('.imgBlock'||'.txtBlock').children().is('.photoBlock')){// <-----(.txtBlockもしくは.imgBlock内に.photoBlockがあれば実行)
		$('.captionSet1').flatHeights();
		$('.captionSet2').flatHeights();
		$('.captionSet3').flatHeights();
		$('.captionSetSingle').css('padding-bottom','9px');// <-----(となりに並べるものが無い場合)
	}
	//
	//------------------------------------------------------------------
	//
	//
	//-------------------------------------------------[dataListの最初のボーダーを消す]
	//
	if($('.dataListBlock').children().is('.dataList')){// <-----(.txtBlockもしくは.imgBlock内に.photoBlockがあれば実行)
		$('.dataList > dt:first').css('border-top','none');
		$('.dataList > dd:first').css('border-top','none');
	}
	//
	//------------------------------------------------------------------
	//
	//
});
//===============================================================================
