var currentURL;

/* jquery ready
----------------------------------------------- */
$(function() {

	// fadeIn
	$(".index .image img").css({ opacity:0 });
	
	// slideDown
	$(".index #subNavi").hide();

	// 外部リンク
	currentURL = window.location.protocol + "//" + window.location.host + "/";
	$('a[href^="http"]').not('[href^="' + currentURL + '"]').click(function() {
		window.open(this.href, '');
		return false;
	});
	$('a[href^="http"]').not('[href^="' + currentURL + '"]').addClass("exLink");
	
	//window
	$('a[href$="window_shipley.html"]').click(function() {
		window.open(this.href, 'window', 'width=740, height=550, menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes');
		return false;
	});

	$('a[href$="window_process.html"]').click(function() {
		window.open(this.href, 'window', 'width=740, height=450, menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes');
		return false;
	});

	$('a[href$="window_disincentive.html"]').click(function() {
		window.open(this.href, 'window', 'width=840, height=810, menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes');
		return false;
	});
	
	// window load
	$(window).bind("load", loadComplete);
});

/* loadComplete
----------------------------------------------- */
function loadComplete() {

	$(window).unbind("load", loadComplete);

	// nav open
	$(".index #subNavi").delay(300).slideDown(500, "easeInOutCirc");
	
	// image fage
	$(".index .image img").delay(250).animate({ opacity:1 }, 800, "easeInOutSine");	
}

/* form
----------------------------------------------- */
function form_btn() {
	document.entry_terms.btn2.disabled =!document.entry_terms.btn[0].checked
}

/* pageup
----------------------------------------------- */
function pageup() {
	$("html, body").animate({ scrollTop:0 }, 500, "easeInOutCubic");
	return false;
}

/* analytics
----------------------------------------------- */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24896823-2']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' :'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();

