new (function(optionObj){
	this.IDs={
		 initStyle:""
	}	  
	this.SELECTORs={
		 parent:""
		,child:""
	}
	this.HTMLs={
		opener:""
	}
	this.hideLimit=10;
	this.ANIMATIONs={
		option:{}
	}
	
	this.openers=[]
	this.hideOuts=[]
	
	this.setStyle=function(){
		document.write("<style id='"+this.IDs.initStyle+"'>"+this.SELECTORs.parent+"{display:none!important}<\/style>");
	}
	this.loadFunction=function(){
		$A($$(this.SELECTORs.parent)).each(this.initialList.bind(this));
		this.displayParent()
	}
	
	this.preSort=function(parentElem){
		var childElems=$A(parentElem.getElementsByTagName(this.SELECTORs.child))
		if(childElems.length<1) return;
		var stacks=[]
		for (var i=0,L=childElems.length;i<L;i++){
			
			var childElem=$(childElems[i])
			var aElem = childElem.down("a.important")
			
			
			if(aElem==null) continue;
			
			stacks.push(childElem)
		}
		
		if(stacks.length<1) return;
		for(var i=(stacks.length+1);i>=0;i--){
			parentElem.insert({top:stacks[i]})
		}
		
	}
	
	this.initialList=function(parentElem,key){
		
		this.preSort(parentElem);
		
		var childElems=$A(parentElem.getElementsByTagName(this.SELECTORs.child))
		
		if(childElems.length <= this.hideLimit) return null;
		
		var hideoutElem = parentElem.cloneNode(false);
		parentElem.insert({after:hideoutElem})

		hideoutElem.hide();
		
		var openerWrapperElem = new Element("div");
		hideoutElem.insert({after:openerWrapperElem})
		if(typeof this.CLASSes.openerWrapper!="undefined") openerWrapperElem.className=this.CLASSes.openerWrapper
		
		var openerElem = new Element("a",{href:"#"})
		openerWrapperElem.insert(openerElem)
		
		openerElem.insert( this.HTMLs.opener )
		
		Event.observe(openerElem,"click",this.clickFunction.bind(this,key),false);
		
		childElems.each(function(childElem,key){
			if( key+1 <= this.hideLimit) return false;
			
			hideoutElem.insert(childElem)
		}.bind(this))
		
		this.openers[key]=openerElem
		this.hideOuts[key]=hideoutElem
		

		parentElem.style.paddingBottom="0px";
		hideoutElem.style.paddingTop="0px";
		openerWrapperElem.style.paddingRight="1em";
	}
	this.clickFunction=function(key,e){
		e.stop();
		this.ANIMATIONs.option.afterFinish=this.afterOpened.bind(this,key)
		
		new Effect.BlindDown(this.hideOuts[key],this.ANIMATIONs.option)
	}
	this.afterOpened=function(key,e){
		this.openers[key].hide()
	}
	this.displayParent=function(){
		//$(this.IDs.initStyle).disabled=true;
		$(this.IDs.initStyle).remove()
	}
	
	// main
	for(var prop in optionObj){
		this[prop]=optionObj[prop]
	}
	this.setStyle()
	
	Event.observe(document,"dom:loaded",this.loadFunction.bind(this),false);
})({
	 IDs:{
		 initStyle:"hideList_style"
	}
	,SELECTORs:{
		 parent:"#top_left ul"
		,child:"li"
	}
	,hideLimit:5
	,HTMLs:{
		opener:"続きを見る <span>▼</span>"
	}
	,CLASSes:{
		openerWrapper:"news_showall"
	}
	,ANIMATIONs:{
		option:{
			 duration:0.5
		}
	}
})

