﻿

// problemy z apostrofami

function sprawdz(url)
{
	var ch=document.getElementById('accept')
	if(ch.checked==false)
	{alert('Aby ściągnąć plik musisz potwierdzić, że zgadzasz się z warunkami licencji\nzaznaczając checkboxa.');
	 return false;
	 }
	else {
		alert('Do prawidłowego działania program SuperMemo Mobile wymaga systemu Windows Mobile 5.0 (lub nowszy) oraz zainstalowania następujących dodatkowych składników:\n\nNET Compact Framework 2.0 SP2 \nMacromedia Flash Player 7 for Pocket PC\n\nLinki do pobrania dodatkowych składników znajdziecie Państwo na stronie WWW z opisem produktu w zakładce ( O programie ). ');
		if (url==1){urchinTrackSMMcab ();}
		else {urchinTrackSMMexePL ();}
	}
}

function informationpda()
{
	alert('Do prawidłowego działania program SuperMemo Mobile wymaga systemu Windows Mobile 5.0 (lub nowszy) oraz zainstalowania następujących dodatkowych składników:\n\nNET Compact Framework 2.0 SP2 \nMacromedia Flash Player 7 for Pocket PC\n\nLinki do pobrania dodatkowych składników znajdziecie Państwo na stronie WWW z opisem produktu w zakładce ( O programie ). ')
}

function tabContainer1()
{
	$(function() { $('#container-1').tabs();});
}

function gaTracker(adr)
{
	var GAcode;
	if(document.domain == "www.supermemo.eu"){GAcode = "UA-12299284-2";}
	else {GAcode = "UA-2853718-1";}
	try
	{
		var pageTracker = _gat._getTracker(GAcode);
		pageTracker._trackPageview(adr);
	}
	catch(err) {}
}


function urchinTrackSmuxDemo()
{
	gaTracker('/download/smux/smuxDemo.zip');
}

function urchinTrackCKAndroid1()
{
	gaTracker('/download/sinsbook/files/CzytnikKodowUK.apk');
}

function urchinTrackCKAndroid2()
{
	gaTracker('/download/sinsbook/files/CzytnikKodowDE.apk');
}

function urchinTrackCKAndroid3()
{
	gaTracker('/download/sinsbook/files/CzytnikKodowES.apk');
}

function urchinTrackFTAndroid1()
{
	gaTracker('/download/fast_track/FastTrackSV.apk');
}

function urchinTrackFTAndroid2()
{
	gaTracker('/download/fast_track/FastTrackNO.apk');
}

function urchinTrackFTAndroid3()
{
	gaTracker('/download/fast_track/FastTrackDA.apk');
}

function urchinTrackFTAndroid4()
{
	gaTracker('/download/fast_track/FastTrackNL.apk');
}

function urchinTrackDemoCourses()
{
	gaTracker('/download/smux/demoCourses.zip');
}

function urchinTrackDemoReps()
{
	gaTracker('/download/smux/demoRepetytoria.zip');
}

function urchinTrackSmuxInstrPL()
{
	gaTracker('/download/smux/instr_pl.pdf');
}

function urchinTrackSmuxInstrEN()
{
	gaTracker('/download/smux/instr_en.pdf');
}

function urchinTrackSMMcab ()
{
	gaTracker('/download/smm/SuperMemoMobile.cab')
}

function urchinTrackSMMexePL ()
{
	gaTracker ('/download/smm/SMMobile_Setup_PL.exe')
}

// ----------------------------

function subvalid()
{
	if((document.subscr.email.value == "") || (document.subscr.email.value == "Twój e-mail") ||
	   (document.subscr.email.value.length < 7) || (document.subscr.email.value.indexOf("@")<3) ||
	   (document.subscr.email.value.indexOf(" ") > 0) || (document.subscr.email.value.indexOf(",") > 0))
  {
		alert("Wpisz poprawnie adres e-mail.\nUsuń zbędne odstępy, sprawdź poprawność danych.\nNie używaj przecinków, ani polskich liter.");
		return false;
	}
	else document.subscr.submit();
}

