// JavaScript Document
//This is the codes to diable select text:

//[script language="JavaScript1.2"]

//Disable select-text script (IE4+, NS6+)- By Andy Scott
//Exclusive permission granted to Dynamic Drive to feature script
//Visit www.dynamicdrive.com for this script

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false" )

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
//[/script]

//Please change all the [square brackets] to the sharp brackets

//--------------------------------------------------------------------------------------------------------------------------------

//This is to disable right click:

//[script type="text/javascript"]
//[!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit www.dynamicdrive.com

var message="No clicky";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
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("alert(message);return false" )

// --]
//[/script]


//Please change all the [square brackets] to the sharp brackets
//You may also want to change the words in Bold and Underline 


//--------------------------------------------------------------------------------------------------------------------
//Code to Disble  PrintScreen & Copy+Paste Functionality

//function SetClipBoardData()
//{
//	setInterval ("window.clipboardData.setData('text','')",20);	
//}
//function blockError()
//{
//	window.location.reload(true);
//	return true;
//}
//	


//--------------------------------------------------------------------------------------------------------------------
//--------------------------------list all CTRL + key combinations you want to disable--------------------------------



function disableCtrlKeyCombination(e)
{
        //list all CTRL + key combinations you want to disable
        var forbiddenKeys = new Array("a", "s", "c", "x", "v");
        var key;
        var isCtrl;

        if(window.event)
        {
                key = window.event.keyCode;     //IE
                if(window.event.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }
        else
        {
                key = e.which;     //firefox
                if(e.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }

        //if ctrl is pressed check if other key is in forbidenKeys array
        if(isCtrl)
        {
                for(i=0; i<forbiddenkeys .length; i++)
                {
                        //case-insensitive comparation
                        if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
                        {
                                alert("Key combination CTRL + "
                                        +String.fromCharCode(key)
                                        +" has been disabled.");
                                return false;
                        }
                }
        }
        return true;
}




//---------------------------------------------------------------------------------------------------------------------
//---------------------Disable ctrl + n and other ctrl + key combinations in JavaScript--------------------------------
function onKeyDown() {
// current pressed key
var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();
 
if (event.ctrlKey && (pressedKey == "c" || pressedKey == "s" ||  pressedKey == "x" ||  pressedKey == "a" ||
pressedKey == "v")) {
// disable key press porcessing
event.returnValue = false;
}
 
} // onKeyDown
 


//---------------------------------------------------------------------------------------------------------------------

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

//var message="";
/////////////////////////////////////
//function clickIE() {if (document.all) {(message);return false;}}
//function clickNS(e) {if
//(document.layers||(document.getElementById&&!document.all)) {
//if (e.which==2||e.which==3) {(message);return false;}}}
//if (document.layers)
//{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
//else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
//
//document.oncontextmenu=new Function("return false")






//------------------------------------------------------------------------------------------------------------------------



function CtrlS_Disable(e)
{
        var key;
        var isCtrl;
        if(window.event)
        {
                key = window.event.keyCode;     //IE
                if(window.event.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }
        else
        {
                key = e.which;     //firefox
                if(e.ctrlKey)
                        isCtrl = true;
                else
                        isCtrl = false;
        }
        if(isCtrl)
        {

                        if(String.fromCharCode(key).toLowerCase() == 's')
                        {
if (e && e.preventDefault) e.preventDefault();
                                return false;
                        }
        }
        return true;
}







//---------------------------------------------------------------------------------------------------------------------






//function noCopyMouse(e) {
//    if (event.button == 2 || event.button == 3) {
//        alert("You are prompted to type this twice for a reason!");
//        return false;
//    }
//    return true;
//}
//
//function noCopyKey(e) {
//    var forbiddenKeys = new Array("c","x","v");
//    var isCtrl;
//
//        if(window.event) {
//        if(window.event.ctrlKey)
//            isCtrl = true;
//        else
//            isCtrl = false;
//        }
//        else {
//                if(e.ctrlKey)
//                    isCtrl = true;
//                else
//                    isCtrl = false;
//        }
//
//  if(isCtrl) {
//        for(i=0; iif(forbiddenKeys[i] == String.fromCharCode(window.event.keyCode).toLowerCase()) {
//                alert('You are prompted to type this twice for a reason!');
//                return false;
//            }
//            }
//    }
//    return true;
//}




