var session_check = 'heck|||||||||valid|||||||||login';
var session_check_replace = 'check|||||||||valid|||||||||login';
var opacity=1 //opacity

var total_musics_ids_play_arr = new Array();

//function for check box manage
function CheckAll(form_name,check_all,isO,noHL)
	{
		var trk=0;
		var frm = eval('document.'+form_name);
		var check_frm = eval('document.'+form_name+'.'+check_all);

		for (var i=0;i<frm.elements.length;i++)
		{
			var e=frm.elements[i];
			if ((e.name != check_all) && (e.type=='checkbox'))
			{
				if (isO != 1)
				{
					trk++;
					if(e.disabled!=true)
						e.checked=check_frm.checked;
				}
			}
		}
	}

/******* Start Trim Functions ************/
function Trim(TRIM_VALUE)
	{
		if(TRIM_VALUE.length < 1)
			{
				return "";
			}
		TRIM_VALUE = RTrim(TRIM_VALUE);
		TRIM_VALUE = LTrim(TRIM_VALUE);
		if(TRIM_VALUE=="")
			{
				return "";
			}
		else
			{
				return TRIM_VALUE;
			}
	}

function RTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		var v_length = VALUE.length;
		var strTemp = "";
		if(v_length < 1)
			{
				return "";
			}
		var iTemp = v_length -1;
		while(iTemp > -1)
			{
				if(VALUE.charAt(iTemp) == w_space)
					{
					}
				else
					{
						strTemp = VALUE.substring(0,iTemp +1);
						break;
					}
				iTemp = iTemp-1;

			}
		return strTemp;
	}

function LTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		if(v_length < 1)
			{
				return "";
			}
		var v_length = VALUE.length;
		var strTemp = "";

		var iTemp = 0;

		while(iTemp < v_length)
			{
				if(VALUE.charAt(iTemp) == w_space)
					{
					}
				else
					{
						strTemp = VALUE.substring(iTemp,v_length);
						break;
					}
				iTemp = iTemp + 1;
			}
		return strTemp;
	}
/***********End trim functions********/
function RegularExpressionReplace(expression, subject, replaced)
	{
	  var re = new RegExp(expression, "g");
	  return subject.replace(re, replaced);
	}
function StringReplcae(find_string, replace_string, subject)
	{
		return RegularExpressionReplace(find_string, subject, replace_string);
	}
function replace_string(str, search_str, replace_str)
	{
			var condition = true;
			var inc= 1;
			while(condition)
				{
					str = str.replace(search_str,replace_str);
					if(str.indexOf(search_str)<0)
						condition = false;
					inc++;
				}
			return str;
	}

function setFullScreenBrowser(){
	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
}
//**************** confirmation box related functions Start *******************/
//Change position of the confirmation block
function getAbsoluteOffsetTopConfirmation(obj){
	    var top = obj.offsetTop;
	    var parent = obj.offsetParent;
	    while (parent != document.body)
			{
		        top += parent.offsetTop;
		        parent = parent.offsetParent;
		    }
	    return top;
	}

function getAbsoluteOffsetLeftConfirmation(obj){
	    var left = obj.offsetLeft;
	    var parent = obj.offsetParent;
	    while (parent != document.body)
			{
		        left += parent.offsetLeft;
		        parent = parent.offsetParent;
		    }
	    return left;
	}

function $(elmt){
	return document.getElementById(elmt);
}

//Hide all confirmation blocks
function hideAllBlocks(){
		var obj;
		if(obj = $('selAlertbox'))
			obj.style.display = 'none';
		for(var i=0;i<block_arr.length;i++){
				if(obj = $(block_arr[i]))
					obj.style.display = 'none';
			}
		if(obj = $('hideScreen'))
			obj.style.display='none';

		return false;
	}

//Get multible check box value with comma seperator
var multiCheckValue='';
var minimum_top = 20;
var minimum_left = 20;
var zIndexValue = 200;
// form_name, check_all_name, alert_value, place
var getMultiCheckBoxValue = function(){
	var form_name = arguments[0];
	var check_all_name = arguments[1];
	var alert_value = arguments[2];
	var place = 0;
	var add_left_position = 0
	var add_top_position = 0;
	if(arguments.length>=4)
		place = arguments[3];
	if(arguments.length>=5)
		add_top_position = arguments[4];
	if(arguments.length>=6)
		add_left_position = arguments[5];

	var frm = eval('document.'+form_name);
	var ids = '';
	for(var i=0;i<frm.elements.length;i++){
		var e=frm.elements[i];
		if ((e.name != check_all_name) && (e.type=='checkbox') && e.checked)
			ids += e.value+',';
	}
	if(ids){
		multiCheckValue =ids.substring(0,ids.length-1);
		return true;
	}
	if(place)
		alert_manual(alert_value, place, add_top_position, add_left_position);
	else
		alert(alert_value);
	return false;
}

