	function drupal_audio( name ){
          this.divid= '';
          this.audiodata= [];
		  this.defaultcode = '';  
		  this.shtml = '';
		  this.name = name;
		  this.width = 400;
		  this.height = 300;
		  this.title="";
	};
	drupal_audio.prototype.setDivId=function ( divid ){
	           this.divid= divid;
	}; 
	drupal_audio.prototype.setWidth =function ( w ){
			   this.width =w ;
	}; 
	drupal_audio.prototype.setHeight =function ( h ){
			   this.height = h ;
	}; 
	drupal_audio.prototype.setData=function ( data ){
	           this.audiodata = data;
	};
	drupal_audio.prototype.setDefaultCode=function ( code   ){
	           this.defaultcode=code;
	};


	drupal_audio.prototype.setBaseurl=function ( base   ){
	           this.base=base;
	};
	drupal_audio.prototype.setDefaultSession=function( t ){
			   this.sessiontitle =  t;
	};
	drupal_audio.prototype.setDefaultNodeid=function( id ){
			   this.nodeid=  id;
	};
	drupal_audio.prototype.setDefaultTitle=function( t ){
			   this.title=  t;
	};
	// <?php echo url('');?>naviagation/node_counter/<?php echo $nodeid ;?>
    drupal_audio.prototype.pay=function ( id  ,tf ){


		     document.getElementById( this.divid ).style.width = this.width;
		     document.getElementById( this.divid ).style.height  = this.height;
 
			var autoStart='false'; //true , false
             


		 
                  var url = this.audiodata[ id ][2];
		          var autoplay= tf ; // 1
  
		            var s  =  '<iframe  id="iframe1" border=0   marginwidth=0 marginheight=0        frameborder=no width="'+ this.width +'" scrolling=no             height="'+ this.height +'"    src="'+ this.base + 'naviagation/playaudio/?src='+ escape( url ) +'&width='+ this.width +'&height='+ this.height +'&autoplay='+autoplay+'&nodeid='+ this.audiodata[ id ][0] +'&session='+escape( this.audiodata[ id ][3]  )+'&'+Math.random()+'"></iframe>';
					
					//<div align="center">'+ this.audiodata[ id ][1]  +'</div>';

				  
				  document.getElementById( this.divid ).innerHTML =s;

			      document.getElementById( this.divid + '_title').innerHTML = '<b>Playing: <font color="#ffffff">'+ this.audiodata[ id ][1] +'</font></b>';

	          // [ id, title, url , session ]
			 try{
			    pageTracker._trackPageview(  this.audiodata[ id ][3] +'/' +  this.audiodata[ id ][1] +'/' + this.audiodata[ id ][2] );

               // document.getElementById( img_audio_counter ).src= this.base + "naviagation/node_counter/" + this.audiodata[ id ][0];

document.getElementById( 'img_audio_counter' ).src= this.base + "naviagation/node_counter/" + this.audiodata[ id ][0] +'?'+ Math.random() ;

			 }catch(e){}
	};

    drupal_audio.prototype.paydefault=function ( url ){


		    document.getElementById( this.divid ).style.width = this.width;
		    document.getElementById( this.divid ).style.height  = this.height;
			 
			var autoplay=''; // 1

             var s  =  '<iframe  id="iframe1" border=0   marginwidth=0 marginheight=0        frameborder=no width="'+ this.width +'" scrolling=no             height="'+ this.height +'"    src="'+this.base + 'naviagation/playaudio?src='+ escape( url ) +'&width='+ this.width +'&height='+ (this.height) +'&autoplay='+autoplay+'&nodeid='+this.nodeid+'&session='+escape(  this.sessiontitle  )+'&'+Math.random()+'"></iframe>';

			 //<div align="center">'+    this.title +'</div>';
				  
	        	   document.getElementById( this.divid ).innerHTML =s;

				   document.getElementById( this.divid + '_title').innerHTML = '<b>Playing: <font color="#ffffff">'+this.title +'</font></b>';

	    	 try{
			  // 	pageTracker._trackPageview( url );
			}catch(e){}

	};

    drupal_audio.prototype.toString =function ( ){
	  	    
 

			   var agent   =   navigator.userAgent;  
			   var downloadstr = '';
			   if   (agent.indexOf("Mac") >0 ) {
				 downloadstr= 'Please hold the “control” button and click to download.'; 
			   }else{
				 downloadstr= 'Please right click to download.' ;
			   }
	           var shtml = '<table>'; 
			   for (var i=0; i<this.audiodata.length ; i++)
			   { 
				   if (  this.audiodata[i][1]!="")
				   {				
					   shtml += '<tr><td  height="22"><a class="a1"   href="javascript:'+this.name+'.pay('+i+',1)">'+ this.audiodata[i][1] + '</a><br><a style="color:#047bcd; text-decoration:none;"  href="javascript:'+this.name+'.pay('+i+',1)">Listen</a> <span  style="color:#666666;">|</span> <a style="color:#047bcd; text-decoration:none;" href="'+ this.audiodata[ i ][2] +'" onclick="alert(\''+downloadstr+'\');return false;" title="'+downloadstr+'">Download</a></td></tr>';
				   }

				 
			   }
                shtml += '</table>';
			   shtml += '<img id="img_audio_counter" style="display:none;">';
 
              // shtml =  '<table border="1" width="100%">' + shtml + '</table>';
			   this.shtml= shtml  ;
			   return  this.shtml;
	}; 


	 drupal_audio.prototype.view= function (nodeid, session, title , url , autoplay ){


			var autoStart='false'; //true , false
             if (autoplay==0)
             {
				 autoStart = 'false'; 
             }else{
			     autoStart = 'true'; 
			 }
 


			//  document.getElementById( this.divid ).innerHTML  = embed ; 

	               var s  =  '<iframe  id="iframe1" border=0   marginwidth=0 marginheight=0        frameborder=no width="'+ this.width +'" scrolling=no             height="'+ this.height +'"    src="'+this.base + 'naviagation/playaudio?src='+ escape( url ) +'&width='+ this.width +'&height='+ (this.height) +'&autoplay='+autoplay+'&nodeid='+ nodeid +'&session='+escape(  session  )+'&'+ Math.random() +'"></iframe><img id="img_audio_counter" style="display:none;">';
				   //<div align="center">'+  title  +'</div>';
				  
	               document.getElementById( this.divid ).innerHTML =s;
				   document.getElementById( this.divid + '_title').innerHTML = '<b>Playing: <font color="#ffffff">'+ title +'</font></b>';

	          // [ id, title, url , session ]
			 try{
			    pageTracker._trackPageview(  session +'/' +  title +'/' + url );

               document.getElementById( 'img_audio_counter' ).src= this.base + "naviagation/node_counter/" + nodeid +'?'+ Math.random() ;



			if(document.body.scrollTop){
			  document.body.scrollTop = 0 ;
			}
			else{
			  document.documentElement.scrollTop=0;
			}
 


			 }catch(e){}

				   // click 
		 
	};