function seltab(bpref, hpref, id_max, selected) {
  if (! document.getElementById) return;
  for (i = 0; i <= id_max; i++) {
    if (! document.getElementById(bpref + i)) continue;
    if (i == selected) {
      document.getElementById(bpref + i).style.visibility = "visible";
      document.getElementById(bpref + i).style.position = "";
      document.getElementById(hpref + i).className = "open";
    } else {
      document.getElementById(bpref + i).style.visibility = "hidden";
      document.getElementById(bpref + i).style.position = "absolute";
      document.getElementById(hpref + i).className = "close";
    }
  }
}

function miniPlayer (fileId) {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="50" height="30" id="miniplayer_' + fileId + '">\n');
document.write('<param name="allowScriptAccess" value="always" />\n');
document.write('<param name="movie" value="http://image.onpoo.net/audition.swf?id=' + fileId + '" />\n');
document.write('<param name="loop" value="false" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="#ffffff" />\n');
document.write('<embed src="http://image.onpoo.net/audition.swf?id=' + fileId + '" loop="false" quality="high" bgcolor="#ffffff" width="50" height="30" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" name="miniplayer_' + fileId + '" />\n');
document.write('</object>\n');
}

function miniPlayerError (fileId) {
  alert('ログインすると試聴できます');
  location.href = 'http://bin.onpoo.net/mypage/';
}

function RuntopFlash()
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="260" height="36" id="head_banner" align="middle">\n');
document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
document.write('<param name="movie" value="http://onpoo.net/swf/banner_top01.swf" />\n');
document.write('<param name="loop" value="false" />\n');
document.write('<param name="menu" value="false" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="#ffffff" />\n');
document.write('<embed src="http://onpoo.net/swf/banner_top01.swf" loop="false" menu="false" quality="high" bgcolor="#ffffff" width="260" height="36" name="top" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />\n');
document.write('</object>\n');
}

/*--------------------------------------------------------------------------*
 *  
 *  heightLine JavaScript Library beta1
 *  
 *  MIT-style license. 
 *  
 *  2007 Kazuma Nishihata 
 *  http://www.webcreativepark.net
 *  
 *--------------------------------------------------------------------------*/
new function(){
	
	function heightLine(){
	
		this.className="heightLine";
		this.parentClassName="heightLineParent"
		reg = new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i");
		objCN =new Array();
		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
		for(var i = 0; i < objAll.length; i++) {
			var eltClass = objAll[i].className.split(/\s+/);
			for(var j = 0; j < eltClass.length; j++) {
				if(eltClass[j] == this.className) {
					if(!objCN["main CN"]) objCN["main CN"] = new Array();
					objCN["main CN"].push(objAll[i]);
					break;
				}else if(eltClass[j] == this.parentClassName){
					if(!objCN["parent CN"]) objCN["parent CN"] = new Array();
					objCN["parent CN"].push(objAll[i]);
					break;
				}else if(eltClass[j].match(reg)){
					var OCN = eltClass[j].match(reg)
					if(!objCN[OCN]) objCN[OCN]=new Array();
					objCN[OCN].push(objAll[i]);
					break;
				}
			}
		}
		
		//check font size
		var e = document.createElement("div");
		var s = document.createTextNode("S");
		e.appendChild(s);
		e.style.visibility="hidden"
		e.style.position="absolute"
		e.style.top="0"
		document.body.appendChild(e);
		var defHeight = e.offsetHeight;
		
		changeBoxSize = function(){
			for(var key in objCN){
				if(key == "parent CN"){
					for(var i=0 ; i<objCN[key].length ; i++){
						var max_height=0;
						var CCN = objCN[key][i].childNodes;
						for(var j=0 ; j<CCN.length ; j++){
							if(CCN[j] && CCN[j].nodeType == 1){
								CCN[j].style.height="auto";
								max_height = max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight;
							}
						}
						for(var j=0 ; j<CCN.length ; j++){
							if(CCN[j].style)CCN[j].style.height = max_height + "px";
						}
					}
				}else{
					var max_height=0;
					for(var i=0 ; i<objCN[key].length ; i++){
						objCN[key][i].style.height="auto";
						max_height = max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight;
					}
					for(var i=0 ; i<objCN[key].length ; i++){
						objCN[key][i].style.height = max_height + "px";
					}
				}
			}
		}
		
		checkBoxSize = function(){
			if(defHeight != e.offsetHeight){
				changeBoxSize();
				defHeight= e.offsetHeight;
			}
		}
		changeBoxSize();
		setInterval(checkBoxSize,1000)
	}
	
	function addEvent(elm,listener,fn){
		try{
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent("on"+listener,fn);
		}
	}
	addEvent(window,"load",heightLine);
}