function applyExternalLink() {
	var oAnchors = document.getElementsByTagName( 'a' );
  	for( var i=0; i<oAnchors.length; i++ ) {
  	  if ( oAnchors[ i ].className.indexOf( 'external_link' ) != -1 ) {
    		oAnchors[ i ].target = '_blank';
    	}
    }
   
   	
// efface le contenu du champ recherche de l'entete sur le onFocus :
   	var pTxt = document.getElementById( 'inp-express' ); 
   	if ( pTxt ) {
   		 var inputTxt = pTxt.getElementsByTagName( 'input' )[0];
   		 if ( "text" == inputTxt.type ) {
	   		inputTxt.onfocus = function() {
				// on reinitialise le champ lors d'un clic s'il affiche toujours la valeur d'origine :
				if ( this.value == this.defaultValue ) {
					this.value = '';
				}
			}
		}
   	}

}

function findShopLink() {
	var anchors = document.getElementsByTagName( 'a' );
	for( var i=0; i<anchors.length; i++ ) {
		if ( anchors[ i ].className.indexOf( 'find_store' ) != -1 ) {
			anchors[ i ].onclick = function() {
				window.open( this.href, 'findStore', 'width=780,height=600,scrollbars=yes' );
				return false;
			}
		}
	}
	var forms = document.getElementsByTagName( 'form' );		//	normalement il n'y en a qu'un
	for( var i=0; i<forms.length; i++ ) {
		if ( forms[ i ].className.indexOf( 'find_store' ) != -1 ) {
			forms[ i ].onsubmit = function() {
				window.open( this.action, 'findStore', 'width=780,height=600,scrollbars=yes' );
				this.target = 'findStore';
			}
		}
	}
}

addListener( window, 'load', applyExternalLink );
