﻿

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}


function checkVersion() {
    var msg = "You're not using Internet Explorer.";
    var ver = getInternetExplorerVersion();

/*    txt = "Browser CodeName: " + navigator.appCodeName + "\n";
    txt += "Browser Name: " + navigator.appName + "\n";
    txt += "Browser Version: " + navigator.appVersion + "\n";
    txt += "Cookies Enabled: " + navigator.cookieEnabled + "\n";
    txt += "Platform: " + navigator.platform + "\n";
    txt += "User-agent header: " + navigator.userAgent + "\n";

    alert(txt);
    'Windows 3.11' => 'Win16', 
    'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', 
    'Windows 98' => '(Windows 98)|(Win98)', 
    'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)', 
    'Windows XP' => '(Windows NT 5.1)|(Windows XP)', 
    'Windows Server 2003' => '(Windows NT 5.2)', 
    'Windows Vista' => '(Windows NT 6.0)', 
    'Windows 7' => '(Windows NT 6.1)', 
    'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)', 
    'Windows ME' => 'Windows ME', 
    'Open BSD' => 'OpenBSD', 
    'Sun OS' => 'SunOS', 
    'Linux' => '(Linux)|(X11)', 
    'Mac OS' => '(Mac_PowerPC)|(Macintosh)', 
    'QNX' => 'QNX', 
    'BeOS' => 'BeOS', 
    'OS/2' => 'OS/2', 
    'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)' 

*/
    
    
    var plat = navigator.platform;
    var doCode = false;
    if (ver >= 9.0 || ver < 0) {
        if (plat == "Win32" || plat == "Win64" || plat == "WOW64") {
            doCode = true;
        }
        else {
            if (navigator.appVersion.indexOf("Chrome") > 0) {
                doCode = true;
            }
        }
    }

    var url = window.location.toString();
    if (url.toUpperCase().indexOf("DEFAULT") >= 0)
        doCode = false;


    if (doCode == true) {
        // **************
        setTimeout("updateSlider(false)", 1);
        setTimeout("updatescr(false)", 2500);
        //setTimeout("updatescr1()", 2000);
        //setTimeout("updatescr2()", 1500);
        setTimeout("updatescr3(false)", 3500);
    }
    else {
        setTimeout("updateSlider(true)", 1);
        setTimeout("updatescr(true)", 1);
        //setTimeout("updatescr1()", 2000);
        //setTimeout("updatescr2()", 1500);
        setTimeout("updatescr3(true)", 1);
    }
    
    
}


function drawStr(ss, i, frameClassName, frameId, frameCaption, nextUpdateFunction, rand,strName ) {
    if (i < ss.length) {
        var x = 1;
        if (rand == true)
            x = Math.floor(Math.random() * 11);
        if (i + x > ss.length)
            x = ss.length - i;


        if (ss.substr(i, x).indexOf("@") >= 0) {
            $('#' + frameId)[0].innerHTML += "<br //>";
        }
        else {
            if (ss.substr(i, x).indexOf("~") >= 0) {
                $('#' + frameId)[0].innerHTML += "&nbsp;";
            }
            else
                $('#' + frameId)[0].innerHTML += ss.substr(i, x);
        }

        i += x;

        
        var dly = 160;
        if (x == 1)
            dly = 5;

        setTimeout("drawStr(" + strName + "," + i.toString() + ", '" + frameClassName + "', '" + frameId +"', '" + frameCaption + "', '" + nextUpdateFunction + "', " + (rand == true ? "true" : "false") + ",'" + strName + "')", dly);
    }
    else {
        var ms = 200;
        ms += new Date().getTime();
        while (new Date() < ms) { }
        if (frameClassName != "")
            $('#' + frameId).attr("className", frameClassName); 
        if (frameCaption != "")
            setTimeout(function() {$('#' + frameId)[0].innerHTML = frameCaption }, 350);
        if (nextUpdateFunction != "")
            setTimeout(nextUpdateFunction, 10);
    }
}
var s;
var s1;
var s2;
var s3;
var s4;

