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 = '/thuy.php?searchtype=music&key=' + keyword;
	}
	if(type==1)
	{
		if ( keyword!='Enter keyword to search Artist with AttMp3!' )
			window.location.href = '/thuy.php?searchtype=artist&key=' + keyword;
	}
	if(type==2)
	{
		if ( keyword!='Enter keyword to search Lyric with AttMp3!' )
			window.location.href = '/thuy.php?searchtype=lyrics&key=' + keyword;
	}
	if(type==3)
	{
		if ( keyword!='Enter keyword to search Album with AttMp3!' )
			window.location.href = '/thuy.php?searchtype=album&key=' + keyword;
	}
	if(type==4)
	{
		if ( keyword!='Enter keyword to search Music Playlist with AttMp3!' )
			window.location.href = '/thuy.php?searchtype=playlist&key=' + keyword;
	}
	if(type==5)
	{
		if ( keyword!='Enter keyword to search Video Clip with AttMp3!' )
            window.location.href = '/thuy.php?searchtype=video&key=' + keyword;
	}
    if(type==6)
	{
		if ( keyword!='Enter keyword to search Albumwith AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=album&key=' + keyword;
	}
    if(type==7)
	{
		if ( keyword!='Enter keyword to search Songtext with AttMp3!' )
			window.location.href = dle_root + 'thuy.php?searchtype=songname&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');	
}
function AW_chat( Refresh_Interval){
       var Refresh_Interval;
	
	   
       chat_refresh();
	  
	this.DoRefresh = function(){
	var ajax = new Chat_ajax();
	ajax.onShow ('');
	var varsString = "";
	ajax.setVar("method_sort", method_sort );
	ajax.requestFile = dle_root + "engine/chat/ajax/refresh.php";
	ajax.method = 'POST';
	ajax.element = 'chat-window';
	ajax.sendAJAX(varsString);
	};
	
	this.DoRefresh_ajax = function(){
	var ajax = new dle_ajax();
	ajax.onShow ('');
	var varsString = "";
	ajax.setVar("method_sort", method_sort );
	ajax.requestFile = dle_root + "engine/chat/ajax/refresh.php";
	ajax.method = 'POST';
	ajax.element = 'chat-window';
	ajax.sendAJAX(varsString);
	};
	
    this.chat_refresh = function(){
		if(Refresh_Interval  > 0) Refresh_Interval = setInterval("aw.DoRefresh()", Refresh_Interval );
	};
    function chat_refresh(){
		if(Refresh_Interval > 0) Refresh_Interval = setInterval("aw.DoRefresh()", Refresh_Interval );
	};
   this.ClearRefresh = function(){
		clearInterval(Refresh_Interval);
	};
	
   
	
	
	 this.translit = function() {
var obj_ta = fombj.message;

if ( (ua_vers >= 4) && is_ie && is_win)
{
if (obj_ta.isTextEdit)
{
obj_ta.focus();
var sel = document.selection;
var rng = sel.createRange();
rng.colapse;
if((sel.type == "Text" || sel.type == "None") && rng != null)
{
rng.text = aw.dotranslate(rng.text);
}
}
else
{
obj_ta.value = aw.dotranslate(obj_ta.value);
}
}
else
{
obj_ta.value = aw.dotranslate(obj_ta.value);
}

obj_ta.focus();

return;
};

 this.dotranslate = function(text)
{
    var txtnew = "";
    var symb = 0;
    var subsymb = "";
    var trans = 1;
    for (kk=0;kk<text.length;kk++)
    {
        subsymb = text.substr(kk,1);
        if ((subsymb=="[") || (subsymb=="<"))
        {
            trans = 0;
        }
        if ((subsymb=="]") || (subsymb==">"))
        {
            trans = 1;
        }
        if (trans)
        {
            symb = transsymbtocyr(txtnew.substr(txtnew.length-1,1), subsymb);
        }
        else
        {
            symb = txtnew.substr(txtnew.length-1,1) + subsymb;
        }
        txtnew = txtnew.substr(0,txtnew.length-1) + symb;
    }
    return txtnew;
};

  
};
//Active Menu

