JFD = {
	find:function() {
		var fr= document.formfind;
		text = fr.keyword1.value;	
		
		// Option --------------------
		opt = fr.opt_search;		
		for(var i=0;i<opt.length; i++) {
			if(opt[i].checked) {
				final_opt= opt[i].value;
			}
		}
		lv = final_opt;
		//----------------------------
		if(_vL('lblsearch') != text) {
			text = replacetxt(text, " ", "");
			if(text == "") {
				alert(_vL('msgsearch') + '!');
				fr.keyword1.focus();
				return false;
			} else
			if(text.length < 3) {
				alert(_vL('msgkeyword') + '!');
				fr.keyword1.focus();
				return false;
			} else {				
				if(lv == 0) {
					text1 = encodeURIComponent(text);
					urlpage = "http://www.google.com.vn/custom?hl=vi&client=pub-9045769491192369&cof=FORID%3A1%3BGL%3A1%3BLBGC%3A004c96%3BLC%3A%23800000%3BVLC%3A%230066cc%3BGALT%3A%230066cc%3BGFNT%3A%239a0225%3BGIMP%3A%239a0225%3BDIV%3A%23adaead%3B&domains=www.oscvn.com&q="+ text1 + "&sitesearch=www.oscvn.com&meta=";
					wopen = window.open(urlpage);
					wopen.focus();
					return false;
				} else if(lv == 1) {
					text1 = encodeURIComponent(text);
					urlpage = "http://www.google.com.vn/custom?hl=vi&client=pub-9045769491192369&cof=FORID%3A1%3BGL%3A1%3BLBGC%3A004c96%3BLC%3A%23800000%3BVLC%3A%230066cc%3BGALT%3A%230066cc%3BGFNT%3A%239a0225%3BGIMP%3A%239a0225%3BDIV%3A%23adaead%3B&domains=www.oscvn.com&q="+ text1 + "&sitesearch=&meta=";
					wopen = window.open(urlpage);
					wopen.focus();	
					return false;
				}
			}
		}
	},
	onfind:function() {		
		JFD.find();
	},
	ofocus:function(field) {
		if(field.value == _vL('lblsearch'))
			field.value = '';
	},
	oblur:function(field){
		if(field.value == '')
			field.value = _vL('lblsearch');
	},
	search:function(view) {
		date = _vL("finddate");
		if(date.length < 2) 
			date = "0" + date;
		month = _vL("findmonth");
		if(month.length < 2) 
			month = "0" + month;
		year = _vL("findyear");
		url = _vL("findurl");
		if(!kiemtrangay(date, month)) {
			alert("Date invalid, please select date again!");
			return;
		} else {
			page = url;
			page += "/ketqua/" + year + "-" + month + "-" + date;
			if(date == "00")
				page += "/ketqua/" + year + "-" + month + "-";
			goText(page, view);
		}
	}
}