var alert_manual = function()
	{
		var obj;
		var alert_value = arguments[0];
		var place = arguments[1];
		var add_left_position = 0
		var add_top_position = 0;
		if(arguments.length>=3)
			add_top_position = arguments[2];
		if(arguments.length>=4)
			add_left_position = arguments[3];
		if(obj = $('selAlertMessage'))
			obj.innerHTML = alert_value;
		if(fromObj = $('selAlertbox'))
			changePosition(fromObj, $(place), add_top_position, add_left_position);
		if(obj = $('selAlertOkButton'))
			obj.focus();
		return false;
	}
function changePosition(fromObj, toObj, add_top_position, add_left_position){
	fromObj.style.zIndex = zIndexValue;
	var top = getAbsoluteOffsetTopConfirmation(toObj)+ add_top_position;
	var left = getAbsoluteOffsetLeftConfirmation(toObj)+ add_left_position;
	if(top<minimum_top)
		top = minimum_top;
	if(left<minimum_left)
		left = minimum_left;
	fromObj.style.top = top + 'px';
	fromObj.style.left = left + 'px';
	fromObj.style.display = 'block';
	if(obj = $('hideScreen')){
		var ss = getPageSizeWithScroll();
		obj.style.width=ss[0]+"px";
		obj.style.height=ss[1]+"px";
		obj.style.display='block';
	}
}
function showHideScreen(divElm){
	var fromObj = $(divElm);
	fromObj.style.zIndex = zIndexValue;
	fromObj.style.display = 'block';
	if(obj = $('hideScreen')){
		var ss = getPageSizeWithScroll();
		obj.style.width=ss[0]+"px";
		obj.style.height=ss[1]+"px";
		obj.style.display='block';
		return false;
	}
}
function makeQueryAsFormFieldValues(form_name)
	{
		var query = '';
		var frm = eval('document.'+form_name);
		for(var i=0;i<frm.elements.length;i++){
				var e=frm.elements[i];
				if (e.type!='button' && e.type!='checkbox'){
						query += e.name+'='+e.value+'&';
					}
			}
		query =query.substring(0,query.length-1);
		return query;
	}

//Display confirmation Block
//place, block, form_name, id_array, value_array, property_array, add_top_position, add_left_position
//property_array, add_top_position, add_left_position --- optional
var Confirmation = function(){
	var obj, inc, form_field;
	hideAllBlocks();

	var place = arguments[0];
	var block = arguments[1];
	var form_name = arguments[2];
	var id_array = arguments[3];
	var value_array = arguments[4];
	var add_top_position = 0;
	var add_left_position = 0;
	var property_array = new Array();
	multiCheckValue ='';

	if(arguments.length==8)
		var add_left_position = arguments[7];
	if(arguments.length>=7)
		var add_top_position = arguments[6];
	if(arguments.length>=6)
		property_array = arguments[5];

	for(inc=0; inc<value_array.length;inc++){
		if(!property_array[inc])
			property_array[inc] = 'value';
		form_field = eval('document.'+form_name+'.'+id_array[inc]);
		if(form_field && form_field[property_array[inc]]!=null)
			form_field[property_array[inc]] = value_array[inc];
		else if(obj = $(id_array[inc]))
			obj[property_array[inc]] = value_array[inc];
	}
	if(fromObj = $(block))
		changePosition(fromObj, $(place), add_top_position, add_left_position);
	return false;
}
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}
//**************** confirmation box related functions End *******************/
function changeWidth(){
	var width_value = document.formGetCode.image_width.value;
	if(parseInt(max_width_value)>=parseInt(width_value)){
		var expression = 'width="([0-9]+)"';
		var subject = document.formGetCode.image_code.value;
		var replaced = 'width="'+width_value+'"';
		document.formGetCode.image_code.value = RegularExpressionReplace(expression, subject, replaced);
	}
}