function updatescr(skipCode) {
    var c = '<br/><div class="innerFrame1"><hr/>We use our extensive Industry experience combined with today&#39s leading edge technology to provide you with the tools and Systems that allow you to run your business competitively and successfully. </div>'

    //s = "hello james how the hell are ya!"
    //s = "??? frame 1 - maybe be purple and contain some nice text about Business Management and perhaps a picture, keep on the left hand side just under the pretty slider.";
    if (skipCode == false) {
        s1 = '<tr valign="top" style="height:150px;" > ' + '@' +
               '~~~~~<td style="width:380px;">' + '@' +
                   '~~~~~~~~~~<div id="F1" class="lframe1a">' + '@' +
                   '~~~~~~~~~~~~~~~Business Management' + '@' +
                   '~~~~~~~~~~</div>' + '@' +
               '~~~~~' + '</td>' + '@';
    }
    else
       s1 = '';
    
    setTimeout("drawStr(s1, 0, 'lframe1a','F1','Business Management" + c + "', 'updatescr1(" + (skipCode == true ? "true" : "false") + ")', false, 's1')", 0)

}


function updatescr1(skipCode) {

    // s = "??? frame 2 - I guess this one should be blue and contain something about Manufacturing and Industrial Automation, right side.";
    var c1 = '<br/><div class="innerFrame2"><hr/>From creating Works Orders and Production Schedules to Machine Programming and Integeration, <br />we have the skills to help you optimise <br/>your manufacturing.</div>'
    if (skipCode == false) {
        s2 = '' +
            '~~~~~<td>' + '@' +
                '~~~~~~~~~~<div id="F2" class="lframe2a">' + '@' +
                '~~~~~~~~~~~~~~~Manufacturing and Industrial Automation' + '@' +
                '~~~~~~~~~~</div>' + '@' +
            '~~~~~</td>' + '@' +
        '</tr>' + '@';
    }
    else
        s2 = '';
    setTimeout("drawStr(s2, 0, 'lframe2a','F2','Manufacturing and Industrial Automation" + c1 + "', 'updatescr2(" + (skipCode == true ? "true" : "false") + ")', false, 's2')", 0)

}

function updatescr2(skipCode) {
    
    var c1 = '<br/><div class="innerFrame3"><hr/>We can help you streamline your business functions by identifying processes which are unnecessary or wasteful and by identifying processes or tasks which can be automated. <br/><br/>We can also help you select the right <br/>Software for your business and over see <br/>it&#39s implementation.</div>'
    if (skipCode == false) {
        //s = "??? frame 3 - Consultancy, loads of experience here!";
        s3 = '<tr valign="top" style="height:200px;">' + '@' +
            '~~~~~<td>' + '@' +
                '~~~~~~~~~~<div id="F3" class="lframe3a">' + '@' +
                '~~~~~~~~~~~~~~~Consultancy' + '@' +
                '~~~~~~~~~~</div>' + '@' +
            '~~~~~</td>' + '@';
    }
    else
        s3 = '';
    
    setTimeout("drawStr(s3, 0, 'lframe3a','F3','Consultancy" + c1 + "', '', false, 's3')", 0)

}
function updatescr3(skipCode) {
    var c1 = '<br/><div class="innerFrame4"><hr/>System integration is the important process of linking different Systems into one. <br/><br/>EPoS, Sales, Purchasing, Stock, Mobile Sales, <br/>Payroll & HR, Time & Attendance, Asset <br/>Tracking, Financial, Production, Quality, etc.<br/><br/>It&#39s only when all your data is in one System, <br/>will you see the full picture and benefits.</div>'
    //s = "??? frame 4 - Aqua blue - a few words about System Integration often forgotten - should never be underestimated!";
    if (skipCode == false) {
        s4 = '~~~~~<td>' + '@' +
            '~~~~~~~~~~<div id="F4" class="lframe4a">' + '@' +
            '~~~~~~~~~~~~~~~System Integration' + '@' +
            '~~~~~~~~~~</div>' + '@' +
        '~~~~~</td>' + '@' +
    '</tr>' + '@';
    }
    else
        s4 = '';

    setTimeout("drawStr(s4, 0, 'lframe4a','F4','System Integration" + c1 + "', '', false, 's4')", 0)

}
function updateFrames() {
    $('#F1' ).attr("className", "lframe1a");
    $('#F1')[0].innerHTML = "Business Management";
    setTimeout(function () {
        $('#F2')[0].innerHTML = "Manufacturing and Industrial Automation";
        $('#F2').attr("className", "lframe2a");
    }, 0);
    setTimeout(function () {
        $('#F3').attr("className", "lframe3a");
        $('#F3')[0].innerHTML = "Consultancy";
    }, 0);
    setTimeout(function () {
    $('#F4').attr("className", "lframe4a");
    $('#F4')[0].innerHTML = "System Integration";
    }, 0);
}


