function submitLink(theForm, theProduct, theName, theValue) {

    document.MyForm.downloadfile.value = theValue;
    document.MyForm.submit();

    if (theProduct != '') {
        if (theValue == 'PublicFoldersClientSetupEN.exe') {
            window.location = "/" + theProduct + "/thanks-client/?downloadfile=" + theValue;
        }
        else if (theValue == 'PublicFoldersServerSetupEN.exe') {
            window.location = "/" + theProduct + "/thanks-server/?downloadfile=" + theValue;
        }
        else {
            window.location = "/" + theProduct + "/thanks/?downloadfile=" + theValue;
        }
    }
    else {
    
        if(theValue == 'OutlookExportSetupEN.exe'){
            window.location = '/freeware/outlook-export-thanks/?downloadfile=OutlookExportSetupEN.exe';
        }
        else if (theValue == 'OutlookExportSetupENx64.exe') {
            window.location = '/freeware/outlook-export-thanks/?downloadfile=OutlookExportSetupEN.exe';
        }
        else if (theValue == 'AttachUnblockerSetupx64EN.exe') {
            window.location = '/freeware/attach-unblocker-thanks/?downloadfile=AttachUnblockerSetupEN.exe';
        }
        else if (theValue == 'AttachUnblockerSetupEN.exe') {
            window.location = '/freeware/attach-unblocker-thanks/?downloadfile=AttachUnblockerSetupEN.exe';
        }
        else if (theValue == 'CatManSetupEN.exe') {
            window.location = '/freeware/catman-thanks/?downloadfile=CatManSetupEN.exe';
        }
        else if (theValue == 'CatManSetupx64EN.exe') {
            window.location = '/freeware/catman-thanks/?downloadfile=CatManSetupx64EN.exe';
        }
        else if (theValue == 'PSTGhostbusterEN.exe') {
            window.location = '/freeware/pst-ghostbuster-thanks/?downloadfile=PSTGhostbusterEN.exe';
        }
        else if (theValue == 'FolderSyncAddinSetupEN.exe') {
            window.location = '/freeware/foldersync-addin-thanks/?downloadfile=FolderSyncAddinSetupEN.exe';
        }
        else if (theValue == 'FolderSyncAddinSetupx64EN.exe') {
            window.location = '/freeware/foldersync-addin-thanks/?downloadfile=FolderSyncAddinSetupx64EN.exe';
        }
        else if (theValue == 'C2NetCalendarsSetupEN.exe') {
            window.location = '/freeware/netcalendars-thanks/?downloadfile=C2NetCalendarsSetupEN.exe';
        }
        else if (theValue == 'C2NetCalendarsSetupx64EN.exe') {
            window.location = '/freeware/netcalendars-thanks/?downloadfile=C2NetCalendarsSetupx64EN.exe';
        }
        else if (theValue == 'OutlookAutoConfigEN.exe') {
            window.location = '/freeware/outlook-autoconfig-thanks/?downloadfile=OutlookAutoConfigEN.exe';
        }
        else if (theValue == 'CodeTwoAutoLogonSetupEN.exe') {
            window.location = '/freeware/autologon-thanks/?downloadfile=CodeTwoAutoLogonSetupEN.exe';
        }
        else if (theValue == 'CodeTwoOutlookSyncEN.exe') {
            window.location = '/outlook-sync/thanks/?downloadfile=CodeTwoOutlookSyncEN.exe';
        }
        else {
            var loc = window.location.toString();
            window.location = loc + "?downloadfile=" + theValue;
        }
    }
    window.open("http://www.codetwo.com/downloads/" + theValue);
}

