
var oldOnload = window.onload;
var isClosed = false;
var margin_width = 170;
var margin_height = 10;
var pop_timer = null;

function scrollpop(){
	isBody = document.body;
	divBG = document.getElementById( 'ptop2' );

	divBG.style.top = ( getScrollTop() +  margin_height) + 'px';
	divBG.style.left = (getWindowWidth() - margin_width) + 'px';
	
	if(isClosed){
		divBG.style.display = 'none';
		clearTimeout(pop_timer);
	}
	else{
		pop_timer = setTimeout( "scrollpop()", 50 );
	}
}

var isNetscape = navigator.appName.indexOf("Netscape")!= -1;
var isBody = document.body;

function getWindowHeight(){
	if( typeof window.innerHeight == 'number' ){
		var winH = window.innerHeight;
		if( window.scrollMaxX > 0 ){
			winH -= 17;
		}
		return winH;
	}
	else if ( document.documentElement.clientHeight){
		return document.documentElement.clientHeight;
	}
	else if( typeof document.body.clientHeight == 'number' ){
		return document.body.clientHeight;
	}
}

function getWindowWidth(){
	if( typeof window.innerWidth == 'number' ){
		var winW = window.innerWidth;
		if( window.scrollMaxY > 0 ){
			winW -= 17;
		}
		return winW;
	}
	else if ( document.documentElement.clientWidth ){
		return document.documentElement.clientWidth;
	}
	else if( document.body && document.body.clientWidth ){
		return document.body.clientWidth;
	}
}

function getScrollLeft(){
	var posLeft = false;

	if( isNetscape ){
		posLeft = window.pageXOffset;
	}
	else if( document.documentElement && document.documentElement.scrollTop ){
		posLeft = document.documentElement.scrollLeft;
	}
	else if( isBody ){
		posLeft = document.body.scrollLeft;	
	}
	return typeof posLeft == 'number' ? posLeft : 0;
}

function getScrollTop(){
	var posTop = false;

	if (window.innerHeight){
		posTop = window.pageYOffset;
	}
	else if( document.documentElement && document.documentElement.scrollTop ){
		posTop = document.documentElement.scrollTop;
	}
	else if( isBody ){
		posTop = document.body.scrollTop;
	}
	return typeof posTop == 'number' ? posTop : 0;
}

window.onload = function(){	
		//scrollpop();				
		dyn2 = document.getElementById("dynamic2");
		if(dyn2){			
			dyn2.innerHTML = "<iframe width=\"100%\" height=\"200px\" scrolling=\"no\" frameborder=\"no\" src=\"http://www.videofotoamatoriali.com/adultadv.html\"></iframe>";
		}		
		dyn3 = document.getElementById("iframe2");
		if(dyn3){			
			dyn3.innerHTML = "<iframe src=\"http://tgp.AreaDiPorno.com/?account=wasterit&rev=yes&sites=2804|1&lang=it&revm=rev&tgpst=thmb&gtype=p_m&sort=last&nc=5&nr=2&t=_blank&cs=4&cttxt=0&bgc=000000&lc=000000&tsize=88x88&imgb=2\" width=\"484\" height=\"196\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>";
		}		
		oldOnload();
}

function setTimer(){
		setTimeout("isClosed=true",5000);
}

