  
//<!--


var curr_menu = 0; 
var curr_li_num = 0; 
//funkcje do lewego menu na stronie głównej 
function getChild(startBrother) { 
var endBrother = startBrother.firstChild; 
while ( endBrother.nodeType != 1 ) { 
endBrother = endBrother.nextSibling; 
} 

return endBrother; 
}; 


function navToggle(id, lvl) { 
var div = document.getElementById(id); 

if ( div.style.display == "block" ) { 
div.style.display = "none"; 
} 
else { 
if ( typeof lvl != "undefined" && lvl == 2 ) { 
if ( curr_menu > 2 ) setTopPosHouseInfo(div); 
else { 
var fcdiv = getChild(div); //pozycja ruchomego prostokąta 
var cnum = setFieldPos(div); 
fcdiv.style.top = cnum * 17 + 1 + "px";
} 
} 
else { 
countSiblings(div); //ustawiamy pozycję drugiego poziomu menu 
} 
div.style.display = "block"; 
} 
}; 


function setFieldPos(div) { 
var fpd = div.parentNode; 
var spdn = fpd.parentNode.getElementsByTagName("LI"); 
var tempnum = 0; 
for ( i = 0; i < spdn.length; i++ ) { 
tempnum = i; 
if ( spdn[i] == fpd ) break; 
} 
return tempnum; 
}

function countSiblings(div) { 
var numb; 
var nav = div.id.substring(4,5) * 1; 
curr_menu = nav; 
if ( nav > 2 ) { 
numb = div.getElementsByTagName("LI"); 
curr_li_num = numb.length; 
setTopPos(div, nav, numb.length) 
} 
}; 


function setTopPos(div, pos, num) { 
var pos0 = (pos - 1) * 34; 
var count = (13 - 1) - 2 * (pos - 3); 
var nb = pos0 - (num - count) * 17; 
//alert(nb); 
if ( num > count ) div.style.top = nb + "px"; 
else div.style.top = pos0 + "px"; 
}; 



function setTopPosHouseInfo(div) { 
var count = (13 - 1) - 2 * (curr_menu - 3); 
var posT = 0; 
if ( curr_li_num <= count ) posT = (count - 13) * 17; 
else posT = (curr_li_num - 13) * 17; 
div.style.top = posT + "px"; 
var fcdiv = getChild(div); 
var cnum = setFieldPos(div); 
fcdiv.style.top = -1*posT + 1 + 17*cnum + "px";
} ;
/***********************/ 

//funkcja do menu na górze strony 
function navTopToggle(id) { 
var div = document.getElementById(id); 
par = div.parentNode.parentNode; 
numb = par.getElementsByTagName("LI"); 
//alert(numb.length); 
if ( div.style.display == "block" ) { 
if ( div.parentNode.className != "curr" && div.parentNode.className != "nocurr" ) div.style.display = "none"; 
for ( i = 0; i < numb.length; i++ ) { 
if ( numb[i].className == "nocurr" ) numb[i].className = "curr"; 
} 
} 
else { 
for ( i = 0; i < numb.length; i++ ) { 
if ( numb[i].className == "curr" ) numb[i].className = "nocurr"; 
} 
div.style.display = "block"; 
} 
} ;
/****************/ 

var t; 
function addTo(dis) { 
clearTimeout(t); 
if ( dis == "in" ) document.getElementById("add_to").style.display = "block"; 
if ( dis == "out" ) t = setTimeout("addOut()",3000); 
if ( dis == "off" ) addOut(); 
};
function addOut() { 
document.getElementById("add_to").style.display = "none"; 
};

function clearVal(id) { 
document.getElementById(id).value = ""; 
};

/********* popup ze zdjęciem z galerii ************/ 
function showBigImg(url) { 
// overlay 
var arrayPageSize = getPageSize(); 
var ov = document.getElementById("overlay"); 
ov.style.width = arrayPageSize[0] + 'px'; 
ov.style.height = arrayPageSize[1] + 'px'; 
ov.style.display = "block"; 
// zdjęcie 
var ph = document.getElementById("phcont"); 
//ph.innerHTML = "<img src='" + url + "' alt=''>"; 
var boxTop = 50; 
// FF 
if ( window.pageYOffset ) boxTop += window.pageYOffset; 
// IE 
else if ( document.documentElement ) boxTop += document.documentElement.scrollTop; 
else if ( document.body ) boxTop += document.body.scrollTop; 
//alert(boxTop); 
ph.style.top = boxTop + 'px'; 

ph.style.display = "block"; 
}; 
function hideBigImg() { 
document.getElementById("overlay").style.display = "none"; 
document.getElementById("phcont").style.display = "none"; 
//document.getElementById("phcont").innerHTML = ""; 
}; 

function getPageSize() { 

var xScroll, yScroll; 

if (window.innerHeight && window.scrollMaxY) { 
xScroll = window.innerWidth + window.scrollMaxX; 
yScroll = window.innerHeight + window.scrollMaxY; 
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 
xScroll = document.body.scrollWidth; 
yScroll = document.body.scrollHeight; 
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 
xScroll = document.body.offsetWidth; 
yScroll = document.body.offsetHeight; 
} 

var windowWidth, windowHeight; 

if (self.innerHeight) { // all except Explorer 
if(document.documentElement.clientWidth){ 
windowWidth = document.documentElement.clientWidth; 
} else { 
windowWidth = self.innerWidth; 
} 
windowHeight = self.innerHeight; 
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode 
windowWidth = document.documentElement.clientWidth; 
windowHeight = document.documentElement.clientHeight; 
} else if (document.body) { // other Explorers 
windowWidth = document.body.clientWidth; 
windowHeight = document.body.clientHeight; 
alert(windowHeight); 
} 

// for small pages with total height less then height of the viewport 
if(yScroll < windowHeight){ 
pageHeight = windowHeight; 
} else { 
pageHeight = yScroll; 
} 

// for small pages with total width less then width of the viewport 
if(xScroll < windowWidth){ 
pageWidth = xScroll; 
} else { 
pageWidth = windowWidth; 
} 

return [pageWidth,pageHeight]; 
}; 


