﻿


function show(item) {
    var browser = navigator.appName;
    var b_version = navigator.appVersion;
    var version = parseFloat(b_version);
    if (browser == "Microsoft Internet Explorer" && version >= 8) {
        item.style.display = 'inherit';
        //LongDescReadMore.style.display = 'none';
    } else {
        //document.getElementById('MoreDetail1895').style.display = 'inherit';
        //document.all.MoreDetail1895.style.display = 'inherit';
        //document.getElementById('LongDescReadMore').style.display = 'none';
        hza = document.getElementById(item);
        hza.style.display = 'block';
    }
}
function hide(item) {
    var browser = navigator.appName;
    var b_version = navigator.appVersion;
    var version = parseFloat(b_version);
    if (browser == "Microsoft Internet Explorer" && version >= 8) {
        item.style.display = 'none';
        //LongDescReadMore.style.display ='inherit';
    } else {
        //document.getElementById(item).style.display = 'none';
        //document.getElementById('LongDescReadMore').style.display = 'inherit';
        hza = document.getElementById(item);
        hza.style.display = 'none';

    }

}

function GetRandomNumber() {
    return Math.floor(Math.random() * 1000000000000001);
}
function GeneratePassword() {

    if (parseInt(navigator.appVersion) <= 3) {
        alert("Sorry this only works in 4.0+ browsers");
        return true;
    }

    var length = 8;
    var sPassword = "";
    //length = document.aForm.charLen.options[document.aForm.charLen.selectedIndex].value;

    var noPunction = true;
    var randomLength = true;

    if (randomLength) {
        length = Math.random();

        length = parseInt(length * 100);
        length = (length % 7) + 6
    }


    for (i = 0; i < length; i++) {

        numI = getRandomNum();
        if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }

        sPassword = sPassword + String.fromCharCode(numI);
    }

    return sPassword.toUpperCase();

    //return true;
}

function getRandomNum() {

    // between 0 - 1
    var rndNum = Math.random()

    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;

    return rndNum;
}

function checkPunc(num) {

    if ((num >= 33) && (num <= 47)) { return true; }
    if ((num >= 58) && (num <= 64)) { return true; }
    if ((num >= 91) && (num <= 96)) { return true; }
    if ((num >= 123) && (num <= 126)) { return true; }

    return false;
}
