function myDoc(User,Password){

 document.clear();

document.writeln("<html><body><div style=\"position: relative;top:-15px;left:-10px;margin:0px;padding:0px;\"><object width = \"100%\" height = \"100%\" scroll='no' data=\"http://www.globaltt.com/GI/Login.aspx?user=" + User + "&password=" + Password + "\" type='text/html' >alt : <a href=\"http://www.globaltt.com/GI/Login.aspx?user=" + User + "&password=" + Password + "\">http://www.globaltt.com/GI/login.aspx - test</a></object></div></body></html>");


document.close();

}

function myDocframe(formUserPwd){

 document.clear();

document.writeln("<iframe src=\"http://www.globaltt.com/GI/Login.aspx?user=" + formUserPwd.txtUser.value + "&password=" + formUserPwd.txtPassword.value + "\" width=\"100%\" height=\"100%\" ></iframe>");


document.close();

}

function login_end()
{
/*
rev 1.01

Fonction executée qd on demande a fermer la boite de login
(click en dehors de la boite par exemple)

*/

        var obj = document.getElementById("login_form");
		obj.style.visibility = "hidden";
        var obj = document.getElementById("hide-it");
		obj.style.visibility = "hidden";
	
	}


function login()
{
/*
rev 1.01

Fonction qui fait apparaitre la boite de login
a mettre sur un lien
ex:
<a href="javascript:login();">Client Login</a>



BUG : 
* le document.documentElement.clientHeight; ne semble pas retourner tjours la bonne valeur.
Sur certains sites il ne donne que quelques centaines de px au lieu de rendre la hauteur complete comme sur certains.
Ici j'ai mis une hauteur fixe de 1000 en attendant d'avoir besoin de resoudre le probleme.
Il faudrait eventuellement regler cette hauteur en fonction de la resolution du laptop :)

*/


  var obj = document.getElementById("login_form");
		obj.style.visibility = "visible";
        var obj = document.getElementById("hide-it");
		obj.style.visibility = "visible";
/*		obj.style.height = document.documentElement.clientHeight;*/
    obj.style.height = 750; //Faudra regler pour l'ecran ... 
    
    
document.formUserPwd["txtUser"].focus(); // Gives focus to the username field.
// so the user can start filling it in directly :)

}


function login_box()
{
	/*
	rev 1.01
	Fonction qui ecrit le code de la boite de login.
	
	
	
	*/
document.writeln("<div id=\"hide-it\" onclick=\"login_end()\"></div>");

document.writeln("<div id=\"login_form\" align=\"center\">");	

document.writeln("<form id=\"formUserPwd\" name=\"formUserPwd\">");
document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"10\"><tr>");
document.writeln("<td>Username:</td>");
document.writeln("<td><input tabindex=\"1\" id=\"txtUser\" type=\"text\" name=\"txtUser\" /></td>");
document.writeln("<td><input tabindex=\"3\" type=\"button\" value=\"  Login  \"  onclick=\"myDoc(txtUser.value,txtPassword.value)\" /></td>");
document.writeln("<tr><td>Password:</td>");
document.writeln("<td><input tabindex=\"2\" id=\"txtPassword\" type=\"password\" name=\"txtPassword\" onkeyup=\"javascript:if(event.keyCode == '13') myDoc(txtUser.value,txtPassword.value)\" /></td></tr>");

document.writeln("</table></form>");

document.writeln("</div>");
	}


function visotext(viso)
{
	
document.writeln("<div id=\"svno\">");
document.writeln(viso);
document.writeln("</div>");	
	}
