var notify = 
  { url:'tcmtests.com',
	script: 'http://www.tcmtests.com/global/scripts/notify.cfm?runAt=[[URL]]&Customer_ID=[[FORM:testprops-Customer_ID]]',
	message: 'You are not authorized to use this page outside the TCMtests.com web site',
	noCopy:true,
	noPrint:true,
	blankPage:true
  }

function secinit()
  { if(notify)
      {  if(!new RegExp(notify.url).test(document.URL) || /file:/i.test(document.URL))
		  { var uuno=document.createElement('script');
			var nstr = notify.script.replace(/\[\[URL\]\]/gi,encodeURIComponent(document.URL));
		    nstr = nstr.replace(/\[\[FORM:(\w*)-(\w*)\]\]/gi,
		        function(str,fn,cn,o,s)
			      { try
			          { return encodeURIComponent(document.forms[fn].elements[cn].value);
				      }
				    catch(e)
		              { return "Form Element document.forms['" + fn + "'].elements['" + cn + "'] not found";
			          }
		          }
		        );
	        uuno.src = nstr;
			document.getElementsByTagName('head')[0].appendChild(uuno);			
			if(notify.blankPage)
		      { while(document.body.firstChild) 
		        document.body.removeChild(document.body.firstChild);
		      }
		    alert(notify.message);
			return false;
	      }
		if(notify.noCopy)
		  {  if(document.body.attachEvent)
	           { document.body.onselectstart = function()
                   { return false;
                   };
	           }
	         if(window.getSelection)	
			   { setInterval('mozClearSelection()',100);
				 var ss=document.createElement('style');
				 ss.type = 'text/css';
				 ss.appendChild(document.createTextNode('html{-moz-user-select: none;}'));
				 document.getElementsByTagName('head')[0].appendChild(ss);	    
			   }
		  }
		if(notify.noPrint)
		  { var ss=document.createElement('style');
		    ss.type = 'text/css';
			var ssstr = '@media print{body {display:none;}}';
			document.getElementsByTagName('head')[0].appendChild(ss);
			if(document.body.attachEvent)
			    ss.styleSheet.cssText = ssstr;
			else
			    ss.appendChild(document.createTextNode(ssstr));	
		  }
	  }
	return true; 
  }	  
 
function mozClearSelection()
  { s = window.getSelection();
    if(s) 
      { if(s.isCollapsed) return;
        s.removeAllRanges();
      }
  }

