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

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

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

$(document).ready(function() {

// 背景画像のスライド（jquery.BgImageTransition）
	var bgImages = [ 'contents_images_01.jpg', 'contents_images_02.jpg', 'contents_images_03.jpg', 'contents_images_04.jpg', 'contents_images_05.jpg', 'contents_images_07.jpg', 'contents_images_08.jpg' ];
	var currImage = 'contents_images_06.jpg';
	setInterval( function(){
		do{
			var randImage = bgImages[Math.ceil(Math.random()*(bgImages.length-1))];
		}while( randImage == currImage )
		currImage = randImage;
		$('#blaf').BgImageTransition( '/common/img/'+currImage );
	}, 5000)

	$('.extended,.hiddened').hover(
		function() {
			$(this).addClass('hover');
		},
		function() {
			$(this).removeClass('hover');
	});

	$('.extended').click(function() {
			$(this).fadeOut('slow');
			$(this).next('div').fadeIn('slow');
			return false;
	});

	$('.hiddened').click(function() {
			$(this).parent('div').ScrollTo(1000, 'easeout');
			$(this).parent('div').fadeOut('slow');
			$('.extended').fadeIn('slow');
			return false;
	});

	$('.comBlock').hover(
		function() {
			$(this).addClass('hover');
			$(this).find('.comAvatar img').addClass('hover');
		},
		function() {
			$(this).removeClass('hover');
			$(this).find('.comAvatar img').removeClass('hover');
	});

	$('.comBlock:even').addClass('addColor');
	$('.comBlock:even').find('.comAvatar img').addClass('addColor');

	$('.comBlock').corner('10px');
	$('.formBlock').corner('10px');

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



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



// フォーカスで消える文字
	$('#comment')
		.focus(function() {
			$(this).val("");
		})
		.blur(function() {
			if ($(this).val()=="") {
				$(this).val("お気軽にコメントをお寄せください。")
			};
	});

	//$('.itemBlock .left').corner();
	//$('.itemBlock .leftC').corner();
	//$('.itemBlock .centerLink').corner();
	//$('#tagcloudBlock ul.wp-tag-cloud').corner();

/*
	$("#prev").html(
		$("#prev").html().replace( /«/ig , "" )
	)
	$("#next").html(
		$("#next").html().replace( /»/ig , "" )
	)
	
	$('#wp-calendar thead th:eq(0)').addClass('sun');
	$('#wp-calendar thead th:eq(6)').addClass('sat');

	$('.meta a:eq(0)').addClass('register');
	$('.meta a:eq(1)').addClass('logout');
*/




});

function fps()	{
	var num;
	num = 4;
	i = Math.floor(Math.random() * num);
	if(i==0){
		photo_search({ text: 'jazz album' });
	} else if(i==1) {
		photo_search({ text: 'portrait woman beauty' });
	} else if(i==2) {
		photo_search({ text: 'product design' });
	} else if(i==3) {
		photo_search({ text: 'graphic design' });
	}
	//document.write(i);
	//document.close();
	//photo_search(i);
	//photo_search({ text: 'bluenote jazz' });
}

/*function showHide(entryID, entryLink, htmlObj, type) {
	if (type == "comments") {
		extTextDivID = ('comText' + (entryID));
		extLinkDivID = ('comLink' + (entryID));
	} else {
		extTextDivID = ('extText' + (entryID));
		extLinkDivID = ('extLink' + (entryID));
	}
	if( document.getElementById ) {
		if( document.getElementById(extTextDivID).style.display ) {
			if( entryLink != 0 ) {
				document.getElementById(extTextDivID).style.display = "block";
				document.getElementById(extLinkDivID).style.display = "none";
				htmlObj.blur();
			} else {
				document.getElementById(extTextDivID).style.display = "none";
				document.getElementById(extLinkDivID).style.display = "block";
			}
		} else {
			location.href = entryLink;
			return true;
		}
	} else {
		location.href = entryLink;
		return true;
	}
}*/



function dwoClock() {

	var isiPad = navigator.userAgent.match(/iPad/i) != null;
	var isiPhone  = navigator.userAgent.match(/iPhone/i) != null;
	var isiPod = navigator.userAgent.match(/iPod/i) != null;

	if (isiPad) {
		document.write('<p id="dwoClock">');
		document.write('<img src="/img/blog/monkey.jpg" width="180px" height="260px" border="0" alt="" />');
		document.write('</p>');
	} else if (isiPhone) {
		document.write('<p id="dwoClock">');
		document.write('<img src="/img/blog/monkey.jpg" width="180px" height="260px" border="0" alt="" />');
		document.write('</p>');
	} else if (isiPod) {
		document.write('<p id="dwoClock">');
		document.write('<img src="/img/blog/monkey.jpg" width="180px" height="260px" border="0" alt="" />');
		document.write('</p>');
	} else {
		document.write('<p id="dwoClock">');
		document.write('<script type="text/javascript">viewClock()</script>');
		document.write('</p>');
		//document.write(number);
		document.close();
	}

}

