/*This code is the intelectual property of Mark Groseth (Silicon Solutions) and should 
  not be used without my permission.  mark@sisnet.biz, www.sisnet.biz
  
 Various functions for size, position, and text manipulation
 
 NOTEs: 
    Positioning
        Some of these functions have been converted to work with frames
        For positioning, pixel works for absolute AND relative in IE.
        If setting position with pixel then measure position with pixel because
	    offset results can vary
        With absolute, object and container can be same size.
        Absolute positioned elements have to be centered dynamically within their DIV element.  
        It is posible to use p align=center in a DIV if the contents are not absolute 
            positioned and the DIV width is specified
        object.style.top/left - works with NS & EI relative, NS & EI absolute if top/left 
            are set.   Will produce "" if not valid
		object.style.pixel[top/left] - top works with nothing? pixelLeft works with IE.
            Will produce 0 if not valid
            the top and pixelTop properties are equiv in IE but top contains text
            Use isIE test rather than pixelLeft test absolute
            use offsetTop rather than pixelTop test for relative
        object.offsetTop/Width  - works with NS & IE DIVs relative and absolute. 0 if not valid
            offsetWidth represents the div container width which, if not specified, is almost 
            as wide as the page
        object.clientTop/Width - works with IE DIVs absolute.  0 if not valid
    Changing text and color
        Netscape has some problems with changing style attributes that are assigned through
            the use of classes.  A div's style attributes may have to be located in the 
            div tag to manipulate them.
        Netscape requires the color in Hex for font tag, but uses rgb for the style, go figure.
        Netscape may recognize the style color in html, but not as a dhtml/jscript object.
            This means that you can use the style to set the color, but not to change it!
            However, you can change the font tag color in netscape
        Font color wins over span style color
        Includes and file references
        Including the findDOM.js file in the page is better than doing it here because you can 
            only include a file once, and you will need it for tools.js as well.
    Object Reference
        Both IE and NN/NS allow an image reference as document.imagename.  However,
	    the object produced may not return values for some basic attributes like width
	    and height in NN/NS.  This problem does not occure when the image is
	    referenced as an object like document.getelementbyid("imageID")
    Errors
	Javascript is very unforgiving.  One syntax error will cause everything to stop
	    working before anything starts working.
	'undefined' values can be tested for using the x == null test.
	Some very limited error handling is possible, see the findDOM.js file.	
 ------------------------------------------------------------------------------------*/

// Height of object in pixels
//   for absolute positioned block element, height is contained object height
//   for relative positioned block element, height is container object height
//   - for relative pass the contained object ie image object rather than
//     the container object ie DIV element
//   imageYN => pass in a 1 for an image object, 0 for other
function getObjHeight(objID, imageYN, frame) {
	if (frame != "" && frame != null) {
		//if (imageYN) obj = findDOMFrames(objID, frame, fdImage)
		obj = findDOMFrames(objID, frame, fdObject) }
	else {	
		//if (imageYN) obj = findDOM(objID,fdImage)
		obj = findDOM(objID,fdObject)  }
	// another IE option is obj.clientHeight for div element
	if (imageYN && obj.height) return obj.height;	//ie,ns image object
	if (obj.offsetHeight) return obj.offsetHeight;	//IE,NS - absolute*
	if (obj.clip.height) return obj.clip.height;	//NN
	return (null);
}

// Width of object in pixels
//   For absolute positioned block element, width is contained object width
//   For relative positioned block element, width is container object width 
//   - for relative pass the contained object ie image object rather than
//     the container object ie DIV element
function getObjWidth(objID, imageYN, frame) {
	if (frame != "" && frame != null) {
		if (frame == "parent") {
			obj = findDOMParent(objID, fdObject) }
		else {
			obj = findDOMFrames(objID, frame, fdObject) } }
	else {	
		obj = findDOM(objID,fdObject)  }
	// another IE option is obj.clientWidth for div element 
	if (imageYN && obj.width) return obj.width;		//ie,ns image object
	if (obj.offsetWidth) return obj.offsetWidth;	//IE,NS - absolute*
	if (obj.clip.width) return obj.clip.width;		//NN
	return (null);
}

