// blank.js
function externallinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "blank") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externallinks;

//init.js
// JavaScript Document  by KiDMaN
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 6=0;$(j).k(5(){$(".l").7(5(){$(1).8("7")},5(){$(1).e("7")});$(".f 4").m(5(){3 a=$(1).2().2().9("d");n(a==""){a="o"+ ++6;$(1).2().2().9("d",a)}$("#"+a+" 4").e("g");$(1).8("g");3 b=$("#"+a+" 4").p(1);$("#"+a+" h.i:q").r();$("#"+a+" h.i").s(b).t();u v});$(".f 4:w-x").y(5(){3 a="z"+ ++6;$(1).2().9("d",a);3 b=$("#"+a+" 4").A;$(1).2().8("B"+b);3 c=C/b;$(1).2().D("4").E(c+"%")})});',41,41,'|this|parent|var|h5|function|idx_auto_kidman|hover|addClass|attr||||id|removeClass|tab|active|div|tabs|document|ready|message|click|if|abox_|index|visible|hide|eq|show|return|false|first|child|each|numTab_|length|numTabsButtons_|100|children|width'.split('|'),0,{}))


/////////////////////////

//otwórz stronę
function loaddoc(link) {
var link;
window.location.href=link;
}

//otwarcie zdjęcia w nowym oknie
function new_img(link, width, height) {
var link;
var width;
var height;
link = link+'&co='+location.href;
window.open('http://www.infoarchitekta.pl/window.php?bimage='+link+'', 'foto' ,'left=20,top=20, width='+width+' , height='+height+', menubar=0, resizable=1, scrollbars=1');
}

//otwarcie dok w nowym oknie
function new_win(link, width, height) {
var link;
var width;
var height;
window.open(link, 'noweokno' ,'left=20,top=20, width='+width+' , height='+height+', menubar=0, resizable=1, scrollbars=1');
}

//sprawdzenie czy login istnieje
function check_login()
{
	var p_log = document.getElementById('login').value;
	new_win('window.php?page=register&run=check&login='+p_log,'550','120');
}

//zakladki w wyszukiwarce
function sea(e)
{
	var e = parseInt(e);
	for (i=1; i<=4; i++)
	{
		k = document.getElementById("z_"+i); //zakładka
		t = document.getElementById("t_"+i); //tabelka
		//wszystkie ustaw na nieaktywne
		k.setAttribute("class", "nact");
		k.setAttribute("className", "nact");
		t.style.display = "none";

		if (i==e) //kliknięty aktywny
		{
			k.setAttribute("class", "act");
			k.setAttribute("className", "act");
			t.style.display = "block";
		}
	}
}

//w zależnosci od wybranej wartosci pola select 1 pokaz odpowiedni select 2
function subsel(sel1)
{
	if (subtab)
	{
		main_op = document.getElementById(sel1).value; //glowny select 
		znikaj = "true";
		znikaj_p = document.getElementById('znikajPK');
		
		for (i=0; i<subtab.length; i++) //w petli sprawdz wszystkie divy z selectami - pokaz jeden wlasciwy
		{
			sub = "sub"+subtab[i];
			p = document.getElementById(sub);

			if (main_op == subtab[i]) {
			   p.style.display="inline";
         znikaj = "false";
      }
			else  {
			   p.style.display="none";
			}
		}
		if (znikaj == "true")
		 znikaj_p.style.display="none";
		else
		 znikaj_p.style.display="inline";
	}
}

//pokaż odpowiednie pola - wgrywanie plików CAD/PDF
function show()
{
	dc1 = document.getElementById('dec1');
	dc2 = document.getElementById('dec2');
	dp1 = document.getElementById('d1');
	dp2 = document.getElementById('d2');
	dp1.style.display = "none";
	dp2.style.display = "none";
	if (dc1.checked == true) dp1.style.display = "block";
	if (dc2.checked == true) dp2.style.display = "block";
}

//dodaj do ulubionych
function dodaj_ulubione(adres,tytul)
{
	//FireFox
	if (window.sidebar)
	{
		window.sidebar.addPanel(tytul, adres, "");
	}
	else if (window.external) //IE
	{
		window.external.AddFavorite(adres, tytul);
	}
	else if (window.opera && window.print)     //Opera
	{
		var a = document.createElement('a');
		a.setAttribute('href', adres); a.setAttribute('title', tytul);
		a.setAttribute('rel','sidebar'); a.click();
	}
}

//ustaw jako stronę startowa
function homepage(adres)
{
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(adres);
	}
	else
	{
		alert('Ta opcja działa tylko w Internet Explorer');
	}
}

//wpisane słowo przenies do google
function gotogoogle()
{
	w = document.getElementById('word').value;
	loaddoc('http://www.google.pl/search?hl=pl&btnG=Szukaj&q='+w);
}

//schowaj województwo
function hide()
{
	k = document.getElementById('kraj');
	w = document.getElementById('wo');
	if (k.value!='PL')
	w.style.display = "none";
	else
	w.style.display = "block";
}

//sprawdza zaznaczenie pol do utworzenia zipa
function send_zip()
{
	cad = document.formularz.elements['all_cad'].checked;
	pdf = document.formularz.elements['all_pdf'].checked;
	pho = document.formularz.elements['photo'].checked;
	if (cad!=true && pdf!=true && pho!=true)
	alert("Zaznacz, które rodzaje plików chcesz pobrać!");
	else
	document.formularz.submit();
}

