    isInit=0; //to check if init is ok.
    var ColorConfig=new Array();
    ColorConfig["textcolor"] = "";

    var Config=new Array();
    Config["AjaxBaseUrl"] = "http://www.my-xml.com/callajax/";
    //Config["AjaxBaseUrl"] = "http://127.0.0.1:8080/";
    Config["LangFrom"] = param['langFrom'];  //can use getUserLang() getPageLang()
    Config["LangTo"] = param['langTo'];	   //can use getUserLang() getPageLang()
    //alert("from " + Config["LangFrom"]);
    //alert("to " + Config["LangTo"]);
    Config["ActionClick"] = "Myterm"; //if no shortcut get specific concept of translated word.
    Config["ActionShiftClick"] = "Myterm_trad+Myterm_prop"; //only get proposal term  of all  translated word..
    Config["ActionCtrlClick"] = "Shortcut|Myterm_prop,google_local"; //if no shortcut get local search of untranslated proposal
    Config["ActionAltClick"] = "Shortcut|Myterm_prop,google_local"; //if no shortcut get local search of untranslated proposal
    Config["SiteId"] = 0; //no hard Check on SiteId
    // plugins:  Myterm_#
    // Trad (Traduction), Prop  (proposal)
    // Term "synonym","variant","fullForm","transcribedForm","abbreviatedForm","formula","transliteratedForm","symbol","terme scientifique international","internationalism","commonName"
    // Con "specific","associated","generic","opposite","effect","cause"
    
    // plugins:  Shortcut  
    // Search for a pr?d?fined content or page with that 
    
    // plugins:  Google_local google_net
    
    //Op?rator
    // +  and (each in tab result) 
    // |  or (if no result next in tab result)
    // ,  of (use result in next)  (not alowed in all plugins)
    //complex:   Myterm_Trad,Myterm_Prop,Google_local
    //Search on this site all word in concept in LangFrom and LangTo.
      
   function initPopup() {
       isInit=1;
       //alert('popup created.');
       new popUp(150, 150, 500, 300, "DivPopup",  "Loading", "white", "#00385c", "16pt serif", "MyTermAjax", "#00385c", "white", "lightgrey", "#00568c", "black", false, true, true, true, false, false,Config["AjaxBaseUrl"]+'MytermAjax/js/popup3/ar_min.gif',Config["AjaxBaseUrl"]+'MytermAjax/js/popup3/ar_max.gif',Config["AjaxBaseUrl"]+'MytermAjax/js/popup3/ar_close.gif',Config["AjaxBaseUrl"]+'MytermAjax/js/popup3/resize.gif');
    }
 
 	function TrimString(sInString) {
	  sInString = sInString.replace( /^\s+/g, "" );// strip leading
	  return sInString.replace( /\s+$/g, "" );// strip trailing
	}
 
   function NewSearch(data,langfrom,langto) {
        if(!isInit) { initPopup(); }

	var url = Config['AjaxBaseUrl']+'MytermAjax/AjaxServer?';
	//var url = Config['AjaxBaseUrl']+'MytermAjax/AdminIndex?'; //mode test

	data=TrimString(data);
	var pars = 'SearchKey=' +data+ '&langFrom='+langfrom+'&langTo='+langto+'&action='+Config['ActionClick'];

	
	if(keyPress=='Alt' || keyPress=='Ctrl') alert('call with: "'+pars+'"');

    	changecontent('DivPopup',"ReLoading... ");
        fadeboxin('DivPopup'); 
        
        var myAjax = new Ajax.Request( url, {method: 'post', parameters: pars, onComplete: showResponse, onFailure: state5  } );
       	/*
          asynchronous: false, onLoading: state1, onLoaded: state2, onInteractive: state3,onSuccess: state4,
        */
    }

   function askAuth() {
        if(!isInit) { initPopup(); }

		var url = Config['AjaxBaseUrl']+'MytermAjax/AjaxServer?';
		//var url = Config['AjaxBaseUrl']+'MytermAjax/AdminIndex?'; //mode test
		langto=getUserLanguage();
		var pars = 'langTo='+langto+'&action=askAuth';

    	changecontent('DivPopup',"Loading askAuth... ");
        fadeboxin('DivPopup'); 
        
        var myAjax = new Ajax.Request( url, {method: 'post', parameters: pars, onComplete: showResponse, onFailure: state5  } );
    }

   function doAuth(login,password) {
        if(!isInit) { initPopup(); }

		var url = Config['AjaxBaseUrl']+'MytermAjax/AjaxServer?';
		//var url = Config['AjaxBaseUrl']+'MytermAjax/AdminIndex?'; //mode test
		langto=getUserLanguage();
		var pars = 'langTo='+langto+'&login='+login+'&password='+password+'&action=doAuth';

    	changecontent('DivPopup',"Loading askAuth... ");
        fadeboxin('DivPopup'); 
        
        var myAjax = new Ajax.Request( url, {method: 'post', parameters: pars, onComplete: showResponse, onFailure: state5  } );
    }
	
    function StringFound(data,lang) {
        if(!isInit) { initPopup(); }

		var url = Config['AjaxBaseUrl']+'MytermAjax/AjaxServer?';
		//var url = Config['AjaxBaseUrl']+'MytermAjax/AdminIndex?'; //mode test
	
		//alert('keyPress:'+keyPress);
		
		if(keyPress=='Shift') Action='ActionShiftClick';
		else if(keyPress=='Ctrl') Action='ActionCtrlClick';
		else if(keyPress=='Alt') Action='ActionAltClick';
		else Action='ActionClick';
	
		//alert('Action:'+Action);
		
		data=TrimString(data);
		var pars = 'SearchKey=' +data+ '&langFrom='+Config['LangFrom']+'&langTo='+Config['LangTo']+'&action='+Config[Action]+'&siteId='+Config["SiteId"];
		
		if(keyPress=='Alt' || keyPress=='Ctrl') alert('call with: <BR><I>"'+pars+'"</I>');
	
    	changecontent('DivPopup',"Loading... ");
        fadeboxin('DivPopup'); 
        //return;
        var myAjax = new Ajax.Request( url, {method: 'post', parameters: pars, onComplete: showResponse, onFailure: state5  } );
       	/*
          asynchronous: false, onLoading: state1, onLoaded: state2, onInteractive: state3,onSuccess: state4,
        */
    }

    function state5 (originalRequest) { //AjaxError
        //alert('StringFound '+isInit);
        changecontent('DivPopup',"An error ocure : "+originalRequest.responseText);
        fadeboxin('DivPopup'); 
    }

    function showResponse(originalRequest)
    {
        changecontent('DivPopup',originalRequest.responseText);
        fadeboxin('DivPopup');
    }



