/*********************************************************************
 * JavaScript Document :: Common Functions
 *
 *
 * author: Slavisa Miljanovic <slavisa.miljanovic@softserbia.com>
 * 
 * ******************************************************************* */

// ********************* paging for slogan boxes ********************* //
    var counter = 1;
    function nextSlogan() {
        counter++;
        if (counter > sloganPages) {
            counter = 1;
        }
        showSlogan();
    }
    function previousSlogan() {
        counter--;
        if (counter < 1) {
            counter = sloganPages;
        }
        showSlogan();
    }
    function showSlogan() {
        for (var i=1; i<=sloganPages; i++) {
            id = 'sloganDivPg_'+i;
            if (i == counter) {
                document.getElementById(id).style.display = 'inline';
            } else {
                document.getElementById(id).style.display = 'none';
            }
        }
    }
// *********(end)******* paging for slogan boxes *********(end)******* //

// **************** mouse over on item of slogan box ***************** //
    function changeBg(id) {
        document.getElementById(id).style.background = itemMouseOverBg;
        document.getElementById(id).style.cursor = 'pointer';
        
        imageId = id + '_Img';
        imageOverId = id + '_Img_over';
        document.getElementById(imageId).style.display = 'none';
        document.getElementById(imageOverId).style.display = 'inline';
    }

    function restoreBg(id) {
        document.getElementById(id).style.background = '';
        document.getElementById(id).style.cursor = 'default';

        imageId = id + '_Img';
        imageOverId = id + '_Img_over';
        document.getElementById(imageId).style.display = 'inline';
        document.getElementById(imageOverId).style.display = 'none';
    }
// ******(end)***** mouse over on item of slogan box *******(end)***** //

    function checkBrowser() {
        var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
        var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

        if (ie55 || ie6) {
            return true;
        } else {
            return false;
        }
    }

    win = null;
    function NewWindow (mypage,myname,w,h,scroll) {
        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
        TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
        win = window.open(mypage,myname,settings);
        if (win.window.focus) { 
            win.window.focus();
        }
    }



