var CloseListBox = 0;
var CloseListBoxOld = 0;
getEventSrc = window.Event? function(e){var targ=e.target;return targ.nodeType==1?targ:targ.parentNode}: function() {return event.srcElement} 
pic1= new Image(7,6); 
pic1.src="menubuttons/checkmark.gif"; 

if (window.captureEvents){
	window.captureEvents(Event.CLICK);
	window.onclick=sourceCheck;
}
else
	document.onclick=sourceCheck;

function sourceCheck(e, extra){
	if (!extra) var el=(typeof event!=='undefined')? event.srcElement : e.target;
	else el = extra;

	if (CloseListBoxOld) showMenu(CloseListBoxOld, 1); 	CloseListBoxOld = '';
	if (CloseListBox)
	{
		if (el.id.substr(0,15) != 'popup_feedback_')
		{
			showMenu(CloseListBox, 1);
		}
	}
}

function showMenu(container, Bshow, e) 
{ 
 if (!document.getElementById || (e && getEventSrc(e)!=container)) return;
 if (Bshow == 1 || container.getElementsByTagName('div')[0].style.display) {
	container.getElementsByTagName('div')[0].style.display = '';
	container.getElementsByTagName('td')[1].style.backgroundColor = '#FFFFFF';
	container.getElementsByTagName('td')[1].value = '';
	CloseListBox = '';
 }
 else {
	container.getElementsByTagName('div')[0].style.display = 'block';
	container.getElementsByTagName('td')[1].style.backgroundColor = '#e39724';
	container.getElementsByTagName('td')[1].value = 'activo';
	if (CloseListBox) { CloseListBoxOld = CloseListBox; sourceCheck(0,container); }
	CloseListBox = container;

	var sfEls = container.getElementsByTagName('div')[0].getElementsByTagName('span');
	for (var i=0; i < sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className="popupdropdownspanhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("popupdropdownspanhover\\b"), "");
		}
	}
 }
}



function clickMenu(container, typeData, newText, textHide)
{
	var whereDidClick = container;
	container = container.parentNode.parentNode;
	window.status='';
	container.getElementsByTagName('input')[0].value = textHide? textHide: newText;
	if (typeData == 1) container.getElementsByTagName('span')[0].innerHTML = newText.substr(0, 14);
	else if (typeData == 2) container.getElementsByTagName('span')[0].innerHTML = '<img src="'+newText+'" id="popup_feedback_imgvalue" alt="" style="width: '+(container.style.width.substr(0, container.style.width.length - 2) - 25)+'px;" />';
	else if (typeData == 3) {
		var anchorTags = whereDidClick.parentNode.getElementsByTagName('span');
		for (var i = 0; i < anchorTags.length ; i++)
		{
		   if (anchorTags[i].getElementsByTagName('img')[0] && anchorTags[i].getElementsByTagName('img')[0].id == 'popup_feedback_ChkThis') anchorTags[i].getElementsByTagName('img')[0].src = '/customizador/menubuttons/transparent.gif';
		}
		whereDidClick.getElementsByTagName('img')[0].src = '/customizador/menubuttons/checkmark.gif';
	}
	showMenu(container,1);
}