// Login ( default.asp )
function loginFormFctn() {
	document.loginForm.action = "util_pages/login.asp";
	document.loginForm.method = "Post";
	document.loginForm.submit();
}


// search engine
function searchFctn() {
	document.searchForm.action = "/util_pages/under_construction.asp";
	document.searchForm.method = "Post";
	document.searchForm.submit();
}

// param:
// f = formulaire
// m = "get" ou "post"
// u = url appelée
function executeForm(f, m, u) {
		f.action = u;
		f.method = m;
		f.submit();
}


function showDisclaimer(){
	disclaimerWindow = window.open( 'disclaimer.htm', 'description', 'scrollbars=no,width=420,height=400,left=177,top=0' );
	disclaimerWindow.title = "Disclaimer";
	disclaimerWindow.document.close();
	disclaimerWindow.focus();
}

// auteur: R Arnaud
// description: ouvre une page html ou jsp dans une fenetre
// parm: 
// pPage = page à ouvrir dans la fenetre
// pWidth = largeur de la fenetre
// pHeight = hauteur de la fenetre
// pTitle = titre de la fenetre
function showPageInWin( pPage, pWidth, pHeight, pTitle){
	disclaimerWindow = window.open( pPage, 'description','scrollbars=no,width='+ pWidth +',height='+ pHeight+',left=177,top=0');
	disclaimerWindow.title = pTitle;
	disclaimerWindow.document.close();
	disclaimerWindow.focus();
}


function showClock(){
	clockWindow = window.open( '/user_services/userServicesSunClock.asp', 'description', 'scrollbars=no,width=522,height=498,left=177,top=0' );
	clockWindow.title = "Sun Clock";
	clockWindow.document.close();
	clockWindow.focus();
}

function showFunctionalities( fctnltName, fctnltDesc ){
	fctnltWindow = window.open( '', 'Functionalty', 'width=200,height=200' );
	fctnltWindow.title = fctnltName;
	fctnltWindow.document.write( fctnltDesc );
	fctnltWindow.focus();
}


function verifNum(valeur)
{
	for (var i=0;i<valeur.length; i++)
	{
		var caractere=valeur.substring(i,i+1);
		if (caractere < "0" || caractere > "9")
		{
			alert ("Enter only numbers");
			return false;
		}
	}
	return true;
}

// used in tradernet.asp
function validation(uti,passcode) 
{
	return (verifNum(uti) && verifNum(passcode));
}




// Used in news.asp; newsAFP.asp; newsPRLINE.asp
function NewsBD() {
	document.NewsBD.action = "news.asp";
	document.NewsBD.method = "Get";
	document.NewsBD.submit();
}

function NewsBD1() {
	document.NewsBD.action = "newsAFP.asp";
	document.NewsBD.method = "Get";
	document.NewsBD.submit();
}

function NewsBD2() {
	document.NewsBD.action = "newsPRLINE.asp";
	document.NewsBD.method = "Get";
	document.NewsBD.submit();
}

function NewsBDs() {
	document.NewsBD.action = "newss.asp";
	document.NewsBD.method = "Get";
	document.NewsBD.submit();
}

function NewsBD1s() {
	document.NewsBD.action = "newsAFPs.asp";
	document.NewsBD.method = "Get";
	document.NewsBD.submit();
}

function NewsBD2s() {
	document.NewsBD.action = "newsPRLINEs.asp";
	document.NewsBD.method = "Get";
	document.NewsBD.submit();
}


// Used in user_services/palmares.asp
function palmaresForm() {
	document.palm1.action = "palmares.asp";
	document.palm1.method = "Get";
	document.palm1.submit();
}

// Used in users_services/marche.asp
function marcheForm() {
	document.march1.action = "marche.asp";
	document.march1.method = "post";
	document.march1.submit();
}

function marcheForm2( strURL ) {
	document.march1.action = strURL;
	document.march1.method = "post";
	document.march1.submit();
}

// Used for indexForm
function fiche() {
	document.indexForm.action = "cours.asp";
	document.indexForm.method = "get";
	document.indexForm.submit();
}

//Used for insert forms: move a list item in the "userForm" form from the selection "listFrom" to the "listTo" 
//(see glps_standalone_order.jsp) 
function moveListItem(userForm,listFrom,listTo)
	{
          indexFrom=document.forms[userForm].elements[listFrom].options.selectedIndex;
          if (indexFrom < 0) return;
          texte=document.forms[userForm].elements[listFrom].options[indexFrom].text;
          valeur=document.forms[userForm].elements[listFrom].options[indexFrom].value;
          document.forms[userForm].elements[listFrom].options[indexFrom]=null;
          a = new Option(texte,valeur,false,true);
          indexTo=document.forms[userForm].elements[listTo].options.length;
          document.forms[userForm].elements[listTo].options[indexTo]=a;
        }

function popup(theURL,winName,features) 
{ 
  window.open(theURL,winName,features);
}