// Assorted JavaScript functions
	function getElement(ref) {
		var IE4 = (document.all && !document.getElementById) ? true : false;
		var NS4 = (document.layers) ? true : false;
		var IE5 = (document.all && document.getElementById) ? true : false;
		var N6 = (document.getElementById && !document.all) ? true : false;
			
		if(IE5 || N6) {
			return document.getElementById(ref);
		}//end if
		if(NS4) {
			return document.layers(ref);
		}//end if
		if(IE4) {
			return document.all(ref);
		}//end if
	}//end function



	function confirm_action(text) {
		return confirm(text);
	}//end function

	
	function navTo(location) {
		window.location.href = location;
	}//end function
	
	
	function chgBgColor(sID, sColor) {
		var oElement = getElement(sID);
		
		oElement.style.backgroundColor = sColor;
	}//end function;
	
	
	function chgClass(sID, sClassName) {
		var oElement = getElement(sID);
		
		oElement.className = sClassName;
	}//end function
	
	
	function changeposition(p,ev,dx,dy){
	
		e=getElement(p);
	
		if(ev.pageX || ev.pageY){
			x = ev.pageX;
			y = ev.pageY;
		} else {
			x = ev.clientX + document.body.scrollLeft - document.body.clientLeft;
			y = ev.clientY + document.body.scrollTop  - document.body.clientTop;
		}
	
		x = x + dx;
		y = y + dy;
	
		e.style.left = x +'px';
		e.style.top  = y + 'px';
	
	}
	
	function skrij(p) {
		e=getElement(p);
		e.style.visibility='hidden';
	}
	
	function pokazi(p) {
		e=getElement(p);
		e.style.visibility='visible';
	}
	
	
	function SkrijPokazi(p) {
		e=getElement(p);
		if (e.style.visibility=='hidden')
			pokazi(p);
		else
			skrij(p);
	}
	
	
	function Pomanjsaj(p) {
		e=getElement(p);
		e.style.display='none';
	}
	
	function Povecaj(p) {
		e=getElement(p);
		e.style.display='block';
	}
	
	
	
	function PovecajPomanjsaj(p) {
		e=getElement(p);
		if (e.style.display=='none')
			Povecaj(p);
		else
			Pomanjsaj(p);
	}
	
	
	function popravi_x(p) {
		e=getElement(p);
		window.alert(document.p.height);
		return	e.width;
	}
	
	function Visina(p) {
		e=getElement(p);
		return	e.height;
	}
	
		
	function dodaj_x() {
		var IE4 = (document.all && !document.getElementById) ? true : false;
		var NS4 = (document.layers) ? true : false;
		var IE5 = (document.all && document.getElementById) ? true : false;
		var N6 = (document.getElementById && !document.all) ? true : false;
			
		if(IE5) {
			return 0;
		}//end if
		if(NS4) {
			return 0;
		}//end if
		if(N6) {
			return 0;
		}//end if
	}//end function
	
	function dodaj_y() {
		var IE4 = (document.all && !document.getElementById) ? true : false;
		var NS4 = (document.layers) ? true : false;
		var IE5 = (document.all && document.getElementById) ? true : false;
		var N6 = (document.getElementById && !document.all) ? true : false;
			
		if(IE5) {
			return -0;
		}//end if
		if(NS4) {
			return 0;
		}//end if
		if(N6) {
			return -0;
		}//end if
	}//end function
	
	
	