// Left coordinate of a positionable object
function getObjLeft(objID, frame)  {
	if (frame != "" && frame != null) {
		if (frame == "parent") {
			obj = findDOMParent(objID, fdObject)
			objStyle = findDOMParent(objID, fdStyle) }
		else {
			obj = findDOMFrames(objID, frame, fdObject)
			objStyle = findDOMFrames(objID, frame, fdStyle) } }
	else {
		obj = findDOM(objID,fdObject)
		objStyle = findDOM(objID,fdStyle)  }
	if (isIE) {
		//if (objStyle.position.indexOf("relative") == -1) return objStyle.pixelLeft;
		return obj.offsetLeft }				//IE - relative and absolute
	else {
		//note that if the left & top parameters are actually 0 this will fail
		if (objStyle.left || objStyle.top) return parseInt(objStyle.left);	//NN
		if (obj.offsetLeft || obj.offsetTop) return obj.offsetLeft;			//NS - rel/abs
		return (null) }	
}

// Top coordinate of a positionable object
function getObjTop(objID, frame)  {
	if (frame != "" && frame != null) {
		if (frame == "parent") {
			obj = findDOMParent(objID, fdObject)
			objStyle = findDOMParent(objID, fdStyle) }
		else {
			obj = findDOMFrames(objID, frame, fdObject)
			objStyle = findDOMFrames(objID, frame, fdStyle) } }
	else {
		obj = findDOM(objID,fdObject)
		objStyle = findDOM(objID,fdStyle)  }
	if (isIE) {
		//if (objStyle.position.indexOf("relative") == -1) return objStyle.pixelTop;
		return obj.offsetTop }				//IE - relative and absolute
	else {
		//note that if the left & top parameters are actually 0 this will fail
		if (objStyle.left || objStyle.top) return parseInt(objStyle.top);		//NN
		if (obj.offsetTop || obj.offsetLeft) return obj.offsetTop;			//NS - rel/abs
		return (null) }
}

// Center coordinates of a positionable object, axis is 'X' or 'Y'
//   for absolute possitioned block element, width is contained width (imgObj = obj)
//   for relative possitioned block element, width is container object width 
//   this will also work for an image object
//   If there is no image object, pass "" to imgID
function getObjCenter(objID, imgID, axis, frame)  {
	if (frame != "" && frame != null) {
		obj = findDOMFrames(objID, frame, fdObject)
		objStyle = findDOMFrames(objID, frame, fdStyle) 
		if (imgID != "") imgObj = findDOMFrames(imgID, frame, fdObject)
		else imgObj = "" }
	else {
		obj = findDOM(objID,fdObject)
		objStyle = findDOM(objID,fdStyle)
		if (imgID != "") imgObj = findDOM(imgID,fdObject)
		else imgObj = "" }
	//note that if the left parameter is actually 0 this will fail
	var leftside = 0
	var topside = 0
	var width = 0
	var height = 0
	if (isIE) {
		if (axis == "X") leftside = obj.offsetLeft;
		else topside = obj.offsetTop }				//IE - rel/abs
	else {
		//note that if the left & top parameters are actually 0 this will fail
		if (objStyle.left || objStyle.top) { 
			if (axis == "X") leftside = parseInt(objStyle.left); 
			else topside = parseInt(objStyle.top) }		//NN
		else { 
			//note that if the left & top parameters are actually 0 this will fail
			if (obj.offsetLeft || obj.offsetTop) { 
				if (axis == "X") leftside = obj.offsetLeft;
				else  topside = obj.offsetTop }			//NS - rel/abs
			else return (null); } }
	if (imgObj.width) { 
		if (axis == "X") width = imgObj.width;			//IE, NS - image
		else height = imgObj.height }
	else { 
		// in case the object isn't an image
		if (obj.offsetWidth) {							//IE, NS - rel/abs
			if (axis == "X") width = obj.offsetWidth;
			else height = obj.offsetHeight }
		else { 
			if (obj.clip.width) {						//NN
				if (axis == "X") width = obj.clip.width;
				else height = obj.clip.height }
			else return (null) } }
	if (axis == "X") return (leftside + width/2);
	else return (topside + height/2)
}

// Width of browser window page space
// netscape supports a outerWidth property but IE has no equiv.
function getInsideWindowWidth() {
	if (window.innerWidth != null) return window.innerWidth; 
	if (document.body.clientWidth != null) return document.body.clientWidth;
	return (null);
}