function ShowObj(obj, txt)
{
	var d = document.getElementById(obj);
	if (d.style.display == "none") 
	{
		d.style.display = "";
		txt.innerHTML = "mniej&nbsp;<img src=\"img/chevron_less.gif\" border=\"0\" alt=\"\" style=\"vertical-align: middle\">";
	}
	else
	{
		d.style.display = "none";
		txt.innerHTML = "więcej&nbsp;<img src=\"img/chevron_more.gif\" border=\"0\" alt=\"\" style=\"vertical-align: middle\">";
	}
}

licz=0;
function otworz(nazwa,szer,wys)
{
	config='left=10,top=10,height='+wys+',width='+szer+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
	kitekSC='okno' + licz;
	stadion=window.open('',kitekSC,config)
	stadion.document.write('<HTML><HEAD>');
	stadion.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">');
	stadion.document.write('<TITLE>Foto</title>');
	
	stadion.document.write('<script language="javascript">');
	stadion.document.write('setTimeout(');
	stadion.document.write('"self.close()');
	stadion.document.write(';",70000)');
	stadion.document.write('</');
	stadion.document.write('script>');
	stadion.document.write('</HEAD>');
	stadion.document.write('<body bgcolor=white leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>');
	stadion.document.write('<DIV align=center><a href=# onclick="javascript:self.close();"><img src='+nazwa+' border=0></A></DIV>');
	stadion.document.write('</body></html>');
	stadion.focus();
	licz+=1;
}

function powrot()
{
	document.nowyform.action = "sklep.php?opt=showcart";
	document.nowyform.nowy.value = 0;
	document.nowyform.submit();
}

function powrotzmien()
{
	document.zmienform.action = "sklep.php?opt=showcart";
	document.zmienform.zmien.value = 0;
	document.zmienform.submit();
}

function nowyklient()
{
	document.logowanie.action = "sklep.php?opt=newclient";
	document.logowanie.zaloguj.value = "";
	document.logowanie.submit();
}

function checkandsendzmien()
{
	document.zmienform.submit();
}

function checkandsend()
{
	document.nowyform.submit();
}

function zrealizuj()
{
	if((!document.formularz.transakcja[0].checked && !document.formularz.transakcja[1].checked && !document.formularz.transakcja[2].checked) || 
     (!document.formularz.form[1].checked && !document.formularz.form[0].checked))
	{
		alert("Prosimy wybrać dokument sprzedaży i formę płatności.");
		return false;
	}
	else
	{
		if(document.formularz.transakcja[0].checked)
		{
			document.formularz.action = "http://www.supermemo.net.pl/polcardGate.net";
			document.formularz.form[1].checked = true;
		}
		document.formularz.submit();
	}
}

function zapytanie()
{
	correct = 1;
	if(document.zapyt.imie.value == "")  correct = 0;
	if(document.zapyt.nazwisko.value == "")  correct = 0;
	if((document.zapyt.email.value == "") && (document.zapyt.telefon.value == ""))  correct = 0;
	if(correct == 0)  alert("Prosimy wypełnić wszystkie zaznaczone pola.");
	else document.zapyt.submit();
}

function changeArrowL()
{
 document.getElementById('arrow').src='/img/prod/rozmowki/phrase_arrowL.gif';
}

function changeArrowR()
{
 document.getElementById('arrow').src='/img/prod/rozmowki/phrase_arrowR.gif';
}

function validateContactForm() {
alert("działa");

var op = document.getElementsByName('op');
var email = document.getElementById('mail');
if (op[0].checked == false && op[1].checked == false && op[2].checked == false) {
	alert("Nie wybrałeś rodzaju problemu.");
	return false;	
	}
if((email.value == "") || (email.value == "Twój e-mail") ||
	   (email.value.length < 7) || (email.value.indexOf("@")<3) ||
	   (email.value.indexOf(" ") > 0) || (email.value.indexOf(",") > 0))
{alert("podany adres e-mail jest nieprawidłowy."); return false;}
return true;
	
}