function chkValidTags(tags){
	var val;
	var i;
	tags = Trim(tags);
	if(tags=='')
		return true;
	tags = tags.split(' ');
	for (i=0;i<tags.length;i++){
		val = Trim(tags[i]);
		if(val=='')
			continue;
		if((val.length<min_tag_size) || (val.length>max_tag_size))
			return true;
	}
	return false;
}

var getCheckBoxValue = function(){
	var form_name = arguments[0];
	var check_all_name = arguments[1];
	var frm = eval('document.'+form_name);
	var ids = '';
	for(var i=0;i<frm.elements.length;i++){
		var e=frm.elements[i];
		if ((e.name != check_all_name) && (e.type=='checkbox') && e.checked)
			ids += e.value+', ';
	}
	if(ids){
		multiCheckValue =ids.substring(0,ids.length-1);
		return true;
	}
	return false;
}
/**
 *
 * @access public
 * @return void
 **/
function showDiv(div_id){
	 show(div_id);
	 // return false;
}

/**
 *
 * @access public
 * @return void
 **/
function checkUsername(path){

		var user_field = document.getElementById('user_name').value;
		if(user_field.length<3)
			return false;


		var currpath = path+'?ajax_page=true&user_name='+ user_field;

		// alert(currpath);   return;
		callAjaxPopulate(currpath,'username_availability');

		return false;


}
function callAjaxPopulate(path,div_id)
	{
		result_div = div_id;
		new AG_ajax(path,'ajaxResultPopulate');
		return false;
	}
/**
 *
 * @access public
 * @return void
 **/
function ajaxResultPopulate(data){


		data = unescape(data);
		  // alert(data);

		var obj = document.getElementById(result_div);
		obj.style.display = 'block';
		obj.innerHTML='';
		if(data.indexOf(session_check)>=1)
			{
				data = data.replace(session_check_replace,'');
			}
		else
			{
					
				return;
			}
		obj.innerHTML = data;

}
 function show_key_value() {
	 if($('billing_card_number'))
	  	{

			  //FIRST, TELL THE BROWSERS TO REACT TO THE EVENT
			  if( document.captureEvents ) {
			      //non IE
			      if( Event.KEYUP ) {
			          //NS 4, NS 6+, Mozilla 0.9+
			          document.captureEvents( Event.KEYUP );
			      }
			  }
			  /* this next line tells the browser to detect a keyup
			  event over the whole document and when it detects it,
			  it should run the event handler function 'alertkey' */
			  $('billing_card_number').onkeydown = changeCreditCardNoFromat;
	  	}
  }

function changeCreditCardNoFromat(e)
	{
		var obj = $('billing_card_number');

		var key_code = alertkey(e);
		var text = Trim(obj.value);
		if( $('billing_payment_method') && $('billing_payment_method').value == 'Amex' ){
				if( text.length > 17 )
					return false;
				if(key_code!=8 && (text.length==4 || text.length==7 || text.length==12)){
					obj.value = text+'-';
				}
		}
		else if(key_code!=8 && (text.length==4 || text.length==9 || text.length==14)){
			obj.value = text+'-';
		}
	}
function alertkey(e) {
     if( !e ) {
         //if the browser did not pass the event information to the
         //function, we will have to obtain it from the event register
         if( window.event ) {
             //DOM
             e = window.event;
         } else {
             //TOTAL FAILURE, WE HAVE NO WAY OF REFERENCING THE EVENT
             return;
         }
     }
     if( typeof( e.which ) == 'number' ) {
         //NS 4, NS 6+, Mozilla 0.9+, Opera
         e = e.which;
     } else if( typeof( e.keyCode ) == 'number'  ) {
         //IE, NS 6+, Mozilla 0.9+
         e = e.keyCode;
     } else if( typeof( e.charCode ) == 'number'  ) {
         //also NS 6+, Mozilla 0.9+
         e = e.charCode;
     } else {
         //TOTAL FAILURE, WE HAVE NO WAY OF OBTAINING THE KEY CODE
         return;
     }
	 return e;
     //window.alert('The key pressed has keycode ' + e + ' and is key ' + String.fromCharCode( e ) );
 }
function setClassName(id, class_name)
	{
		if($(id))
			$(id).className=class_name;
	}
