
function checkShowIntermediatePage() {
    try {		
		//alert ('Checking login name for old/new names.');
		
		var loginbox, username, OldLoginFinderRegexp;
		loginbox=getMultibrowserElementById('Uid');
		
		username=loginbox.value;
		//alert (username);
		
		// 20061128 Sonja: Het gaat om usernames beginnend met een kleine c of een kleine s gevolgd door 9 cijfers, 
		//  en voor usernames bestaande uit alleen cijfers (variabel aantal).
		OldLoginFinderRegexp = new RegExp("^[cs]{1}[0-9]{1,9}$", ""); 
		
		//if (myString.match(/regex/)) { /*Success!*/ }
		//If you are using a username of the format c000001234 or s000000567 or only  numeric
		// and wish to maintain access to the usage reports in 2006..
		
		//if (((username.match(oldLoginFinderRegexp)) || (username.match(oldLoginFinderRegexp2))) /* && (username == username.toLowercase() )*/ ) //check for lowercase is required for workaround since i-flag has no influence
		if ((username.match(OldLoginFinderRegexp)) || 
		    ((username == parseInt(username).toString())) && ((username.length >= 3) && (username.length <= 7 )))
		{ 
			/*Success!*/ 
						
			if(confirm('IMPORTANT NOTICE\n\nWe noticed that you have just logged in with a non-administrator type of username.\n\nDid you know that you could have access to a special administration tool which allows\nyou to view and edit your institute s ScienceDirect and/or Scopus settings, \nincluding the possibility to view Usage Statistics as you always have?\nAdministrators also receive monthly alerts when the usage reports are updated.\n\nTo register as an administrator go to:\n     http://www.info.sciencedirect.com/adminsignup/\nor alternatively send an e-mail to\n     nlinfo@sciencedirect.com\n\nWould you like to send this e-mail now?'))
			{
				//alert('send an email is not implemented yet');
				// to get linebreaks in body, use %0D or %0A (or both - wich is best could be tested in different email clients)
				document.location.href='mailto:nlinfo@sciencedirect.com?subject=Request for administrator username for '+username+'&body=Dear E-Helpdesk,%0DI would like to request an administrator username.%0D%0DMy current ScienceDirect/Scopus username is: '+username+'%0DI would like to get this ScienceDirect/Scopus username: %0DMy e-mail address: %0D%0D'; 
			}
				
		}
    }
    catch(e){
    //alert(e.toString())
    }    
}


function register_checkShowIntermediatePage() {
  var func = checkShowIntermediatePage;
  //register_onLoad(func);
  		
  // register the function to be attached to an event in the form 
  try {
	//	var loginbox;
	//	loginbox=getMultibrowserElementById('Uid');
	//			
	//	if (loginbox) {			 
	//		if (typeof loginbox.onblur != 'function') {
	//			loginbox.onblur = func;
	//		} else {
	//			loginbox.onblur = function() {
	//			//oldfunc();
	//			func();
	//			}
	//		}			
	//	}
		  
		var loginForm;
		loginForm=getMultibrowserElementById('loginForm');	
		
		if (loginForm) {
			var oldonsubmit = loginForm.onsubmit;
			 
			if (typeof loginForm.onsubmit != 'function') {
				loginForm.onsubmit = func;
			} else {
				loginForm.onsubmit = function() {
				oldonsubmit();
				func();
				}
			}			
		}
		
		
    }
    catch(e){}
}

// some ELS standard parts...:
// these functions are defined in each ELS script file - if changed, please replace also in other files

function getMultibrowserElementById(sID,oDoc) { 
    if( !oDoc ) { oDoc = document; } // init at document level, used for recursive for netscape
    if( document.layers ) { //Netscape layers
		//alert('document.layers');
        if( oDoc.layers[sID] ) { return oDoc.layers[sID]; } else {
            //repeatedly run through all child layers
            for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
                //on success, return that layer, else return nothing
                y = getMultibrowserElementById(sID,oDoc.layers[x].document); }
            return y; } }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
		//alert('document.getElementById');
        return document.getElementById(sID); }
    if( document.all ) { //Proprietary DOM; IE4
		//alert('document.all');
        return document.all[sID]; }
    if( document[sID] ) { //Netscape alternative
		//alert('document[xxx]');
        return document[sID]; }
    return false;
}

//voorbeeld on
function register_onLoad(func) {
  var oldonload = window.onload;  
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
   
///// activation of script:
//window.onload fires after all content (including images) has been loaded
//register_cleanupHashCode(); // uses the windows.onload

// activate now: (this js is now called AFTER <body> is complete
register_checkShowIntermediatePage();