// JavaScript Document
if (window.captureEvents){
	window.captureEvents(Event.CLICK);
	window.onclick=windowEventFirefox;
}
else{
	document.onclick=windowEventIE;
}

function windowEventFirefox(e) {
  var el=(typeof event!=='undefined')? event.srcElement : e.target
  //alert(el.tagName);
  if (el.nodeName=='A') {
	    window.routeEvent(Event.CLICK);
   return true;
  }
//  if ((el.childNodes[0].nodeName=='A') || (el.childNodes[0].nodeName=='DIV')){
  if (el.childNodes[0].nodeName=='DIV') el=el.childNodes[0];
  if (el.childNodes[0].nodeName=='A'){	
  	//document.location.href=el.childNodes[0].getAttribute("href");
	if (el.childNodes[0].getAttribute("target")!=null)
		window.open(el.childNodes[0].getAttribute("href"),el.childNodes[0].getAttribute("target"));
	else
		document.location.href=el.childNodes[0].getAttribute("href");
	
  }
  window.routeEvent(Event.CLICK);
   return true;
}

function windowEventIE(e) {
  var el=(typeof event!=='undefined')? event.srcElement : e.target
  //alert(el);
//  if ((el.childNodes[0].nodeName=='A') || (el.childNodes[0].nodeName=='DIV')){
  if (el.nodeName=='A') return true;
  if (el.childNodes[0].nodeName=='DIV') el=el.childNodes[0];
  if (el.childNodes[0].nodeName=='A'){	
  	//document.location.href=el.childNodes[0].getAttribute("href");
	el.childNodes[0].click();
  }
   return true;
}