// Width of browser window page space
// netscape supports a outerWidth property but IE has no equiv.
function getParentWindowWidth() {
	if (parent.innerWidth != null) return parent.innerWidth; 
	if (parent.document.body.clientWidth != null) return parent.document.body.clientWidth;
	return (null);
}

// Height of browser window page space
function getInsideWindowHeight() {
	if (window.innerHeight != null) return window.innerHeight; 
	if (document.body.clientHeight != null) return document.body.clientHeight;
	return (null);
}
            
// Width of screen
function getScreenWidth() {
	if (screen.availWidth) return screen.availWidth;
	return screen.width;
}

// Height of screen
function getScreenHeight() {
	if (screen.availHeight) return screen.availHeight;
	return screen.height;
}

// Auto Resize a window, resize only occurs if trigger violated.
//   The resizeTo parameters are for the windows OUTER measurements!
//   When passing the Maximize param use a string ie "false"
//   NOTE: due to IE limitations this function must use the 
//   INSIDE browser window size for calculations.  The result is
//   that space needed for toolbars, status bar, address bar and menus
//   is not accounted for.  IE uses about 155px horizontal for default setup.
//   NS uses more, and may include a SideBar feature that uses horizontal
//   space.
function autoResizeWindow(TriggerWidth, TriggerHeight, OuterWidth, OuterHeight, Maximize) {
	var newWidth, newHeight
	if (getInsideWindowWidth() < TriggerWidth || getInsideWindowHeight() < TriggerHeight) {  //>>
		if (Maximize == "true") {
			newWidth = getScreenWidth() 
			newHeight = getScreenHeight() }
		else {
			// check screen size
			if (OuterWidth + 10 > getScreenWidth()) {
				OuterWidth = getScreenWidth() - 10 }
			if (OuterHeight + 10 > getScreenHeight()) {
				OuterHeight = getScreenHeight() - 10 }
			newWidth = OuterWidth
			newHeight = OuterHeight }
		//alert("doing a resize; " + newWidth + ", " + newHeight)
		resizeTo(newWidth, newHeight)
		moveTo(0,0)
		// tell the user whether or not it worked
		if (Maximize == "true") {
			if (getInsideWindowWidth() < TriggerWidth || getInsideWindowHeight() < TriggerHeight) {  //>>
				return "false" }
			else {
				return "true" } }
		else return "true" }
	else return "true"
}

// Sets visibility to visible
function show(objID, frame) {
	if (frame != "" && frame != null) {
		if (frame == "parent") {
			objStyle = findDOMParent(objID,fdStyle) }
		else {
			objStyle = findDOMFrames(objID,frame,fdStyle) } }
	else objStyle = findDOM(objID,fdStyle)
	objStyle.visibility = "visible"
}

// Sets visibility to hidden
function hide(objID, frame) {
	if (frame != "" && frame != null) {
		if (frame == "parent") {
			objStyle = findDOMParent(objID,fdStyle) }
		else {
			objStyle = findDOMFrames(objID,frame,fdStyle) } }
	else objStyle = findDOM(objID,fdStyle)
	objStyle.visibility = "hidden"
}

// toggles the Display style for an element
// This fucntion toggles an element's display property between 'none' and 
// the supplied displayType variable.  It can be set to colapse all other
// element's in a supplied array an element IDs
// can be used in hyperlink like href="javascript:expandToggle('itemID','block')"
// display options are: 
//       block - line break before and after, like div
//       inline - no line breaks, like span
//       none - no visible and no place holder
function expandToggle(objID, displayStyle, colapseAll, IDarray) {
	objStyle = findDOM(objID,fdStyle)
	if (isSTD || isIE) {
		if (objStyle.display == displayStyle) {
			objStyle.display = "none"
			return false }
		else {
			if (colapseAll) {
				for (var i = 0; i < IDarray.length; i++) {
					removeElement(IDarray[i]) } }
			objStyle.display = displayStyle 
			return true } }
	else {
		// I'm not quite sure what this does
		destination = objID + ".html"
		self.location = destination }
	return
}

// remove an element
function removeElement(objID) {
	objStyle2 = findDOM(objID,fdStyle);
	if (isSTD || isIE) objStyle2.display = 'none';
	else {
		destination = objID + '.html';
		self.location = destination }
}