function submitLinkNew(theForm, theProduct, theName, theValue, campId, referrer, sts_param) {

    document.MyForm.downloadfile.value = theValue;
    document.MyForm.submit();

    if (theProduct != '') {
        if (theValue == 'PublicFoldersClientSetupEN.exe') {
            window.location = "/" + theProduct + "/thanks-client/?downloadfile=" + theValue;
        }
        else if (theValue == 'PublicFoldersServerSetupEN.exe') {
            window.location = "/" + theProduct + "/thanks-server/?downloadfile=" + theValue;
        }
        else {
            window.location = "/" + theProduct + "/thanks/?downloadfile=" + theValue;
        }
    }
    else {

        if (theValue == 'OutlookExportSetupEN.exe') {
            window.location = '/freeware/outlook-export-thanks/?downloadfile=OutlookExportSetupEN.exe';
        }
        else if (theValue == 'OutlookExportSetupENx64.exe') {
            window.location = '/freeware/outlook-export-thanks/?downloadfile=OutlookExportSetupENx64.exe';
        }
        else if (theValue == 'AttachUnblockerSetupx64EN.exe') {
            window.location = '/freeware/attach-unblocker-thanks/?downloadfile=AttachUnblockerSetupEN.exe';
        }
        else if (theValue == 'AttachUnblockerSetupEN.exe') {
            window.location = '/freeware/attach-unblocker-thanks/?downloadfile=AttachUnblockerSetupEN.exe';
        }
        else if (theValue == 'CatManSetupEN.exe') {
            window.location = '/freeware/catman-thanks/?downloadfile=CatManSetupEN.exe';
        }
        else if (theValue == 'CatManSetupx64EN.exe') {
            window.location = '/freeware/catman-thanks/?downloadfile=CatManSetupx64EN.exe';
        }
        else if (theValue == 'PSTGhostbusterEN.exe') {
            window.location = '/freeware/pst-ghostbuster-thanks/?downloadfile=PSTGhostbusterEN.exe';
        }
        else if (theValue == 'FolderSyncAddinSetupEN.exe') {
            window.location = '/freeware/foldersync-addin-thanks/?downloadfile=FolderSyncAddinSetupEN.exe';
        }
        else if (theValue == 'FolderSyncAddinSetupx64EN.exe') {
            window.location = '/freeware/foldersync-addin-thanks/?downloadfile=FolderSyncAddinSetupx64EN.exe';
        }
        else if (theValue == 'C2NetCalendarsSetupEN.exe') {
            window.location = '/freeware/netcalendars-thanks/?downloadfile=C2NetCalendarsSetupEN.exe';
        }
        else if (theValue == 'C2NetCalendarsSetupx64EN.exe') {
            window.location = '/freeware/netcalendars-thanks/?downloadfile=C2NetCalendarsSetupx64EN.exe';
        }
        else if (theValue == 'OutlookAutoConfigEN.exe') {
            window.location = '/freeware/outlook-autoconfig-thanks/?downloadfile=OutlookAutoConfigEN.exe';
        }
        else if (theValue == 'CodeTwoAutoLogonSetupEN.exe') {
            window.location = '/freeware/autologon-thanks/?downloadfile=CodeTwoAutoLogonSetupEN.exe';
        }
        else if (theValue == 'CodeTwoOutlookSyncEN.exe') {
            window.location = '/outlook-sync/thanks/?downloadfile=CodeTwoOutlookSyncEN.exe';
        }
        else {
            var loc = window.location.toString();
            window.location = loc + "?downloadfile=" + theValue;
        }
    }
    var link = "http://download.codetwo.com/";
    if (campId != '')
        link = link + campId + "/";
    link = link + theValue + "?w=2&r=" + referrer + sts_param;
    
    window.open(link);
}



function Trademarks() {
    window.open("/regulations/trademarks.php", "", "height=275,width=450,location=0,menubar=0,status=0,toolbar=0,resizeable=0");
}

function Privacy() {
    window.open("/regulations/privacy.php", "", "height=500,width=450,location=0,menubar=0,status=1,toolbar=0,resizeable=1,scrollbars=1");
}
function ProductSelected() {
    // Liczba licencji
    var ctrlLicCount = document.getElementById('product');
    if (ctrlLicCount.value == "" ) {
        alert("Please select the CodeTwo product.   ");
        ctrlLicCount.focus();
        return false;
    }
    return true;
}

