//
// LINK REDIRECTOR
// Copyright (c)1999 by Predrag Supurovic
// All rights reserved
//

if (navigator.userAgent.indexOf("MSIE") == -1){
	topdir = '/html/'
} else {
	topdir = '\\html\\'
}

function ldd(url,dir) {
	this.url = url
	this.dir = dir
}
var c = 0;
var ld = new Array();
ld[c++] = new ldd ('http://www.dv.co.yu','dv')
ld[c++] = new ldd ('http://www.uzice.net','uzicenet')
ld[c++] = new ldd ('http://www.seval.co.yu','seval')
ld[c++] = new ldd ('http://www.bonex.co.yu','bonex')
ld[c++] = new ldd ('http://www.motomat.com','motomat')
ld[c++] = new ldd ('http://www.motomat.co.yu','motomat')
ld[c++] = new ldd ('http://www.luna.co.yu','luna')
ld[c++] = new ldd ('http://www.drypoint.org.yu','drypoint')
ld[c++] = new ldd ('http://www.tv5-ue.co.yu','tv5')
ld[c++] = new ldd ('http://www.coppersev.com','coppersev')
ld[c++] = new ldd ('http://www.uzice.org.yu','uzicenet')
ld[c++] = new ldd ('http://www.sirogojno.org.yu','sirogojno')
ld[c++] = new ldd ('http://www.zlatne-ruke.co.yu','zlatneruke')
ld[c++] = new ldd ('http://www.kondor.co.yu','kondor')
ld[c++] = new ldd ('http://www.plastikanova.com','plastika')
ld[c++] = new ldd ('http://www.seoski-prag.org.yu','seoski-prag')
ld[c++] = new ldd ('http://www.rpk-uzice.co.yu','rpkuzice')
ld[c++] = new ldd ('http://www.radio31.co.yu','radio31')
ld[c++] = new ldd ('http://www.ok-jedinstvo.org.yu','okjedinstvo')
ld[c++] = new ldd ('http://www.fasau.com','fasau')
ld[c++] = new ldd ('http://www.qsl.net','qslnet')
ld[c++] = new ldd ('http://www.cigota.co.yu','cigota')
ld[c++] = new ldd ('http://www.yugent.co.yu','yugent')
ld[c++] = new ldd ('http://www.euklid.edu.yu','euklid')
ld[c++] = new ldd ('http://www.manimex.co.yu','manimex')
ld[c++] = new ldd ('http://www.computerservice.co.yu','computerservice')
ld[c++] = new ldd ('http://www.olimpija.co.yu','olimpija')
ld[c++] = new ldd ('http://www.izolater.co.yu','izolater')
ld[c++] = new ldd ('http://www.atm.co.yu','atm')
ld[c++] = new ldd ('http://www.infosys.co.yu','infosys')
ld[c++] = new ldd ('http://www.mehanoprint.co.yu','mehanoprint')
ld[c++] = new ldd ('http://www.mehanoprint.com','mehanoprint')
ld[c++] = new ldd ('http://www.controlpoint.co.yu','controlpoint')
ld[c++] = new ldd ('http://www.j-metalogradnja.co.yu','j-metalogradnja')
ld[c++] = new ldd ('http://www.metaloprerada.co.yu','metaloprerada')
ld[c++] = new ldd ('http://www.dtucovicuzice.co.yu','dtucovic')
ld[c++] = new ldd ('http://www.bgelektronik.co.yu','bgelektronik')
ld[c++] = new ldd ('http://www.bgelektronik.com','bgelektronik')

function fixpath (inpath) {
	outpath = inpath
	if (outpath.charAt (outpath.length-1) != '/') {
		outpath = outpath + '/'
	}
	return outpath
}

function cl(lnkref) {
	var pos
	var out
  out = lnkref
	if ((window.location.host.length == 0) && (out.indexOf('http:',0) > -1)) {
		for (i = 0; i < ld.length; i++) {
      pos = out.indexOf(ld[i].url)
			if ( pos > -1) {
				path = out.substring(pos + ld[i].url.length, out.length)
				out = document.URL.substring(0, document.URL.indexOf(topdir,0) + topdir.length) + ld[i].dir + path
				if (out.indexOf('.htm',0) == -1) {
					out = fixpath (out)
					out += 'index.htm'
				}
				break
			}
		}
	}
	return out
}

function lr(lnk) {
  lnk.href = cl(lnk.href) 
	if ((window.location.host.length == 0) && (lnk.href.indexOf('http:',0) > -1)) {
    return confirm(lnk.href + '\n\nLink pokazuje na dokument koji ne pripada ovoj prezentaciji.\nDa bi ste ga pogledali potrebno je da se povezete na Internet.\nZelite li da pristupite dokumentu na Internetu?')
	}
	return true
}