function page_prev() 
{ 
if($('.wmc_nl2').children('.nl2a.on').prev().children().attr('href')) 
{location.href=$('.wmc_nl2').children('.nl2a.on').prev().children().attr('href');} 
}; 

function page_next() 
{ 
if($('.wmc_nl2').children('.nl2a.on').next().children().attr('href')) 
{location.href=$('.wmc_nl2').children('.nl2a.on').next().children().attr('href');} 
}; 

function check_page() 
{ 
if($('.wmc_nl2').children('.nl2a.on').next().children().attr('href')) 
{} 
else { 
$('.navnp').children('.arrd_r_small').css('display','none'); 
$('.navnp').children('.sep2').css('display','none'); 
} 
if($('.wmc_nl2').children('.nl2a.on').prev().children().attr('href')) 
{} 
else { 
$('.navnp').children('.arrd_l_small').css('display','none'); 
$('.navnp').children('.sep2').css('display','none'); 
} 

}; 


function schowek_add_page(id) 
{ 
var zm,gg,uj; 
var nazwa="#"+id; 
if($.cookie("danwood_schowek")) 
{ 
gg=$.cookie("danwood_schowek"); 
zm=gg.split(','); 
uj=jQuery.inArray(id.toString(),zm); 
if(uj!=-1) 
{} 
else { 
zm=zm+id+","; 

$.cookie("danwood_schowek", zm, {path: '/', expires: 7 }); 
$('#dodaj_schowek').html('Dodano do schowka'); 
$('#dodaj_schowek').attr('href','javascript:void(0)');} 
} 
else { 
zm=id+","; 
$.cookie("danwood_schowek", zm, {path: '/', expires: 7 }); 
$('#dodaj_schowek').html('Dodano do schowka'); 
$('#dodaj_schowek').attr('href','javascript:void(0)');
} 
show_nr(); 
}; 

function show_nr() 
{ 
var gg, zm; 
if($.cookie("danwood_schowek")) 
{ 
gg=$.cookie("danwood_schowek"); 
zm=gg.split(','); 
var d=zm.length-1; 
var err=" ( "+d+" )"; 
$("#schowek_id").html(err); 
} 
else 
{ 
var err=" ( 0 )"; 
$("#schowek_id").html(err); 
} 
}; 


function check_in_schowek(nr) 
{ 
var zm33 = new Array(); 
var nazw; 
var gg,jk; 
if($.cookie("danwood_schowek")) 
{ 

gg=$.cookie("danwood_schowek"); 

zm33=gg.split(','); 
for(jk=0; jk<zm33.length-1; jk++) 
{ 

if(nr==zm33[jk]) 
{ 
$('#dodaj_schowek').html('Dodano do schowka'); 
} 

} 

} 
else { } 
}; 


function sh_box(id) 
{ 
if(document.getElementById(id).style.display=='none') 
{ document.getElementById(id).style.display='block'; } 
else 
{document.getElementById(id).style.display='none';} 
};

$(document).ready(function () { 

social(); 
check_page(); 
}); 

function social() 
{ 
var title=$('title').html(); 
var zmienna='http://www.facebook.com/sharer.php?u='; 
zmienna+=location.href; 

$('#sp1_lnk').attr('href',zmienna); 

zmienna='http://twitter.com/home?status='; 
zmienna+=location.href; 
$('#sp2_lnk').attr('href',zmienna); 

zmienna='http://del.icio.us/post?url='; 
zmienna+=location.href; 
zmienna+='&title='+title; 
$('#sp3_lnk').attr('href',zmienna); 

zmienna='http://www.wykop.pl/dodaj?url='; 
zmienna+=location.href; 
zmienna+='&title='+title; 
$('#sp4_lnk').attr('href',zmienna); 

zmienna='http://nasza-klasa.pl/sledzik?shout='; 
zmienna+=location.href; 
$('#sp5_lnk').attr('href',zmienna); 


zmienna='http://blip.pl/dashboard?body='+title+'+'; 
zmienna+=location.href; 
$('#sp6_lnk').attr('href',zmienna); 

zmienna='http://flaker.pl/add2flaker.php?url='; 
zmienna+=location.href; 
zmienna+='&title='+title; 
$('#sp7_lnk').attr('href',zmienna); 

zmienna='http://www.google.com/reader/link?url='; 
zmienna+=location.href; 
zmienna+='&title='+title; 
$('#sp8_lnk').attr('href',zmienna); 

zmienna='http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='; 
zmienna+=location.href; 
zmienna+='&title='+title; 
$('#sp9_lnk').attr('href',zmienna); 

};
var global_link='/306.php';
function ShowPopup() { 
popup = window.open(global_link, 'popup', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width=450, height=393'); 
if (!popup.opener) 
popup.opener = self; 

popup.focus(); 
return false; 
};
//-->
