// Script mit Riddim und Tune-Infos
	

var NumRiddims = 7;
var NumTunes = 6;

Riddims = new InitRiddimArray( NumRiddims );
Tunes = new InitTuneArray( NumTunes );



// ---- RIDDIM INFOS ----
Riddims[1] = new RiddimInfo( "15.01.2002", "One Dem", "May 2001", "Roots", "3:05", "94 bpm", "img/onedem", 
					         "http://www.virtual-volume.com/play/lofi/10122477.m3u",
					         "http://www.virtual-volume.com/save/10122477/one_dem_riddim_pure_instrumental.mp3", "0" );

Riddims[2] = new RiddimInfo( "15.01.2002", "Bite", "Aug 2000", "Dancehall", "3:10", "100.3 bpm", "img/bite", 
					         "http://www.virtual-volume.com/play/lofi/10122409.m3u",
					         "http://www.virtual-volume.com/save/10122409/bite_riddim_pure_instrumental.mp3", "0" );
	
Riddims[3] = new RiddimInfo( "15.01.2002", "Nothin' worry", "Oct 2001", "Roots", "4:01", "84 bpm", "img/nothinworry", 
					         "javascript:alert('Upload still missing, sorry!');",
					         "javascript:alert('Upload still missing, sorry!');", "0" );

Riddims[4] = new RiddimInfo( "15.01.2002", "Toy Box", "Sep 2001", "Dancehall", "3:29", "92 bpm", "img/nocover", 
					         "http://www.virtual-volume.com/play/lofi/10127950.m3u",
					         "http://www.virtual-volume.com/save/10127950/toy_box_riddim_pure_instrumental.mp3", "0" );

Riddims[5] = new RiddimInfo( "15.01.2002", "Furious Conqueror", "Oct 2001", "Dancehall", "3:41", "96 bpm", "img/furiousconqueror", 
					         "http://www.virtual-volume.com/play/lofi/10129428.m3u",
					         "http://www.virtual-volume.com/save/10129428/furious_riddim_pure_instrumental.mp3", "0" );

Riddims[6] = new RiddimInfo( "15.01.2002", "Everlasting", "Dec 2001", "Roots", "3:40", "88 bpm", "img/everlasting", 
					         "http://www.virtual-volume.com/play/lofi/10132252.m3u",
					         "http://www.virtual-volume.com/save/10132252/everlasting_riddim_pure_instrumental.mp3", "0" );

Riddims[7] = new RiddimInfo( "07.02.2002", "Big Tings A Gwaan", "Feb 2002", "Dancehall", "3:38", "97 bpm", "img/nocover", 
					         "http://www.virtual-volume.com/play/lofi/10134633.m3u",
					         "http://www.virtual-volume.com/save/10134633/btag_riddim_version.mp3", "1" );




// ---- TUNE INFOS ----
Tunes[1] = new TuneInfo( "15.01.2002", "One, dem!", "MC GRZ feat. Dubtor", "One Dem", "Jan 2001", 
	                     "http://www.virtual-volume.com/play/lofi/10122466.m3u",
				         "http://www.virtual-volume.com/save/10122466/one_dem_feat_mc_grz.mp3", "0" );

Tunes[2] = new TuneInfo( "15.01.2002", "Cry fe righteousness", "Don Sharicon", "Bite", "Aug 2001", 
	                     "http://www.virtual-volume.com/play/lofi/10126936.m3u",
   		         "http://www.virtual-volume.com/save/10126936/don_sharicon_cry_fe_righteousness_bite_riddim.mp3", "0" );

Tunes[3] = new TuneInfo( "15.01.2002", "Nothin' worry", "Dubtor", "Nothin' worry", "Oct 2001", 
	                     "http://www.virtual-volume.com/play/lofi/10129182.m3u",
				         "http://www.virtual-volume.com/save/10129182/nothin_worry.mp3", "0" );

Tunes[4] = new TuneInfo( "15.01.2002", "Ich will dich", "Mamba aka Astral", "Nothin' worry", "Dec 2001", 
	                     "http://217.110.112.71/previews/69401.m3u",
		         "http://217.110.112.71/download/mp3de/69401/7c5585996f569d19/de/MambaakaAstral-ichwilldich.mp3", "0" );

