<!--

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// JS za bookmark: START
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// odpremo popup
function bookmark_show(siteURL)
{
        // nastavimo cookie, da naslednjic ne bo vec videl tega bannerja
        set_cookie('bm', 'doma');

        var agt=navigator.userAgent.toLowerCase();

        // ce je IE5+ potem takoj nastavimo default stran
        if (((agt.indexOf("opera") == -1)) && (typeof(oHomePage) != 'undefined')) {
                oHomePage.style.behavior='url(#default#homepage)';
                oHomePage.setHomePage(siteURL);

                // redirectamo na isto stran, ampak z dodatnim parametrom da vemo da je uporabnik kliknil
                var tmp_loc = document.location.href;

                if (tmp_loc.indexOf('?')==-1) {
                        document.location.href = tmp_loc + '?bm=click';
                } else {
                        document.location.href = tmp_loc + '&bm=click';
                }

                return;
        }

        var url = bookmark_get_pagename();
        var name = 'bookmark_me';
        var props = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=450,height=250';

        var popupWin = window.open( url, name, props );
        popupWin.focus();
}

// Funkcija poslje uporabnika na pravilno stran za njegov brskalnik
function bookmark_get_pagename() {

        var agt=navigator.userAgent.toLowerCase();
        var is_major = parseInt(navigator.appVersion);
        var is_minor = parseFloat(navigator.appVersion);
        var is_aol7  = (agt.indexOf("aol 7") != -1);
        var is_aol8  = (agt.indexOf("aol 8") != -1);
        var is_newerAOL = (is_aol7 || is_aol8);

        var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));

        var is_nav4up = (is_nav && (is_major >= 4));
        var is_nav6up = (is_nav && (is_major >= 5));

        var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

        var is_ie3 = (is_ie && (is_major < 4));
        var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
        var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) && (agt.indexOf("msie 6")==-1));

        var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
        var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

        var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || (agt.indexOf("windows 16-bit")!=-1));

        var is_mac = (agt.indexOf("mac")!=-1);

        var is_konq = (agt.indexOf("konqueror")!=-1);
        var is_opera = (agt.indexOf("opera") != -1);


        if (is_ie) {
                // IE na windowsih
                return "/bin/bookmark.php?b=ie";
        }
        else if (is_nav6up) {
                // netscape 6 ali več
                return "/bin/bookmark.php?b=ns";
        }
        else if (is_nav4up) {
                // netscape 4 (?5?)
                return "/bin/bookmark.php?b=ns";
        }
        else if (is_konq) {
                // konqueror
                return "/bin/bookmark.php?b=konq";
        }
        else if (is_opera) {
                // opera
                return "/bin/bookmark.php?b=opera";
        }
        else {
                // za vse ostale
                return "/bin/bookmark.php?arch=other&b=other";
        }

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// JS koda za bookmark: END
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// funkcija vrne vsebino cookija
function get_cookie(cookie_name) {

    var dc = document.cookie;
    var prefix = cookie_name + "=";
    var begin = dc.indexOf("; " + prefix);

    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else
        begin += 2;

    var end = document.cookie.indexOf(";", begin);

    if (end == -1)
        end = dc.length;

    return unescape(dc.substring(begin + prefix.length, end));

}

// funkcija doda cookie med uporabnikove cookije
function set_cookie(cookie_name, cookie_val) {
    var expdate = new Date();
    expdate.setTime(expdate.getTime()+31536000000);
    document.cookie=cookie_name+"="+escape(cookie_val)+"; expires="+expdate.toGMTString()+"; path=/;";
}

// za resize video iframa
function calcHeight()
{
        var the_height=document.getElementById('video_iframe').contentWindow.document.body.scrollHeight + 0;//find the height of the internal page
        if (navigator.userAgent.toLowerCase().indexOf("msie") > 0) the_height -= 5;

	if (the_height>10)
	        document.getElementById('video_iframe').style.height=the_height + 'px';
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// za print okno
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var Win1 = null;

//funkcija, ki naredi popup
function POPUP (aUrl, aName, aX, aY) {
        if (Win1==null || Win1.closed) {
        Win1=window.open (aUrl, aName, 'toolbar=no,width='+aX+',height='+aY+',directories=no,status=no,scrollbars=yes,resize=yes,menubar=yes,location=no,copyhistory=no');

        }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// premaknil sem iz templatov
// -- od tu
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var PicsArray = new Array();
var PicsSArray = new Array();
var PicsAArray = new Array();
var CurPic = 0;
function GoPic() {
        if (PicsArray.length>1) {
                CurPic = CurPic + 1;
                if (CurPic>=PicsArray.length) CurPic = 0;
                document.prva_slikica.src = PicsArray[CurPic];
                document.prva_slikica.alt = PicsAArray[CurPic];
                //document.getElementById("prva_slika_source").innerHTML = PicsSArray[CurPic];
                setTimeout("GoPic()", 6000);
        }
}

function AddToPool(PA,ImgSrc,PAS,Source,PAA,Alt) {
        if (ImgSrc!="") {
                PA[PA.length] = ImgSrc;
                PAS[PAS.length] = Source;
                PAA[PAA.length] = Alt;
        }
}
// -- do tu
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function frmsub(event,ourform)
{
	if (event && event.keyCode == 13)
		ourform.submit();
	else
		return true;
}


//function prepares string for ajax send
function string_clean_xml(string)
{
	string = string.replace("&", "&amp;");
	string = string.replace("<", "&lt;");
	string = string.replace(">", "&gt;");
	return string;
}


/**
 * Vrne nakljucno stevilko
 */
function mk_uniq() {
        return Math.random();
}

/**
 * Prikaze ali skrije element
 */
function show_or_hide( elt_name )
{
        var elt = document.getElementById( elt_name );
        if ( !elt )
                return;

        if ( elt.style.display == 'none' )
                elt.style.display = '';
        else
                elt.style.display = 'none';
}

/**
 * Vrne HTML za text box
 */
function create_inputbox( t_name, t_type, t_value, t_id, t_class, t_style )
{
        if ( !t_type )
                t_type = 'text';

        if ( !t_id )
                t_id = t_name;

        html = '<input type="' + t_type + '" name="' + t_name + '" id="' + t_id + '" value="' + t_value + '" ';

        if ( t_class )
                html += ' class="' + t_class + '" ';

        if ( t_style )
                html += ' class="' + t_style + '" ';

        html += " />";

        return html;
}

//-->