function favouriteBlogPosts(id_to_fetch,div_array)
	{

		var liBase='li_';

		for(var i=0;i<div_array.length;i++)
		  {

		    	var divName = div_array[i];
		     	setClassName(liBase+divName,'');

		  }
		currpath = article_path+'&action='+id_to_fetch;
		setClassName(liBase+id_to_fetch,'clsActive');
		var obj = document.getElementById('selFavouriteBlog');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader_squre.gif' /> </p>";
		obj.innerHTML=imgSource;
		callAjaxPopulate(currpath,'selFavouriteBlog');


			return false;
	}
function showTabs(id_to_fetch,div_array)
	{

		var selBase='sel_';
		var liBase='li_';

		for(var i=0;i<div_array.length;i++)
		  {
		    	var divName = div_array[i];
				if(id_to_fetch == 'latestcomment' || id_to_fetch == 'latestblog')
					{

						if(divName == 'latestcomment')
							{
								setClassName(liBase+divName,'clsLatstCmd');
							}
							else
								setClassName(liBase+divName,'clsLatstblog');
					}
					else
		     			setClassName(liBase+divName,'');

		     			hide(selBase+divName);
		  }
		if(id_to_fetch == 'latestcomment' || id_to_fetch == 'latestblog')
			{

				if(id_to_fetch == 'latestcomment')
					{
						setClassName(liBase+id_to_fetch,'clsLatstCmd clsActive');
					}
					else if(id_to_fetch == 'latestblog')
						setClassName(liBase+id_to_fetch,'clsLatstblog clsActive');
			}
			else
     			setClassName(liBase+id_to_fetch,'clsActive');



		show(selBase+id_to_fetch);

			return false;
	}
var populatePageComment = function()
	{
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true';
		 // alert(currpath);  return;
		callAjaxPopulate(currpath,'selCommentBlock');
		return false
	}

var populatePageComment1 = function()
	{
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true';
		 // alert(currpath);  return;
		callAjaxPopulate(currpath,'selCommentBlock1');
		return false
	}
	
var populateAlbumPage = function()
	{
		//alert('Hi');
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true&page=albumNext';
		//alert(currpath);  return;
		var obj = document.getElementById('selAlbumBlock');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader_squre.gif' /> </p>";
		obj.innerHTML=imgSource;
		
		callAjaxPopulate(currpath,'selAlbumBlock');
		return false
	}
	
var populateAlbumPageRecent = function()
	{
		//alert('Hi');
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true&page=MostRecent';
		//alert(currpath);  return;
		var obj = document.getElementById('selAlbumBlockMostRecent');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader_squre.gif' /> </p>";
		obj.innerHTML=imgSource;
		
		callAjaxPopulate(currpath,'selAlbumBlockMostRecent');
		return false
	}
	
var populateAlbumPageFavorite = function()
	{
		//alert('Hi');
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true&page=MostFavorite';
		//alert(currpath);  return;
		var obj = document.getElementById('selAlbumBlockMostFavorite');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader_squre.gif' /> </p>";
		obj.innerHTML=imgSource;
		
		callAjaxPopulate(currpath,'selAlbumBlockMostFavorite');
		return false
	}
	
var populateAlbumPageFuture = function()
	{
		//alert('Hi');
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true&page=MostFuture';
		//alert(currpath);  return;
		var obj = document.getElementById('selAlbumBlockFutureRel');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader_squre.gif' /> </p>";
		obj.innerHTML=imgSource;
		
		callAjaxPopulate(currpath,'selAlbumBlockFutureRel');
		return false
	}
	
var populateAlbumPagePopular = function()
	{
		//alert('Hi');
		var currpath ='';
		if(arguments[0])
			{

					currpath = arguments[0];
			}

		currpath = currpath+'&ajax_page=true&page=MostPopular';
		//alert(currpath);  return;
		var obj = document.getElementById('selAlbumBlockMostPopular');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader_squre.gif' /> </p>";
		obj.innerHTML=imgSource;
		
		callAjaxPopulate(currpath,'selAlbumBlockMostPopular');
		return false
	}	
	

function showAlbumMusicList(id_to_fetch,div_array)
	{
		currpath = id_to_fetch+'&ajax_page=true';
		var obj = document.getElementById('selshowAlbumMusicList');
		var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader.gif' /> </p>";
		obj.innerHTML=imgSource;
		callAjaxPopulate(currpath,'selshowAlbumMusicList');

		return false;
	}

