//
//
//  Copyright NETSPACE, All rights reserved
//
// --------------------------------------------------------------------------
//
//  Author(s) :		      ACUNDEGER Erol
//  Creation date :   	      
//  Last Modification :
//
// --------------------------------------------------------------------------
//	
//  Purpose :                 Create Radio Buttons functions
//
// --------------------------------------------------------------------------
//
//

var loaded = 0;
var docimg = (document.images) ? 1 : 0;
var lastbutton = "none";


function nspMakeRadioButtons () {

	// Appel : (lang, namebut1, pathbut1-on, pathbut1-off, sufbut1, 
        //                namebut2, pathbut2-on, pathbut2-off, sufbut2, ... 

	var args, i, lang, butoff, buton;

	args = nspMakeRadioButtons.arguments;

	lang = args[0];

	if ( docimg == 1 ) {
	  for (i = 1; i < (args.length-3); i+=4) { 
             butoff = args[i] + "off";
	     buton = args[i] + "on";
             
             if ( lang != "" ) {
	       this[butoff] = new Image();
               this[butoff].src = args[i + 1] + "-" + lang + "." +  args[i+3];
               this[buton] = new Image();
	       this[buton].src = args[i + 2] + "-" + lang + "." +  args[i+3];
             } else {
	       this[butoff] = new Image();
               this[butoff].src = args[i + 1] + "." +  args[i+3];
               this[buton] = new Image();
	       this[buton].src = args[i + 2] + "." +  args[i+3];
             }
	  }

	  loaded = 1;
       }
}

// Classic Radio Buttons 

function nspRBinMouseAction(Name) {

        var buton = Name + "on";

	if ((docimg == 1) && (loaded == 1) && (document[Name])) {
          document[Name].src = radiobuttons[buton].src;
	}
}

function nspRBoutMouseAction(Name) {

        var butoff = Name + "off";

        if ( Name != lastbutton ) {
	  if ((docimg == 1) && (loaded == 1) && (document[Name])) {
	    document[Name].src = radiobuttons[butoff].src;
	  }
        }
}

function nspRBonClickAction(Name){

	if ((docimg == 1) && (loaded == 1)) {
          oldname = lastbutton;
	  lastbutton = Name;
          nspRBinMouseAction(lastbutton);
          nspRBoutMouseAction(oldname);
	}
}

// Déclaration d'un bouton
//  <A HREF="#" TARGET="#"
//     onMouseover="nspRBinMouseAction('bienvenue');" 
//     onMouseout="nspRBoutMouseAction('bienvenue');"
//     onClick="nspRBonClickAction('bienvenue');">
//     <IMG SRC="./images/buttons/b-bienvenue-off-fr.gif"
//          ALT="Welcome" 
//          WIDTH=129 HEIGHT=30 BORDER=0 
//          NAME="bienvenue" 
//          HSPACE=0 VSPACE=0>
//     </A>

// Ajouter en début de fichier
// <SCRIPT LANGUAGE="JavaScript">
// <!-- 
//
// loaded = 0;
// docimg = (document.images) ? 1 : 0;
// lastbutton = "none";
//
// var radiobuttons = new nspMakeRadioButtons ("fr", 
//                                   "bienvenue", 
//                                   "./images/buttons/b-bienvenue-off",
//                                   "./images/buttons/b-bienvenue-on",
//                                   "gif",
//                                   "passe", 
//                                   "./images/buttons/b-passe-off",
//                                   "./images/buttons/b-passe-on",
//                                   "gif");
// // Mask end -->
// </SCRIPT>


// Simple Radio Buttons 

function nspSimpleRBinMouseAction(Name) {

        var buton = Name + "on";

	if ((docimg == 1) && (loaded == 1) && (document[Name])) {
          document[Name].src = radiobuttons[buton].src;
	}
}

function nspSimpleRBoutMouseAction(Name) {

        var butoff = Name + "off";

	if ((docimg == 1) && (loaded == 1) && (document[Name])) {
	  document[Name].src = radiobuttons[butoff].src;
	}
}

// Déclaration d'un bouton
//  <A HREF="#" TARGET="#"
//     onMouseover="nspSimpleRBinMouseAction('bienvenue');" 
//     onMouseout="nspSimpleRBoutMouseAction('bienvenue');">
//     <IMG SRC="./images/buttons/b-bienvenue-off-fr.gif"
//          ALT="Welcome" 
//          WIDTH=129 HEIGHT=30 BORDER=0 
//          NAME="bienvenue" 
//          HSPACE=0 VSPACE=0>
//     </A>

// Ajouter en début de fichier
// <SCRIPT LANGUAGE="JavaScript">
// <!-- 
//
// loaded = 0;
// docimg = (document.images) ? 1 : 0;
// lastbutton = "none";
//
// var radiobuttons = new nspMakeRadioButtons ("fr", 
//                                   "bienvenue", 
//                                   "./images/buttons/b-bienvenue-off",
//                                   "./images/buttons/b-bienvenue-on",
//                                   "gif",
//                                   "passe", 
//                                   "./images/buttons/b-passe-off",
//                                   "./images/buttons/b-passe-on",
//                                   "gif");
// // Mask end -->
// </SCRIPT>

// Color changing buttons 

function nspSplitBinMouseAction(DocName, Name) {

        var buton = Name + "on";

	if ((docimg == 1) && (loaded == 1) && (document[DocName])) {
          document[DocName].src = radiobuttons[buton].src;
	}
}

function nspSplitBoutMouseAction(DocName, Name) {

        var butoff = Name + "off";

	if ((docimg == 1) && (loaded == 1) && (document[DocName])) {
	    document[DocName].src = radiobuttons[butoff].src;
	}
}


function nspSplitBCoutMouseAction(DocName, Name) {

        var butoff = Name + "off";

        if ( DocName != lastbutton ) {
	  if ((docimg == 1) && (loaded == 1) && (document[DocName])) {
	    document[DocName].src = radiobuttons[butoff].src;
	  }
        }
}

function nspSplitBConClickAction(DocName, Name){

	if ((docimg == 1) && (loaded == 1)) {
          oldname = lastbutton;
	  lastbutton = DocName;
          nspSplitBinMouseAction(lastbutton, Name);
          nspSplitBCoutMouseAction(oldname, Name);
	}
}