function ValidateQuotationFormData(product) {

    // Company name
    var ctrlCompany = document.getElementById('client_name');
    if (ctrlCompany.value == "") {
        alert("Please enter the company name.   ");
        ctrlCompany.focus();
        ctrlCompany.select();
        return false;
    }

    // Kraj
    var ctrlCountry = document.getElementById('client_country_code');
    if ('' == ctrlCountry.options[ctrlCountry.selectedIndex].value) {
        ctrlCountry.focus();
        alert("Please choose your country.  ");
        return false;
    }
    
    var ctrlVAT = document.getElementById('client_nip');
    if (IsEuCountry(ctrlCountry.options[ctrlCountry.selectedIndex].value)) {
        if (trim(ctrlVAT.value) == '') {
            ctrlVAT.focus();
            if (!confirm("Your company is based in the EU, but you have not entered a valid VAT ID. 22% VAT will be added to the order value.\n\nDo you want to continue?")) {
                return false;
            }
        }
        else if (ValidVatID == false) {
            ctrlVAT.focus();
            alert("Please enter a valid VAT ID or leave this field empty!");
            return false;
        }
    }
    // VAT ID
    /*
    var ctrlVatID = document.getElementById('vat_id');
    if (ctrlVatID.value == "") {
        alert("Please enter the Vat ID.   ");
        ctrlVatID.focus();
        ctrlVatID.select();
        return false;
    }
    */
    // Address
    var ctrlAddress = document.getElementById('client_addr');
    if (ctrlAddress.value == "") {
        alert("Please enter the address.   ");
        ctrlAddress.focus();
        ctrlAddress.select();
        return false;
    }
    // Miasto
    var ctrlClientCity = document.getElementById('client_city');
    if (trim(ctrlClientCity.value) == '') {
        ctrlClientCity.select();
        alert("Enter the city of the company.");
        return false;
    }
   
    // Title
    var ctrlTitle = document.getElementById('client_title');
    if ('' == ctrlTitle.options[ctrlTitle.selectedIndex].value) {
        ctrlTitle.focus();
        alert("Enter the title of the person responsible for this quotation.");
        return false;
    }


    // Osoba odpowiedzialna
    var ctrlRespPersonFirstName = document.getElementById('client_first_name');
    if (trim(ctrlRespPersonFirstName.value) == '') {
        ctrlRespPersonFirstName.select();
        alert("Enter the first name of the person responsible for this quotation.");
        return false;
    }

    // Osoba odpowiedzialna
    var ctrlRespPersonLastName = document.getElementById('client_last_name');
    if (trim(ctrlRespPersonLastName.value) == '') {
        ctrlRespPersonLastName.select();
        alert("Enter the last name of the person responsible for this quotation.");
        return false;
    }
    // Email
    var ctrlUserMail = document.getElementById('client_mail');
    if (!IsSmtpAddress(ctrlUserMail.value)) {
        ctrlUserMail.select();
        alert("Enter the correct e-mail address.   ");
        return false;
    }
    // Telefon kontaktowy
    var ctrlUserPhone = document.getElementById('client_phone');
    var userPhone = ctrlUserPhone.value;
    var userPhone = userPhone.replace(/X/gi, "");
    var userPhone = userPhone.replace(/\+/gi, "");
    var userPhone = userPhone.replace(/\s+|\s+/gi, "");
    if (trim(ctrlUserPhone.value) == '' || !isNumeric(userPhone)) {
        ctrlUserPhone.select();
        alert("Enter a correct contact telephone number.   ");
        return false;
    }


    if (document.getElementById('reseller').checked && product != 'Exchange Rules PRO') {
        // Firma
        var ctrlLicenseName = document.getElementById('license_name');
        if (trim(ctrlLicenseName.value) == '') {
            ctrlLicenseName.select();
            alert("Please enter the company name.");
            return false;
        }
        // Firma
        var ctrlLicenseAddr = document.getElementById('license_addr');
        if (trim(ctrlLicenseAddr.value) == '') {
            ctrlLicenseAddr.select();
            alert("Please enter the address.");
            return false;
        }
        // Firma
        var ctrlLicenseCountryCode = document.getElementById('license_country_code');
        if (trim(ctrlLicenseCountryCode.value) == '') {
            //ctrlLicenseCountryCode.select();
            alert("Please choose your country.");
            return false;
        }
    }
    
    if (product == 'Exchange Rules') {
        if (!document.getElementById('sbs').checked) {
            // Mailboxes
            var ctrlMailBoxes = document.getElementById('mail_boxes');
            if (trim(ctrlMailBoxes.value) == '' || !isNumeric(ctrlMailBoxes.value) || trim(ctrlMailBoxes.value) == 0) {
                ctrlMailBoxes.select();
                alert("Enter the total no. of mailboxes.   ");
                return false;
            }
            // Servers
            var ctrlServers = document.getElementById('servers');
            if (trim(ctrlServers.value) == '' || !isNumeric(ctrlServers.value) || trim(ctrlServers.value) == 0) {
                ctrlServers.select();
                alert("Enter the no. of mail processing servers.   ");
                return false;
            }
        }
    }
    if (product == 'Exchange Rules 2007') {
        var sbs = document.getElementById('sbs');
        if (sbs.checked == false) {
            // Mailboxes
            var ctrlMailBoxes = document.getElementById('mail_boxes');
            if (trim(ctrlMailBoxes.value) == '' || !isNumeric(ctrlMailBoxes.value) || trim(ctrlMailBoxes.value) == 0) {
                ctrlMailBoxes.select();
                alert("Enter the total no. of mailboxes.   ");
                return false;
            }
            // Servers
            var ctrlServers = document.getElementById('servers');
            if (trim(ctrlServers.value) == '' || !isNumeric(ctrlServers.value) || trim(ctrlServers.value) == 0) {
                ctrlServers.select();
                alert("Enter the no. of mail processing servers.   ");
                return false;
            }
        }
    }
    if (product == 'Exchange Rules 2010') {
        // Mailboxes
        var ctrlMailBoxes = document.getElementById('mail_boxes');
        if (trim(ctrlMailBoxes.value) == '' || !isNumeric(ctrlMailBoxes.value) || trim(ctrlMailBoxes.value) == 0) {
            ctrlMailBoxes.select();
            alert("Enter the total no. of mailboxes.");
            return false;
        }
        // Servers
        var ctrlServers = document.getElementById('servers');
        if (trim(ctrlServers.value) == '' || !isNumeric(ctrlServers.value) || trim(ctrlServers.value) == 0) {
            ctrlServers.select();
            alert("Enter the no. of mail processing servers.");
            return false;
        }
    }
    if (product == 'Exchange Rules PRO') {
        // Mailboxes
        var ctrlMailBoxes = document.getElementById('mail_boxes');
        if (trim(ctrlMailBoxes.value) == '' || !isNumeric(ctrlMailBoxes.value) || trim(ctrlMailBoxes.value) == 0) {
            ctrlMailBoxes.select();
            alert("Enter the total no. of mailboxes.   ");
            return false;
        }
        // Servers
        var ctrlServers = document.getElementById('servers');
        if (trim(ctrlServers.value) == '' || !isNumeric(ctrlServers.value) || trim(ctrlServers.value) == 0) {
            ctrlServers.select();
            alert("Enter the no. of mail processing servers.   ");
            return false;
        }
    }
    if (product == 'FolderSync') {
        // Servers
        var ctrlServers = document.getElementById('servers');
        if (trim(ctrlServers.value) == '' || !isNumeric(ctrlServers.value) || trim(ctrlServers.value) == 0) {
            ctrlServers.select();
            alert("Enter the no. of mail processing servers.   ");
            return false;
        }
    }
    if (product == 'Public Folders') {
        // Servers
        var ctrlWorkstations = document.getElementById('workstations');
        if (trim(ctrlWorkstations.value) == '' || !isNumeric(ctrlWorkstations.value) || trim(ctrlWorkstations.value) == 0) {
            ctrlWorkstations.select();
            alert("Enter the no. of workstations you want to equip with CodeTwo Public Folder.");
            return false;
        }
    }
    return true; 
}

