

function do_search2() {

	kw = document.getElementById("keyword2").value;

	if (!kw) alert('Bạn chưa nhập từ khóa');

	else {

		kw = encodeURIComponent(kw);

		kw = str_replace(' ','-',kw);

		kw = str_replace('%20','-',kw);

		s_type = document.getElementById("s_type");

		type = s_type.options[s_type.selectedIndex].value;

		s = document.getElementsByName("songtype");

		if (s[0].checked)

		window.location.href = 'http://diemtua.net/tim_kiem/'+type+'/'+kw+'.html';

		if (s[1].checked)

		window.location.href = 'http://diemtua.net/tim_kiem/video/'+kw+'.html';

		if (s[2].checked)

		window.location.href = 'http://diemtua.net/tim_kiem/lyric/'+kw+'.html';

	}

	return false;



}



function do_search() {

	kw = document.getElementById("keyword").value;

	if (!kw) alert('Bạn chưa nhập từ khóa');

	else {

		kw = encodeURIComponent(kw);

		kw = str_replace(' ','-',kw);

		kw = str_replace('%20','-',kw);

		searchType = document.getElementById("searchType");

		type = searchType.options[searchType.selectedIndex].value;

		s = document.getElementsByName("songtype");

		if (s[0].checked)

		window.location.href = 'http://diemtua.net/tim_kiem/'+type+'/'+kw+'.html';

		if (s[1].checked)

		window.location.href = 'http://diemtua.net/tim_kiem/video/'+kw+'.html';

		if (s[2].checked)

		window.location.href = 'http://diemtua.net/tim_kiem/lyric/'+kw+'.html';

	}

	return false;

}



function player(type,id,name,singer,song) {

var url = '';

var download = '';

var h = 140;

if(type==1)

{

url = 'http://diemtua.net/xml.php?id='+id+'&showeq=true&logo=';

download = 'http://diemtua.net/download.php?id='+id+'&file_name='+name+'.mp3';

}

if(type==2)

{

url = 'http://diemtua.net/xml.php?id='+id+'&logo=http://diemtua.net/images/flash.png';

h = 240;

download = 'http://diemtua.net/download.php?id='+id+'&file_name='+name+'.flv';

}

if(type==3)

{

url = 'http://www.youtube.com/watch?v='+id+'&logo=http://diemtua.net/images/flash.png';

h = 240;

act = 'xem';

download = 'http://diemtua.net/download/'+id+'/'+name+'.yt.flv';

}

	try {

	document.getElementById("player_field").innerHTML = loadingText;

    document.getElementById("player_field").style.display = "block";

	document.getElementById("sender_field").style.display = "block";

	document.getElementById("info_field").style.display = "block";

	var	info_f = '<div style="margin-top:12"><i>Ca khúc: </i>'+name+'<br><i>Trình bày: </i> '+singer+'</div>';

	var	player_f = '<embed type="application/x-shockwave-flash" id="Mediaplayer" wmode="transparent" name="Mediaplayer" src="http://diemtua.net/player.swf" quality="high" allowfullscreen="true" allowscriptaccess="always" flashvars="repeat=always&file='+url+'&abouttxt=™†DiemTua.Net†™&aboutlnk=http://diemtua.net&showfsbutton=true&autostart=true&repeat=always&shuffle=false&showdigits=true&volume=100&skin=" height="'+h+'" width="280">';

	var sender_f = 'Link nhạc: <input type="text" style="width: 210px" onFocus="this.select()" value="http://diemtua.net/nghe/'+id+'/'+type+'/'+song+'.html">';

		sender_f+= '<br>Copy vào blog: <input type="text" style="width: 180px" onFocus="this.select()" value=\'<OBJECT height="'+(h+20)+'" width="350" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="Mediaplayer" name="Mediaplayer"><PARAM name="allowScriptAccess" value="never"></PARAM><PARAM name="allowNetworking" value="internal"></PARAM><PARAM name="movie" value="http://diemtua.net/embed/'+type+'/'+id+'"></PARAM><PARAM name="wmode" value="transparent"></PARAM><PARAM name="quality" value="high"></PARAM><EMBED height="'+(h+20)+'" width="350" type="application/x-shockwave-flash" allowscriptaccess="never" allownetworking="internal" src="http://diemtua.net/embed/'+type+'/'+id+'" id="Mediaplayer" name="Mediaplayer" wmode="transparent" quality="high"></EMBED></OBJECT>'+info_f+'<br><a href="http://diemtua.net" target="_blank">™†DiemTua.Net†™</a>\'>';

		sender_f+= '<br>Copy vào diễn đàn: <input type="text" style="width: 160px" onFocus="this.select()" value="[FLASH]http://diemtua.net/player.swf?file=http://diemtua.net/xml.php?id='+id+'&abouttxt=™†DiemTua.Net†™&aboutlnk=http://diemtua.net&autostart=true&repeat=true&skin=[/FLASH]">';

		sender_f+= '<center><a href="'+download+'" title="Download ca khúc '+name+'" onclick="alert(\'Click chuột phải chọn save target as\')"><img src="http://diemtua.net/images/download2.gif" alt="download" border=0></a><br><a href="javascript:popup(\'http://diemtua.net/email.php?id='+type+'/'+id+'/'+name+'/'+singer+'\',\'sendmail_popup\',350,250);" title="Gửi tặng bạn bè bài hát '+name+'" onclick="popup(\'http://diemtua.net/email.php?id='+type+'--'+id+'--'+name+'--'+singer+'\',\'sendmail_popup\',350,250);"><img src="http://diemtua.net/images/email_icon.jpg" alt="Gửi tặng bạn bè bài hát '+name+'" border=0></a></center>';

	document.getElementById("info_field").innerHTML = info_f;

	document.getElementById("player_field").innerHTML = player_f;

	document.getElementById("sender_field").innerHTML = sender_f;

	document.getElementById("player_field").scrollIntoView();

	}

	catch(e){}

	finally{}

	return false;

}