soundManager.url = '/swf/';
soundManager.onload=function(){
  soundManager.debugMode=false;
  soundManager.defaultOptions.volume=90;
  soundManager.defaultOptions.autoLoad = true;
}
function $id(i){return document.getElementById(i)}
function $$(e,p){p=$id(p)||p||document; return p.getElementsByTagName(e)}
var JACK={};
JACK.mp3=function(){
  return{
init:function(U){
	   M=$$('li',U);
	   for(i=0;i<M.length;i++){
		 M[i].onmouseover=JACK.mp3.load;
		 M[i].onclick=JACK.mp3.play;
	   }
	 },
onload:function(){
		 var B=this.B; var G='xloading';
		 if(B) B.className=G+'0';
		 this.D=setInterval(function(){if(B&&B.className.substr(0,8)==G)B.className=G+((parseInt(B.className.substr(8,1))+1) % 3)},200);
	   },
whileloading:function(){
			   var S=this; var L=this.L; var B=this.B; var D=this.D;
			   if(L) clearTimeout(L);
			   this.L=setTimeout(function(){
				   if(S.readyState==3){if(B)B.className='xloaded';if(D)clearInterval(D)}
				   if(S.readyState==2){if(B)B.className='xlisten';if(D)clearInterval(D)}
				   },200);
			 },
onplay:function(){
		 var B=this.B; var D=this.D;
		 if(D) clearTimeout(D);
		 if(B) B.className='xplaying0';
	   },
whileplaying:function(){
			   var B=this.B;
			   if(B) B.className='xplaying'+((parseInt(B.className.substr(8,1))+1) % 5);
			 },
onfinish:function(){
		   var B=this.B;
		   if(B) setTimeout(function(){B.className='xloaded'},600);
		 },
load:function(){
	   var ss;
	   if(!this.ss){  
		 var href=(this.href)?this.href:this.getElementsByTagName('a')[0].href;
		 var mid = href.substring(href.lastIndexOf('/')+1);
		 ss = soundManager.createSound({id:mid,url:href,
			 onload:JACK.mp3.onload,
			 whileloading:JACK.mp3.whileloading,
			 onplay:JACK.mp3.onplay,
			 whileplaying:JACK.mp3.whileplaying,
			 onfinish:JACK.mp3.onfinish
			 });
		 ss.B=this.getElementsByTagName('button')[0];
		 this.ss = ss;
	   }
	   return this.ss;
	 },
play:function(){
	   if(!(this.ss))this.ss = JACK.mp3.load();
	   this.ss.play();
	   return false;
	 }
  }
}();
$(document).ready(function(){
	$id('xmp3')?$id('xmp3').onmouseover=JACK.mp3.load : '';
	$id('xmp3')?$id('xmp3').onclick=JACK.mp3.play : '';
	$id('xmp32')?$id('xmp32').onmouseover=JACK.mp3.load : '';
	$id('xmp32')?$id('xmp32').onclick=JACK.mp3.play : '';
	var A='message01',F='fsolution01',M='more01',L='less01',S;
	if($id(A)){S=setTimeout(function(){$id(A).style.display='none'},8000);}
	if($id(F) && $id(M) && $id(L)){
	  $id(M).onclick=function(){
	    $id(F).style.display='block';
	    $id(M).style.display='none';
	    $id(L).style.display='inline';
		clearTimeout(S);
	  }
	  $id(L).onclick=function(){ 
	    $id(F).style.display='none'; 
	    $id(M).style.display='inline'; 
	    $id(L).style.display='none'; 
		S=setTimeout(function(){$id(A).style.display='none'},3000);
	  }
	}
});
