
function scrollImg(){
var posX,posY;
if (window.innerHeight) {
posX = window.pageXOffset;
posY = window.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop) {
posX = document.documentElement.scrollLeft;
posY = document.documentElement.scrollTop;
}
else if (document.body) {
posX = document.body.scrollLeft;
posY = document.body.scrollTop;
}
var ad=document.getElementById("ad");

var h=window.screen.height>768 ? 50 : 20;
var w=window.screen.width>1024 ? (window.screen.width>1279 ? 200 : 85):0;

ad.style.top=(posY+h)+"px";
if(window.screen.width>=1100){
	ad.style.left=(window.screen.width-120)+"px";
}else if(window.screen.width<1100){
	ad.style.left=(window.screen.width-80)+"px";
}

setTimeout("scrollImg()",100);
}
