function getAbsPoint(e) {
	var x = e.offsetLeft;
	var y = e.offsetTop;
	while (e = e.offsetParent) {
		x += e.offsetLeft;
		y += e.offsetTop;
	}
	return {"x":x, "y":y};
}

function over(o, menuName, offset) {
	if (offset == null) {
		offset = 2;	
	}
	var menu = document.getElementById(menuName);
	var xy = getAbsPoint(o);
	//alert(menu.style.width)
	if (menuName == "layer_11") {
		menu.style.left = xy.x - 31 + "px";
	} else {
		menu.style.left = xy.x + "px";
	}
	//menu.style.right = xy.x + "px";
	menu.style.top = (xy.y + o.offsetHeight + offset) + "px";
	//menu.style.backgroundColor = "#00173A";
	clickDocument();
	//menu.style.filter = 'Alpha(Opacity=80)';
	menu.style.visibility = "visible";
	//o.style.backgroundColor = "#00173A";
}
function out(o) {
	//o.style.backgroundColor = "#FFFFFF";
}
function clickDocument() {
	var divs = document.getElementsByTagName("div");
	for (var i = 0; i < divs.length; i++) {
		if (divs[i].getAttribute("ismenu") == "true") {
			divs[i].style.visibility = "hidden";
		}
	}

	var tds = document.getElementById("menu").getElementsByTagName("li");
	for (var i = 0; i < tds.length; i++) {
		//tds[i].style.backgroundColor = "#00173A";
		tds[i].style.backgroundColor = "";
	}
}
//****************add by bxl
function openwin1(page,target,width,height){
	window.open(page,target,'height='+height+',width='+width+',toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no,left='+(screen.width-width)/2+',top='+(screen.height-height)/2);
}

function vote(form){
  o  =   form.vote_content;
  var value='';
  for(i=0;i<o.length;i++)   
       {   
           if(o[i].type == 'radio'&&o[i].checked) {  
             value =  o[i].value;
            }
         }  
  if (value==''){
    alert('Please choose an option!');
  }else{
    openwin1('/pageonlinevote.do?method=save&langType=1&box='+value,'vote',420,335);
  }
}
//****************
document.onclick = clickDocument;