function ValidateQuotationFormSupport(){
    // Company name
    var ctrlCompany = document.getElementById('client_name');
    if (ctrlCompany.value == "") {
        alert("Please enter the company name.   ");
        ctrlCompany.focus();
        ctrlCompany.select();
        return false;
    }
	
	// Title
    var ctrlTitle = document.getElementById('client_title');
    if ('' == ctrlTitle.options[ctrlTitle.selectedIndex].value) {
        ctrlTitle.focus();
        alert("Enter the title of the person responsible for this quotation.");
        return false;
    }
	
	// Osoba odpowiedzialna
    var ctrlRespPersonFirstName = document.getElementById('client_first_name');
    if (trim(ctrlRespPersonFirstName.value) == '') {
        ctrlRespPersonFirstName.select();
        alert("Enter the first name of the person responsible for this quotation.");
        return false;
    }
	
	// Osoba odpowiedzialna
    var ctrlRespPersonLastName = document.getElementById('client_last_name');
    if (trim(ctrlRespPersonLastName.value) == '') {
        ctrlRespPersonLastName.select();
        alert("Enter the last name of the person responsible for this quotation.");
        return false;
    }
    // Email
    var ctrlUserMail = document.getElementById('client_mail');
    if (!IsSmtpAddress(ctrlUserMail.value)) {
        ctrlUserMail.select();
        alert("Enter the correct e-mail address.   ");
        return false;
    }
    
    // Telefon kontaktowy
        var ctrlUserPhone = document.getElementById('client_phone');
           if (ctrlUserPhone.value == '') {
            ctrlUserPhone.select();
            ctrlUserPhone.focus();
            alert("Enter a contact telephone number. ");
        return false;
    } 
	
	//LicKey
	ctrlLicKey = document.getElementById('lickey');
	var wzor = /^([a-zA-Z0-9\-\s]{5})$/;
	if (!wzor.test(ctrlLicKey.value))
	{
		ctrlLicKey.select();
		alert("Please enter the first 5 digits of the License key or old activation code!");
		return false;
	}
}


