$(document).ready(function() {
	$("a").focus(function () {
         $(this).blur();
    });
});

function getPage(page)
{
	top.document.location.href="http://www.intermedia.horsefield.pl/"+page;
}


function getObject(objectId) {
		// cross-browser function to get an object's style object given its id
		if(document.getElementById && document.getElementById(objectId)) {
		// W3C DOM
		return document.getElementById(objectId);
		} else if (document.all && document.all(objectId)) {
		// MSIE 4 DOM
		return document.all(objectId);
		} else if (document.layers && document.layers[objectId]) {
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
		} else {
		return false;
		}
}

function hf_prev() {
	var step = get_id(-1);
	get_data(step);
}

function hf_next() {
	var step = get_id(1);
	get_data(step);
}

function get_id(step) {
	indeks[0] = indeks[0]+step;
	if (indeks[0]<0) indeks[0]=tablica.length-1;
	if (indeks[0]>=tablica.length) indeks[0]=0;
	return tablica[indeks[0]];
}

function set_flash(film) {
			var flash_projekt=getObject("flash_projekt");
			flash_projekt.SetVariable("hf_film", film);	
			var a = flash_projekt.GetVariable("hf_film");		
			//alert(a);
}

function get_data(id){
	$.ajax({
	  type: "GET",
	  url: 'index.php?page=portfolio&action=xml&projekt_id='+id,
//	  data: "page=portfolio&aaction=xml&projekt_id="+id,
	  dataType: "xml",
	  success: function(xml){
			var _klient_title = "";
			var _opis = "";
			var _film = "";
			_klient_title = $(xml).find("klient_title").text();
			_opis = $(xml).find("opis").text();
			_film = $(xml).find("film").text();
			$("#klient_zajawka").html(_klient_title);
			$("#projekt_opis").html(_opis);
			var flash_projekt=getObject("flash_projekt");
			flash_projekt.SetVariable("hf_film", _film);	
			//var a = flash_projekt.GetVariable("hf_film");		
			//alert(a);
	  },
	  
	  error: function(errorData, msg){alert(msg);}
	});
}


function hf_sound_on_on(dzwiek) {
	$(document).ready(function() {
		$("#dzwiek_flash").load("index.php?page=sound_off_on&dzwiek="+dzwiek);	
	});
}