// JavaScript Document
<!--
var p_id = 0;
var poz_x = 0;

var szer_logo = 200;
var il_logo = 4;

var skok = 0; // nr skoku
var auto = null; // aut sko.

var chmurka;
var x = 0;
var ch_id = null;

var ie=(document.all)?true:false; 
var akt_top;
var zero = null;

var loading_vp = '<p style="color:#ccc">wczytywanie... [visualpromotion.pl]</p>';

function visual_ORY(nr) 
{
clearInterval(p_id);
clearInterval(auto);
auto_clear = 0;

if(nr>0)
skok++;
else if(skok>0)
skok--;

if(skok>il_logo-4) skok = il_logo-4;
p_id = setInterval("vpromotion("+skok+")", 15);
//mieszacz();
}

function visual(nr)
{
//if(auto_clear==0)
//{
clearInterval(p_id);
clearInterval(auto);
auto_clear = 0;


//if(nr>0)
//	skok++;
//else if(skok>0)
//	skok--;
//alert(cel);

poz_x = -cel;

if( nr==1 && cel < (il_logo-4)*szer_logo ) //
cel += 400;
else if( cel >0)
cel -= 400;

if(cel > (il_logo-4)*szer_logo) cel = (il_logo-4)*szer_logo-1;
if(cel < 0) cel =0;

//alert(cel);

//alert(cel);

//var gdzie = -cel;	
gdzie = cel;
p_id = setInterval("vpromotion("+gdzie+")", 15);
//}
}

var auto_clear = 0;
function vpromotion(l)
{
var przed = poz_x;
var po;

//poz_x = poz_x-(poz_x+(l*szer_logo)) / 15;
poz_x = poz_x-(poz_x+(l)) / 15;
document.getElementById('prze').style.left = Math.round(poz_x)+'px';

po = poz_x;
auto_clear++;
if(auto_clear>90)
{
clearInterval(p_id);
auto = setInterval("auto_sc()", 25);
auto_clear = 0;
}
//if(Math.abs(przed - po) < 1)
//clearInterval(zakladka_id);	

}
/*************************** vp **/
var r_id = 0;
var gdzie = 0;
var tmp_y = 0;



function vp_real(id)
{
//alert('OK');
for(i=0; i<3; i++)
{
if(id==i)
document.getElementById('img'+i).style.border = '1px solid #fff';
else
document.getElementById('img'+i).style.border = '1px solid #999';
}

clearInterval(r_id);
//254
gdzie = 254 * id;
r_id = setInterval("anim("+gdzie+")", 15);

}
function anim(poz_y)
{
//alert(poz_y);
tmp_y = tmp_y-(tmp_y+(poz_y)) / 8;
document.getElementById('real').style.top = Math.round(tmp_y)+'px';

}


function init()
{
document.getElementById('prze').style.width = (il_logo * szer_logo) + 'px';
//document.getElementById('img'+0).style.border = '1px solid #fff';
}
//init();



//var raz;

//<![CDATA[
function v_p(naz, url) {

//alert(url);
var req = null;
var displayId = 'init';
if (window.XMLHttpRequest) {//other than IE
try {
req = new XMLHttpRequest();
} catch (e) {
req = null;
}
} else if (window.ActiveXObject) {//IE
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
req = null;
}
}
}
var display = document.getElementById(displayId);
if (!display) {
//alert("staa");
return;
}
if (req != null) 
{			  						
req.onreadystatechange = function()
{
if (req.readyState == 4 && req.status == 200)
{	
//alert('4');						
display.innerHTML = req.responseText;

}
else display.innerHTML = loading_vp;
}
//url = url<10?'00'+url:'0'+url;

var linki = 'mod/gal_w_txt.php?url='+url+'&sg='+url;

//req.open('GET', url, true);
req.open('GET', linki, true);
req.send(null);


} else {
display.innerHTML =
"Wymagana obsługa języka JavaScript!";
}

if(raz==1)
{
if(ie) document.documentElement.scrollTop = 0; //ie
else document.body.scrollTop=0; //reszta
//zer = setInterval("zero()", 25);
for(i=1;i<=3;i++)
document.getElementById('inv_'+i).style.display = 'none';
}

raz = 0;

wywal ='';
for(i=1;i<=il_menu;i++)
{
tmp_i = i<10?'00'+i:'0'+i;
wywal += tmp_i + ' : ';
if(	tmp_i == url ){
document.getElementById('m_'+url).style.backgroundImage ="url(grafika/menu-on.jpg)";
//alert (tmp_i + '==' + url);
}
else
{
if(i%2 == 0)
document.getElementById('m_'+tmp_i).style.backgroundImage ="url(grafika/menu-1.jpg)";
else
document.getElementById("m_"+tmp_i).style.backgroundImage ="url(grafika/menu-0.jpg)";
}
}
//alert(wywal);



}
//]]>

function zero()
{
if(ie) 
{
//akt_top = akt_top-(akt_top-0) / 3;
document.documentElement.scrollTop = 0;
}
}


var ch_i = 0;
function vp_off()
{
ch_i = 0;
clearTimeout(ch_id);	
ch_id = setInterval("chmurka_poz(302)", 25);
}
function vp_on()
{
ch_i = 0;
clearTimeout(ch_id);
ch_id = setInterval("chmurka_poz(0)", 25);	
}
//function vp_zn()
//{
//	document.getElementById( 'slidepanel' ).style.display = 'none';
//}

function chmurka_poz(a)
{
x = x-(x+(a)) / 3;
tmp = -x;	
document.getElementById( 'slidepanel_content' ).style.left = Math.round(x)+'px';
ch_i++;
if(ch_i >50){
clearInterval(ch_id); ch_i=0;
}
}

-->