function updateSlider(skipCode) {
    if (skipCode == false)
        s = 'We Build Solutions.....';
    else
        s = "";

    setTimeout("drawStr(s, 0, '','sl2','', 'updateSlider1a(" + (skipCode == true ? "true" : "false") + ")', false, 's')", 0)
}
function updateSlider1a(skipCode) {
    var ms = 2000;
    if (skipCode == true) 
        ms = 0;

    ms += new Date().getTime();
    while (new Date() < ms) { }
    updateSlider1(skipCode);
}


function updateSlider1(skipCode) {

    $("#sl1")[0].innerHTML = "";
    if (skipCode == false) {
        s = '' +
            '<ul id="slider1" style="height:300px; width:740px; " >@' +
                '~<li class="panel1">@' +
                    '~~<div>@' +
                        '~~~<div class="textSlide">@' +
                        '~~~</div>@' +
                    '~~</div>@' +
                '~</li>@' +
            '</ul>@';
    }
    else
        s = "";
    $("#sl1").css("classname", "");
    setTimeout("drawStr(s, 0, '','sl1','', 'updateSlider2()', false, 's')", 0)
}


function updateSlider2() {



    $('#sl1')[0].innerHTML = '<ul id="slider1" style="height:350px; width:800px; " >' +
                        '<li class="panel1" style="cursor:pointer" onclick="window.location.href=&#39BusinessManagement.aspx&#39">' + 
                            '<div>' + 
                                '<div class="textSlide">' + 
                                    '<table><tbody>' +
                                    '<tr valign="top">' +
                                     '<td width="350px" colspan="2" >' +
                                            '<div class="SliderHeaderText" style="padding-top:10px; padding-left:20px;">Business Management</div>' +
                                            '<ul >' +
                                                    '<li class="liGreen" >Sales and Debtors</li>' +
                                                    '<li class="liGreen" >Purchasing and Creditors</li>' +
                                                    '<li class="liGreen" >Stock Control</li>' +
                                                    '<li class="liGreen">Finance</li>' +
                                                    '<li class="liGreen">Optimised Functionality</li>' +
                                            '</ul>' +
                                        '</td>' + 
                                        '<td >' + 
                                            '<img alt="Entity Software - Advanced Technology, Real Solutions" src="Images/BusinessManagement1.png" />' + 
                                        '</td>' + 
                                    '</tr>' + 
                                    '</tbody></table>' + 
                                '</div>' + 
                            '</div>' + 
                        '</li>' +
                        '<li class="panel2" style="cursor:pointer" onclick="window.location.href=&#39Manufacturing.aspx&#39">' + 
                            '<div>' + 
                                '<div class="textSlide">' + 
                                  '<table><tbody>' +
                                     '<tr valign="top">' +
                                        '<td width="350px" >' +
                                            '<div class="SliderHeaderText">Manufacturing and <br />Industrial Automation</div>' + 
                                            '<ul >' +
                                                    '<li class="liRed">Production/Works Orders</li>' +
                                                    '<li class="liRed">Production Scheduling and Management</li>' +
                                                    '<li class="liRed">Human Machine Interface (HMI) Development</li>' +
                                                    '<li class="liRed">PLC Programming</li>' +
                                                    '<li class="liRed">Back Office Integration</li>' + 
                                            '</ul>' + 
                                        '</td> ' + 
                                        '<td>' + 
                                            '<img alt="Entity Software - Advanced Technology, Real Solutions" src="Images/production.png" />' + 
                                        '</td>' + 
                                    '</tr>' + 
                                    '</tbody></table>' + 
                                '</div>' + 
                            '</div>' + 
                        '</li>' +
                        '<li class="panel3" style="cursor:pointer" onclick="window.location.href=&#39Consultancy.aspx&#39">' + 
                            '<div>' + 
                                '<div class="textSlide">' + 
                                   '<table><tbody>' +
                                    '<tr valign="top">' +
                                        '<td width="350px">' +
                                            '<div class="SliderHeaderText">Consultancy</div>' +
                                            '<ul >' +
                                                '<li class="liOrange" >Business Process Optimisation and Automation</li>' +
                                                '<li class="liOrange" >Software Selection and Implementation</li>' +
                                                '<li class="liOrange" s>Server, Desktop and Network Infrastructure</li>' +
                                            '</ul>' +
                                        '</td> ' + 
                                        '<td>' +
                                            '<img alt="Entity Software - Advanced Technology, Real Solutions" src="Images/Consultancy1.png" />' +
                                        '</td>' + 
                                           
                                    '</tr>' + 
                                    '</tbody></table>' + 
                                '</div>' + 
                            '</div>' + 
                        '</li>' +
                        '<li class="panel4" style="cursor:pointer" onclick="window.location.href=&#39Integration.aspx&#39">' + 
                            '<div>' + 
                                '<div class="textSlide">' + 
                                 '<table><tbody>' + 
                                    '<tr valign="top">' +
                                        '<td width="350px">' +
                                            '<div class="SliderHeaderText">System Integration</div>' + 
                                            '<ul >' +
                                                '<li class="liBlue" >Sales and Services</li>' +
                                                '<li class="liBlue" >Purchasing and Stock</li>' +
                                                '<li class="liBlue" >Payroll and HR</li>' +
                                                '<li class="liBlue" >Production and Quality</li>' +
                                                '<li class="liBlue" >All your data in one System</li>' + 
                                            '</ul>' + 
                                        '</td> ' + 
                                        '<td>' + 
                                            '<img alt="Entity Software - Advanced Technology, Real Solutions" src="Images/SystemIntegration.png" />' + 
                                        '</td>' + 
                                    '</tr>' + 
                                    '</tbody></table>' + 
                                '</div>' + 
                            '</div>' + 
                        '</li>' + 
                        '</ul>'; // +   <!-- END AnythingSlider #1 -->



    $(function () {

        $('#slider1').anythingSlider({
            theme: 'default',
            easing: 'linear',
            resizeContents: true,
            buildArrows: false,
            buildNavigation: true,
            buildStartStop: true,
            expand: false,
            vertical: false,
            showMultiple: 1,
            changeBy: 1,
            autoPlay: true,
            pauseOnHover: false,
            autoPlayLocked: false,  // If true, user changing slides will not stop the slideshow
            delay: 4000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
            resumeDelay: 600,     // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
            animationTime: 1000,       // How long the slideshow transition takes (in milliseconds)
            delayBeforeAnimate: 0,
            navigationFormatter: function (index, panel) { // Format navigation labels with text
                return ['Business Management', 'Manufacturing and Industrial Automation', 'Consultancy', 'System Integration'][index - 1];
            },

            onSlideComplete: function (slider) {
                // alert('Welcome to Slide #' + slider.currentPage);
            }
        });

    });


    
    
}

