
//siryo-------------------------------------------------------------------------------------

function getTopOffset() {
    if(document.all) {
	if(document.compatMode == "CSS1Compat")
	    return document.body.parentNode.scrollTop;
	else if(document.body.scrollTop)
	    return document.body.scrollTop;
	else
	    return 0;
    }
    else {
		return window.pageYOffset;
	}
}

function getWindowHeight() {
    if(window.innerHeight)
	return window.innerHeight;
    if(document.compatMode == "CSS1Compat")
	return document.body.parentNode.clientHeight;
    if(document.body.clientHeight)
	return document.body.clientHeight;	
}

function PIPUpdate(){
	
	// alert("test");
	
	if(document.getElementById("adPIP") != null){
		
		var top = parseInt((getWindowHeight() - 226) + getTopOffset());
		var ad = document.getElementById("adPIP");
		top = parseInt((getWindowHeight() - 226) + getTopOffset());
		
		elem = document.getElementById("container");
		if(document.all) {
			ad.style.pixelLeft = elem.offsetLeft + 200;
			ad.style.pixelTop = top;
		}else{
			ad.style.left = elem.offsetLeft + "px";
			ad.style.top  = top + "px";
		}
	}else{
		//alert("right=null");
	}
}
var timer;
window.onload   = PIPUpdate;	
window.onscroll = PIPUpdate;	
window.onresize = PIPUpdate;


