NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

document.all.v2.style.height = 0;

lastScrollY = 0;
var maxs = 0;
//if(IE) document.all.v2.style.visibility = "visible"; //if(NS) document.v2.visibility = "show";

function al(){

s =  parseInt(document.all.v2.style.height);
s += 178;
t = document.body.scrollTop;

alert ("wys= "+ s + ", diffY= "+ t)
};

function start(wm){
maxs = document.body.scrollHeight - (178 + wm + 175);
//alert(maxs);
if(IE) window.setInterval("turn_on()",1);
};

//funkcja przesuwajac warstwe
function turn_on() {
            if(IE) { 
					diffY = document.body.scrollTop; 
					s = parseInt(document.all.v2.style.height);
				   }
//            if(NS) { diffY = self.pageYOffset;}



                if(diffY != s + 148) {

                        percent = .2 * (diffY - (s + 148));
                        if(percent > 0) percent = Math.ceil(percent);
                        else percent = Math.floor(percent);
										
						ss = percent + s;
						if (ss < 0 ) document.all.v2.style.height = 0;
						else 
						if(IE && ss < maxs) document.all.v2.style.height = ss;

                       // lastScrollY = lastScrollY + percent;
            	}  	

}


