﻿$(document).ready(function() {

    /*spletne predstv**/
    $('.SpletnePredstavitve').slide({
        btnleft: '#prevSpletne',
        btnright: '#nextSpletne',
        direction: 0,
        delay: '0.4',
        displayheight: '180px',
        displaywidth: '780px',
        innercontainer: '.SpletnePredstavitve > div',
        innerwidth: ($('.SpletnePredstavitve .SplPredBox').size() / 2 * 780) + 'px',
        startpage: '1',
        stepwidth: '780px',
        totalPage: 0,
        newspage: 0
    }); 

    /*spletne predstv**/
    $('.PoslovneResitve').slide({
        btnleft: '#prevPoslovne',
        btnright: '#nextPoslovne',
        direction: 0,
        delay: '0.4',
        displayheight: '180px',
        displaywidth: '780px',
        innercontainer: '.PoslovneResitve > div',
        innerwidth: ($('.PoslovneResitve .SplPredBox').size() / 2 * 780) + 'px',
        startpage: '1',
        stepwidth: '780px',
        totalPage: 0,
        newspage: 0
    });

    $(".SplPredBox:odd").css("margin-left", "60px");

    /*ref slider**/
    $('#reference').slide({
        btnleft: '#refBack',
        btnright: '#refNext',
        direction: 0,
        delay: '0.4',
        displayheight: '215px',
        displaywidth: '780px',
        innercontainer: '#reference > div',
        innerwidth: ($('.RefSlika').size() / 3 * 780) + 'px',
        startpage: '1',
        stepwidth: '780px',
        totalPage: 0,
        newspage: 0
    });

   


    /*news slider**/
    $('#article1').slide({
        btnleft: '.prev',
        btnright: '.next',
        direction: 0,
        delay: '0.4',
        displayheight: '160px',
        displaywidth: '410px',
        innercontainer: '#article1 > div',
        innerwidth: ($('#news > .novicaIzpis').size() * 410) + 'px',
        startpage: '1',
        stepwidth: '410px',
        totalPage: 0,
        newspage: 0
    });

    /*podpora  slider Horizontal**/
    $('.podporaLeft').slide({
        btnleft: '.prev3',
        btnright: '.next3',
        direction: 0,
        delay: '0.4',
        displayheight: '160px',
        displaywidth: '410px',
        innercontainer: '.podporaLeft > div',
        innerwidth: ($('.podporaLeft .novicaIzpis').size() * 410) + 'px',
        startpage: '1',
        stepwidth: '410px',
        totalPage: 0,
        newspage: 0
    });

    /*podpora  slider Vertical**/
    $('.podporaRight').slide({
        btnleft: '.up3',
        btnright: '.down3',
        direction: 1,
        delay: '0.4',
        displayheight: '160px',
        displaywidth: '250px',
        innercontainer: '.podporaRight > div',
        innerwidth: ($('.podporaRight > div').size() * 160) + 'px',
        startpage: '1',
        stepwidth: '160px',
        totalPage: 0,
        newspage: 0
    });


    /*podpora  slider Vertical**/
    $('.mainRight').slide({
        btnleft: '.up',
        btnright: '.down',
        direction: 1,
        delay: '0.4',
        displayheight: '160px',
        displaywidth: '250px',
        innercontainer: '.mainRight > div',
        innerwidth: ($('.mainRight > div').size() * 160) + 'px',
        startpage: '1',
        stepwidth: '160px',
        totalPage: 0,
        newspage: 0
    });
    /**/

    var opt = { modal: false,
        filter: ['iframeForm'], loadFilter: 'iframeForm'
    };

    $(".vec > a,.vec2 > a,.vec3 > a,.vec4 > a,.vec5 > a, #linkLj, #linkCe, #linkSm").each(function() {
        $(this).attr("href", "javascript:OpenWindow('" + $(this).attr("href") + "');");

    });

    $(".RefSlika").css({ opacity: 0.5 });
    $('.RefSlika').each(function() {

        $(this).hover(function() {
            $(this).stop().animate({ opacity: 1.0 }, 500);
        },
                   function() {
                       $(this).stop().animate({ opacity: 0.5 }, 500);
                   });
    });


    $("#linkLj").hover(
              function() {
                  $("#imgKura").attr("src", "/Files/img/450.png");
              },
              function() {
                  $("#imgKura").attr("src", "/Files/img/444.png");
              }
              );
    $("#linkCe").hover(
              function() {
                  $("#imgKura").attr("src", "/Files/img/451.png");
              },
              function() {
                  $("#imgKura").attr("src", "/Files/img/444.png");
              }
              );
    $("#linkSm").hover(
              function() {
                  $("#imgKura").attr("src", "/Files/img/452.png");
              },
              function() {
                  $("#imgKura").attr("src", "/Files/img/444.png");
              }
            );



});

function OpenWindow(href) {
    var oWindow = window.radopen(href, null);

   // $('.RadWindow').borderImage('url("/html/default/library/images/okvir.png") 8% 6% 9% 6%');
    $(".RadWindow").css({ border: "3px solid #fff" });
    $(".TelerikModalOverlay").css({ opacity: 0.8 });
    $(".TelerikModalOverlay").css({ background: "#000" });

}

//===========================================================================
// Provides a Dictionary object for client-side java scripts
//===========================================================================

function Lookup(key) {
    return (this[key]);
}


function Delete() {
    for (c = 0; c < Delete.arguments.length; c++) {
        this[Delete.arguments[c]] = null;
    }
    // Adjust the keys (not terribly efficient)
    var keys = new Array()
    for (var i = 0; i < this.Keys.length; i++) {
        if (this[this.Keys[i]] != null)
            keys[keys.length] = this.Keys[i];
    }
    this.Keys = keys;
}

function Add() {
    for (c = 0; c < Add.arguments.length; c += 2) {
        // Add the property
        this[Add.arguments[c]] = Add.arguments[c + 1];
        // And add it to the keys array
        this.Keys[this.Keys.length] = Add.arguments[c];
    }
}

function Dictionary() {
    this.Add = Add;
    this.Lookup = Lookup;
    this.Delete = Delete;
    this.Keys = new Array();
}