/**
   this function return to Flash ActiveX Object or Plugin depending upon browser
   it takes care for browser type and returns the proper reference.
  Accepts the id or name of <OBJECT> or <EMBED> tag respectively
  Taken from Colin Moock (http://www.moock.org) code base.
**/
function thisMovie(movieName)
	{
	  // IE and Netscape refer to the movie object differently.
	  // This function returns the appropriate syntax depending on the browser.
		if (navigator.appName.indexOf ("Microsoft") !=-1)
			{
				return window[movieName];
			}
		else
			{
				return window.document[movieName];
			}
	}


/** PLAYER RELATED FUNCTIONS STARTS HERE **/

/**
 create an instance of JSFCommunicator, pass the flashMovie's reference
 make sure flash object is loaded when you create this object with parameter otherwise
 you can JSFCommunicator.setMovie(flashMovie) once flash object is loaded
**/
function createJSFCommunicatorObject(playerObj)
	{
		fc = new JSFCommunicator(playerObj);
	}

//Play Song
function playSong(music_id)
	{
		fc.callFunction("_root","js_playSong",[music_id]);
		if(typeof(playlist_player_volume) == 'number')
			setVolume(playlist_player_volume);
	}

//To resume play after song is being paused
var resmueSongPlaying = function()
	{
		if(arguments[0])
	  		{
	  			var music_id = arguments[0];
	  			hide('resume_play_music_icon_'+music_id);
	  			show('play_playing_music_icon_'+music_id);

				// $('resume_play_music_icon_'+music_id).hide();
				// $('play_playing_music_icon_'+music_id).show();
			}
		fc.callFunction("_root","js_play");

	}

//Add Song
function addSong(music_details)
	{
		fc.callFunction("_root","js_playSelectedSong",[music_details]);
	}

//Pause Song
var pauseSong = function()
	{
	  	if(arguments[0])
	  		{
	  			var music_id = arguments[0];
	  			hide('play_playing_music_icon_'+music_id);
	  			show('resume_play_music_icon_'+music_id);

			//	$('play_playing_music_icon_'+music_id).hide();
			//	$('resume_play_music_icon_'+music_id).show();
			}
		//fc.callFunction("_root","js_pauseSong");
		fc.callFunction("_root","js_pause")
	}

//Stop Song
var stopSong = function()
	{
	  	if(arguments[0])
	  		{
				if(typeof(volume_slider) != 'undefined' && volume_slider)
					{
						volume_slider.setDisabled();
						$('volume_container').addClassName('clsVolumeDisabled');
						$('volume_speaker').title = '';
					}
	  			var music_id = arguments[0];
	  			//Clearing Index music id when stop is called
				index_play_music_id = '';
			  	if(arguments[1])
			  		{
						//$(arguments[1]+'_play_playing_music_icon_'+music_id).hide();
						//$(arguments[1]+'_play_music_icon_'+music_id).show();
						hide('play_playing_music_icon_'+music_id);
						show('play_music_icon'+music_id);

						index_play_music_id = '';
					}
				else
					{
						hide('play_playing_music_icon_'+music_id);
						show('play_music_icon_'+music_id);
					}
			}

	  	fc.callFunction("_root","js_stopSong");
	}

//Call playSong and change Play image icons
var playSelectedSong = function()
	{
		/*// music_id = arguments[0];
	  	if(arguments[0])
	  		{
	  			var music_id = arguments[0];
	  			hide('play_music_icon'+music_id);
	  			show('play_playing_music_icon_'+music_id);
				//document.getElementById('play_music_icon'+music_id).hide();
				//document.getElementById('play_playing_music_icon_'+music_id).show();
				playSong(parseInt(music_id));
			}*/
		
		music_id = arguments[0];
		
		if(arguments[0])
	  		{	
				index_current_play_block = arguments[1];
				index_play_music_id = music_id;
				changePlayStatusForIndex(music_id, arguments[1]);
				hide('play_music_icon'+music_id);
	  			show('play_playing_music_icon_'+music_id);
				playSong(music_id);
				
			}

	}

//To change the play status of currently playing songs
function changePlayStatus(music_id)
	{
		//stopSong();  //--No need to call stopSong since song previously playing will be stopped automatically
		for(var i=0; i<total_musics_ids_play_arr.length; i++)
			{
				if(total_musics_ids_play_arr[i] != music_id)
					{
						if($('play_playing_music_icon_'+total_musics_ids_play_arr[i]) && $('play_music_icon_'+total_musics_ids_play_arr[i]))
							{
								$('play_playing_music_icon_'+total_musics_ids_play_arr[i]).hide();
								$('play_music_icon_'+total_musics_ids_play_arr[i]).show();
							}
					}
			}
 	}

