﻿//Hide Show functions
function showTextArea(id, classname) {
    $('.' + classname).hide();
    $('#' + id).show();
}
function ShowText(id, classname) {
    if ($('#' + id).is(":hidden")) {
        $('.' + classname).slideUp();
        $('#' + id).slideDown();
    }
    else {
        $('#' + id).slideUp();
    }
}
function ServiceLinkText(anchor, div) {
    anchorclass = $('#' + anchor).attr('class').split(' ').slice(-1);
    divclass = $('#' + div).attr('class').split(' ').slice(-1);
    $('.' + divclass).hide();
    $('#' + div).show();
    $('.' + anchorclass).removeClass("selected");
    $('#' + anchor).addClass("selected");
}
/*mouse over and out events*/
function MouseOverShowText(id, classname) {
    $('#Shown').hide();
    $('#' + id).show();
}
function MouseOuthideText(id, classname) {
    $('.' + classname).hide();
    $('#Shown').show();
}

//LOGIN PAGE
function RestrictedLinkMessage(src) {
    $(document.getElementById(src)).after('<span class="PopUp"><div><p>To view this item you must <a href="javascript:void(0);" title="login" onclick="$(\'#LoginDiv\').slideDown();$(\'.PopUp\').hide();">log in</a></p><p><a href="javascript:void(0);" onclick="$(\'.PopUp\').hide();">Close</a></p></div></span>');
}

//TESTIMONIALS PAGE
hexinput1 = 0;
hexinput2 = 153;
hexinput3 = 255;
var inc = -1
function fadingtext() {
    if (!Stopped) {
        hexinput1 += 5;
        hexinput2 += 5;
        hexinput3 += 5;
        if (hexinput1 > 255)
            hexinput1 = 255;
        if (hexinput2 > 255)
            hexinput2 = 255;
        if (hexinput3 > 255)
            hexinput3 = 255;

        if (hexinput1 + hexinput2 + hexinput3 == 0) {
            Stopped = true;
        }
        Testimonials.style.color = "rgb(" + hexinput1 + "," + hexinput2 + "," + hexinput3 + ")"; // Set color value.
    }
    setTimeout("fadingtext()", 60);
}
var Stopped;
function ResetTextColour() {
    hexinput1 = 0;
    hexinput2 = 153;
    hexinput3 = 255;
    Testimonials.style.color = "rgb(" + hexinput1 + "," + hexinput2 + "," + hexinput3 + ")"; // Set color value.
}
function changetext() {
    if (TestimonailsText[Count] == null) {
        Count = 0;
    }
    if (Testimonials == null) {
        Testimonials = document.getElementById("Testimonials");
    }
    if (TestimonailsText.length == 0) {
        return;
    }
    ResetTextColour();
    Testimonials.innerHTML = TestimonailsText[Count];
    Stopped = false;
    Count++;
    setTimeout("changetext()", 9000);
}
function StartText() {
    Stopped = false;
    changetext();
    fadingtext();
}
var Count = 0;
var Testimonials;
var TestimonailsText = ["&quot;We would not hesitate to recommend Linac to any organisation seeking to introduce an Intranet based system and will look forward to working with the team again.&quot;<br/><br/><b>Piers Watson, Senior Training Officer, London Borough of Newham</b>", "&quot;I would strongly recommend Linac to any company looking for a learning management solution&quot;<br/><br/><b>Brendan Farell, Technical Training Manager, Diageo</b>", "&quot;Linac come highly recommended for anyone looking for a Training Management System. We are already working with Linac's team to extend the scope of the original system.&quot;<br/><br/><b>Bill Kelly, Training and Development Director, Speedy Hire</b>", "&quot;Linac are a company that work with you - they share their expertise and listen to the customers needs and requirements - what we end up with is an excellent piece of software that meets our current and Future needs.&quot;<br/><br/><b>Andi Smith, Principal Manager CPD, London Borough of Newham</b>"];
