//オーバーレイの透明度
var opc = 0.8;
//イージング
jQuery.easing.def = "easeInOutQuart";

/*================================================
準備
================================================*/
$(document).ready(function(){
	//フォーカス枠非表示
	$('a').focus(function(e){
		this.blur();
	});
	//liの高さ揃え
	uniformLi($('#worksContent li'));
	
	$("div.wanted").css("height",$("div.wanted").outerHeight()+20);
});

/*================================================
スクロール、リサイズ時の処理
================================================*/
window.onscroll=function(){
};
window.onresize=function(){
};

/*================================================
フォーム送信
================================================*/
function submitForm(fID){
	$('#mailform p.confirmBtn a').attr('href','javascript:void(0)');
	$('#mailform p.confirmBtn a').css('opacity','0.5');
	//document.charset='shift_jis';
	document.charset='utf-8';
	frm = $('form#'+fID);
	//alert(frm);
	frm.submit();
}

/*================================================
Twitter読み込み
================================================*/

/****************************************************
 * jQuery RSS Plugin by fieeeld
 * version: 0.04 (2008/12/01)
 * @requires jQuery v1.2.6 or later
 *
 * Demo at: http://tpfields.xrea.jp/demo/js/sitefeeds/
 *
 ****************************************************/
$(function(){
	var date = dateParse(postTime);
	//var url = "http://twitter.com/gautt";
//	$('dl#content dd:first').append('<p id="tw"><a href="'+url+'">'+aaa+'<span>（'+date[0]+'）</span></a></p>');
	$('div.profile').append('<p class="tw"><a href="' + url + '">' + tweet + '<span></span></a></p>');
});

//dateParse: "2008/10/14" 形式
function dateParse(str){
    var objDate = new Date(str);
    var nowDate = new Date();
    //現在の日付との差を計算
    myDay = Math.floor((nowDate.getTime()-objDate.getTime()) / (1000*60*60*24)) + 1;
	/*
    //もし2週間以内なら"new!"マーク
    if (myDay < 15 ){
        var newMsg = '&nbsp;&nbsp;<span style="color:#ff6666; font-weight:bold;">new!</span>';
    } else {
        var newMsg = '';
    }*/
	//alert(new Date());
	//alert(str);
	var newMsg = '';
    var year = objDate.getFullYear();
    var month = objDate.getMonth() + 1;
    var date = objDate.getDate();
    if ( month < 10 ) { month = "0" + month; }
    if ( date < 10 ) { date = "0" + date; }
    str = year + '/' + month + '/' + date;
    rtnValue = new Array(2);
    rtnValue[0] = str;
    rtnValue[1] = newMsg;
    return rtnValue;
}


function getTwitter(json){
	postTime = json[0].created_at;
	tweet = json[0].text;
	url = "https://twitter.com/#!/gautt/status/" + json[0].id;
/*
	for ( var index in json[0]){
		alert(index);
	}
*/
}


/*================================================
求人
================================================*/
function showMore(target){
//	$(target).slideToggle(500);
	$(target).animate({ 
		height: "toggle",
		opacity:"toggle"
	}, 500);
}

/*================================================
li高さ揃え
================================================*/
function uniformLi(el){
	/*コンテンツ一覧の高さをすべて統一する*/
	var maxHeight = 0;
	el.each(function(){
		if($(this).height() > maxHeight){
			maxHeight = $(this).height();
		}
	});
	el.each(function(){
		$(this).height(maxHeight);
	});
}
