	var pubXmlHttp;
	var pubLastRow;
	var pubBlackBck;
	var pubDivVideoWindow;
	var pubDivLoadingWindow;

	// ------------------------------------
	// 				Ajax
	// ------------------------------------
	//
	// Ajax's HttpRequest object
	//
	function getXmlHttpObject(handler) { 
		var objXmlHttp=null;
	
		if (navigator.userAgent.indexOf("Opera")>=0) {
			alert("This page doesn't work in Opera") 
			return; 
		}
		// Microsoft
		if (navigator.userAgent.indexOf("MSIE")>=0) { 
			var strName="Msxml2.XMLHTTP";
			if (navigator.appVersion.indexOf("MSIE 5.5")>=0) {
				strName="Microsoft.XMLHTTP";
			} 
			try { 
				objXmlHttp=new ActiveXObject(strName);
				objXmlHttp.onreadystatechange=handler ;
				return objXmlHttp;
			} 
			catch(e) { 
				alert("Error. Scripting for ActiveX might be disabled") ;
				return ;
			} 
		} 
		// Mozilla
		if (navigator.userAgent.indexOf("Mozilla")>=0) {
			objXmlHttp=new XMLHttpRequest();
			objXmlHttp.onload=handler;
			objXmlHttp.onerror=handler ;
			return objXmlHttp;
		}
	} 
	//
	// navigation
	//
	function gotoPage(pageName,ID) {
		if(pageName == "en" || pageName =="sr") {
			window.location.href = "../" + pageName + "/index.php";
			return;	
		}
		this.showLoading();
		pubXmlHttp=getXmlHttpObject(pageReturned);
		var postValues = "page=" + pageName;
		if(ID != "undefined") postValues +="&ID=" + ID;
		pubXmlHttp.open("POST", "_retrivePage.php" , true);
		pubXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		pubXmlHttp.send(postValues);
	}
	//
	// pageReturned
	//
	function pageReturned() {
		if (pubXmlHttp.readyState==4 || pubXmlHttp.readyState=="complete") { 
			hideLoading();
			document.getElementById("html_content").innerHTML = pubXmlHttp.responseText;
		}
	}
	// ------------------------------------
	// 				UI
	// ------------------------------------
	//
	// change color
	//
	function changeColor(obj,color) {
		obj.style.backgroundColor = color;
	}
	function rowClicked(rowId,fileName,boFirst,boAsyh) {
		if(! boAsyh) boAsyh == true;
		obRow = document.getElementById("row_" + rowId);
		obContent = document.getElementById("aboutContainer");
		if(obRow.style.display == "block") {
			obRow.style.display = "none";
			try {
				//if(!boFirst) obContent.scrollTop -= 90;
			} catch(ob) {}
		} else {
			obRow.style.display = "block";
			pubLastRow = document.getElementById("row_text_" + rowId);
			if(pubLastRow.innerHTML == "") {
				this.showLoading();
				pubXmlHttp=getXmlHttpObject(rowProjectReturned);
				var postValues = "ID=" + rowId;
				pubXmlHttp.open("POST", fileName , boAsyh);
				pubXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				pubXmlHttp.send(postValues);
			}
			try {
				if(!boFirst) obContent.scrollTop += 90;
			} catch(ob) {}
		}
	}
	//
	// returned data for our work
	//
	function rowProjectReturned() {
		if (pubXmlHttp.readyState==4 || pubXmlHttp.readyState=="complete") { 
			hideLoading();
			pubLastRow.innerHTML = pubXmlHttp.responseText;
		}
	}
	//
	// shows video
	//
	function showVideo(videoPath) {
		if(! pubBlackBck) pubBlackBck = document.getElementById("video_bck");	
		if(! pubDivVideoWindow) pubDivVideoWindow = document.getElementById("video_window");	
		var oScroll = tools_getScrollXY();
		var oSize = tools_getWindowSize();
		pubDivVideoWindow.style.visibility = "visible";
		pubBlackBck.style.visibility = "visible";
		pubDivVideoWindow.style.left = String((oSize[0]/2-200) + oScroll[0]) + "px";
		pubDivVideoWindow.style.top = String((oSize[1]/2-175) + oScroll[1]) + "px";
		pubDivVideoWindow.style.width = "400px";
		pubDivVideoWindow.style.height = "350px";
		pubBlackBck.style.width = oSize[0] + "px";
		pubBlackBck.style.height = oSize[1] + "px";
		pubBlackBck.style.left = oScroll[0] + "px";
		pubBlackBck.style.top = oScroll[1] + "px";
		pubDivVideoWindow.innerHTML = loadSwf('../video.swf',400,350,'videoPath='+videoPath,7);
		//pubDivVideoWindow.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="280" id="FLVPlayer">  <param name="movie" value="video.swf" />  <param name="salign" value="lt" />  <param name="quality" value="high" />  <param name="scale" value="noscale" />  <param name="FlashVars" value="videoPath=images/video_materijal/video&autoPlay=false&autoRewind=false" />  <embed src="video.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&videoPath=images/video_materijal/video.flv&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="320" height="280" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';	
	}
	// 
	// shows jpeg images
	//
	function showSlika(img) {
		if(! pubBlackBck) pubBlackBck = document.getElementById("video_bck");	
		if(! pubDivVideoWindow) pubDivVideoWindow = document.getElementById("video_window");	
		var oScroll = tools_getScrollXY();
		var oSize = tools_getWindowSize();
		pubDivVideoWindow.style.visibility = "visible";
		pubBlackBck.style.visibility = "visible";
		pubDivVideoWindow.style.left = String((oSize[0]/2-150) + oScroll[0]) + "px";
		pubDivVideoWindow.style.top = String((oSize[1]/2-10) + oScroll[1]) + "px";
		pubDivVideoWindow.style.width = "320px";
		pubDivVideoWindow.style.height = "280px";
		pubBlackBck.style.width = oSize[0] + "px";
		pubBlackBck.style.height = oSize[1] + "px";
		pubBlackBck.style.left = oScroll[0] + "px";
		pubBlackBck.style.top = oScroll[1] + "px";
		pubDivVideoWindow.innerHTML = "<strong style='cursor:pointer' onclick='hideVideo()'>loading image ...</strong>";
		var nImg = new Image();
		nImg.onload = function() {
			pubDivVideoWindow.style.left = String((oSize[0]/2-this.width/2) + oScroll[0]) + "px";
			pubDivVideoWindow.style.top = String((oSize[1]/2-this.height/2) + oScroll[1]) + "px";
			pubDivVideoWindow.innerHTML = "<img src='sr/" + this.src + "' onclick='hideVideo()' style='cursor:pointer' />";
		}
		nImg.src = img;
	}
	function hideVideo() {
		pubDivVideoWindow.innerHTML = "";
		pubDivVideoWindow.style.visibility = "hidden";
		pubBlackBck.style.visibility = "hidden";
	}
	function showLoading() {
		if(! pubDivLoadingWindow) pubDivLoadingWindow = document.getElementById("loading_window");
		var oScroll = tools_getScrollXY();
		var oSize = tools_getWindowSize();
		pubDivLoadingWindow.style.left = String((oSize[0]/2-50) + oScroll[0]) + "px";
		pubDivLoadingWindow.style.top = String((oSize[1]/2-25) + oScroll[1]) + "px";
		pubDivLoadingWindow.style.visibility = "visible";
	}
	function hideLoading() {
		if(! pubDivLoadingWindow) pubDivLoadingWindow = document.getElementById("loading_window");
		pubDivLoadingWindow.style.visibility = "hidden";
	}
	function slikaMouseOver(obj) {
		if(obj.style.opacity) obj.style.opacity ="0.8";
	 	if (obj.style.MozOpacity) {
			obj.style.MozOpacity="0.8";
		} else if (obj.filters) {
			obj.filters.alpha.opacity="80";
		}		
	}
	function slikaMouseOut(obj) {
		if(obj.style.opacity) obj.style.opacity ="1";
	 	if (obj.style.MozOpacity) {
			obj.style.MozOpacity="1";
		} else if (obj.filters) {
			obj.filters.alpha.opacity="100";
		}		
	}
	// projekti
	function ExpandAll() {
		var a = document.getElementById("ids").value.split(";");
		var i;
		for(i=0;i<a.length;i++) {
			obRow = document.getElementById("row_" + a[i]);
			if(obRow.style.display != "block") {
				showLoading();
				rowClicked(a[i],'_retriveRowData.php',(i==0),false);	
			}
			hideLoading();
		}
		try {
			document.getElementById("aboutContainer").scrollTop = 0;
		} catch(ob) {}
	}
	function CloseAll() {
		var a = document.getElementById("ids").value.split(";");
		var i;
		for(i=0;i<a.length;i++) {
			obRow = document.getElementById("row_" + a[i]);
			if(obRow.style.display != "none") obRow.style.display = "none";
		}
	}
	
	
	