
var bg_nrm = new Array();
bg_nrm[1] = '#616D8E';
bg_nrm[2] = '#ee0000';
//bg_nrm[2] = '#616D8E';

var bg_cur = new Array();
bg_cur[1] = '#394861';
bg_cur[2] = '#cc5566';
//bg_cur[2] = '#394861';

var bg_ovr = new Array();
//bg_ovr[1] = '#4B6482';
bg_ovr[1] = '#455e7c';
//bg_ovr[2] = '#cc0000';
bg_ovr[2] = '#455e7c';


function nav(r,d) {

var root_dots = "";
for (var i=0; i<d; i++) {
  root_dots += "../";
}


document.write("<table align='center' width='100%' border='0' cellspacing='0' cellpadding='0' class='donji_beli_brdr_1px'>");
document.write("<tr>");
document.write("<td width='12' bgcolor='#FF0000' class='rubrika_nav'>&nbsp;</td>");

if ( r==1 ) {
  nav_cur(65,root_dots,'01_company/01_whoarewe/index.htm','COMPANY',1);
} else {
  nav_nrm(65,root_dots,'01_company/01_whoarewe/index.htm','COMPANY',1);
}

if ( r==2 ) {
  nav_cur(70,root_dots,'02_furniture/01_collections/01_kozne.htm','FURNITURE',1);
} else {
  nav_nrm(70,root_dots,'02_furniture/01_collections/01_kozne.htm','FURNITURE',1);
}

/*
if ( r==3 ) {
  nav_cur(40,root_dots,'03_rosa/index.htm','ROSA',1);
} else {
  nav_nrm(40,root_dots,'03_rosa/index.htm','ROSA',1);
}
*/

if ( r==4 ) {
  nav_cur(85,root_dots,'04_simpo_dekor/index.htm','SIMPO DEKOR',1);
} else {
  nav_nrm(85,root_dots,'04_simpo_dekor/index.htm','SIMPO DEKOR',1);
}

if ( r==5 ) {
  nav_cur(59,root_dots,'05_kondiva/index.htm','KONDIVA',1);
} else {
  nav_nrm(59,root_dots,'05_kondiva/index.htm','KONDIVA',1);
}

if ( r==6 ) {
  nav_cur(66,root_dots,'06_kucastil/index.htm','KU&#262;A STIL',1);
} else {
  nav_nrm(66,root_dots,'06_kucastil/index.htm','KU&#262;A STIL',1);
}

if ( r==7 ) {
  nav_cur(116,root_dots,'07_fields/index.htm','FIELDS OF ACTIVITY',1);
} else {
  nav_nrm(116,root_dots,'07_fields/index.htm','FIELDS OF ACTIVITY',1);
}

if ( r==8 ) {
  nav_cur(122,root_dots,'08_small/01_svet/index.htm','SMALL ENTERPRISES',1);
} else {
  nav_nrm(122,root_dots,'08_small/01_svet/index.htm','SMALL ENTERPRISES',1);
}

/*
if ( r==9 ) {
  nav_cur(37,root_dots,'../09_info/index.htm','INFO',1);
} else {
  nav_nrm(37,root_dots,'../09_info/index.htm','INFO',1);
}
*/

if ( r==10 ) {
  nav_cur(77,root_dots,'12_sitemap/index.htm','SITE MAP',1);
} else {
  nav_nrm(77,root_dots,'12_sitemap/index.htm','SITE MAP',1);
}

if ( r==11 ) {
  nav_cur(60,root_dots,'11_contact/index.htm','CONTACT',1);
} else {
  nav_nrm(60,root_dots,'11_contact/index.htm','CONTACT',1);
}

document.write("<td bgcolor='#FF0000' background='"+root_dots+"img/subnav_desno_crveno02.gif'>&nbsp;</td>");
document.write("</tr>");
document.write("</table>");

} // function nav()


function nav_nrm(w,rd,l,n,bgx) {
  document.write("<td width='"+w+"' class='rubrika_nav' bgcolor='"+bg_nrm[bgx]+"' align='center' onMouseOver='ukljuci(this,"+bgx+");' onMouseOut='iskljuci(this,"+bgx+");'><a href='"+rd+l+"' class='rubruika_nav_ahref'>"+n+"</a></td>");
}


function nav_cur(w,rd,l,n,bgx) {
  document.write("<td width='"+w+"' class='rubrika_nav' bgcolor='"+bg_cur[bgx]+"' align='center'><a href='"+rd+l+"' class='rubruika_nav_ahref'>"+n+"</a></td>");
}




function ukljuci(obj,bgx) {
  obj.bgColor=bg_ovr[bgx]; //'#4B6482';
//  obj.bgColor='#394861';
}

function iskljuci(obj,bgx) {
  obj.bgColor=bg_nrm[bgx];  //'#616D8E';
}


function OtvoriProzor(url, sc, wd, ht) {
  var NP = window.open(url, '', 'location=no, status=no, scrollbars='+sc+', width='+wd+', height='+ht+', top='+(screen.height-ht)/2+', left='+(screen.width-wd)/2);
//  var NP = window.open(url,nm,'scrollbars=yes,width='+wd+',height='+screen.height*0.92+',top='+screen.height*0.04+',left='+(screen.width-wd)/2);
  /*
    NP.resizeTo((wd+18),screen.height);
  	NP.moveTo((screen.width-(wd+SB))/2,0);
  alert(scrollbarWidth());
  alert('SB:'+SB);
  if(SB!=0) {
    NP.resizeTo((wd+SB),screen.height);
  	NP.moveTo((screen.width-(wd+SB))/2,0);
  }*//**/
}

function scrollbarWidth() {
    var div = $('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>');
    // Append our div, do our calculation and then remove it
    $('body').append(div);
    var w1 = $('div', div).innerWidth();
    div.css('overflow-y', 'scroll');
    var w2 = $('div', div).innerWidth();
    $(div).remove();
    return (w1 - w2);
}
