$(document).ready(function(){

	//--------------------------------------//
	//ブラウザ判別
	//--------------------------------------//
	
	/*
	$.browser.msie
	$.browser.opera
	$.browser.safari
	$.browser.mozilla
	*/
	
	if ($.browser.msie && $.browser.version <= 6){
		movePages();
	} 
	
	//ページ移管
	function movePages(){
		location.href="http://www.tfdesignstudio.com/ie.html";
	}
	
	
	//--------------------------------------//
	//vgrid1.6
	//--------------------------------------//
	//setTimeout(function(){
		$("#grid-content").vgrid({
			easeing: "easeOutQuint",
			useLoadImageEvent: true,
			time: 1000,
			delay: 100,
			fadeIn: {
			time: 500,
			delay: 100
			}
		});
	//},2000);
	
	
	/*$("#grid-content div").mouseover(function(){
		$(this).css("background","#ddd");
	});
	
	$("#grid-content div").mouseout(function(){
		$(this).css("background","#fff");
	});*/
	
	//--------------------------------------//
	//supersized3.1
	//--------------------------------------//
	/**/jQuery(function($){
		$.supersized({
		
		//Functionality
		slideshow               :   0,		//Slideshow on/off
		autoplay				:	0,		//Slideshow starts playing automatically
		start_slide             :   1,		//Start slide
		slide_interval          :   3000,	//Length between transitions
		transition              :   0, 		//0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
		transition_speed		:	1500,	//Speed of transition
		new_window				:	0,		//Image links open in new window/tab
		pause_hover             :   0,		//Pause slideshow on hover
		keyboard_nav            :   0,		//Keyboard navigation on/off
		performance				:	1,		//0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
		
		//Size & Position
		min_width		        :   0,		//Min width allowed (in pixels)
		min_height		        :   0,		//Min height allowed (in pixels)
		vertical_center         :   1,		//Vertically center background
		horizontal_center       :   1,		//Horizontally center background
		fit_portrait         	:   0,		//Portrait images will not exceed browser height
		fit_landscape			:   0,		//Landscape images will not exceed browser width
		
		//Components
		navigation              :   0,		//Slideshow controls on/off
		thumbnail_navigation    :   0,		//Thumbnail navigation
		slide_counter           :   0,		//Display slide numbers
		slide_captions          :   0,		//Slide caption (Pull from "title" in slides array)
		slides 					:  	[		//Slideshow Images
		{image : 'http://tfdesignstudio.com/img/2012.jpg', title : '', url : ''}
		]
				
		}); 
	});

	
	//--------------------------------------//
	//globalnavi - 開閉
	//--------------------------------------//
	$("#open").click(function(){
		$("#header").animate({height: "toggle", opacity: "toggle"},"normal");
		$("#open span").toggle(0);
		/*$("#middleWrappe").toggle(
			function(){
				$(this).animate({padding:"10px 0 0 0"},"normal");
			},
			function(){
				$(this).animate({padding:"100px 0 0 0"},"normal");
			}
		);*/
			//$("#globalNaviNew").toggle(0);
		return false;
	});
	
	//globalnavi - middleWrappe　位置
	$("#open").toggle(
		function(){
			$("#middleWrappe").animate({padding:"10px 0 0 0"},"normal");
		},
		function(){
			$("#middleWrappe").animate({padding:"40px 0 0 0"},"normal");
		}
	);
	
	//--------------------------------------//	
	//globalnavi - RollOver
	//--------------------------------------//
	$('#globalNaviNew li a').wink(500);

	//--------------------------------------//
	//aboutMe - 開閉
	//--------------------------------------//
	$("a#btAboutMe").click(function(){
	
		$("#aboutMe").animate({height: "toggle"},"normal");
	
		return false;
	});
	
	function backGroundOn(){
		$("#grid-content div").fadeOut();
		setTimeout(function(){
			$("#content").fadeIn();
		},1000);
	}
	
	function backGroundOff(){
		$("#content").fadeOut();
		setTimeout(function(){
			$("#grid-content div").fadeIn();
		},1000);
	}
	
	//--------------------------------------//
	//#about
	//--------------------------------------//
	$("#navi02 .Mycontents").click(function(){
		backGroundOn();
		$("#about").fadeIn();
		$("#works").fadeOut();
	});
	
	$("#about .closeBtB").click(function(){
		$("#about").fadeOut();
		$("#works").fadeOut();
		backGroundOff();
	});
	
	//--------------------------------------//
	//#works
	//--------------------------------------//
	$("#navi03 .Mycontents").click(function(){
		backGroundOn();
		$("#works").fadeIn();
		$("#about").fadeOut();
	});
	
	$("#works .closeBtB").click(function(){
		$("#works").fadeOut();
		$("#about").fadeOut();
		backGroundOff();
	});
	
	//--------------------------------------//
	//center 表示
	//--------------------------------------//
	var center = function(){
		var about = Math.floor(($(window).height() - $("#mainContent").height())/2);
		$("#mainContent").animate({top:about});
		
	}

	//リサイズ時再度計算
	$(window).resize(function(){
		center();
	});
	
	//計算
	$(function(){
		center();
	});
	
	//--------------------------------------//
	//#slider
	//--------------------------------------//
	$("#slide").awShowcase(
	{
		content_width:			640,
		content_height:			480,
		fit_to_parent:			false,
		auto:					false,
		interval:				7000,
		continuous:				true,
		loading:				true,
		tooltip_width:			200,
		tooltip_icon_width:		32,
		tooltip_icon_height:	32,
		tooltip_offsetx:		18,
		tooltip_offsety:		0,
		arrows:					true,
		buttons:				true,
		btn_numbers:			false,
		keybord_keys:			true,
		mousetrace:				false, 
		pauseonover:			true,
		stoponclick:			false,
		transition:				'hslide', /* hslide/vslide/fade */
		transition_delay:		0,
		transition_speed:		500,
		show_caption:			'onload', /* onload/onhover/show */
		thumbnails:				false,
		thumbnails_position:	'outside-last', /* outside-last/outside-first/inside-last/inside-first */
		thumbnails_direction:	'vertical', /* vertical/horizontal */
		thumbnails_slidex:		1, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
		dynamic_height:			false, 
		speed_change:			true,
		viewline:				false, 
		custom_function:		null 
	});


	//--------------------------------------//
	//拡張
	//--------------------------------------//

	
});


