<!--

/******************************************
screen width
******************************************/
function velicinaProzora() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
  	ret = new Array();
  	ret[0] = myWidth;
  	ret[1] = myHeight;
  	return ret;
}
window.onresize = function(){
	daVidimoCijaMajkaCrnuVunuPrede();
}
function daVidimoCijaMajkaCrnuVunuPrede(){
	velicina = velicinaProzora();
	var ceeses = "";
	
	rimuvniCss("rez_a");
	rimuvniCss("rez_d");
	rimuvniCss("rez_c");
	rimuvniCss("rez_b");

	if (velicina[0]>980) {  
		apendniCss("/elementi/rez_a.css","rez_a");
	}
	if (velicina[0]>1200) { 
		apendniCss("/elementi/rez_b.css","rez_b");
	}
	if (velicina[0]>1320) {  
		apendniCss("/elementi/rez_c.css","rez_c");
	}
	if (velicina[0]>1500) {
		apendniCss("/elementi/rez_d.css","rez_d");
	}
}
function rimuvniCss(cssid){
	var objHead = document.getElementsByTagName('head');
	if (objHead[0]){
		if(brisi = document.getElementById(cssid)){
			objHead[0].removeChild(brisi);
		}
	}
}
function apendniCss(css,cssid){
	var objHead = document.getElementsByTagName('head');
	if (objHead[0]){
		if(!document.getElementById(cssid)){
			var objCSS = document.createElement('link'); 
			objCSS.rel = 'stylesheet';
			objCSS.id = cssid;
			objCSS.href = css;
			objCSS.type = 'text/css';	
			objHead[0].appendChild(objCSS);
		}
	}
}
daVidimoCijaMajkaCrnuVunuPrede();

// *****
// ***** screen width END
// *****

/******************************************
tinyscrolling
******************************************/
/* Tiny Scrolling - a smooth navigation between internal links and their destinations
by Marco Rosella - http://www.centralscrutinizer.it/en/design/js-php/tiny-scrolling
based on the works by Travis Beckham and Brian McAllister.
                v0.3 - March 27, 2006
*/

var tinyScrolling = {
	speed : 50,      //set here the scroll speed: when this value increase, the speed decrease. 
	maxStep: 150,	 //set here the "uniform motion" step for long distances
	brakeK: 3,		 //set here the coefficient of slowing down
	hash:null,		
	currentBlock:null,
	requestedY:0,
	init: function() {
			var lnks = document.getElementsByTagName('a');
			document.getElementById("dizz_plane").onclick=tinyScrolling.initScroll;
			/*for(var i = 0, lnk; lnk = lnks[i]; i++) {   
				if ((lnk.href && lnk.href.indexOf('#') != -1) &&  ( (lnk.pathname == location.pathname) ||
				('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {  
				lnk.onclick = tinyScrolling.initScroll;   		
				}   
			}*/
	},
	getElementYpos: function(el){
			var y = 0;
			while(el.offsetParent){  
				y += el.offsetTop;  
				el = el.offsetParent;
			}	return y;
	},		
	getScrollTop: function(){
			if(document.all) return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
			else return window.pageYOffset;   
	},	
	getWindowHeight: function(){
			if (window.innerHeight)	return window.innerHeight;
			if(document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
	},
	getDocumentHeight: function(){
			if (document.height) return document.height;
			if(document.body.offsetHeight) return document.body.offsetHeight;
	},
	initScroll: function(e){
			var targ;  
			if (!e) var e = window.event;
			if (e.target) targ = e.target;
			else if (e.srcElement) targ = e.srcElement;   
			tinyScrolling.hash = targ.href.substr(targ.href.indexOf('#')+1,targ.href.length); 
			tinyScrolling.currentBlock = document.getElementById(tinyScrolling.hash);   
			if(!tinyScrolling.currentBlock) return;
			tinyScrolling.requestedY = tinyScrolling.getElementYpos(tinyScrolling.currentBlock); 
			tinyScrolling.scroll();  
			return false;
	},
	scroll: function(){
			var top  = tinyScrolling.getScrollTop();
			if(tinyScrolling.requestedY > top) {  
				var endDistance = Math.round((tinyScrolling.getDocumentHeight() - (top + tinyScrolling.getWindowHeight())) / tinyScrolling.brakeK);
				endDistance = Math.min(Math.round((tinyScrolling.requestedY-top)/ tinyScrolling.brakeK), endDistance);
				var offset = Math.max(2, Math.min(endDistance, tinyScrolling.maxStep));
			} else { var offset = - Math.min(Math.abs(Math.round((tinyScrolling.requestedY-top)/ tinyScrolling.brakeK)), tinyScrolling.maxStep);
			} window.scrollTo(0, top + offset);  
			if(Math.abs(top-tinyScrolling.requestedY) <= 1 || tinyScrolling.getScrollTop() == top) {
				window.scrollTo(0, tinyScrolling.requestedY);
				if(!document.all || window.opera) location.hash = tinyScrolling.hash;
				tinyScrolling.hash = null;
			} else {
				setTimeout(tinyScrolling.scroll,tinyScrolling.speed);
			}
	}		
};
// *****
// ***** tinyscrolling END
// *****

/******************************************
styleswitcher
******************************************/
/*
modification from http://alistapart.com/articles/relafont
*/

function fontsizeup() {
  active = getActiveStyleSheet();
  switch (active) {
/*    case 'A--' : 
      setActiveStyleSheet('A-');
      break;
    case 'A-' : 
      setActiveStyleSheet('A');
      break;*/
    case 'null' : // FF
      setActiveStyleSheet('A+');
      break;
	case 'A' : 
      setActiveStyleSheet('A+');
      break;
    case 'A+' : 
      setActiveStyleSheet('A++');
      break;
    case 'A++' :
      break;
    default :
      setActiveStyleSheet('A');
      break;
  }
}

function fontsizedown() {
  active = getActiveStyleSheet();
  switch (active) {
    case 'A++' : 
      setActiveStyleSheet('A+');
      break;
    case 'A+' : 
      setActiveStyleSheet('A');
      break;
    case 'A' : 
      //setActiveStyleSheet('A-');
      break;
	/*  
    case 'A-' : 
      setActiveStyleSheet('A--');
      break;
    case 'A--' : 
       break;*/
    default :
      setActiveStyleSheet('A');
      break;
  }
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  return ('A');
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
if (title == 'null') {
  title = getPreferredStyleSheet();
}

setActiveStyleSheet(title);
// *****
// ***** sstyleswitcher END
// *****


/******************************************
xxx
******************************************/

// *****
// ***** xxx END
// *****

function openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

window.onload = function(e) {
	tinyScrolling.init();
	//
	var cookie = readCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
};

window.onbeforeunload = function(e) {
	var title = getActiveStyleSheet();
	createCookie("style", title, 365);
}

-->