/************************************************
*						*
* splosnovizija					*
*						*
************************************************/
var isNN, isIE, isMac, isMoz;
var agent = navigator.userAgent;
var js_glo_jezik = "si";


isMac = (agent.lastIndexOf('Mac') < 0);

if (document.all){
  isIE = true;
} else if (document.layers){
  isNN = true;
  document.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP | Event.RESIZE);
  window.onresize=um_resize;
} else if (navigator.userAgent.indexOf('Gecko') != -1) {
  isMoz = true;
}

// netscapove neumnosti...
if (isNN){
   var ws = window.innerWidth;
   var hs = window.innerHeight;
}

function um_resize(){
  if (isNN) {
    if ((window.innerWidth != ws) || (window.innerHeight != hs)){
      window.location.href = window.location.href;
    }
  }
}

// čisto nič
function donull () {}

function um_okno(url, w, h, opt, wname) {
var win = null;
var i = 0;

  w = w || 450;
  h = h || 640;
  opt = opt || "width=" + w + ",height=" + h + ",toolbar=0,resize=0";
  wname = wname || "amWin";

  win = window.open(url, wname, opt);

  if (!win.opener) {
    win.opener = self;
  }

  if (window.focus) {
    win.focus()
  }

}


function um_preloadimages()
{
	var d = document;
	if(d.images)
	{
		if(!d.um_pics) d.um_pics=new Array();
		var i, j = d.um_pics.length, a = um_preloadimages.arguments;
		for(i=0; i<a.length; i++)
		{
			d.um_pics[j] = new Image;
			d.um_pics[j++].src = a[i];
		}
	}
}

function um_changeGif(anc)
{
	if ( anc.getElementsByTagName )
	{
		var i = anc.getElementsByTagName("IMG").item(0);
		if ( i.src.indexOf('_a.gif') > 0 )
		{
			i.src = i.src.replace(/_a\.gif/i, '.gif');
		}
		else
		{
			i.src = i.src.replace(/\.gif/i, "_a.gif");
		}
	}
}
function um_changeJpg(anc)
{
	if ( anc.getElementsByTagName )
	{
		var i = anc.getElementsByTagName("IMG").item(0);
		if ( i.src.indexOf('_a.jpg') > 0 )
		{
			i.src = i.src.replace(/_a\.jpg/i, '.jpg');
		}
		else
		{
			i.src = i.src.replace(/\.jpg/i, "_a.jpg");
		}
	}
}

function um_changeimg(i)
{
	if ( i.src.indexOf('_a.gif') > 0 )
		{
			i.src = i.src.replace(/_a\.gif/i, '.gif');
		}
	else
		{
			i.src = i.src.replace(/\.gif/i, "_a.gif");
		}
}

function um_changeanc(anc)
{

	if ( anc.getElementsByTagName )
	{
		var i = anc.getElementsByTagName("IMG").item(0);
		if ( i ) um_changeimg(i);
	}
}

function um_print(w)
{
	if (w.print) {
		w.print();
	} else {
		alert('Za tiskanje te strani izberite ustrezen ukaz v meniju ali gumb v orodjarni brskalnika!');
	}
	return true;
}


// stvaritev layerja - crossbrowser
function ustvari(ime,w,h,x,y,z,vidno,vsebina,dodatnoNN,dodatnoIE) {
  if (isNN) {
    vidno ? vidno = 'show' : vidno = 'hide';
    document.write('<layer width='+w+' height='+h+' left='+x+' top='+y+' name="'+ime+'" z-index='+z+' visibility="'+vidno+'" '+dodatnoNN+'>'+vsebina+'</layer>');
  } else if (isIE || isMoz) {
    vidno ? vidno = 'visible' : vidno = 'hidden';
    document.write('<div id="'+ime+'" style="position:absolute;width:'+w+';height:'+h+';left:'+x+';top:'+y+';z-index:'+z+';visibility:'+vidno+';'+dodatnoIE+'" >'+vsebina+'</div>');
  }
}

// premikanje layerja - crossbrowser
function premakni(id,x,y){
  if (isNN){
    if (x != null) document.layers[id].left = x;
    if (y != null) document.layers[id].top = y;
  } else if(isIE){
    if (x != null) document.all[id].style.posLeft = x;
    if (y != null) document.all[id].style.posTop = y;
  } else if (isMoz) {
    if (x != null) document.getElementById(id).style.left = x;
    if (y != null) document.getElementById(id).style.top = y;
  }
}


// vidnost layerja - crossbrowser
function vidnost(id, vidno) {
  if (isNN) {
    vidno ? vidno = 'show' : vidno = 'hide';
    if ( document.layers[id] ) document.layers[id].visibility = vidno;
  } else if (isIE) {
    vidno ? vidno = 'visible' : vidno = 'hidden';
    if ( document.all[id] ) document.all[id].style.visibility = vidno;
  } else if (isMoz) {
    vidno ? vidno = 'visible' : vidno = 'hidden';
    if ( document.getElementById(id) ) document.getElementById(id).style.visibility = vidno
  }
}

// premik & prikaz layerja - crossbrowser
function prikazxy(id, x, y, offsetx) {
  if (isNN) {
    if (x != null) document.layers[id].left = x + offsetx;
    if (y != null) document.layers[id].top = y;
    document.layers[id].visibility = 'show';
  } else if (isIE) {
    if (x != null) document.all[id].style.posLeft = x + offsetx;
    if (y != null) document.all[id].style.posTop = y;
    document.all[id].style.visibility = 'visible';
  } else if (isMoz) {
    if (x != null) document.getElementById(id).style.left = x + offsetx;
    if (y != null) document.getElementById(id).style.top = y;
    document.getElementById(id).style.visibility = 'visible';
  }
}

// menjava slike na layerju - crossbrowser
function menjajImg(kaj,novSrc,nnLayer){
  var layerInfo = "";
  if (isNN){
    layerInfo = nnLayer;
  }
  eval(layerInfo + "document.images['" + kaj + "'].src = '" + novSrc.src + "'");
}


// blinkovizija
function um_blink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}
function um_startblink() {
  // Make sure it is IE4, what about moz?
  if (document.all)
    setInterval("um_blink()",1000)
}


function colorMe(e,c)
{
  e.style.backgroundColor = c;
}

// concessionares

var divShown = null;
var mnuShown = null;

function AdriaNet(n) {

	if ( !isNaN(n) ) {

		if ( divShown != null )	document.getElementById("div" + divShown).style.display = 'none';
		if ( n > 0 ) {
			document.getElementById("div" + n).style.display = 'block';
			divShown = n;
		} else
			divShown = null;
	}
	
}

// SHOW-HIDE
var divShown = null;
var mnuShown = null;

function AdriaFAQ(n) {

	if ( !isNaN(n) ) {

		// Menu
		if ( divShown != null )	document.getElementById("div" + divShown).style.display = 'none';
		if ( n > 0 ) {
			document.getElementById("div" + n).style.display = 'block';
			divShown = n;
		} else
			divShown = null;
			
	}
	
}

// DK 360 posnetek
function popSide(vogn)	{
	window.open('http://www.adria.dk/'+vogn+'panoxpress.htm','','resizable=1,menu=no,toolbar=0,width=550,height=380,top=0,teft=0');
}