	function search_focus() {
		document.getElementById('rijec').value ='';
	}
	
	function search_blur(value) {
		if(document.getElementById('rijec').value == '')
			document.getElementById('rijec').value =value;
	}
	
	// Get base url 
	url = document.location.href;
	xend = url.lastIndexOf("/") + 1;
	var base_url = url.substring(0, xend);
	
	var ajax_get_error = false;
	
	function ajax_do (url) {
		
		// Does URL begin with http?
		if (url.substring(0, 4) != 'http') {
			url = base_url + url;
		}
		
		// Create new JS element
		var jsel = document.createElement('SCRIPT');
		jsel.type = 'text/javascript';
		jsel.src = url;
	
		// Append JS element (therefore executing the 'AJAX' call)
		document.body.appendChild (jsel);
	
		return true;
	}
	
	function ajax_get (url, el) {
		
		// Has element been passed as object or id-string?
		if (typeof(el) == 'string') {
			el = document.getElementById(el);
		}
	
		// Valid el?
		if (el == null) { return false; }
	
		// Does URL begin with http?
		if (url.substring(0, 4) != 'http') {
			url = base_url + url;
		}
	
		// Create getfile URL
		getfile_url = base_url + 'getfile.php?url=' + escape(url) + '&el=' + escape(el.id);
	
		// Do Ajax
	//	alert(getfile_url);
		ajax_do (getfile_url);
		
		return true;
	}

	function getRata(lang_id){
		var iznos;
		var broj_rata;
		var tip_perioda;
		var tip;
		if(document.all){
			tip =document.getElementById('tip_kredita').value;
			iznos =document.getElementById('iznos_kredit').value;
			broj_rata =document.getElementById('broj_rata_kredit').value;
			tip_perioda =document.getElementById('tip_perioda_kredit').value;
			tip_kredita_stopa =document.getElementById('tip_kredita_stopa').value;
		}else{
			tip =document.CCGK.tip_kredita.value;
			iznos =document.CCGK.iznos_kredit.value;
			broj_rata =document.CCGK.broj_rata_kredit.value;
			tip_perioda =document.CCGK.tip_perioda_kredit.value;
			tip_kredita_stopa =document.CCGK.tip_kredita_stopa.value;
		}
		url ='credit_calc.php?language_id=' + lang_id + '&iznos=' + escape(iznos) + '&broj_rata=' + escape(broj_rata)+ '&kredit=false&tip_perioda='+tip_perioda+ '&tip='+tip+ '&tip_kredita_stopa='+tip_kredita_stopa;
		ajax_get (url, 'rezultat1');
	}
	
	function getKredit(){
		var iznos;
		var broj_rata;
		if(document.all){
			iznos =document.getElementById('iznos_plata').value;
			broj_rata =document.getElementById('broj_rata_plata').value;
			tip_klijenta =document.getElementById('tip_klijenta_plata').value;
			tip_kredita_stopa =document.getElementById('tip_kredita_stopa').value;  
		}else{
			iznos =document.CCGK.iznos_plata.value;
			broj_rata =document.CCGK.broj_rata_plata.value;
			tip_klijenta =document.CCGK.tip_klijenta_plata.value;                 
			tip_kredita_stopa =document.CCGK.tip_kredita_stopa.value;               
		}
		url ='credit_calc.php?iznos=' + escape(iznos) + '&broj_rata=' + escape(broj_rata)+ '&kredit=true&tip_klijenta='+tip_klijenta+ '&tip_kredita_stopa='+tip_kredita_stopa;
		ajax_get (url, 'rezultat2');
	}
	
	var FlashDetect = new function(){
		var self = this;
		self.installed = false;
		self.raw = "";
		self.major = -1;
		self.minor = -1;
		self.revision = -1;
		self.revisionStr = "";
		var activeXDetectRules = [
			{
				"name":"ShockwaveFlash.ShockwaveFlash.7",
				"version":function(obj){
					return getActiveXVersion(obj);
				}
			},
			{
				"name":"ShockwaveFlash.ShockwaveFlash.6",
				"version":function(obj){
					var version = "6,0,21";
					try{
						obj.AllowScriptAccess = "always";
						version = getActiveXVersion(obj);
					}catch(err){}
					return version;
				}
			},
			{
				"name":"ShockwaveFlash.ShockwaveFlash",
				"version":function(obj){
					return getActiveXVersion(obj);
				}
			}
		];
		var getActiveXVersion = function(activeXObj){
			var version = -1;
			try{
				version = activeXObj.GetVariable("$version");
			}catch(err){}
			return version;
		};
		var getActiveXObject = function(name){
			var obj = -1;
			try{
				obj = new ActiveXObject(name);
			}catch(err){}
			return obj;
		};
		var parseActiveXVersion = function(str){
			var versionArray = str.split(",");//replace with regex
			return {
				"raw":str,
				"major":parseInt(versionArray[0].split(" ")[1], 10),
				"minor":parseInt(versionArray[1], 10),
				"revision":parseInt(versionArray[2], 10),
				"revisionStr":versionArray[2]
			};
		};
		var parseStandardVersion = function(str){
			var descParts = str.split(/ +/);
			var majorMinor = descParts[2].split(/\./);
			var revisionStr = descParts[3];
			return {
				"raw":str,
				"major":parseInt(majorMinor[0], 10),
				"minor":parseInt(majorMinor[1], 10), 
				"revisionStr":revisionStr,
				"revision":parseRevisionStrToInt(revisionStr)
			};
		};
		var parseRevisionStrToInt = function(str){
			return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision;
		};
		self.majorAtLeast = function(version){
			return self.major >= version;
		};
		self.FlashDetect = function(){
			if(navigator.plugins && navigator.plugins.length>0){
				var type = 'application/x-shockwave-flash';
				var mimeTypes = navigator.mimeTypes;
				if(mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description){
					var version = mimeTypes[type].enabledPlugin.description;
					var versionObj = parseStandardVersion(version);
					self.raw = versionObj.raw;
					self.major = versionObj.major;
					self.minor = versionObj.minor; 
					self.revisionStr = versionObj.revisionStr;
					self.revision = versionObj.revision;
					self.installed = true;
				}
			}else if(navigator.appVersion.indexOf("Mac")==-1 && window.execScript){
				var version = -1;
				for(var i=0; i<activeXDetectRules.length && version==-1; i++){
					var obj = getActiveXObject(activeXDetectRules[i].name);
					if(typeof obj == "object"){
						self.installed = true;
						version = activeXDetectRules[i].version(obj);
						if(version!=-1){
							var versionObj = parseActiveXVersion(version);
							self.raw = versionObj.raw;
							self.major = versionObj.major;
							self.minor = versionObj.minor; 
							self.revision = versionObj.revision;
							self.revisionStr = versionObj.revisionStr;
						}
					}
				}
			}
		}();
	};
	FlashDetect.release = "1.0.3";
	
	function checkFlash() {
		if(!FlashDetect.installed) {
			document.getElementById('headerimage').innerHTML ='<img src="images/noflash.jpg" width="957" height="281" border="0">';
		}
	}
