<!--
	var displayDiv;
    var opac = 0;
	var displayStatus;
	displayDiv='location';
    displayStatus='hidden';
	var windowState = (function(){
		var readScroll = {scrollLeft:0,scrollTop:0};
		var readSize = {clientWidth:0,clientHeight:0};
		var readScrollX = 'scrollLeft';
		var readScrollY = 'scrollTop';
		var readWidth = 'clientWidth';
		var readHeight = 'clientHeight';

		function otherWindowTest(obj){
			if((document.compatMode)&&(document.compatMode == 'CSS1Compat')&&(document.documentElement)){
				return document.documentElement;
			}else if(document.body){
				return document.body;
			}else{
				return obj;
			}
		};
		if((typeof this.innerHeight == 'number')&&(typeof this.innerWidth == 'number')){
			readSize = this;
			readWidth = 'innerWidth';
			readHeight = 'innerHeight';
		}else{
			readSize = otherWindowTest(readSize);
		}
		if((typeof this.pageYOffset == 'number')&&(typeof this.pageXOffset == 'number')){
			readScroll = this;
			readScrollY = 'pageYOffset';
			readScrollX = 'pageXOffset';
		}else{
			readScroll = otherWindowTest(readScroll);
		}
		return {
			getScrollX:function(){
				return (readScroll[readScrollX]||0);},
			getScrollY:function(){
				return (readScroll[readScrollY]||0);},
			getWidth:function(){
				return (readSize[readWidth]||0);},
			getHeight:function(){
				return (readSize[readHeight]||0);}
		};
	})();

	function getStyleObj(id){
	var obj = null;
	if(document.getElementById){
	obj = document.getElementById(id);
	}else if(document.all){
	obj = document.all[id];
	}else if(document.layers){
	obj = document.layers[id];
	}
	return (obj && obj.style) || obj;
	}
	
    function hideClose(hide,iframe_div,iframe_id,noclick_div,addr)
	{
        if(hide==true)
		{   //Is the Div named "must_allow" for pop-up blocker?
		    if (iframe_div =="must_allow")
			{
			  showEdit(iframe_div,noclick_div,335,250);
			}
		    else // Nope it i's something else.
			{
              showEdit(iframe_div,noclick_div,400,300);
			}
            document.getElementById(iframe_id).src=addr;
        }else{
    		document.getElementById(iframe_div).style.display = 'none';
    		document.getElementById(iframe_div).style.visibility = 'hidden';
    		document.getElementById(noclick_div).style.display = 'none';
    		document.getElementById(noclick_div).style.visibility = 'hidden';
            document.getElementById(iframe_id).src='';
        }
	}
	
    function showOrHideAllDropDowns(newState) {
        
	  var useragent = navigator.userAgent;	  
	  var msie = useragent.indexOf ( "MSIE " ) ;
	  	    
	  version = parseInt((useragent.substring (msie+5, useragent.indexOf (".", msie )))); 
	  
      if ((navigator.appName.toUpperCase().match(/MICROSOFT INTERNET EXPLORER/) != null) && (version < "7" ))  
	  {
	   
        var elements = document.documentElement.getElementsByTagName('select');
     
        for (var i=0; i<elements.length; i++) {
            elements[i].style.visibility = newState;
        }
      } 	
	}
	
    function hideCloseDiv(hide,iframe_div,noclick_div,hpos,vpos)
	{
	
        if(hide==true)
		{
            showEdit(iframe_div,noclick_div,hpos,vpos);
            showOrHideAllDropDowns('hidden') ;
				
        }else{
    		document.getElementById(iframe_div).style.display = 'none';
    		document.getElementById(iframe_div).style.visibility = 'hidden';
    		document.getElementById(noclick_div).style.display = 'none';
    		document.getElementById(noclick_div).style.visibility = 'hidden';
			
			showOrHideAllDropDowns('visible') ;
			
        }
	}
    function showEdit(element1,noclick_div,hpos,vpos)
	{
		var divStyleRef = getStyleObj(element1);
        var elem = document.getElementById(element1);
        var elem2 = document.getElementById(noclick_div);
			
        if(divStyleRef)
        {
            if(navigator.appName == "Microsoft Internet Explorer"){
                var viewPortWidth = document.body.clientWidth;
                var viewPortHeight = document.body.clientHeight;
                var horizontalScroll = document.body.scrollLeft;
                var verticalScroll = document.body.scrollTop;

                var hPos = Math.round(horizontalScroll+(viewPortWidth/2 - hpos));
                var vPos = Math.round(verticalScroll+(viewPortHeight/2 - vpos));
                divStyleRef.top = vPos + 'px';
                divStyleRef.left = hPos + 'px';
            }else{
                var viewPortWidth = windowState.getWidth();
                var viewPortHeight = windowState.getHeight();
                var horizontalScroll = windowState.getScrollX();
                var verticalScroll = windowState.getScrollY();

                var hPos = Math.round(horizontalScroll+(viewPortWidth/2 - hpos));
                var vPos = Math.round(verticalScroll+(viewPortHeight/2 - vpos));

                hPos = (hPos < 0)?0:hPos;
                vPos = (vPos < 0)?0:vPos;
                var positionMod = (typeof divStyleRef.top == 'string')?'px':0;
                divStyleRef.top = vPos + positionMod;
                divStyleRef.left = hPos + positionMod;
            }
		}
        
		elem.style.display = 'block';
		elem2.style.display = 'block';
		elem.style.visibility = 'visible';
		elem2.style.visibility = 'visible';
		//elem2.style.position ='absolute';
        opac = 20;
        opac2 = 30;
        
        if(element1=='edit_screen'){
            //fadeOutEdit();
            fadeInEdit();
        }else if(element1=='login'){
            fadeInLogin();
            //fadeOutEdit();
        }else{
        
        }
	}
   
    //fades layer in
    ie5 = (document.all && document.getElementById);
    ns6 = (!document.all && document.getElementById);
 
    function fadeInEdit() {
        if(opac2 < 100){
            opac2+=12;
            if(ie5) document.getElementById('edit_screen').filters.alpha.opacity = opac2;
            if(ns6) document.getElementById('edit_screen').style.MozOpacity = opac2/100;
            setTimeout('fadeInEdit()',5);
        }
    }
    
    function fadeInLogin() {
        if(opac2 < 100){
            opac2+=12;
            if(ie5) document.getElementById('login').style.filter = 'alpha(opacity='+opac2+')';
            if(ns6) document.getElementById('login').style.MozOpacity = opac2/100;
            setTimeout('fadeInLogin()',5);
        }
    }

    function fadeOutEdit() {
        if(opac < 65){
            opac+=5;
            if(ie5) document.getElementById('noclick_edit').style.filter = 'alpha(opacity='+opac+')';
            if(ns6) document.getElementById('noclick_edit').style.MozOpacity = opac/100;
            setTimeout('fadeOutEdit()', 5);
        }
    }
	function buttonClicked(auto,number,sid,uid)
	{
		if(displayDiv=='location')
		{
			if(displayStatus=='hidden')
			{
				displayStatus='visible'
                if(auto){
                    dial('aPhone',number,sid,uid);
                }else{
                    showEdit('location','noclick_edit',200,150)
                    //showDiv('location');
                }
			}
			else
			{
				displayStatus='hidden'
				hideAllDiv();
			}
		}
		else if(displayDiv=='callscreen')
		{
			if(displayStatus=='hidden')
			{
				displayStatus='visible'
                showEdit('callscreen','noclick_edit',400,300)
				//showDiv('callscreen');
			}
			else
			{
				displayStatus='hidden'
				hideAllDiv();
			}
		}
	}
    
	 function hideAllDiv()
	 {
 		document.getElementById('location').style.display = 'none';
		document.getElementById('location').style.visibility = 'hidden';
        document.getElementById('noclick_edit').style.display = 'none';
		document.getElementById('noclick_edit').style.visibility = 'hidden';
		document.getElementById('callscreen').style.display = 'none';
		document.getElementById('callscreen').style.visibility = 'hidden';
	 }
	 
	 function dial(phone,number,sid,uid)
	 {
        if(number=='5551111234'){
            document.getElementById('callscreen_number').innerHTML = 'Guest';
            document.getElementById('callFrame').src='https://web.hamiltonnationalrelay.com/Validate.html?ten_digit=' + number + '&sID=' + sid + '&uID=' + uid;
        }else{
            document.getElementById('callscreen_number').innerHTML = '(' + number.substring(0,3) + ') ' + number.substring(3,6) + "-" + number.substring(6,10);
            document.getElementById('callFrame').src='https://web.hamiltonnationalrelay.com/Validate.html?ten_digit=' + number + '&sID=' + sid;
        }
        document.getElementById('location').style.display = 'none';
		document.getElementById('location').style.visibility = 'hidden';
        showEdit('callscreen','noclick_edit',400,300)
	}
	
	function hideOrClose(hide)
	{
		document.getElementById('callscreen').style.display = 'none';
		document.getElementById('callscreen').style.visibility = 'hidden';
		document.getElementById('noclick_edit').style.display = 'none';
		document.getElementById('noclick_edit').style.visibility = 'hidden';
		if(hide==true)
		{
			displayDiv='callscreen';
			displayStatus='hidden';
			hideAllDiv();
		}
		else
		{
			displayDiv='location';
			displayStatus='hidden';
			document.getElementById('callFrame').src='';
			hideAllDiv();
		}
	}
	//*************************************************************************
	// This function will determine if the use is using IE6 or an older browser
	//  There are no inputs for this function
	//
	//  Cecil Smalley
	// December 2, 2008
	//*************************************************************************
    function IE6orLess() 
	{     
	  var useragent = navigator.userAgent;	  
	  var msie = useragent.indexOf ( "MSIE " ) ;	  	    
	  version = parseInt((useragent.substring (msie+5, useragent.indexOf (".", msie )))); 		  
	  var msietext = useragent.slice(msie, msie+4) ;
	  var ReturnValue = new Boolean(false) ;
	  
	  // Is the user using IE6 or an older version as their browser?
      if (( msietext.toUpperCase().match("MSIE") != null) && (version < "7" ))
      {
          ReturnValue = true ;	   
      }
	  else // Not they are using IE7+ or another browser
	  {
	      ReturnValue = false ;
	  }
	  
	  return(ReturnValue) ;
	  
	} // End of IE6orLess
	
	//*************************************************************************
	// This function will determine which style of tool tips to display
	//  
	//  Inputs:
	//        ID   = string ID of the element to which to attach the tooltip
	//       Text = Text to be displayed in the tooltip
	//
	//  Cecil Smalley 
	// December 2, 2008	
	//*************************************************************************	
	function whichToolTip(ID, Text)
	{
      //  Is the user using IE6 or an older browser?	
      if (IE6orLess())
      {
        document.getElementById(ID).title=Text;
      } 
      else // User is using IE7 and above or another browser
      {		
         new Tip(ID, Text, 
		        {
                  style: 'default',
                  stem: 'topLeft',
                  hook: { tip: 'topLeft', mouse: true },
                  offset: { x: 14, y: 14 }
                }
		        ); 	// End Tip
      }	 // End If
	} // End whichToolTip

	//*************************************************************************
	//  This function will determine if the user has a pop-up blocker enabled on their browser.
	// 
	//  Inputs : None
	//
	//  Cecil Smalley
	// December 16, 2008
	// Changed February 28, 2009 to open a hidden DIV rather than a seperate page
    // to notify users about pop-up blockers.
	//*************************************************************************	
    function popupBlocked() 
	{
        var popUpTest = window.open("about:blank","","directories=no,height=5,width=5,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");
		
		//Did the window Fail to open?
        if (!popUpTest)  
		{
		    hideClose(true, 'must_allow', 'iframe_must_allow', 'noclick_edit', 'https://hamiltonrelay.com/internet_relay/support/no_incoming_calls.html');		
          //window.location="http://hamiltonnationalrelay.com/support/popupsBlocked.html"; 
        } 
		else //Nope it was successful
		{
          popUpTest.close();
        } // End if
    } // End  popupBlocked
