
/*----------------------------------------------

	Theme Name:Nextware Ltd.
	http://www.nextware.co.jp/
	Description:Common Style Sheet　10-10-2008 (mm-dd-yyyy)
	Version:ver. 1.0

----------------------------------------------*/



function thisYear() {
	weeks=new Array('日','月','火','水','木','金','土');
	today=new Date();
	y=today.getFullYear();
	m=today.getMonth()+1;
	d=today.getDate();
	w=weeks[today.getDay()];
	document.write(y);
	document.close();
}



$(function() {
// for エラー: jQuery.dequeue is not a function
( function( $ ) {
$.dequeue = function( a , b ){
return $(a).dequeue(b);
};
})( jQuery );
});



$(document).ready(function() {

// 現在のページにクラスを追加

	$('#headerNavi').find('a').each(function(){
		if( location.href.indexOf(this.href) != -1) {
			$(this).addClass('current');
		}
	});

	$('#sideNavi').find('a').each(function(){
		if( location.href.indexOf(this.href) != -1) {
			$(this).addClass('current');
		}
	});

	$('#businessSideNavi').find('a').each(function(){
		if( location.href.indexOf(this.href) != -1) {
			$(this).addClass('current');
		}
	});

// ロールオーバーボタンにクラスを追加
	var conf = {
		className : 'btn',
		postfix : '_over'
	};
	$('img.'+conf.className).hover(
		function() {
			this.originalSrc = this.src;
			this.src = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/,conf.postfix+'$1');
		},
		function() {
			this.src = this.originalSrc;
	});
	$('input.'+conf.className).hover(
		function() {
			this.originalSrc = this.src;
			this.src = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/,conf.postfix+'$1');
		},
		function() {
			this.src = this.originalSrc;
	});

// ページトップへスムーズスクロール
	$('#scrollPageTop a').click(function() {
		$('#container').ScrollTo(1000, 'easeout');
		return false;
	});

// 新規ウインドウオープン

	$('a.blank').click(function() {
		window.open(this.href, '_blank').focus();
		return false;
	});



	var popupEvent = function(event) {
		var option = 'width=680,height='+screen.availHeight+',left=0,top=0,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,status=no,location=no,directories=no,addressbar=no';
		window.open(this.href, this.rel, option).focus();
		event.preventDefault();
		event.stopPropagation();
	}
	$("a.popup").each(function(i) {
		$(this).click(popupEvent);
		$(this).keypress(popupEvent);
	});

// フォーカスで消える文字
	$('#Comments')
		.focus(function() {
			if ($(this).val()=='お問い合わせ内容をどうぞ。') {
				$(this).val('');
			}
		})
		.blur(function() {
			if ($(this).val()=='') {
				$(this).val('お問い合わせ内容をどうぞ。')
			};
	});

	$('a[@href$=pdf]').addClass('pdf');
	$('a[@href$=xls]').addClass('xls');
	$('a[@href$=ppt]').addClass('ppt');
	$('a[@href$=doc]').addClass('doc');



	$('input[@type="text"],textarea').hover(
		function() {
			$(this).addClass('hover');
		},
		function() {
			$(this).removeClass('hover');
	});

	$('input[@type="text"],textarea').focus(function() {
		$(this).addClass('focus');
	});

	$('input[@type="text"],textarea').blur(function(){
		$(this).removeClass('focus');
	});

	$('#contactBlock input#submit,#contactBlock input#reset').hover(
		function() {
			$(this).addClass('hoverBtn');
		},
		function() {
			$(this).removeClass('hoverBtn');
	});

	$('#entryBlock input#submit,#entryBlock input#reset').hover(
		function() {
			$(this).addClass('hoverBtn');
		},
		function() {
			$(this).removeClass('hoverBtn');
	});



});