// set an element's display style
function setDisplay(objID, displayType) {
	objStyle2 = findDOM(objID,fdStyle);
	if (isSTD || isIE) objStyle2.display = displayType;
	else {
		destination = objID + '.html';
		self.location = destination }
}
	
// Position an object at a specific x,y location
//     some browsers won't allow negative values      
function shiftTo(objID, x, y, frame) {
	if (frame != "" && frame != null) {
		obj = findDOMFrames(objID, frame, fdObject)
		objStyle = findDOMFrames(objID, frame, 1) }
	else {
		obj = findDOM(objID,fdObject)
		objStyle = findDOM(objID,fdStyle)  }
	if (isSTD || isIE) {
		objStyle.left = Math.round(x);
		objStyle.top = Math.round(y) } 
	else {
		if (isLayers) objStyle.moveToAbsolute(Math.round(x),Math.round(y)) }
}

// Center an object on the page
function center(objID, frame) {
	if (frame != "" && frame != null) {
		obj = findDOMFrames(objID, frame, fdObject)
		objStyle = findDOMFrames(objID, frame, fdStyle) }
	else {
		obj = findDOM(objID,fdObject)
		objStyle = findDOM(objID,fdStyle)  }
	if (isSTD || isIE) {
		objStyle.left = (getInsideWindowWidth()/2 - obj.offsetWidth/2) }
}

// Move an object by x and/or y pixels
//   Note that for Netscape, if the block element's possition is relative
//   than it becomes relative to itself in the vertical direction
//   so that it's original offsetTop must be subtracted each time to 
//   it at the same vertical possition.
function shiftBy(objID, deltaX, deltaY, frame) {
	//note that if the top parameter is actually 0 this will fail
	if (frame != "" && frame != null) {
		obj = findDOMFrames(objID, frame, fdObject)
		objStyle = findDOMFrames(objID, frame, fdStyle) }
	else {
		obj = findDOM(objID,fdObject)
		objStyle = findDOM(objID,fdStyle)  }
	if (isSTD || isIE) {
		objStyle.left = Math.round(parseInt(objStyle.left) + deltaX);
		objStyle.top = Math.round(parseInt(objStyle.top) + deltaY) }
	else {
		obj.moveBy(Math.round(deltaX),Math.round(deltaY)) }
}

// Scroll a document in its window or frame
// an amount of 0 represents the non-scrolled possition
// Scrollbars don't have to be activated for this to work
// Scrolling will NOT go beyond content regardless of parameters used
function scrollDocTo(x,y) {
	if (isSTD || isIE) {
		document.body.scrollLeft = x
		document.body.scrollTop = y
		return }
	else {
		scrollTo(x,y)
		return }
}

// Scrolling Index Initial Stuff
// This method uses a hot spot.  You could use the findMouseXY functions instead.
// (ALL OF THIS GOES IN YOUR WEB PAGE) just remove the /**/
// put this is the body, some.gif can be nothing or a transparent gif
//<Div ID="ScrollMe" class=scrollers style="z-index:1; position: absolute; visibility: hidden; 
//background-color: yellow; or background-image: some.gif;	 top: 0px; left: 0px; width: 160px; 
//height: 25px" onMouseOver="scrollIndex()"></Div>
// DocHeight is tricky.  In IE you can use doc.body.scrollHeight.  In NN/NS there is 
// window.page[X|Y]offset, which is the amount scrolled off screen, but using scrollTo
// first to scroll to the bottem of the page doesn't update the pageYOffset property in
// NS6. DocHeight can be determind from the lowest element on the page, but the best bet
// is to just assign it, NO reliable script method exists to find it.
/*var ScrollPos = "Top"
var WinHeight
var DocHeight
var HotSpotHeight = 30
var objScroll
var objScrollStyle
window.onresize = positionScrollers
Your onload function() {
	WinHeight = getInsideWindowHeight()
	DocHeight = 385
	positionScroller()
}*/
// Scrolling INdex Function ONE
/*function positionScroller() {	*/
	// posistion the scrolling hot spots	
	// The window height function does not include border, padding or
	// scroll bar heights.
