function coreSearch(q, d){
	window.open("http://www.google.co.th/custom?domains=www.dek-d.com&q="+ q +"&sitesearch="+d+"&sa=Google+Search&client=pub-1198128426900590&forid=1&safe=active&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BLH%3A57%3BLW%3A100%3BL%3Ahttp%3A%2F%2Fwww.dek-d.com%2F06pic%2Fnewhead.gif%3BS%3Ahttp%3A%2F%2Fhttp%3A%2F%2Fwww.dek-d.com%2F06pic%2Fnewhead.gif%3BLP%3A1%3BFORID%3A1&hl=th","","toolbar=1,scrollbars=1,location=1,status=0,resizable=1");

}

function doSearch(){
	var k = document.forms["search"]["radiobutton"];
	var q = document.forms["search"]["q"].value;
	var i, c, s = Array("www.dek-d.com", "");
	for(i = 0; i < k.length; i++){
		if(k[i].checked){
			c = k[i].value;
		}
	}
	if(c != 2) {
		coreSearch(q, s[c]);
		return false;
	}else{
		return true;
	}
	return false;

}

function boardSearch(){
	var q = document.forms["bSearch"]["q"].value;
	var topic = document.forms["bSearch"]["t_topic"].value;
	var name = document.forms["bSearch"]["t_name"].value;
	var d = "dek-d.com/board/";
	q = encodeURI(q);

	if(topic == "Y") {
		d = "dek-d.com/board/view.php";
	}
	coreSearch(q, d);
	return false;
}

function frmSearch(textBox, domain){
	var q = encodeURI(textBox.value);
	var d = encodeURI(domain.value);
	coreSearch(q, d);
	return false;
}