function dwoClockJS() {

	var isiPad = navigator.userAgent.match(/iPad/i) != null;
	var isiPhone  = navigator.userAgent.match(/iPhone/i) != null;
	var isiPod = navigator.userAgent.match(/iPod/i) != null;

	if (isiPad) {
		document.write('<script type="text/javascript" src="/js/blog/jQueryRotate.js"></script>');
		document.write('<script type="text/javascript" src="/js/blog/clock.js"></script>');
		document.write('<script language="JavaScript">$(document).ready(function(){ clock(); });</script>');
		document.write('<div class="clock">');
		document.write('<div class="clock_bg">');
		document.write('<div class="clockHours"><img src="/img/blog/clock_js/hours_hand.png" id="hours_hand" /></div>');
		document.write('<div class="clockMinutes"><img src="/img/blog/clock_js/minutes_hand.png" id="minutes_hand" /></div>');
		document.write('<div class="clockSeconds"><img src="/img/blog/clock_js/seconds_hand.png" id="seconds_hand" /></div>');
		document.write('</div>');
		document.write('<div class="clock_bg_r">');
		document.write('<div class="clockHours_r"><img src="/img/blog/clock_js/hours_hand_r.png" id="hours_hand_r" /></div>');
		document.write('<div class="clockMinutes_r"><img src="/img/blog/clock_js/minutes_hand_r.png" id="minutes_hand_r" /></div>');
		document.write('<div class="clockSeconds_r"><img src="/img/blog/clock_js/seconds_hand_r.png" id="seconds_hand_r" /></div>');
		document.write('</div>');
		document.write('<div class="gradation"><img src="/img/blog/clock_js/gradation.png" /></div></div>');
		document.close();
	} else if (isiPhone) {
		document.write('<img src="img/blog/monkey.jpg" width="180px" height="260px" border="0" alt="" />');
	} else if (isiPod) {
		document.write('<img src="img/blog/monkey.jpg" width="180px" height="260px" border="0" alt="" />');
	} else {
		document.write('<p id="dwoClock">');
		document.write('<script type="text/javascript">viewClock()</script>');
		document.write('</p>');
		//document.write(number);
		document.close();
	}

}

function viewClock() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="180" height="260" id="clock_180" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="/fla/clock_180.swf" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="/fla/clock_180.swf" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="180" height="260" name="clock_250" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	document.close();
}



function dwoClockJS_sample() {
	document.write('<script type="text/javascript" src="/js/blog/jQueryRotate.js"></script>');
	document.write('<script type="text/javascript" src="/js/blog/clock.js"></script>');
	document.write('<script language="JavaScript">$(document).ready(function(){ clock(); });</script>');
	document.write('<div class="clock">');
	document.write('<div class="clock_bg">');
	document.write('<div class="clockHours"><img src="/img/blog/clock_js/hours_hand.png" id="sample_hours_hand" /></div>');
	document.write('<div class="clockMinutes"><img src="/img/blog/clock_js/minutes_hand.png" id="sample_minutes_hand" /></div>');
	document.write('<div class="clockSeconds"><img src="/img/blog/clock_js/seconds_hand.png" id="sample_seconds_hand" /></div>');
	document.write('</div>');
	document.write('<div class="clock_bg_r">');
	document.write('<div class="clockHours_r"><img src="/img/blog/clock_js/hours_hand_r.png" id="sample_hours_hand_r" /></div>');
	document.write('<div class="clockMinutes_r"><img src="/img/blog/clock_js/minutes_hand_r.png" id="sample_minutes_hand_r" /></div>');
	document.write('<div class="clockSeconds_r"><img src="/img/blog/clock_js/seconds_hand_r.png" id="sample_seconds_hand_r" /></div>');
	document.write('</div>');
	document.write('<div class="gradation"><img src="/img/blog/clock_js/gradation.png" /></div></div>');
	document.close();
}

function clock_sample() {
	document.write('<script type="text/javascript">$(document).ready(function(){ clock(); });</script>');
	document.write('<div class="clock_face">');
	document.write('<div class="clock_hours"><img src="/img/blog/clock_js/clock_hours_hand.png" id="clock_hours_hand" /></div>');
	document.write('<div class="clock_minutes"><img src="/img/blog/clock_js/clock_minutes_hand.png" id="clock_minutes_hand" /></div>');
	document.write('<div class="clock_seconds"><img src="/img/blog/clock_js/clock_seconds_hand.png" id="clock_seconds_hand" /></div>');
	document.write('</div>');
}

$(function() {
	$(".block a[rel^='prettyPhoto']").prettyPhoto({theme: 'facebook'});
})

function plusone() {
	//document.write('<g:plusone size="medium" count="false"></g:plusone>');
	document.write('<g:plusone size="medium"></g:plusone>');
	document.close();
}
