function getXmlText( parentNode ) {
  if ( parentNode == null )
    return null;
  var rv = '';
  var nodeType;
  for ( var i=0; i<parentNode.childNodes.length; i++ ) {
    nodeType = parentNode.childNodes[ i ].nodeType;
    if ( nodeType == 3 || nodeType == 4 )
      rv += parentNode.childNodes[ i ].nodeValue.trim();
  }
  if ( 0 == rv.length ) rv = null;
  return rv;
}

function applyExternalLink() {
  var oAnchors = document.getElementsByTagName( 'a' );
  for( var i=0; i<oAnchors.length; i++ ) {
    var className = oAnchors[ i ].className;
    if ( className.indexOf( 'external_link' ) != -1 ) {
      oAnchors[ i ].target = '_blank';
    } else if ( className.indexOf( 'new_window' ) != -1 ) {
      oAnchors[ i ].onclick = function( e ) {
        window.open( this.href, 'new_window', 'width=640,height=480,scrollbars=no,titlebar=no,menubar=no,resizable=yes' );
        return false;
      }
    }
  }
}

function showStreet() {
  var w = window.open( '/streetmarketing.php', 'streemarket', 'width=750,height=415,scrollbars=no,resizable=no,titlebar=yes' );
  w.focus();
}

function popUpReglement() {
  var w = window.open( '/reglement.htm', 'reglement', 'width=520,height=465,scrollbars=yes,resizable=no,titlebar=yes' );
  w.focus();
}

function popUpParticipation() {
  var w = window.open( '/comment_participer.htm', 'participation', 'width=520,height=465,scrollbars=yes,resizable=no,titlebar=yes' );
  w.focus();
}

addListener( window, 'load', applyExternalLink );