//////////////////////Text for the signin page //////////////////////

   function displayText(text)
     {
			var url = new String(window.location.href);
			var textValue = "";
			if (url.indexOf(".fr") == -1)
			{switch (text)
			 {
			  case 'username':        textValue="Username:";break;
				case 'password':        textValue="Password:";break;
				case 'forgot_username': textValue="Can't remember your Username? Please contact us at support@workspeed.com.";break;
				case 'remember_username': textValue="Remember my username";break;
				case 'forgot_password': textValue="Forgot your password?";break;
				case 'send_password': textValue="Send Username/Password";break;
				case 'trouble':         textValue="Trouble signing in?";break;
        case 'copyright':       textValue="2009 - 2010 Workspeed Management, LLC.  All Rights Reserved.<BR>Workspeed<sup>TM</sup> is a trademark of Workspeed Management, LLC.<BR/>Protected by U.S. Patent No. 7,143,048";break;
				case 'terms':           textValue="Terms of Use";break;
				case 'privacy':					textValue="Privacy Policy";break;
				case 'technical_requirements':					textValue="Technical Requirements";break;
				case 'hint':					  textValue="Password Hint:";break;
				case 'enterusername':   textValue="Please enter your Username and we will show you the Password hint that you provided when your first signed in.";break;
        case 'still_forgot':    textValue="Still can't remember your Password? Please contact us at support@workspeed.com.";break;
       }
			}
			else
			{switch (text)
			 {
			  case 'username':        textValue="Identifiant:";break;
				case 'password':        textValue="Mot de passe:";break;
				case 'forgot_username': textValue="Si vous avez oublié votre nom d'utilisateur, veuillez appeler Workspeed France";break;
				case 'remember_username': textValue="Se rappeler du nom d'utilisateur";break;
				case 'forgot_password': textValue="Oublié votre mot de passe?";break;
				case 'trouble':         textValue="Problème de connexion?";break;
        case 'copyright':       textValue="2000-2003 Workspeed Inc., tous droits réservés<BR>Workspeed<sup>TM</sup>est une marque déposée de Workspeed Inc.";break;
				case 'terms':           textValue="Conditions d'utilisation";break;
				case 'privacy':					textValue="Confidentialité";break;
				case 'hint':					  textValue="Indication pour votre mot de passe:";break;
				case 'enterusername':   textValue="Donnez votre nom d'utilisateur pour obtenir l'indication que vous avez donnée lors de votre première connexion";break;
        case 'still_forgot':    textValue="Vous ne vous rapplelez plus de votre mot de passe? Appelez Workspeed France";break;
       }
			}
		 document.write(textValue);
   }

function fetchUrlProp()
{
    var urlhost = location.host;
    var indes1  = urlhost.indexOf("."); //ggg
    document.form1.urlPropertyNameToMatch.value = urlhost.substring(0,indes1);
}

var firstClickFlag = 0;

function gotoUrl()
{
    if (firstClickFlag == 0) {
        firstClickFlag += 1;
        document.form1.action="/workspeed/ui/workspeed/admin/servlet/SignOnControl";
        return true;
    } else return false;
}

function delCookie ()
{
    document.cookie = "IPBroker" + "=" +  "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function clean(A) {
    var B=A.nextSibling.nextSibling;
    if(B)
    {
        A.onblur = function() {
            if (!A.value) B.style.top = "";
        };
        B.style.top = "-9999px";
    }
}
function popUp(url, name, w, h) {
    var l = (screen.availWidth-10 - w) / 2;
    var t = (screen.availHeight-20 - h) / 2;

    features = "width="+w+",height="+h+",left="+l+",top="+t;
    features += ",screenX="+l+",screenY="+t;
    features += ",scrollbars=0,resizable=1,location=0";
    features += ",menubar=0,toolbar=0,status=0";

    window.open(url, name, features);
}

var handle__iterator=null;
function checkInput()
{
    if (document.getElementById('PASSWORD').value!='')
    {
        clean(document.getElementById('PASSWORD'));
        stopCheck();
    }
}

function checkLogin() {
    if (document.getElementById('USERID').value!='')
    {
        clean(document.getElementById('USERID'));
    }
}

function startCheck()
{
    handle__iterator=setInterval(checkInput,20);
}
function stopCheck()
{
    clearInterval(handle__iterator);
}
function checkWhitespace (elem)
{   var i;
    var whitespace = " \t\n\r";
    var s = elem.value;
    if (((s == null) || (s.length == 0))) return;
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) {startCheck(); return };
    }
}

