// JavaScript Document

var isNN = (navigator.appName.indexOf("Netscape") != -1);
var isIE = (navigator.appName.indexOf("Microsoft") != -1);
var IEVersion = (isIE ? getIEVersion() : 0);
var NNVersion = (isNN ? getNNVersion() : 0);

function getNNVersion()
{
  var userAgent = window.navigator.userAgent;
  var isMajor = parseInt(window.navigator.appVersion);
  var isMinor = parseFloat(window.navigator.appVersion);
  if (isMajor == 2) return 2;
  if (isMajor == 3) return 3;
  if (isMajor == 4) return 4;
  if (isMajor == 5)
  {
    if (userAgent.toLowerCase().indexOf('netscape')!=-1)
    {
      isMajor = parseInt(userAgent.substr(userAgent.toLowerCase().indexOf('netscape')+9));
      if (isMajor>0) return isMajor;
    }
    if (userAgent.toLowerCase().indexOf('firefox')!=-1) return 7;
    return 6;
  }
  return isMajor;
}
 
function getIEVersion()
{
  var userAgent = window.navigator.userAgent;
  var MSIEPos = userAgent.indexOf("MSIE");
  return (MSIEPos > 0 ? parseInt(userAgent.substring(MSIEPos+5, userAgent.indexOf(".", MSIEPos))) : 0);
}

//No Copy
am = "Copyright 2009. Affordable Closets Plus, LLC. All Rights Reserved.";
 
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"
 
function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}
 
function disableCtrlKeyCombination(e){
    //list all CTRL + key combinations you want to disable
    var forbiddenKeys = new Array('a', 'c', 'x');
    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(am);
                return false;
            }
        }
    }
    return true;
}
 
if(isIE){
 document.onkeyup = disableCtrlKeyCombination;
}else{
 document.onkeypress = disableCtrlKeyCombination;
}
document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc
document.oncontextmenu=new Function("return false");
//End No Copy/Paste