/*	if (DocHeight - 10 >= WinHeight) {	
		show("ScrollMe")
		if (ScrollPos == "Top") { 
			y = WinHeight - HotSpotHeight }
		else {
			y = DocHeight - WinHeight } 
 		shiftTo("ScrollMe", 1, y) }
 	else {
		hide("ScrollMe") }
}*/
// Scrolling Index Function TWO
/*function scrollIndex() {
	switch(ScrollPos) {
		case "Bottom":
			scrollDocTo(0,0)
			ScrollPos = "Top"
			break
		case "Top":
			y = DocHeight - WinHeight
			scrollDocTo(0,y)
			ScrollPos = "Bottom"
			break
		}
	positionScroller()
}*/

// Fade spanned text from one color to another, given RGB color values
//	variables must be static global to work in nested functions
//    this is necessary because in IE, setTimeout doesn't pass parameters to the 
//    function it calls (lame but true)
//    Netscape doesn't recognize the style.color DOM so you have to use the font tag color
//    Netscape prefers to get the color as a hex value when using the font tag
var fadeObj = new Object()
var fadeIntervalID = new Number()
var fadeColorArray = new Array()
var fadeI = new Number()
var fadeWaitTime = new Number()
var fadeDone = new Boolean()
function fadeRGB(objID, startR, startG, startB, endR, endG, endB, wait, shifts) {
	// put variables needed in other functions into static global variables
	fadeObj = findDOM(objID,fdObject)
	fadeWaitTime = wait
	fadeDone = false
	// first build a color array
	// NOTE, the math here will actually produce shifts+1 color shifts
	var incR, incG, incB, curR, curG, curB
	incR = (endR - startR)/shifts
	incG = (endG - startG)/shifts
	incB = (endB - startB)/shifts
	curR = startR
	curG = startG
	curB = startB
	for (fadeI = 1; fadeI <= shifts; fadeI++) {
		curR = Math.round(curR + incR);
		curG = Math.round(curG + incG);
		curB = Math.round(curB + incB);
		//fadeColorArray[fadeI] = "rgb(" + curR + ", " + curG + ", " + curB + ")" }
		fadeColorArray[fadeI] = "#" + decToHex(curR) + decToHex(curG) + decToHex(curB) }
	fadeI = 1
	fadeRGB2()
}
function fadeRGB2() {
	if (fadeI >= fadeColorArray.length) {
		clearTimeout(fadeIntervalID); 
		fadeDone = true }
	else {
		fadeObj.color = fadeColorArray[fadeI];
		fadeI += 1;
		fadeIntervalID = setTimeout("fadeRGB2()", fadeWaitTime) }
}