//To change the play status of currently playing songs for MUSIC INDEX PAGE
var changePlayStatusForIndex = function()
	{
		music_id = arguments[0];
		var block_element = arguments[1];
		
		//stopSong();  //--No need to call stopSong since song previously playing will be stopped automatically
		for(var j=0; j<play_functionalities_arr.length; j++)
			{
				
				for(var i=0; i<total_musics_ids_play_arr.length; i++)
					{
						//if(total_musics_ids_play_arr[i] != music_id && play_functionalities_arr[j] != block_element)
							{
								//alert(play_functionalities_arr[j]+'_play_playing_music_icon_'+total_musics_ids_play_arr[i]);
								if($('play_playing_music_icon_'+total_musics_ids_play_arr[i])
										&& $('play_music_icon'+total_musics_ids_play_arr[i]))
									{
										hide('play_playing_music_icon_'+total_musics_ids_play_arr[i]);
										show('play_music_icon'+total_musics_ids_play_arr[i]);
									}
							}
					}
			}
 	}

function highlightIndexCurrentMusic()
	{
		if($(index_current_play_block+'_play_playing_music_icon_'+index_play_music_id)
				&& $(index_current_play_block+'_play_music_icon_'+index_play_music_id))
			{
				$(index_current_play_block+'_play_playing_music_icon_'+index_play_music_id).show();
				$(index_current_play_block+'_play_music_icon_'+index_play_music_id).hide();
			}
	}

// To Change the image status after song completed
function playmovie(music_id)
	{
		//Clearing Index music id when stop is called
		index_play_music_id = '';
		if(index_current_play_block != '')
			{
				if($(index_current_play_block+'_play_playing_music_icon_'+music_id) && $(index_current_play_block+'_play_music_icon_'+music_id))
				$(index_current_play_block+'_play_playing_music_icon_'+music_id).hide()
				$(index_current_play_block+'_play_music_icon_'+music_id).show();
			}

		if($('play_playing_music_icon_'+music_id) && $('play_music_icon_'+music_id))
			{
				$('play_playing_music_icon_'+music_id).hide()
				$('play_music_icon_'+music_id).show();
			}
		//For View Profile
		if($('resume_play_music_icon_'+music_id))
			$('resume_play_music_icon_'+music_id).hide();
 	}

//FUNCTION WILL BE CALLED AFTER PLAYER GETS LOADED
function playerReady()
	{
		$('hidden_player_status').value='yes';
		if(hidden_player_music_id != '')
			{
				hideAllBlocks();
				if(hidden_player_argument1 != '')
					setTimeout('playSelectedSong(hidden_player_music_id, hidden_player_argument1)',500);
				else
					setTimeout('playSelectedSong(hidden_player_music_id)', 500);
			}

	}

//FUNCTION TO CHANGE VOLUME
function setVolume(player_volume)
	{
		fc.callFunction("_root","js_setVolume",[player_volume])
	}


/** PLAYER RELATED FUNCTIONS ENDS HERE **/

/** VOLUME CONTROL RELATED FUNCTIONS STARTS HERE **/
function mute_volume()
	{
		if(typeof(volume_slider) != 'undefined' && volume_slider && !$('volume_container').hasClassName('clsVolumeDisabled'))
			{
				if(playlist_player_volume_mute_prev == 0)
					{
						$('volume_speaker').title = LANG_VOLUME_UNMUTE;
					}
				else
					{
						if(playlist_player_volume_mute_prev != 0 && playlist_player_volume_mute_cur != 0)
							playlist_player_volume_mute_prev = 0;
						$('volume_speaker').title = LANG_VOLUME_MUTE;
					}
				//alert(playlist_player_volume_mute_prev + 'playlist_player_volume_mute_prev');
				volume_slider.setValue(playlist_player_volume_mute_prev);
				$('volume_slider_bg').style.width = $('volume_slider_handle').style.left;
			}
	}