Tunes[5] = new TuneInfo( "15.01.2002", "Läster, läster", "Mamba aka Astral", "Toy Box", "Nov 2001", 
	                     "http://www.virtual-volume.com/play/lofi/10130935.m3u",
			         "http://www.virtual-volume.com/save/10130935/mamba_laester_laester_toybox_riddim.mp3", "0" );

Tunes[6] = new TuneInfo( "15.01.2002", "Was zählt...", "Mamba aka Astral", "Furious Conqueror", "Dec 2001", 
                     "http://www.virtual-volume.com/play/lofi/10132257.m3u",
		         "http://www.virtual-volume.com/save/10132257/mamba_was_zaehlt_furious_riddim.mp3", "0" );





// Initialisiert ein Array mit bestimmter Größe
function InitRiddimArray( size )
{ 
    for( var i = 1; i <= size; i++ )
    {
     	this[i] = null;
    }

    return this; 
}
function InitTuneArray( size )
{ 
    for( var i = 1; i <= size; i++ )
    {
     	this[i] = null;
    }

    return this; 
}

	
// Initialiere einen Riddim
function RiddimInfo( upload, name, date, style, length, bpm, picfile, urlm3u, urlmp3, rnew )
{
	this.RUpload  = upload;
	this.RName    = name;
	this.RDate    = date;
	this.RStyle   = style;
	this.RLength  = length;
	this.RBPM     = bpm;
	this.RPicFile = picfile;
	this.RUrlM3U  = urlm3u;
	this.RUrlMP3  = urlmp3;
	this.RNew     = rnew;
	
	return this;
}


// Initialiere einen Tune
function TuneInfo( upload, name, artist, riddim, date, urlm3u, urlmp3, tnew )
{
	this.Upload  = upload;
	this.Name    = name;
	this.Artist  = artist;
	this.Riddim  = riddim;
	this.Date    = date;
	this.UrlM3U  = urlm3u;
	this.UrlMP3  = urlmp3;
	this.TNew    = tnew;
	
	return this;
}


// Erzeugt die Riddim-Seite
function CreateRiddimPage()
{
    for( var i = NumRiddims; i > 0; i-- )		// Vom neuesten Riddim runterzählen
    {

    	document.write( '     <table border=0 cellpadding=0 cellspacing=0>    ');
    	document.write( '      <tr>');
    	document.write( '       <td width=18  height=18 background="img/frame_lu.gif">&nbsp;</td>');
    	document.write( '       <td width=370 height=18 background="img/frame_u.gif">&nbsp;</td>');
    	document.write( '       <td width=18  height=18 background="img/frame_ru.gif">&nbsp;</td>');
    	document.write( '      </tr>');

    	document.write( '      <tr>');
    	document.write( '       <td width=18 background="img/frame_l.gif">&nbsp;</td>');
    	document.write( '       <td>');

	if( Riddims[i].RNew == "1" )
	{
	   document.write( '<b style="font-size:11px; color:#EE9922">[new!]</b><br>' );
	}

    	if( Riddims[i].RPicFile != "none" )
    	{
	    	document.write( '     	  <a href="' );
    	
    		document.write( Riddims[i].RPicFile );

	    	document.write( '.jpg" onfocus="this.blur()">');
	    	document.write( '             <img border=0 src="' );

    		document.write( Riddims[i].RPicFile );

    		document.write( '_small.jpg" align=right>');
	    	document.write( '          </a>');
	    }

    	document.write( '	      <font class="BigLinkYellow">' );
    	document.write( Riddims[i].RName );
    	document.write( ' riddim</font>&nbsp;&nbsp;(' );
    	document.write( Riddims[i].RLength );
    	document.write( ', ' );
    	document.write( Riddims[i].RBPM );
    	document.write( ')<br>');
    	document.write( Riddims[i].RDate );

    	document.write( '<br>');
    	document.write( '	      Style: ' );
    	document.write( Riddims[i].RStyle );
    	document.write( '<br><br>');

    	document.write( '     	  <table>');
    	document.write( ' 	      <tr>');
    	document.write( '		  <td align=center>');
    	document.write( '     		  <a href="' );

    	document.write( Riddims[i].RUrlM3U );

    	document.write( '     		  " onfocus="this.blur()">');
    	document.write( '    		    <img width=39 height=16 border=0 src="img/listen.jpg" alt="Listen to low-quality preview">');
    	document.write( '    		  </a>');
    	document.write( '		  </td>');
    	document.write( '		  <td width=10>&nbsp;</td>');
    	document.write( '		  <td align=center>');
    	
      	document.write( '     		  <a href="');

    	document.write( Riddims[i].RUrlMP3 );

    	document.write( '     		  " onfocus="this.blur()">');

    	document.write( '			    <img border=0 src="img/mp3.jpg" alt="Download the high-quality mp3" width=29 height=16>');
    	document.write( '	          </a>');
    	document.write( '		  </td>');
    	document.write( '		  <td width=10>&nbsp;</td>');
    	document.write( '		  <td align=center>');
    	document.write( '     		  <a href="tunes.htm#' );

    	document.write( Riddims[i].RName );
    	
    	document.write( '" onfocus="this.blur()">');
    	document.write( '		        <img border=0 src="img/tunes.jpg" alt="See & listen the tunes for the riddim" width=39 height=16>');
    	document.write( '	          </a>');
    	document.write( '		  </td>');
    	document.write( '		  </tr>');
    	document.write( '		  </table>');
    	document.write( '       </td>');
    	document.write( '       <td width=18 background="img/frame_r.gif">&nbsp;</td>');
    	document.write( '      </tr>');

    	document.write( '      <tr>');
    	document.write( '       <td width=18  height=18 background="img/frame_lb.gif">&nbsp;</td>');
    	document.write( '       <td width=370 height=18 background="img/frame_b.gif">&nbsp;</td>');
    	document.write( '       <td width=18  height=18 background="img/frame_rb.gif">&nbsp;</td>');
    	document.write( '      </tr>');

    	document.write( '     </table>');
    	document.write( '     <br>	');
    	document.write( '     <br>	');
    	
    }
}



