/*
	基本のJS
	作成日：080211
	更新日：080211
*/

$(function(){
	//別窓ウインドウ
	$('[@href^="http"]').not('[@href*="'+document.domain+'"]').click(function(){
		window.open(this.href, "_blank");
		return false;
	}).each(function() {
		$(this.parentNode).addClass('external');
	});

	//PDF
	$('a[@href$=".pdf"]').click(function(){
		window.open(this.href, "_blank");
		return false;	
	}).each(function() {
		$(this.parentNode).addClass('pdf');
	});	

	//Word
	$('a[@href$=".doc"]').each(function() {
		$(this.parentNode).addClass('word');
	});	

	//Excel
	$('a[@href$=".xls"]').each(function() {
		$(this.parentNode).addClass('excel');
	});	

	//PPT
	$('a[@href$=".ppt"]').each(function() {
		$(this.parentNode).addClass('ppt');
	});	
	
	//zip
	$('a[@href$=".zip"]').each(function() {
		$(this.parentNode).addClass('zip');
	});

	//exe
	$('a[@href$=".exe"]').each(function() {
		$(this.parentNode).addClass('exe');
	});
	
	//MailTo
	$('a[@href^="mailto"]').each(function() {
		$(this.parentNode).addClass('mailTo');
	});	

	//Scroll
	var pageUrl = location.href.split('#')[0];
	$('a[@href]').each(function() {
		if (this.href.indexOf(pageUrl + '#') == 0) {
			var id = this.href.split('#')[1];
			$(this).click(function() {
				$('#' + id).ScrollTo(300, 'easeout');
				return false;
			});
		}
	});	  
	
	//最新jQuery対応
	(function($) {
		$.dequeue = function( a , b ){
		return $(a).dequeue(b);
		};
	})( jQuery );
});  