﻿function popup(url) 
{
 params  = 'width=600';
 params += ', height=600';
 params += ', top=0, left=0'
 params += ', fullscreen=yes';

 newwin=window.open(url,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}


function applyType(obj, value)
{
					var arrType = document.getElementsByName('searchType');
					for (var i = 0; i < arrType.length; i++) {
						arrType[i].className = '';
					}
					obj.className = 'curnav';
					//$('t').value = value;
					document.getElementById('t').value = value;
}

function searchKeyWord(){
	var folder = '';
	kw = document.getElementById("q").value;
	if (!kw) alert('Từ khóa phải có 1 ký tự trở lên!');
	else {
		kw = encodeURIComponent(kw);
		type = document.getElementById("t").value;
		last_url = '';
		if (type==2) 
		window.location.href = '/index.php?go=search&keyword='+kw+'&type=2';
		else
		window.location.href = '/index.php?go=search&keyword='+kw+'&type='+type;
	}
	return false;
}
var str = '';
function setValue(obj)
{
		var str = 'NHẬP TỪ KHÓA VÀO ĐÂY.';
			if(obj.value == '')
			{
				obj.value = str;
				obj.style.color = '#848484';
			}
			else if(obj.value == str)
			{
				obj.value = '';
				obj.style.color = '#000000';
			}
}			