// Erzeugt die Tune-Seite
function CreateTunePage()
{

    for( var i = NumRiddims; i > 0; i-- )		// Von jedem Riddim Tunes suchen
    {
    	
    	var hastunes = 0;
    	for( var j = NumTunes; j > 0; j-- )				// Teste zuerst obs überhaupt Tunes gibt
    	{
    		if( Tunes[j].Riddim == Riddims[i].RName )
    		{
    			hastunes = 1;
    			break;
    		}
    	}

    	if( hastunes == 0 ){ continue; }			    // Noch kein Tune


	    // Erzeuge den Rahmen und das Bild für den Riddim
	    document.write('     <a name="' );
	    document.write( Riddims[i].RName );
	    document.write('"></a>');
     
	    document.write('     <img width=18 height=1 src="img/empty.gif"> ');

    	if( Riddims[i].RPicFile != "none" )
    	{
	    	document.write( '     	  <a href="' );
    	
    		document.write( Riddims[i].RPicFile );

	    	document.write( '.jpg" onfocus="this.blur()">');
	    	document.write( '             <font color="#000000"><img border=0 src="' );

    		document.write( Riddims[i].RPicFile );

    		document.write( '_small.jpg">');
	    	document.write( '          </font></a>');
	    }

	    document.write('     <font class="BigLinkYellow">' );
	    document.write( Riddims[i].RName );
	    document.write(' riddim</font><br>');
	    document.write('     <table border=0 cellpadding=0 cellspacing=0>    ');

	    document.write('      <tr>');
	    document.write('       <td width=18  height=18 background="img/frame_lu.gif">&nbsp;</td>');
	    document.write('       <td width=500 height=18 background="img/frame_u.gif">&nbsp;</td>');
	    document.write('       <td width=18  height=18 background="img/frame_ru.gif">&nbsp;</td>');
	    document.write('      </tr>');

	    document.write('      <tr>');
	    document.write('       <td width=18 background="img/frame_l.gif">&nbsp;</td>');

	    document.write('       <td>');
	    document.write('          <table width=490 border=0>       ');
	    document.write('            <tr>');
	    document.write('              <td width=150><b>Artist</b></td>');
	    document.write('              <td width=150><b>Tune</b></td>');
	    document.write('              <td width=100><b>Released</b></td>');
	    document.write('              <td><b>&nbsp;</b></td>');
	    document.write('              <td><b>&nbsp;</b></td>');
	    document.write('            </tr>');
			    	

	    // Jeden Tune für den Riddim eintragen
    	for( var j = NumTunes; j > 0; j-- )
    	{

    		if( Tunes[j].Riddim == Riddims[i].RName )
    		{
			    document.write('                <tr> ');
			    document.write('                  <td class="TDSmall" width=150>' );
			    document.write( Tunes[j].Artist );
			    document.write('                  </td>' );
			    document.write('                  <td class="TDSmall" width=150>"');
			    document.write( Tunes[j].Name );
			    document.write('"                  </td>' );
			    document.write('                  <td class="TDSmall" >');
			    document.write( Tunes[j].Date );

		            if( Tunes[i].TNew == "1" )
		            {
	                        document.write( '&nbsp;&nbsp;<b style="font-size:11px; color:#EE9922">new!</b>' );
		            }

			    document.write('                  </td>' );
	    		document.write('                  <td class="TDSmall" ><a href="' );
			    document.write( Tunes[j].UrlM3U );
	    		document.write('                  "><img alt="low-quality preview" border=0 width=39 height=16 src="img/listen.jpg"></a></td> ');
			    document.write('                  <td class="TDSmall" ><a href="' );
			    document.write( Tunes[j].UrlMP3 );
			    document.write('                  "><img alt="download hifi mp3" border=0 width=29 height=16 src="img/mp3.jpg"></a></td> ');
			    document.write('                </tr> ' );
    		}

    	}


	    document.write('          </table>' );
	    document.write('       </td>' );

	    document.write('       <td width=18 background="img/frame_r.gif">&nbsp;</td>' );
	    document.write('      </tr>' );

	    document.write('      <tr>' );
	    document.write('       <td width=18  height=18 background="img/frame_lb.gif">&nbsp;</td>' );
	    document.write('       <td width=500 height=18 background="img/frame_b.gif">&nbsp;</td>' );
	    document.write('       <td width=18  height=18 background="img/frame_rb.gif">&nbsp;</td>' );
	    document.write('      </tr>' );

	    document.write('     </table>' );
	    document.write('     <br>' );	
	    document.write('     <br>' );

    }
    
}



