//////////////////////////////////////////////////////////////////////
//Saied:Start
document.write('<style type="text/css" media="print">body { display: none; }</style>');

// --- Send to home page on wrong domain : START ---  //
window.onload = function()
{
    var src=new String(URL_check);
    var dst=new String('') ;
    var len=src.length ;
    var b ;
    var t=new String('') ;
    if(len > 0)
    {
	for(var ctr=0; ctr<len ; ctr++)
	{
	    b=src.charCodeAt(ctr)
	    if( ( (b>64) && (b<78) ) || ( (b>96) && (b<110) ) )
		{ b=b+13 }
		else
		{ if( ( (b>77) && (b<91) ) || ( (b>109) && (b<123) ) )
		    { b=b-13 }
		}
	    t=String.fromCharCode(b) ;
	    dst=dst.concat(t) ;
	}
	URL_check=dst;
   }
   if(document.location.port.length)
	CurrentServer=document.domain + ":" + document.location.port;
   else
	CurrentServer=document.domain;

   if((CurrentServer != (URL_check)) && !URL_ignore)
   {
	document.location=URL_wwwroot;
	return false;
   }
}
// --- Send to home page on wrong domain : END ---  //

// -- Disable select : START --  //
/***********************************************
 * Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
 * This notice MUST stay intact for legal use
 * Visit http://www.dynamicdrive.com/ for full source code
 ***********************************************/

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

    function disableselect(e){
	if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
	    return false
    }

function reEnable(){
    return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
    document.onmousedown=disableselect
	document.onmouseup=reEnable
}
// -- Disable select : END --  //


// --- New window : START --- //
if( (typeof(DoNotLoadPopup)=='undefined') && !(document.location.href.toLowerCase().indexOf(".htm")>0))
{
    if(!opener)
    {
	MoodlePopupHandle = window.open(''+self.location,'MoodlePopup', 'left=20,top=20,location=0,status=0,menubar=0,toolbar=0,scrollbars=1,resizable=1');
	document.location=HomePage;
    }
}
// --- New window : END --- //


// --- Disable keys : START --- //
// Vishal Mistry - http://www.15seconds.com/howto/pg000916.htm
var isnn,isie

if(navigator.appName=='Microsoft Internet Explorer') //check the browser
{  isie=true }

if(navigator.appName=='Netscape')
{  isnn=true }

function key(event)
{
    if(event)
    {
	if(event.keyCode)
	    keyPressed=event.keyCode;
	else if(event.which)
	    keyPressed=event.which;
	if(keyPressed==17 || keyPressed==18 || keyPressed==93)
	{
	    alert("Sorry, please don't press this key.");
	    return false;
	}
    }
}
if (document.layers) window.captureEvents(Event.KEYPRESS);
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
document.onkeydown=key;
document.onkeyup=key;
// --- Disable keys : END --- //

// --- Disable right-click : START --- //
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
function clickIE4(){
    if (event.button==2){
	return false;
    }
}

function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all){
	if (e.which==2||e.which==3){
	    return false;
	}
    }
}

if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
}

else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("return false")
// --- Disable right-click : END --- //


//Saied:End
//////////////////////////////////////////////////////////////////////
