//Popup----------------------------------------------------------------------------------

//URL,幅,高さを指定----------------------------------
//HTML記述例↓
//<a href="javascript:OpenWin('*****/index.html','680','500')">～</a>
function OpenWin(URL,myWidth,myHeight) {
  var win = window.open(URL,'newwin','left=0,top=0,location=no,toolbar=no,menubar=no,directories=no,status=no,scrollbars=yes,resizable=yes,width='+ myWidth+',height='+myHeight);
  win.focus();
}

//全てを個別に指定----------------------------------
//HTML記述例↓
//<a href="javascript:OpenWinSelf('*****/index.html','newsWindow','width=540,height=600,left=0,top=0,location=no,toolbar=no,menubar=no,directories=no,status=no,scrollbars=no,resizable=no');">～</a>
function OpenWinSelf(URL,winName,parameter){
  var selfWin=window.open(URL, winName, parameter);
  selfWin.focus();
}

//閉じる場合は<a href="javascript:window.close();">～</a>を記述



// smooth scrooll----------------------------------------------------------------------------------
$(function() {
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &&　location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length && target;
			if (target.length) {
				var sclpos = 30;
				var scldurat = 1200;
				var targetOffset = target.offset().top - sclpos;
				$('html,body')
					.animate({scrollTop: targetOffset}, {duration: scldurat, easing: "easeOutExpo"});
				return false;
			}
		}
	});
});


// Rollover----------------------------------------------------------------------------------
/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	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 == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+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('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

function addEvent(elm,listener,fn){
	try{
		elm.addEventListener(listener,fn,false);
	}catch(e){
		elm.attachEvent("on"+listener,fn);
	}
}

addEvent(window,"load",initRollovers);
 
 

// Drop Down----------------------------------------------------------------------------------
  $(function() {
    $('#nav').droppy();
  });
  

