var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
        var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck, movediv;

        if ( bNetscape4plus ) { // ³×Ã÷ÄÉÀÌÇÁ ¿ë ¼³Á¤
                yMenuFrom   = document["slide_right"].top;
                yMenuTo     = top.pageYOffset;		
        }
        else if ( bExplorer4plus ) {  // IE ¿ë ¼³Á¤
                yMenuFrom   = parseInt (slide_right.style.top , 10);
                yMenuTo     = document.body.scrollTop + 48;
        }

        timeoutNextCheck = 50;

        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus ) {
			//if (parseInt(nAdCornerOriginY)>(parseInt(document["slide_right"].top)+parseInt(document.body.innerHeight)) || yMenuTo<yMenuFrom) {
                        	document["slide_right"].top += yOffset;
			//}
		}
                else if ( bExplorer4plus ) {
//			if (yOffset >=(parseInt(slide_right.style.top) + parseInt(document.body.clientHeight)) || yMenuTo  yMenuFrom) {
	                        slide_right.style.top = parseInt (slide_right.style.top, 10) + yOffset;
//			}
		}
                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}


function Slide()
{
	var y;
	var scrWidth = screen.availWidth;
	var scrHeight = screen.availHeight;

	if (scrWidth>800 && scrHeight> 600) {
        // ÆäÀÌÁö ·Îµù½Ã Æ÷Áö¼Ç
        if ( bNetscape4plus ) {
          document["slide_right"].top = top.pageYOffset;
          document["slide_right"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
					slide_right.style.top = document.body.scrollTop + 48;
					//slide_right.style.top = 50;
          slide_right.style.visibility = "visible";
        }

				//alert(document.body.offsetHeight);
				//alert(document.body.scrollTop);

        //initializing UI update timer
        CheckUIElements();
        return true;
	} else {
		return false;
	}
}




function funcSwapImage(imageName, bHilite) {
// DUMB Netscape doesn't see img names if they're inside a <div which has an id
// if they're just in <div></div> - it's okay, but that's not the case :\
// Workaround (using layers) was provided by Kostya. Tnx man :)
        if ( bExplorer4plus ) {
                document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
        }
        else if ( bNetscape4plus ) {
                document.layers["shop"].document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
        }
        return false;
}
