function mOver(id)
{
//	if (document.getElementById && document.getElementById(id))
//		document.getElementById(id).className='active';
	id.className='itemactive';
}

function mOut(id)
{
	id.className='item';
//	if (document.getElementById && document.getElementById(id))
//		document.getElementById(id).className='';
}

function mOver(id)
{
//	if (document.getElementById && document.getElementById(id))
//		document.getElementById(id).className='active';
	document.getElementById(id).className='itemactive';
}

function mOut(id)
{
	document.getElementById(id).className='item';
//	if (document.getElementById && document.getElementById(id))
//		document.getElementById(id).className='';
}

function mOver2(id)
{
//	if (document.getElementById && document.getElementById(id))
//		document.getElementById(id).className='active';
	document.getElementById(id).className='firstitemover';
}

function mOut2(id)
{
	document.getElementById(id).className='firstitem';
//	if (document.getElementById && document.getElementById(id))
//		document.getElementById(id).className='';
}

function heightRegulator()
{
	alert('1');
	heightLeft = document.getElementById('left').clientHeight;
	heightRight = document.getElementById('right').clientHeight;
	document.getElementById('list').style.height = heightLeft - 63;
}


function mOver3(id, _class)
{
	document.getElementById(id).className=_class;
}

function mOut3(id, _class)
{
	document.getElementById(id).className=_class;
}

// emoticon insertion
function emoticon(text1)  
{  
	document.commentForm.comment.focus();
	text_final = " " + text1 + " ";
	document.commentForm.comment.value += text_final;
}  

// control movie to play <?=IMG_URL?>

function documentwrite(text)
{
	document.write(text); 
}

function show_swf_movie(mid,mwidth,mheight,mfile,playerid, mvariable, backcolor)
{
	var movie;
	if (backcolor=='')
	{
		backcolor='#ffffff';
	}
	movie = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
			+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"'
			+'width="'+mwidth+'" height="'+mheight+'" id="'+playerid+'" align="middle">'
			+'<param name="allowScriptAccess" value="sameDomain" />'
			+ '<param name="movie" value="'+mfile+'" />'
			+'<param name="wmode" value="transparent" />'
			+ '<param name="quality" value="high" />'
			+ '<PARAM NAME="FLASHVARS" VALUE="'+mvariable+'">'
			+ '<param name="bgcolor" value="'+backcolor+'" />'
			+ '<param name="wliveconnect" value="true" />'
			+ '<embed id="'+playerid+'" src="'+mfile+'" quality="high" flashvars="'+mvariable+'"  swliveconnect="true" wmode="transparent" bgcolor="#ffffff" width="'+mwidth+'" height="'+mheight+'" name="'+playerid+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			+'</object>';
			return movie;
}


function show_swf_youtube(mwidth,mheight,video_id)
{
	var movie;
	movie =  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  id="youtube" align="middle" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+mwidth+'" height="'+mheight+'">'
			+'<param name="movie" value="http://www.youtube.com/v/'+video_id+'"></param>'
			+ '<param name="quality" value="high" />'
			+'<param name="wmode" value="transparent"></param>'
			+'<embed  id="youtube" quality="high"  src="http://www.youtube.com/v/'+video_id+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" width="'+mwidth+'" height="'+mheight+'"></embed>'
			+'</object>';
			return movie;
}

function Reset_track2(track,current_track,doca,mfile) {
	if (current_track!=track && current_track!==0 && track!==0)
	{
		var playing = doca;
		playing.innerHTML = show_swf_movie('play_button','65','25',mfile,'play_button','id='+current_track, '#ffffff');

		return current_track = track;
			
	}
	else if (current_track==0 || track==0)
	{
		return current_track = track;
	}

}

function Reset_track2_small(track,current_track,doca,mfile) {
	if (current_track!=track && current_track!==0 && track!==0)
	{
		var playing = doca;
		playing.innerHTML = show_swf_movie('play_button','65','25',mfile,'play_button','id='+current_track, '#ffffff');

			return current_track = track;
			
	}
	else if (current_track==0 || track==0)
	{
		return current_track = track;
	}

}

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( name ) {	
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) &&
	( name != document.cookie.substring( 0, name.length ) ) )
		{
			return null;
		}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) {
	document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1980 00:00:01 GMT";
}
}


function sendonmail(mail,subj)
{
	domain = 'mp3ninja.com';
	eml = "ma" + "ilto:" + mail + "@" + domain;
	eml = 'mailto: mp3ninja.com@gmail.com';
	if (subj != "") 
		eml += "?subject=" + subj;
	window.location.href = eml;
}


function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
var movie_count_l = 0;
var movie_count = 0;

function set_movie_count(page_movie_count)
{
	movie_count = page_movie_count;
}

function set_movie_count_l(page_movie_count)
{
	movie_count_l = page_movie_count;
}

function stop_playing(player_id)
{
	 for(i=1; i<=movie_count; i++)
	 {
		   var flashMovie=getFlashMovieObject('play_' + i.toString());
		if (player_id!=i)
		{		
			flashMovie.SetVariable("moviestatus",0);
		 }
		 else
		 {
			flashMovie.SetVariable("moviestatus",1);
		 }
	 }
}


function stop_playing_l(player_id)
{
	 for(i=1; i<=movie_count_l; i++)
	 {
		   var flashMovie=getFlashMovieObject('l_play_' + i.toString());
		if (player_id!=i)
		{		
			flashMovie.SetVariable("moviestatus",0);
		 }
		 else
		 {
			flashMovie.SetVariable("moviestatus",1);
		 }
	 }
}


function rateImg(rating,forma)
{
		document.getElementById('rating_value').value=rating;
		rating = rating * 25;
		document.getElementById('star-rating-current').style.width = rating+'px';

		forma.submit();
}