function ValidatePaymentFormData() {


    // Osoba odpowiedzialna
    var ctrlRespPersonFirstName = document.getElementById('client_first_name');
    if (trim(ctrlRespPersonFirstName.value) == '') {
        ctrlRespPersonFirstName.select();
        alert("Enter the first name.");
        return false;
    }

    // Osoba odpowiedzialna
    var ctrlRespPersonLastName = document.getElementById('client_last_name');
    if (trim(ctrlRespPersonLastName.value) == '') {
        ctrlRespPersonLastName.select();
        alert("Enter the last name.");
        return false;
    }

    // Company name
    var ctrlCompany = document.getElementById('client_name');
    if (ctrlCompany.value == "") {
        alert("Please enter the company name.   ");
        ctrlCompany.focus();
        ctrlCompany.select();
        return false;
    }
    // Email
    var ctrlUserMail = document.getElementById('client_mail');
    if (!IsSmtpAddress(ctrlUserMail.value)) {
        ctrlUserMail.select();
        alert("Enter the correct e-mail address.   ");
        return false;
    }
    // Kraj
    var ctrlCountry = document.getElementById('client_country_code');
    if ('' == ctrlCountry.options[ctrlCountry.selectedIndex].value) {
        ctrlCountry.focus();
        alert("Please choose your country.  ");
        return false;
    }
 
    // Oreder no
    var ctrlOrderNo = document.getElementById('order_no');
    if (trim(ctrlOrderNo.value) == '') {
        ctrlOrderNo.select();
        alert("Enter a correct order number.   ");
        return false;
    }
    // Amount
    var ctrlAmount = document.getElementById('amount');
    if (trim(ctrlAmount.value) == '' || !isFloat(ctrlAmount.value)) {
        ctrlAmount.select();
        alert("Enter a correct amount.   ");
        return false;
    }

   
    return true;
}


