//------------variables globales
var ie=document.all
var ns6=document.getElementById&&!document.all
//---------------effet sur le menu haut
function mouseOver(lien,fond,couleur){
	lien.style.background = fond;
	lien.style.color = couleur;
}
function mouseOut(lien,fond,couleur){
	lien.style.background = fond;
	lien.style.color = couleur;
}
//------------liens
function ouvreLien(url,mode) {
	if (mode == "_blank") {
		window.open(url)
	} else if (mode == "_top")  {
		window.top.location.href = url
	} else { 
		window.top.parent.frames[mode].location.href  = url
	}
}
//----------verif email --------------/
function verif_email(email){
	z=/^[a-zA-Z0-9_.]+\@{1}\w+\.{1}[a-z]{2,3}$/;
	if(!z.test(email)) {
		alert('E-mail non valide!!!');
		return false;
	}else{
		return true;
	}
}
//-----------------gestion menu a guache
function showmenu(ssmenu,tssmenu)
{
		if (ie) {
			objet = document.all[ssmenu]
		} else if (ns6) {
			objet = document.getElementById(ssmenu);
		}
		
		if (objet.style.display == ""){
			objet.style.display = "none";
			document.images["puce"+ssmenu.substr(1,1)].src='./images/puce_on.gif';
		}else {
		objet.style.display = "";
		document.images["puce"+ssmenu.substr(1,1)].src='./images/puce_off.gif';
		tssmenu = tssmenu.split(",");
			for(i=0;i<tssmenu.length;i++){
				if (ie) {
					document.all[tssmenu[i]].style.display = "none";
				} else if (ns6) {
					document.getElementById(tssmenu[i]).style.display = "none";
				}
				document.images["puce"+tssmenu[i].substr(1,1)].src='./images/puce_on.gif';
			}
		}
}
//--------------------gestion puce menu a guche
function off(indice){
document.images["puce"+indice].src='./images/puce_off.gif';
}

function on(indice){
document.images["puce"+indice].src='./images/puce_on.gif';
}
//-------------------initialisation du menu a gauche
function init(indice){
if(indice!="no"){
		if (ie) {
			if(indice.substr(1,1)) cell  = document.all["cell"+indice]
			objet = document.all["t"+indice.substr(0,1)]
		} else if (ns6) {
			if(indice.substr(1,1)) cell  = document.getElementById("cell"+indice);
			objet = document.getElementById("t"+indice.substr(0,1));
		}
		objet.style.display = "";
		if(indice.substr(1,1)) {
						cell.style.color='#0099FF';
						cell.style.background='#FFFFFF';
						//cell.style.fontWeight='bold';
						}
		document.images["puce"+indice.substr(0,1)].src='./images/puce_off.gif';
}}
//------------open popup
function popup (url,h,v,x,y)
{
   propriete="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+ h +",height=" + v + ",top="+x+",left="+y;
   var popup = window.open (url,"LectureArticle",propriete);
   if( navigator.appName.substring(0,8) == "Netscape" )
           {popup.location = url;}
}

//---------------------tests sur le formulaire contact
function verif_contact(nom,email,message){
	if(nom.value == "") { alert("Nom non renseigné !"); nom.focus(); return false; }
	else if(!verif_email(email.value)) { email.focus(); return false; }
	else if(message.value == "") { alert("Message non renseigné !"); message.focus(); return false; }
	else return true;
}
//-----------------------Ajouter au favoris
function favoris() {
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )) {
        window.external.addFavorite("http://www.arcanes.ma", "Arcanes Technologies");
    } else {
        alert("Cette fonction n'est activée que dans Internet Explorer v5.0 ou + ...\n Tapez CTRL + D pour ajouter Atlasvista dans vos favoris !");
    }
}
//------------------------live support
function dounique() { var date = new Date() ; return date.getTime() ; }

var url = escape( location.toString() ) ;
var unique = dounique() ;

function openlivechat(){
var request_url_1_0 = "https://www.arcanes.ma/support/visitor/index.php?_m=livesupport&_a=startclientchat" ;
newwin = window.open( request_url_1_0, unique, 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=500,height=430,left=20,top=20' ) ;
newwin.focus() ;
}
//-----------------------pop up images
function resizePopUp(monImage, monTitre)
  {
  w = window.open('','chargement','width=10,height=10,top=100,left=100');
  w.document.write( "<html><head><title>"+  monTitre+"</title>\n" ); 
  w.document.write( "<script language='JavaScript'>\n"); 
  w.document.write( "IE5=NN4=NN6=false;\n"); 
  w.document.write( "if(document.all)IE5=true;\n"); 
  w.document.write( "else if(document.getElementById)NN6=true;\n"); 
  w.document.write( "else if(document.layers)NN4=true;\n"); 
  w.document.write( "function autoSize() {\n"); 
  w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31)\n"); 
  w.document.write( "else if(NN6) self.sizeToContent();\n");
  w.document.write( "else window.resizeTo(document.images[0].width,document.images[0].height+20)\n"); 
  w.document.write( "self.focus();\n"); 
  w.document.write( "}\n</script>\n");
  w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
  w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='"+monTitre+"'></a>" ); 
  w.document.write( "</body></html>" );
  w.document.close(); 
  }
//------------------alternate pack
a = 1;
function alternate(prix){
if(ie){
	if(a==1){
		document.all["l1"].innerHTML="<span class='29'>"+prix+"</span><span class='htmois'> DH HT/Mois</span>";
		a=0;
	}else{
		document.all["l1"].innerHTML="<span class='commander'>Commander en ligne</span>";
		a=1;
	}
}else if(ns6){
	if(a==1){
		document.getElementById("l1").innerHTML="<span class='29'>"+prix+"</span><span class='htmois'> DH HT/Mois</span>";
		a=0;
	}else{
		document.getElementById("l1").innerHTML="<span class='commander'>Commander en ligne</span>";
		a=1;
	}
}
}