var img='/data/themes/otn/images/';//ługę zakladek na stronie technologii
var XMLHttpRequestObject = false;
if (window.XMLHttpRequest) {
	XMLHttpRequestObject = new XMLHttpRequest();
} else if (window.ActiveXObject){
	XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
function getData(dataSource, divID){
	if(XMLHttpRequestObject){
		var obj = document.getElementById(divID);
		XMLHttpRequestObject.open("GET", dataSource);
		XMLHttpRequestObject.onreadystatechange = function(){
			if (XMLHttpRequestObject.readyState ==4 && XMLHttpRequestObject.status ==200){
				obj.innerHTML = XMLHttpRequestObject.responseText;
			}
		}
		XMLHttpRequestObject.send(null);
	} else {
		var obj = document.getElementByID(divID);
		obj.innerHTML = "Twoja przeglądarka nie obsługuje technologii Ajax";
	}
}

// zadania odpalone przy wywolaniu strony
function task() {
	change_text();
	$(document).ready(function() {
		$("li.menu_option_:first").addClass('first_link');
		$("li.menu_option_:last").addClass('last_link');
	});
}
function task_en() {
	change_text_en();
	$(document).ready(function() {
		$("li.menu_option_:first").addClass('first_link');
		$("li.menu_option_:last").addClass('last_link');
	});
}

// obsluga zakladek w technologiach
function SetFreeAll() {
	$('#technologie ul li a').removeClass('active');
}
function selectedAnchor(zakladka, zakladka_li) {
	$('#'+zakladka).addClass('active');
	$('#'+zakladka).blur();
}

//funkcje zmiany tła na podstronach  
function zmientlo(){
	var url = location.pathname;
	if (url.match("rozwiazania")){
		document.getElementById('top_header').style.backgroundImage = "url('" + img + "header_produkty.jpg')";
	} else if (url.match("zespol")){
		document.getElementById('top_header').style.backgroundImage = "url('" + img + "header_zespol.jpg')";
	} else if (url.match("start")){
		document.getElementById('top_header').style.backgroundImage = "url('" + img + "header.jpg')";
	} else if (url.match("technologie")){
		document.getElementById('top_header').style.backgroundImage = "url('" + img + "header_technologie.jpg')";
	} else if (url.match("doswiadczenie")){
		document.getElementById('top_header').style.backgroundImage = "url('" + img + "header_doswiadczenie.jpg')";
	} else if (url.match("kontakt")){
		document.getElementById('top_header').style.backgroundImage = "url('" + img + "header_kontakt.jpg')";
	} else document.getElementById('top_header').style.backgroundImage = "url('" + img + "header.jpg')";
}

//funkcje obsługi rekomendacji
var rekomendacja =  new Array();
rekomendacja[0] = '<p>„<span class="otn">otn.pl</span> jest partnerem Wygodnie.pl w obszarze rozwoju serwisu dostarczając usługi programistyczne wysokiej jakości. Zespół <span class="otn">otn.pl</span> jest również często autorem pomysłów i usprawnień biznesowych w serwisie.”</p><p><strong>Artur Jurczakowski</strong><br/> <span class=\"zielony\">Prezes zarządu, Wygodnie.pl Sp. z .o.o.</span></p>';
rekomendacja[1] = '<p>„Zespół <span class="otn">otn.pl</span> w ekspresowym tempie zaprojektował i wykonał aplikację centralną oraz zbudował interfejsy do systemów ATM oraz POS przystępując z marszu do pracy. Swoją wiedzą i doświadczeniem wsparł nas również  we wdrożeniu systemu w Bankach Spółdzielczych”</p><p><strong>Piotr Burkacki</strong><br /> <span class="zielony">Dyrektor IT, Bankowe Technologie Informatyczne - Dukat Sp. z o.o.</span></p>';
rekomendacja[2] = '<p>"Zespół <span class="otn">otn.pl</span> dostarczył Portal, który jest kluczowym elementem świadczonej przez naszą firmę usługi. <span class="otn">otn.pl</span> zgodził się na elastyczną formułę współpracy uzależniając swoje wynagrodzenie od wyników sprzedaży uzyskiwanych przez Success Fee."</p><p><strong>Bohdan Leśniak</strong><br /><span class="zielony">Prezes zarządu, Success Fee Sp. z o.o.</span></p>';
rekomendacja[3] = '<p>"Zespół <span class="otn">otn.pl</span> to nie tylko profesjonalny partner, ale ”ZAWODOWY PRZYJACIEL” - tak bowiem śmiało i szczerze możemy nazwać osoby skupione pod szyldem <span class="otn">otn.pl</span>. Poprzez swoje zaangażowanie, zawodową rzetelność, kwalifikacje, skuteczność w działaniu i prawdziwie życzliwą otwartość utwierdzili nas w przekonaniu, że „lepiej trafić nie mogliśmy”. (..) Prawdziwie radzi jesteśmy, że spotkaliśmy takiego partnera, który przygotował dla nas, organizacji non-profitowej, specjalne warunki. Chlubnym efektem naszej współpracy z Zespółem <span class="otn">otn.pl</span> jest portal społeczno-ściowy www.katyn-pamietam.pl".</p><p><strong>śp. o. Józef Joniec SP</strong><br />Prezes zarządu<br /><strong>Renata Wardecka</strong><br />Dyrektor zarządzający<br /><span class="zielony">Stowarzyszenie PARAFIADA<br /> im. św. Józefa Kalasancjusza</span></p>';
rekomendacja[4] = '<p>"Rekomenduję współpracę z zespołem <span class="otn">OTN</span> każdej firmie, która szuka rzetelnego Partnera do budowy portalu internetowego o rozbudowanej funkcjonalności. "</p> <p><strong>Piotr Sikorski</strong><br /><span class="zielony">AutoNegocjator</span></p>';

var rekomendacja_en =  new Array();
rekomendacja_en[0] = '<p>„<span class="otn">otn.pl</span> is Wygodnie.pl partner in the field of Wygodnie.pl development area, otn.pl provides high quality programming services. The <span class="otn">otn.pl</span> team is also the author of innovative ideas.that improves the business.”</p><p><strong>Artur Jurczakowski</strong><br/> <span class=\"zielony\">CEO, Wygodnie.pl Sp. z .o.o.</span>';
rekomendacja_en[1] = '<p>„<span class="otn">otn.pl</span> team has quickly designed, and implemented the central application and the interfaces to ATM  and POS systems in an express mode immediately after initial agreement. The team has supported us with its knowledge and experience in implementing the solution in cooperative banks”</p><p><strong>Piotr Burkacki</strong><br /> <span class="zielony">IT director - BTI Dukat Sp. z o.o.</span></p>';
rekomendacja_en[2] = '<p>"<span class="otn">otn.pl</span> Team delivered Portal that is crucial element of the services that we are providing to our Customers. <span class="otn">otn.pl</span> engaged in flexible agreement in which our sales results are related with with their fee."</p><p><strong>Bohdan Leśniak</strong><br/> <span class=\"zielony\">CEO, Success Fee Sp. z o.o.</span>';
rekomendacja_en[3] = '<p>"The <span class="otn">otn.pl</span> Team is not only our professional partner but also a "PROFESSIONAL FRIEND” of ours. Indeed, that is how we can readily and truly call the people at <span class="otn">otn.pl</span>. Their commitment, professional honesty, competence, effectiveness and friendly openness convince us that we could have not made a better choice. (..) We are truly happy to have met a partner who offered us, a non-profit organisation, specially tailored terms and a unique approach. The www.katyn-pamietam.pl community portal, source of our pride, is the fruit of our co-operation with <span class="otn">otn.pl</span>".</p><p><strong>RIP father Józef Joniec SP</strong><br />CEO<br /><strong>Renata Wardecka</strong><br />Managing Director<br /><span class="zielony">Stowarzyszenie PARAFIADA<br /> im. św. Józefa Kalasancjusza</span></p>';
rekomendacja_en[4] = '<p>"I recommend working with OTN\'s team to any company that is looking for a reliable Partner in building a website with extensive functionality."</p> <p><strong>Piotr Sikorski</strong><br /><span class="zielony">AutoNegocjator</span></p>';


rekomandacjaArrayLength = rekomendacja.length;
rekomandacjaEnArrayLength = rekomendacja_en.length;
var licznikRekomendacji = Math.floor(Math.random()*5);


function change_text(){
	document.getElementById('divRekomendacji').innerHTML = rekomendacja[licznikRekomendacji];
	licznikRekomendacji = licznikRekomendacji + 1;
	if (licznikRekomendacji >= rekomandacjaArrayLength) {
		licznikRekomendacji = 0;
	}	
}
function change_text_en(){
	document.getElementById('divRekomendacji').innerHTML = rekomendacja_en[licznikRekomendacji];
	licznikRekomendacji = licznikRekomendacji + 1;
	if (licznikRekomendacji >= rekomandacjaEnArrayLength) {
		licznikRekomendacji = 0;
	}	
}