// Animate object, based on center of object
//   NOTE: for 'absolute' position (pos), use object width, for 'relative' 
//         position use image width.  For absolute position, Netscape
//         requires an adjustment.
var flyByIntID = new Number()
var flyByStartX = new Number()
var flyByStartY = new Number()
var flyByObjID = new String()
var flyByDone = new Boolean()
var flyByPos = new String()
var flyByDeltaX = new Number()
var flyByDeltaY = new Number()
var flyByMoves = new Number()
var flyByWait = new Number()
var flyByFrame = new String()
var flyByI = new Number()
function flyByCenter(objID, imgID, startX, startY, endX, endY, moves, wait) {
	objStyle = findDOM(objID,fdStyle)
	flyByObjID = objID
	flyByDone = false
	flyByMoves = moves
	flyByWait = wait
	flyByI = 0
	if (objStyle.position.indexOf("relative") == -1) flyByPos = "absolute";
	else flyByPos = "relative";
	if (endX == startX) flyByDeltaX = 0;
	else flyByDeltaX = (endX - startX)/moves;
	if (endY == startY) flyByDeltaY = 0;
	else flyByDeltaY = (endY - startY)/moves;
	// convert center to left and top for shiftTo function
	if (flyByPos == "relative") {
		startX -= Math.round(getObjWidth(imgID,1, "")/2)
		startY -= Math.round(getObjHeight(imgID,1, "")/2) }
	else {
		startX -= Math.round(getObjWidth(objID,0, "")/2)
		startY -= Math.round(getObjHeight(objID,0, "")/2) }
	if (objStyle.visibility = "visible") hide(objID, "")
	// Set initial position then show object
	shiftTo(objID, startX, startY, "")
	show(objID, "") 
	flyByCenter2()
}
function flyByCenter2() {
	// Move the object by x pixels until it's centered
	shiftBy(flyByObjID, flyByDeltaX, flyByDeltaY, "")
	if (flyByI >= flyByMoves) {
		clearTimeout(flyByIntID); 
		flyByDone = true }
	else {
		flyByI += 1;
		flyByIntID = setTimeout("flyByCenter2()",flyByWait) }
}
// this version is a perpetual loop from start to end beginning at init
function flyByCenterLoop(objID, imgID, startX, startY, initX, initY, endX, endY, moves, wait, frame) {
	flyByObjID = objID
	if (frame != "" && frame != null) objStyle = findDOMFrames(objID, frame, fdStyle)
	else objStyle = findDOM(objID,fdStyle)
	flyByStartX = startX
	flyByStartY = startY
	flyByMoves = moves
	flyByWait = wait
	flyByFrame = frame
	if (objStyle.position.indexOf("relative") == -1) flyByPos = "absolute";
	else flyByPos = "relative";
	flyByDeltaX = (endX - startX)/moves
	flyByDeltaY = (endY - startY)/moves
	flyByI = Math.round((initX - startX)/flyByDeltaX)
	if (flyByI == 0) flyByI = Math.round((initY - startY)/flyByDeltaY)
	if (flyByI < 0) flyByI = flyByI * -1
	// convert center to left and top for shiftTo function
	if (flyByPos == "relative") {
		flyByStartX -= Math.round(getObjWidth(imgID,1, frame)/2)
		flyByStartY -= Math.round(getObjHeight(imgID,1, frame)/2)
		initX -= Math.round(getObjWidth(imgID,1, frame)/2)
		initY -= Math.round(getObjHeight(imgID,1, frame)/2) }
	else {
		flyByStartX -= Math.round(getObjWidth(objID,0, frame)/2)
		flyByStartY -= Math.round(getObjHeight(objID,0, frame)/2)
		initX -= Math.round(getObjWidth(objID,0, frame)/2)
		initY -= Math.round(getObjHeight(objID,0, frame)/2) }
	if (objStyle.visibility = "visible") hide(objID, frame); 
	// Set initial position then show object
	shiftTo(objID, initX, initY, frame)
	show(objID, frame) 
	flyByIntID = setInterval("flyByCenterLoop2()",flyByWait)
}
function flyByCenterLoop2() {
	// Move the object to the left by x pixels until it's centered
	shiftBy(flyByObjID, flyByDeltaX, flyByDeltaY, flyByFrame)
	// the test uses the move count rather than the position
	// because the positions may never exactly match due to rounding errors
	if (flyByI >= flyByMoves) {
		shiftTo(flyByObjID, flyByStartX, flyByStartY, flyByFrame) 
		flyByI = 0 }
	else {
		flyByI += 1 }
}

// Change text each time page loads, gets text from array which can be in root doc,
// or in seperate js file.  inserts HTML into a DIV object.  A cookie is used to 
// keep track.  If not using cookies pass "" as cookieName
//     NOTE: netscape 6 supports innerHTML but not innerText, this won't work with
//           pre NS 6 browsers.
function dynamicLoadingText(objID, textArray, preHTML, postHTML, cookieName, durationDays) {
	var obj = findDOM(objID,fdObject)
	var textCount = findCookie(cookieName)
	if (textCount == "NoCookies" || textCount == "NoCookie") {
		saveCookie(cookieName, 0 ,durationDays)
		textCount = 0 }
	textCount = parseInt(textCount)
	obj.innerHTML = preHTML + textArray[textCount] + postHTML
	if (textCount + 1 < textArray.length) {
		textCount += 1 }
	else {
		textCount = 0 }
	if (cookieName != "") {
		saveCookie(cookieName, textCount, durationDays)  }
}

// Change text to that which is passed to the function.  inserts HTML into a DIV object.
//     NOTE: netscape 6 supports innerHTML but not innerText, this won't work with
//           pre NS 6 browsers.
function changeText(objID, newText, preHTML, postHTML) {
	obj = findDOM(objID,fdObject)
	obj.innerHTML = preHTML + newText + postHTML
}

// Find Mouse x coordinate
function findMouseX(MouseEvent) {
	if (isSTD || isIE) {
		return MouseEvent.x }
	else {
		return MouseEvent.pageX }
}
// Find Mouse y coordinate
function findMouseY(MouseEvent) {
	if (isSTD || isIE) {
		return MouseEvent.y }
	else {
		return MouseEvent.pageY }
}