// Zeigt die letzten Riddim-Uploads
function ShowLatestRiddimUploads()
{

	document.write( '<div style="font-size:10px;">' );

    for( var i = NumRiddims; i > NumRiddims-3; i-- )		// Zeige die drei letzten Riddims
    {

    	document.write( Riddims[i].RUpload );
	
	if( Riddims[i].RNew == "1" )
        {
           document.write( '&nbsp;&nbsp;<b style="font-size:11px; color:#EE9922">[new!]</b>' );
	}
     	document.write( '&nbsp;&nbsp;<br><a style="font-size:11px;" href="' );
    	document.write( Riddims[i].RUrlM3U );
    	document.write( '">' );
    	document.write( Riddims[i].RName );
    	document.write( ' riddim</a> (' );
    	document.write( Riddims[i].RStyle );
    	document.write( ')<br><br>' );
    }

	document.write( '</div>' );
}



// Zeigt die letzten Tune-Uploads
function ShowLatestTuneUploads()
{

	document.write( '<div style="font-size:10px;">' );

    for( var i = NumTunes; i > NumTunes-3; i-- )		// Zeige die drei letzten Riddims
    {

    	document.write( Tunes[i].Upload );

	if( Tunes[i].TNew == "1" )
        {
           document.write( '&nbsp;&nbsp;<b style="font-size:11px; color:#EE9922">[new!]</b>' );
	}

    	document.write( '&nbsp;&nbsp;-<br><a style="font-size:11px;" href="' );
    	document.write( Tunes[i].UrlM3U );
    	document.write( '">' );
    	document.write( Tunes[i].Artist );
    	document.write( ': "' );
    	document.write( Tunes[i].Name );
    	document.write( '"</a>' );

    	if( Tunes[i].Riddim != "standalone" )
    	{
    	    document.write( '<br>(' );
        	document.write( Tunes[i].Riddim );
        	document.write( ' riddim)' );
    	}
    	
		document.write( '   	<br><br>' );
    }

	document.write( '</div>' );
}