/*
 * JavaScript for BluFun, AttMp3
 * Type:	function
 * By:	donghungx
 */
function showContent(content, type, page)
{
	strContent = document.getElementById(content).innerHTML;
}
//Function for Search Box
var	loai = 0;
var	tukhoa = 'txtKeyword0';

function setFromSearchType(loai_b, tukhoa_b)
{
	loai = loai_b;
	tukhoa = tukhoa_b;
}

function checkFormSearch(type, idKeyword)
{
	keyword = document.getElementById(idKeyword).value;
	if (!trim(keyword))
	{
		keyword = "";
		document.getElementById(idKeyword).focus();
		return false;
	}
	if(type==0)
	{
		if ( keyword!='Enter keyword to search Music with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=mp3&key=' + keyword;
	}
	if(type==1)
	{
		if ( keyword!='Enter keyword to search Artist with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=artist&key=' + keyword;
	}
	if(type==2)
	{
		if ( keyword!='Enter keyword to search Lyric with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=lyrics&key=' + keyword;
	}
	if(type==3)
	{
		if ( keyword!='Enter keyword to search Album with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=album&key=' + keyword;
	}
	if(type==4)
	{
		if ( keyword!='Enter keyword to search Music Playlist with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=playlist&key=' + keyword;
	}
	if(type==5)
	{
		if ( keyword!='Enter keyword to search Video Clip with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=video&key=' + keyword;
	}

}
//end Search Box
function trim(val)
{ 
	return val.replace(/^\s+|\s+$/g, "");
}

function stripPHP(str)
{
	str = trim(str);
	str = str.replace(/<\?php/g, "");
	str = str.replace(/<\?/g, "");
	str = str.replace(/\?>/g, "");
	return str;
}

//Tab
function photo_active_tab(obj, num){
		var curentTab=obj.id;
		var curentContent=curentTab.replace("tab","cont");

		curentContent_1=curentTab.replace("tab","cont");
		var tabs=$('#' + curentTab).parent().children();
		var contents=$('#' + curentContent).parent().children();

		$(tabs).each( function(){								
				$(this).attr('class','');
		});		
		
		$(contents).each( function(){								
				$(this).hide();
		});	
		
		$('#' + curentTab).addClass('active');
		$('#' + curentContent).fadeIn('slow');	
}
//Active Menu

