<!--
// ==================================================================================
// FICHIER:      js.js                                                               
// Description:  déclaration de fonctions globales pour le site                      
//               doit être inséré avant les autres déclarations de scripts           
// ==================================================================================
function test_js(texte){
	alert(texte);
}

// ========================================================
//    Déclaration de variables pour la page ou le site     
// ========================================================
var clic_droit = 'non'; // oui, non, cop

// ========================================================


// ====================================================================
// GESTION DU CLIC DROIT                               no_clic_droit(e)
// ====================================================================

function no_clic_droit(e){
	if ((!document.all && e.which == 3) || (document.all && event.button==2)){
		// CLIC DROIT DETECTE 
			
			// Qu'est-ce qu'on fait? ============
			switch(clic_droit){
				case 'oui':
					// je laisse le clic droit actif et je ne fais rien
					return true;
					break;
					
				case 'non':
					// je ne veux pas de clic droit, mais rien ne se passe
					//alert('non');
					return;
					break;
					
				case 'cop':
					// je ne veux pas de clic droit et j'affiche le message de copyright
					alert('Copyright Ricardo Bandeira');
					break;
					
				default:
			} // Fin Switch =====================
		
	} // Fin if
  
}

document.onmousedown = no_clic_droit;

// FIN no_clic_droit(e)
// ====================================================================


// ========================================================================================================================================
// FONCTIONS DE TRAITEMENT d'OBJETS                                                                                                        
// ========================================================================================================================================


// ====================================================================
// Fonction : ouvfen(url, nom ,posx, posy, tx, ty)                     
// param  :   url = fichier                                            
//            nom = nom de la fenêtre                                  
//            posx = position de la fenetre                            
//            posy = position de la fenetre                            
//            tx = taille de la fenetre                                
//            ty = taille de la fenetre                                
// Descriptif : ouvre une nouvelle fenete...                           
//                                                                     
// ====================================================================
// Pour ouvrir une fenetre en pop-up
function n_fen(fich, nom_fen, opts, stitre) {
 fenetre = window.open(fich, nom_fen, opts);
 fenetre.focus();
 fenetre.defaultStatus = stitre;
}
//-->

function ouvfen(url, nom ,posx, posy, tx, ty){
				param = "dependent=no,location=no,menubar=no,status=no,statusbar=no,toolbar=no,resizable=no";
				param += ",left = " + posx + ", top = " + posy;
				param += ", width = " + tx  + " , height = " + ty ;
				fen = window.open(url,nom, param);
}

// Fonction: ouvfen(url, nom ,posx, posy, tx, ty)
// FIN
// ====================================================================



// ====================================================================
// Fonction : aff_dim()                                                
// param  :                                                            
// Descriptif :                            
//                                                                     
// ====================================================================


function aff_dim(){
var h="";
var w="";
if (document.all){
	h=document.body.clientHeight;
	w=document.body.clientWidth;
}else{
	w=window.innerWidth;
	h=window.innerHeight;
}
	window.status = "dims: " + w + " x " + h;
	window.defaultStatus=" Voyez-vous ce message ?.............."; 

}


// Fonction: aff_dim()
// FIN
// ====================================================================



// ====================================================================
// Fonction : img_over(img,pos,ext)                                    
// param  : le nom de l'image / over ou out / extension                
// Descriptif : permet d'afficher une image avec le mouseover          
//               et retablir la source                                 
// ====================================================================
function img_over(img,pos,ext){
		document.getElementById(img).src = "imgs/interface/" + img + "_" + pos + "." + ext;
}


// Fonction: aff_dim()
// FIN
// ====================================================================



// ========================================================================================================================================









// ========================================================================================================================================
// FONCTIONS DE TRAITEMENT de texte                                                                                                        
// ========================================================================================================================================


// ====================================================================
// Fonction : droite(txt,n)
// param  : txt = texte ; n = nombre
// Descriptif : equivalent de la fonction right()
// 
// ====================================================================



function gauche(txt,n){
	nb_char = txt.length;
	// txt = txt.substr( pos1, long )
	if( !(isNaN(n)) ){
		txt = txt.substring(0 , n);
		return txt;	
	}
}


function milieu(txt,pos1,pos2){
	nb_char = txt.length;
	txt.substring(pos1 , pos2)
}


function droite(txt,n){
	if(txt != ""){
		ch = chaine.substr( (txt.length - n),n)
		return ch;
	}
}
// Fonction: droite(txt,n)
// FIN
// ====================================================================

function char(cod){
	// Chaine.fromCharCode(code1[, code2, ..])
}




// FIN                                                                                                                                     
// ========================================================================================================================================













// ====================================================================
// GESTION DE L'Envoi de mail                              envoi_mail()
// ====================================================================
function envoi_mail(){
	//	alert("Cette fonction est en cours de développement. \n Vous pouvez copier le texte affiché sur l'image. ");
	mail_ad = "ricardo" + "@" + "rband" + "eira.com";
	sujet = "J'ai visité votre site..."
	ligne1 = "Remplissez votre demande de renseignement ci dessus. N'oubliez pas de nous indiquer vos coordonnées, et merci de votre visite.";
	parent.location = "mailto:" + mail_ad + "?subject=" + sujet + "&cci=" + mail_ad + "&body=" + ligne1 ;
	
}

// FIN envoi_mail()
// ====================================================================


// -->
