﻿function item_frame(){
    if(document.getElementsByName("itemframeNM").height != "undefined"){
        if (navigator.appVersion.indexOf("Safari") > -1) {
            fh=itemframeID.document.body.scrollHeight;
        }else{
            fh=itemframeNM.document.body.scrollHeight;
        }    
        if(fh) document.getElementById("itemframeID").height=fh+30;
        if (document.getElementById("itemframeID").height<fh) setTimeout("item_frame()",100);
        if (document.getElementById("itemframeID").height=="") setTimeout("item_frame()",100);
    }else{
        setTimeout("item_frame()",100);
    }
}
window.onload = function() {
	var isIE = 0<=window.navigator.userAgent.indexOf("MSIE");
	if (isIE){
	    if(document.compatMode=="BackCompat"){
		    document.body.onscroll = ScrollEvent;
	    }else{
		    document.documentElement.onscroll = ScrollEvent;
	    }
	}else{
        window.onscroll = ScrollEvent;
	}
}
function ScrollEvent() {
    document.getElementById("hidScrollX").value = ScrPositionX();
    document.getElementById("hidScrollY").value = ScrPositionY();
}
function ScrPositionX(){
	var isIE = 0<=window.navigator.userAgent.indexOf("MSIE");
    if (isIE) {
        if (document.compatMode=="CSS1Compat"){
            return document.documentElement.scrollLeft;
        }else{
            return document.body.scrollLeft;
        }
    }else{
        return self.pageXOffset;
    }
}
function ScrPositionY(){
	var isIE = 0<=window.navigator.userAgent.indexOf("MSIE");
    if (isIE) {
        if (document.compatMode=="CSS1Compat"){
            return document.documentElement.scrollTop;
        }else{
            return document.body.scrollTop;
        }
    }else{
        return self.pageYOffset;
    }
}
function DefaultPosition(){
    document.getElementById('hidScrollX').value ='0';
    document.getElementById('hidScrollY').value ='0';
    return true;
}

