var ContNews = function(){
	this.name = "news";
	
	this.func = function(){
		//console.log(this.name)
	}
	this.preset = function(){
		
	}
	this.initialize = function(){
		//最新記事取得
		newslist = $("#news-list li");
		
		
		
		for( i=0; i < newslist.length; i ++ ){
			$(newslist[i]).find("a").click( function(){
				S.playclick();
				$(this).attr("disabled","disabled");
				$("#pane").animate( { opacity:0 }, 500  ,"easeOutCubic" , function(){
				} );
				href = $(this).attr("href");
				$("#pane").delay(10).load( href + " #page" ,{} , P.cont.contLoaded );
				P.cont.setbtn();
				return false;
			} )
		}
		
		var btn = $(newslist[0]).find("a");
		$(btn).attr("disabled","disabled");
		P.cont.setbtn();
		target = $(newslist[0]).find("a");
		
		if(def_article){
			this.loadNews("/?p=" + def_article);
		}else{
			this.loadNews(target.attr("href"));
		}
		
		$("#pane").css( "opacity", 0 );
		$.event.add($("#pane"), "load", function(){
			P.cont.onresize();
		});
		if( BrowserDetect.OS == "iphone" ||BrowserDetect.OS == "ipad" ){
			document.getElementById("pane").addEventListener( "touchstart" , P.cont.onresize );
		}
		$(window).resize( this.onresize );
		/*$("#content-inner").bind('jsp-initialised',function(event, isScrollable){
			jspFix();
		});*/
   	}
	this.onresize = function(){
		
		//$('#area').jScrollPaneRemove();
		$('#pane').css("height", ($(window).height() - 120) + "px" );
		$('#page').css("height", ($(window).height() - 120) + "px" );
		$('#area').css("height", ($(window).height() - 120) + "px" );
		$('#area').jScrollPane({
			autoReinitialise: true
		});

			
	}
	this.setbtn = function(){
		$("#news-list li a").each( function(){
			$(this).unbind( "mouseover" , P.btnhover );
			if( $(this).attr("disabled") == "disabled" ){
				$(this).stop();
				$(this).css("opacity",0.5);
			}else{
				$(this).css("opacity",1);
				$(this).stop();
				$(this).bind( "mouseover" , P.btnhover );
			}
		});
		$("#news-list li a").each( function(){
			$(this).unbind( "mouseout" , P.btnout );
			if( $(this).attr("disabled") == "disabled" ){
				$(this).removeAttr("disabled");
				$(this).stop();
				$(this).css("opacity",0.5);
			}else{
				$(this).css("opacity",1);
				$(this).stop();
				$(this).bind( "mouseout" , P.btnout );
			}
		});
	}
	this.loadNews = function( href ){
		$("#pane").load( href + " #page" ,{} , P.cont.contLoaded);
		P.cont.onresize();
	}
	this.contLoaded = function(){
		P.cont.onresize();
		$("#pane").delay(10).animate( { opacity:1 }, 500  ,"easeOutCubic" ,function(){
		});
	}
	
}

