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

	Theme Name:design works onside inc.
	http://www.onside.com/
	Description:Common Style Sheet　08-02-2010 (mm-dd-yyyy)
	Version:ver. 1.0

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



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



$(document).ready(function() {

	$(document).pngFix();

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

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

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

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

	$('#bottomNavi').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[href*='#'],.tabNaviCenter a[href*='#']").easingScroll({
		easing: "easeOutQuad",
		duration: 600
	});*/

	$('#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);
	});



// AdSenseの角丸
	$('.comadBlockS dt').corner('10px top');
	$('.comadBlockS dd').corner('10px bottom');



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



	$('#contactCont input#submit,#contactCont 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');
	});



// フッター部分の Show Hide

	$('.hide,.show').hover(
		function() {
			$(this).addClass('hoverBtn');
		},
		function() {
			$(this).removeClass('hoverBtn');
	});

	$('#scissors').toggle(
		function() {
			$(this).html('show');
			$(this).removeClass('hide');
			$(this).addClass('show');
			$('#toggle').fadeOut('slow');
			return false;
		},
		function() {
			$(this).html('hide');
			$(this).removeClass('show');
			$(this).addClass('hide');
			$('#toggle').fadeIn('slow');
			return false;
		}
	);



// フッター部分のリンクブロック

	$('.linkBlock dl').hover(
		function() {
			$(this).find('dt a,dd a,dd em').addClass('hover');
		},
		function() {
			$(this).find('dt a,dd a,dd em').removeClass('hover');
	});

	$('.linkBlock dl').click(function() {
		window.location=$(this).find('a').attr('href');
		return false;
	});

	//fade things on hover
	/*$(".hovers").hoverFade();*/

	$('#qrcode').find('img').fadeTo(200,0.5);

	$('#qrcode').hover(
		function() {
			$(this).find('img').fadeTo(200,1);
			$(this).find('dd').addClass('hover');
		},
		function() {
			$(this).find('img').fadeTo(200,0.5);
			$(this).find('dd').removeClass('hover');
	});



	$('#plane').sprite({fps: 15, no_of_frames: 23});

	$('#stage').find('img').fadeTo(0,0);
	$('#stage').hover(
		function() {
			$(this).find('img').fadeTo(200,1);
		},
		function() {
			$(this).find('img').fadeTo(200,0);
	});

});



/*function plane() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="320" height="200" id="plane">');
	document.write('<param name="movie" value="/fla/plane.swf" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="scale" value="exactfit" />');
	document.write('<param name="bgcolor" value="#5B536C" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="/fla/plane.swf" menu=false quality=autohigh scale=exactfit bgcolor="#5B536C" width="320" height="200" wmode="transparent" name="plane" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	document.write('</object>');
	document.close();
}*/

function acclog() {
	document.write("<img src='http://www.onside.com/cgi-local/acc/acclog.cgi?");
	document.write("referrer="+document.referrer+"&");
	document.write("width="+screen.width+"&");
	document.write("height="+screen.height+"&");
	document.write("color="+screen.colorDepth+"' />");
}