function ValidateResellerData() {
    // Company name
    var ctrlCompany = document.getElementById('company_name');
    if (ctrlCompany.value == "") {
        alert("Please enter the company name.   ");
        ctrlCompany.focus();
        ctrlCompany.select();
        return false;
    }
    // Strona
    var ctrlWebsite = document.getElementById('company_website');
    if (ctrlWebsite.value == "") {
        alert("Please enter the company website.   ");
        ctrlWebsite.focus();
        ctrlWebsite.select();
        return false;
    }
    // Ulica
    var ctrlAddress = document.getElementById('company_street');
    if (ctrlAddress.value == "") {
        alert("Please enter the street.   ");
        ctrlAddress.focus();
        ctrlAddress.select();
        return false;
    }
    // Miasto
    var ctrlClientCity = document.getElementById('company_city');
    if (trim(ctrlClientCity.value) == '') {
        ctrlClientCity.select();
        alert("Enter the city of the company.");
        return false;
    }
    // Kod
    var ctrlCode = document.getElementById('company_code');
    if (ctrlCode.value == "") {
        alert("Please enter the post code.   ");
        ctrlCode.focus();
        ctrlCode.select();
        return false;
    }
    // Kraj
    var ctrlCountry = document.getElementById('company_country');
    if ('' == ctrlCountry.options[ctrlCountry.selectedIndex].value) {
        ctrlCountry.focus();
        alert("Please choose your country.  ");
        return false;
    }

    // Osoba odpowiedzialna
    var ctrlRespPersonFirstName = document.getElementById('reseller_name');
    if (trim(ctrlRespPersonFirstName.value) == '') {
        ctrlRespPersonFirstName.select();
        alert("Enter the first name of reseller.");
        return false;
    }

    // Osoba odpowiedzialna
    var ctrlRespPersonLastName = document.getElementById('reseller_surname');
    if (trim(ctrlRespPersonLastName.value) == '') {
        ctrlRespPersonLastName.select();
        alert("Enter the last name of the reseller.");
        return false;
    }
    // Email
    var ctrlUserMail = document.getElementById('reseller_email');
    if (!IsSmtpAddress(ctrlUserMail.value)) {
        ctrlUserMail.select();
        alert("Enter the correct e-mail address.   ");
        return false;
    }
    // Telefon kontaktowy
    var ctrlUserPhone = document.getElementById('reseller_phone');
    var userPhone = ctrlUserPhone.value;
    var userPhone = userPhone.replace("ext", "");
    var userPhone = userPhone.replace(/X/gi, "");
    var userPhone = userPhone.replace(/-/gi, "");
    var userPhone = userPhone.replace(/\(/gi, "");
    var userPhone = userPhone.replace(/\)/gi, "");
    var userPhone = userPhone.replace(/\+/gi, "");
    var userPhone = userPhone.replace(/\./gi, "");
    var userPhone = userPhone.replace(/\s+|\s+/gi, "");
    if (trim(ctrlUserPhone.value) == '' || !isNumeric(userPhone)) {
        ctrlUserPhone.select();
        alert("Enter a correct contact telephone number.   ");
        return false;
    }

    //akceptacja regulaminu
    if (!document.getElementById('agreement').checked) {
        alert("Please accept Resellers Agreement");
        return false;
    }

    //akceptacja newslettera
    if (!document.getElementById('newsletter').checked) {
        alert("Please agree to receive information for resellers");
        return false;
    }
    
    return true;
}





function SBSSelect() {
    var ctrlSBS = document.getElementById('sbs');
    if (ctrlSBS.checked) {
        document.getElementById('section1').style.display = 'none';
    }
    else {
        document.getElementById('section1').style.display = 'block';
    }
}

function CountrySelected(ctrlCountry) {
    var countryCode = ctrlCountry.options[ctrlCountry.selectedIndex].value;

    // Ustaw nazwe kraju w ukrytym polu formularza
    document.getElementById('client_country_name').value = ctrlCountry.options[ctrlCountry.selectedIndex].innerHTML;

}

var n = 0;
var ie = document.all;
var CurrentQuoteIndex = 0;
var TimeoutID = 0;

function cytat(tablica) {
    var objholder = document.getElementById("cytat");

    CurrentQuoteIndex = n;
    objholder.innerHTML = tablica[n];

    if (n < tablica.length - 1) {
        n = (n + 1);
    }
    else {
        n = 0;
    }
    TimeoutID = setTimeout("cytat(tablica)", 8000);
}

function ChangeQuote(direction, event) {

    event.returnValue = false;
    if (event.preventDefault)
        event.preventDefault();

    if (direction == "prev") {
        if (CurrentQuoteIndex == 0) {
            n = tablica.length - 1
        }
        else {
            n = CurrentQuoteIndex - 1
        }

    }
    else if (direction == "next") {
        if (CurrentQuoteIndex == tablica.length - 1) {
            n = 0
        }
        else {
            n = CurrentQuoteIndex + 1
        }
    }
    clearTimeout(TimeoutID);
    cytat(tablica);


}

function showResellerData() {
    if (document.getElementById('reseller').checked) {
        document.getElementById('resellerdata').style.display = 'block';
    }
    else {
        document.getElementById('resellerdata').style.display = 'none';
    }
}

function disableCtrlKeyCombination(e, forbiddenKeys)
{
    //var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j');    
    
    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)
    {
        for(i=0; i<forbiddenKeys.length; i++)
        {
            if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
            {
                /*alert('Key combination CTRL + '+String.fromCharCode(key)+' has been disabled.');*/
                return false;
            }
        }
    }
    return true;
}

