/*	
Author:Kyo Ichida
Author URI:http://www.abcjapon.co.jp
Version:0.3
*/

jQuery(document).ready(function($){
	$(".home #access").hide();
	$(".home #footer").css({opacity: 0.0});
	$("html .home #branding").hover(function(){
		$(".home #access").stop(true, true).slideDown("slow");
	});
/*	$("html .home").hover(function(){
		$(".home #access").stop(true, true).slideDown("slow");
	},function(){
		$(".home #access").slideUp("slow");
	});
*/
	$("html").hover(function(){
		$(".home #access").stop(true, true).slideDown("slow");
		$(".home #footer").stop(true, true).animate({opacity: 1.0});
	},function(){
		$(".home #access").slideUp("slow");
		$(".home #footer").stop(true, true).animate({opacity: 0.0});
	});

	$(function(){
		$('a[href^=#]').click(function() {
			var speed = 900;
			var href= $(this).attr("href");
			var target = $(href == "#" || href == "" ? 'html' : href);
			var position = target.offset().top;
			$($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, speed, 'swing');
			return false;
		});
	});
/*
	$(function(){
		$("p").hover(function(){
//			$(this).animate({background-color: "#ffffff" }, 400);
//			$(this).animate({background-color: "rgba(255, 255, 255, 0.8)" }, 400);
			$(this).animate({color: "#ff0000" }, 400);
		},function(){
//			$(this).animate({background-color: "transparent" }, 500);
			$(this).animate({color: "#000000" }, 500);
		});
	});
*/
	$(function(){
		$("#main").hover(function(){
			$(this).css("background-color", "#ffffff");
			$(this).css("background-color", "rgba(255, 255, 255, 0.5)");
		},function(){
			$(this).css("background-color", "transparent");
		})
	});



	var nav = $('#primary .xoxo'),
	offset = nav.offset();
	$(window).scroll(function (){
		if($(window).scrollTop() > offset.top - 20){
			nav.addClass('fixed');
		}else{
			nav.removeClass('fixed');
		}
	});


	$(function(){
		jQuery('img.bgmaximage').maxImage({
			isBackground:true,
			slideShow:true,
			slideShowTitle:false,
			slideDelay:6,
			overflow:'auto',
			verticalAlign:'top'
		});
	});

});

function annee(){
	TheDate=new Date();
	annee_now=parseInt(TheDate.getYear());
	if(annee_now<200 && annee_now>99) annee_now+=1900;
	if(annee_now<100 && annee_now>80) annee_now+=1900;
	if(annee_now<=80) annee_now+=2000;
	return(annee_now);
}
/*
function externalLinks(){
if(!document.getElementsByTagName) return;
var anchors=document.getElementsByTagName("a");
for(var i=0;i<anchors.length;i++){
varanchor=anchors[i];
if(anchor.getAttribute("href")&&
((anchor.getAttribute("rel")=="external nofollow")||(anchor.getAttribute("rel")=="nofollow external")||(anchor.getAttribute("rel")=="external")))
anchor.target="_blank";
}
}
window.onload = externalLinks;
*/
