// JavaScript Document
function gotoUrl(str){
	window.location.href = str;
}
function open_vote(urlx,twidth,theight)
{
	var frmPoll = document.voteForm;
	var len = frmPoll.elements["answer"].length;
	var check = false;
	var id = 0;
	
	for(var i=0; i<len ; i++) 
		if(frmPoll.elements["answer"][i].checked)
			{
				check = true;
				id = frmPoll.elements["answer"][i].value;
				break;
			}
	
	if(!check) {
		alert("Xin vui lòng chọn 1 tiêu chí bình chọn !");		
	}
	else {
		var strurl= urlx + '&selected_id=' + id;
		var tposx= (screen.width- twidth)/2
		var tposy= (screen.height- theight)/2;		
		var newWin=window.open(strurl,"HanhChinhVN","toolbar=no,width="+ twidth+",height="+ theight+ ",directories=no,status=no,scrollbars=yes,resizable=no, menubar=no")
		newWin.moveTo(tposx,tposy);
		newWin.focus();
	}
}
function open_vote_result(urlx,twidth,theight)
{
	var strurl= urlx;
	var tposx= (screen.width- twidth)/2
	var tposy= (screen.height- theight)/2;

	var newWin=window.open(strurl,"HanhChinhVN","toolbar=no,width="+ twidth+",height="+ theight+ ",directories=no,status=no,scrollbars=yes,resizable=no, menubar=no");
	newWin.moveTo(tposx,tposy);
	newWin.focus();
}
function confirmSubmit()
{
var agree=confirm("Are you sure ? Press [OK] to Yes, [Cancel] to No");
if (agree)
	return true ;
else
	return false ;
}
