﻿// JScript File

// *************************************
// * Jewel Menu Click functions        *
// * Created by Brite Global, Inc.     *
// *************************************

var clickCount = 0;
function showHideMenu(my)
{
    if (Menu.style.display == "none")
    {
        showMenu(my);
    }
    else
    {
        if (clickCount>1)
            hideMenu(my);
    }
}
function showMenu(my)
{
    Menu.style.top = my.style.top + 86;         
    Menu.style.left = my.style.left + 10;
    Menu.style.display = "block"; 
    my.src='/images/bgframe_topleft_down.png'
    clickCount++;
}

function hideMenu(my)
{
    Menu.style.display = "none"; 
    my.src='/images/bgframe_topleft_normal.png'
    clickCount = 0;
}


// *************************************
// * Rotating Partner Logo functions   *
// * Created by Brite Global, Inc.     *
// *************************************

var currentIndex = 1;
var dynamicIndex = 1;
window.setInterval('rotateLogo()', 5000);

function rotateLogo()
{
    if (currentIndex==2) currentIndex=0;
    currentIndex+=1;
    showLogo(currentIndex);
}

function showLogo(index)
{
    var logoUrl = '/images/imgPartner' + index + '.jpg';
    document.getElementById('imgLogo').src = logoUrl;
}

// *************************************
// * Open Image/Video Window functions *
// * Created by Brite Global, Inc.     *
// *************************************

function displayDemoWindow(my)
{
    var targetUrl = 'http://www.microsoft.com/dynamics/crm/demos/professional/crm.html';
    alert(targetUrl);
    window.open(targetUrl, 'Dynamics CRM Demo', 'width=780,height=600,scrollbars=1');
}

function displayEGIWindow()
{
    var me = window.self;
    var targetUrl = 'http://www.briteglobal.com/crm/egi.htm';
    me.open('http://www.briteglobal.com/crm/egi.htm', '', 'width=700,height=420,scrollbars=1');
}


function displayTechImage(my, imageId)
{
    window.open('/images/tech_large' + imageId + '.jpg', 'Technology', 'width=600,height=500,scrollbars=1');
}

function loadDemo()
{
    var me = window.self;
    me.opener = window.self; 
    me.open('http://www.microsoft.com/dynamics/crm/demos/professional/crm.html', '', 'width=750,height=480,scrollbars=1');
}
