


//function for greyed out text in Access Code textbox - SSO
    function setExampleAccessCode(obj){
        obj = document.getElementById(obj);
        if(obj.value==''){
            obj.value='Enter Access Code';
            obj.style.fontSize = '10px';
            obj.style.fontStyle  = 'italic';
            obj.style.fontFamily='Arial';
        }
    }
    
    //function for clearing the greyed out text
    function clearExampleAccessCode(obj){
       obj = document.getElementById(obj);
       if(obj.value=='Enter Access Code'){
        obj.value='';
        obj.style.fontSize = '12px';
        obj.style.fontStyle  = 'normal';
        obj.style.fontFamily='Arial';
       }
    }
   //function to show/ hide an object 
   function showHideErrorLabel(show,obj){
        if(show){
            document.getElementById(obj).style.display='block';
        }else{
            document.getElementById(obj).style.display ='none';        
        }
    }  
//function for redirecting the faculty to administering the exam - SSO
	function RedirectValidation(url,txtboxId,lblErrorId){
	    var accessCode = document.getElementById(txtboxId).value;
	        if(accessCode.length != 10){
	            showHideErrorLabel(true,lblErrorId);       
	            document.getElementById(lblErrorId).value='&nbsp;&nbsp;&nbsp;Please enter a valid Access Code.';  
	        }else{
	            
               var Regxp = /[0-9a-zA-Z]{10}/;
                if(Regxp.test(accessCode)){
                    showHideErrorLabel(false,lblErrorId);
                    AjaxSetSecurityToken(url,accessCode);
                    //AjaxSetSecurityToken(url,null);
	            }else{
	                showHideErrorLabel(true,lblErrorId);       
	                document.getElementById(lblErrorId).value='&nbsp;&nbsp;&nbsp;Please enter a valid Access Code.';  
	            }
	        }
	        return false;
	    }
	
	