/*
$(document).ready(function(){

	function roundNumber(number,decimals) {
		var newString;// The new rounded number
		decimals = Number(decimals);
		if (decimals < 1) {
			newString = (Math.round(number)).toString();
		} else {
			var numString = number.toString();
			if (numString.lastIndexOf(".") == -1) {// If there is no decimal point
				numString += ".";// give it one at the end
			}
			var cutoff = numString.lastIndexOf(".") + decimals;// The point at which to truncate the number
			var d1 = Number(numString.substring(cutoff,cutoff+1));// The value of the last decimal place that we'll end up with
			var d2 = Number(numString.substring(cutoff+1,cutoff+2));// The next decimal, after the last one we want
			if (d2 >= 5) {// Do we need to round up at all? If not, the string will just be truncated
				if (d1 == 9 && cutoff > 0) {// If the last digit is 9, find a new cutoff point
					while (cutoff > 0 && (d1 == 9 || isNaN(d1))) {
						if (d1 != ".") {
							cutoff -= 1;
							d1 = Number(numString.substring(cutoff,cutoff+1));
						} else {
							cutoff -= 1;
						}
					}
				}
				d1 += 1;
			} 
			newString = numString.substring(0,cutoff) + d1.toString();
		}
		if (newString.lastIndexOf(".") == -1) {// Do this again, to the new string
			newString += ".";
		}
		var decs = (newString.substring(newString.lastIndexOf(".")+1)).length;
		for(var i=0;i<decimals-decs;i++) newString += "0";
		//var newNumber = Number(newString);// make it a number if you like
		return newString;
	}	 

	//tabela ZA EFEKTIVNI STRANI NOVAC
	$.ajax({
	 type: "GET",
	 url: "/sites/all/themes/aik_banka/uploads/kursna_lista.xml",
	 dataType: "xml",
	 success: function(xml) {                    
		 var c0, c1, c2, c3, c4, c5;
		 $(xml).find("Row:eq(9)").each(function(){                           
			c0 = $(this).find("Cell:eq(0)").text();
			c1 = $(this).find("Cell:eq(1)").text();
			c2 = $(this).find("Cell:eq(2)").text();
			c3 = $(this).find("Cell:eq(3)").text();
			c4 = $(this).find("Cell:eq(4)").text();
			c5 = $(this).find("Cell:eq(5)").text();
			 $("<tr></tr>")
				 .html("<td>"+c0+"</td><td>"+c1+"</td><td>"+c2+"</td><td>"+c3+"</td><td>"+c4+"</td><td>"+c5+"</td>")
				 .appendTo("#kursna_lista1");    
		 });
		 $(xml).find("Row:gt(9):lt(3)").each(function(){                           
			c0 = $(this).find("Cell:eq(0)").text();
			c1 = $(this).find("Cell:eq(1)").text();
			c2 = $(this).find("Cell:eq(2)").text();
			c3 = $(this).find("Cell:eq(3)").text();
			c4 = roundNumber($(this).find("Cell:eq(4)").text(), 4);
			c5 = roundNumber($(this).find("Cell:eq(5)").text(), 4);
			 $("<tr></tr>")
				 .html("<td>"+c0+"</td><td>"+c1+"</td><td>"+c2+"</td><td>"+c3+"</td><td>"+c4+"</td><td>"+c5+"</td>")
				 .appendTo("#kursna_lista1");    
		 });
		 $(xml).find("Row:eq(5)").each(function(){                           
			datum = $(this).find("Cell:eq(4)").text();
			datum_formated = datum.substring(8, 10) + "." + datum.substring(5, 7) + "." + datum.substring(0, 4) + ". ";
			$(".kl_datum").html(datum_formated);
		 });
	 }
	}); 
	
	//tabela ZA DEVIZE
	$.ajax({
	 type: "GET",
	 url: "/sites/all/themes/aik_banka/uploads/kursna_lista.xml",
	 dataType: "xml",
	 success: function(xml) {                    
		 var c0, c1, c2, c3, c4, c5, c6, c8, c9;
		 $(xml).find("Row:eq(37)").each(function(){                           
			c0 = $(this).find("Cell:eq(0)").text();
			c1 = $(this).find("Cell:eq(1)").text();
			c2 = $(this).find("Cell:eq(2)").text();
			c3 = $(this).find("Cell:eq(3)").text();
			c4 = $(this).find("Cell:eq(4)").text();
			c5 = $(this).find("Cell:eq(5)").text();
			c6 = $(this).find("Cell:eq(6)").text();			
			 $("<tr></tr>")
				 .html("<td>"+c0+"</td><td>"+c1+"</td><td>"+c2+"</td><td>"+c3+"</td><td>"+c4+"</td><td>"+c5+"</td><td>"+c6+"</td>")
				 .appendTo("#kursna_lista2");    
		 }); 
		 $(xml).find("Row:gt(37):lt(11)").each(function(){                           
			c0 = $(this).find("Cell:eq(0)").text();
			c1 = $(this).find("Cell:eq(1)").text();
			c2 = $(this).find("Cell:eq(2)").text();
			c3 = $(this).find("Cell:eq(3)").text();
			c4 = roundNumber($(this).find("Cell:eq(4)").text(), 4);
			c5 = roundNumber($(this).find("Cell:eq(5)").text(), 4);
			c6 = roundNumber($(this).find("Cell:eq(6)").text(), 4);			
			 $("<tr></tr>")
				 .html("<td>"+c0+"</td><td>"+c1+"</td><td>"+c2+"</td><td>"+c3+"</td><td>"+c4+"</td><td>"+c5+"</td><td>"+c6+"</td>")
				 .appendTo("#kursna_lista2");    
		 }); 
	 }
	}); 
}); 
*/




