// JavaScript Document

//
// 調達情報の入札情報で、日付セルをチェックして、本日より１ヶ月以内の情報の場合、
// タイトルのセルにNEWラベルを付ける処理
//
//

jQuery(function($) {
	
	var last = new $.exDate().addMonths(-1).getTime();	// 拡張日付オブジェクト（本日）	

	$("div#newsTargetArea dt").each(function(id,obj){
	
		var cell = $(obj).text().match(/([0-9]+?)年([0-9]+?)月([0-9]+?)日/);
		
		if(cell){
			var i = new $.exDate(cell[1] + "/" + cell[2] + "/" + cell[3]).getTime();
			
			if(last < i){
				//console.log("一ヶ月以内です");
				// このときの２つ横のセルにNEWを付ける
				$(obj).next().addClass("newsLabel");
				
			}else{
				//console.log("古いです");
			}
			
		}else{
			// 日付以外のセル
		}
	})

	//
	// １行お知らせのアニメーション
	//
	$("div#medical_collabo").animate(
	{ backgroundColor:'brown' },
	{ duration : 700,easing : "linear",
	 complete:function(){
		 $("div#medical_collabo").animate(
			{ backgroundColor:'#FDD9E2' },
			{ duration : 1000,easing : "linear"}
		);
	 }
	});
	
	// フッターポップアップ関係
	$("#closePopup").click(function(){
		$.unfixedUI();
		return false;
	});
	
	setTimeout(function(){
		$.fixedUI("#specialPopup");
	},1000);
	

});