function show_volume_help_tip()
	{
		if($('volume_what_is_this').style.visibility == 'visible')
			{
				var volume_help_tip = $('volume_help_tip');
				var volume_speaker_ele = $('volume_speaker');
				var volume_what_is_this_ele = $('volume_what_is_this');
				var bg_iframe = $('selBackgroundIframe');

				volume_help_tip.style.top = getAbsoluteOffsetTop(volume_what_is_this_ele) + volume_help_tip_top_pos + "px";
				volume_help_tip.style.left = getAbsoluteOffsetLeft(volume_what_is_this_ele) + volume_help_tip_left_pos + "px";
				bg_iframe.style.top = getAbsoluteOffsetTop(volume_what_is_this_ele) + volume_iframe_help_tip_top_pos + "px";
				bg_iframe.style.left = getAbsoluteOffsetLeft(volume_what_is_this_ele) + volume_iframe_help_tip_left_pos + "px";
				//bg_iframe.show();
				volume_help_tip.show();
				bg_iframe.style.width = 215 + "px";
				bg_iframe.style.height = (volume_help_tip.offsetHeight - 16) + "px";
				if($('volume_container').hasClassName('clsVolumeDisabled'))
					{
						$('volume_help_message').innerHTML = volume_control_disabled_help_tip;
					}
				else
					{
						$('volume_help_message').innerHTML = volume_control_enabled_help_tip;
					}
				bg_iframe.show();
				volume_help_tip.show();
			}
	}

function hide_volume_help_tip()
	{
		var volume_help_tip = $('volume_help_tip');
		var bg_iframe = $('selBackgroundIframe');
		bg_iframe.hide();
		volume_help_tip.hide();
		hide_what_is_this();
	}
//TO CHANGE MUTE CONTROL AND VOLUME CONTROL BACKGROUND
function toggle_volume_control(value)
	{
		$('volume_slider_bg').style.width = $('volume_slider_handle').style.left;
		if(value == 0)
			{
				$('volume_speaker').title = LANG_VOLUME_UNMUTE;
				$('volume_speaker').removeClassName('clsSpeakerOn');
				$('volume_speaker').addClassName('clsSpeakerOff');
			}
		else
			{
				$('volume_speaker').title = LANG_VOLUME_MUTE;
				playlist_player_volume_mute = value;
				$('volume_speaker').removeClassName('clsSpeakerOff');
				$('volume_speaker').addClassName('clsSpeakerOn');
			}
		if($('volume_container').hasClassName('clsVolumeDisabled'))
			{
				$('volume_speaker').title = '';
			}
	}

function getAritistVideoHome(id_to_fetch,div_array)
	{

		var liBase='li_';

		for(var i=0;i<div_array.length;i++)
		  {

		    	var divName = div_array[i];
		     	setClassName(liBase+divName,'');

		  }
		currpath = article_path+'&action='+id_to_fetch;
		setClassName(liBase+id_to_fetch,'clsActive');
		var obj = document.getElementById('li_artist');
		var imgSource ="<p align='right' > <img src= ' "+siteUrl+"images/ajax-loader_videohome.gif' /> </p>";
		obj.innerHTML=imgSource;
		callAjaxPopulate(currpath,'selFavouriteBlog');


			return false;
	}

function featureSong(id_to_fetch,div_array,album_val)
	{

		for(var i=0;i<div_array.length;i++)
		  {

		    	var divName = div_array[i];
		     	setClassName(divName,'');

		  }

		currpath = featuredsong_path+'&action='+id_to_fetch+'&album_val='+album_val;
		setClassName(id_to_fetch,'clsActive');
		var obj = document.getElementById('selFavouriteBlog');
		//var imgSource ="<p align='center' > <img src= ' "+siteUrl+"images/ajax-loader.gif' /> </p>";
		//obj.innerHTML=imgSource;
		callAjaxPopulate(currpath,'selFavouriteBlog');
	}

function count_SongPlay(album_val)
{
		currpath = featuredsong_path+'&song_id='+album_val;

		callAjaxPopulate(currpath,'');
}

function show_what_is_this()
	{
		$('volume_what_is_this').style.visibility = 'visible';
	}

function hide_what_is_this()
	{
		$('volume_what_is_this').style.visibility = 'hidden';
	}
/** VOLUME CONTROL RELATED FUNCTIONS ENDS HERE **/

function fade(divID){
if (opacity>0.05)
opacity-=0.05
else{
$(divID).style.display='none';
clearInterval(animId);
}

$(divID).style.MozOpacity=opacity;



}



function doOpen(url1){
	document.getElementById("selLogin").src=url1;
	document.getElementById('lightLogin').style.display='block';
	document.getElementById('fadeLogin').style.display='block';
}
