﻿//function initWZ() {
//    ADD_DHTML("start", "end", "bottomPH");
//}

function initDimensions() {
    topHeight = topPH.offsetHeight;
    bottomHeight = wz.bottomPH.h;  //bottomPH.offsetHeight;
    minDivHeight = 350;
    //minDivHeight = 300;
    minImgWidth = 750;

    startImg = document.getElementById("startImg");
    endImg = document.getElementById("endImg");
}

function setupLayout() {

    //visina content diva

    //alert(document.body.offsetWidth);
    
    var totalHeight = document.body.offsetHeight;

    var newHeight = totalHeight - topHeight - bottomHeight + 10;

    contentPH.style.height = Math.max(newHeight, minDivHeight) + 'px';

    //velicina pozadinskih slika
    var totalWidth = document.body.offsetWidth;

    startImg.width = endImg.width = Math.max(document.body.offsetWidth, minImgWidth) + 100;
    //startImg.height = endImg.height = contentPH.offsetHeight + 100;

    wz.bottomPH.resizeTo(totalWidth, wz.bottomPH.h)

    //sirina placeholdera za stranicu
    wz.pagePH.resizeTo(totalWidth - wz.pagePH.x, wz.pagePH.h);

    //sirina praznog dijela slidera stranice
    wz.blankDiv.resizeTo(wz.pagePH.w, wz.blankDiv.h);

    $('#pagePH').scrollTo($('#pageDiv'), 0, { axis: 'x' });
    

    //pageDiv width je 700px (css/page.css)
    var pagePosition = (totalWidth - 700)/2;
    if (pagePosition < 250)
        pagePosition = 250;

    document.getElementById("pagePH").style.left = pagePosition + "px";
    
    document.getElementById("logoFrame").style.left = totalWidth - 126 + "px";

}

function loadThumbMenu() {
    $('#thumbMenu').Fisheye(
				{
				    maxWidth: 90,
				    items: 'a',
				    itemsText: 'span',
				    container: '.fisheyeContainter',
				    itemWidth: 90,
				    proximity: 50,
				    alignment: 'left',
				    valign: 'bottom',
				    halign: 'center'
				}
			)
}

function loadTransitions(f) {

    $('#ph').cycle(
                {
                    timeout: 10000,
                    speed: 2000,
                    before: onBefore,
                    after: onAfter
                }
            );

    
};
function stopTransitions() {

    window.clearTimeout(moveTimer);
    moveTimer = null;

    $('#ph').cycle('pause');
};
function resumeTransitions() {

    moveTimer = window.setTimeout('MoveElement(curOff)', 200);
    $('#ph').cycle('resume');
}


function pageSlideIn(fSlider) {
    var $panels = $('#pagePH .scrollContainer > div');
    var $container = $('#pagePH .scrollContainer');

    $panels.css({
        'float': 'left',
        'position': 'relative' // IE fix to ensure overflow is hidden
    });
    $container.css('width', $panels[0].offsetWidth * $panels.length);

    document.getElementById('pageDiv').style.visibility = 'visible';
    $('#pagePH').scrollTo($('#pageDiv'), 600, { axis: 'x' });
}


//Image rotator START
function startLocalSlideshow() {
    $('#pageDiv .slideshow').cycle({
        timeout: 2000,
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
};
function endLocalSlideshow() {
    $('#pageDiv .slideshow').stop();
};

//Image rotator END





