/** * DivPlus * A set of methods and properties that make divs easier to work with * Retains most compatability with DivTools, but DivPlus is preferred. * Creates the DivPlus constructor & methods, 5 divplus mouse handler global functions, * and the DivList global array which contains references to all DivPlus objects. * * @author john.bell@REMOVEME.umit.maine.edu * @version 1.06.20040825+20061106 * @uses defined.js * @uses sniff.js * * DivPlus divs are created using a three-step process that layers style properties on top * of each other in order to create a final set of properties for the div.  The first layer * loads default settings for all available properties.  The second (optional) layer reads  * a CSS style sheet and applies the properties set in it to the div.  The third layer * reads a passed associative array and applies its contents to the div. * * Layer 1:  DivPlus defaults * (DivPlus defaults will not be applied if you add {defaults: "no"} to the passed array. * This is not recommended, though, as it may break some DivPlus methods.  Use at your own risk. * You can also change the defaults by changing the value of the property in the array DivPlus.defaultStyle. * This only changes the defaults on new DivPlus objects, though, it is not retroactive.) * * fontFamily = "sans-serif"; * fontSize = "12px"; * fontVariant = "normal"; * fontWeight = "normal"; * backgroundColor = "transparent"; * backgroundImage = "none"; * backgroundPosition = "0% 0%"; * backgroundRepeat = "no-repeat"; * backgroundAttachment = "scroll"; * letterSpacing = "normal"; * lineHeight = "normal"; * textAlign = "left"; * textDecoration = "none"; * textIndent = "0px"; * textTransform = "none"; * verticalAlign = "baseline"; * wordSpacing = "normal"; * color = "rgb(0,0,0)"; * borderStyle = "solid"; * borderColor = "rgb(0,0,0)"; * borderWidth = "0px"; * margin = "0px 0px 0px 0px"; * padding = "0px 0px 0px 0px"; * clip = "rect(auto, auto, auto, auto)"; * listStyle = "disc outside none"; * clear = "none"; * cssFloat = "none"; (this defines cssFloat if Moz and styleFloat if IE) * position = "absolute"; * width = "auto"; * height = "auto"; * left = "auto"; * top = "auto"; * bottom = "auto"; * right = "auto"; * minHeight = "0px"; * zIndex = 1; * visibility = "visible"; * display = "block"; * overflow = "visible"; * whiteSpace = "nowrap"; * html = "<span style='font-size:1px;line-height:1px;'>&nbsp</span>"; * * --------- * * Layer 2: CSS style * * A CSS style class can be specified by adding the className property to the passed array. * This property should be a string with the full name of the style you wish to read. * ex. {className: "div.myClass"} or {className: ".myGlobalClass"} * * --------- * * Layer 3: Passed Property Array * * The only argument that the DivPlus constructor takes is an associative array with * the following (optional) properties:  * * defaults, as specified above * className, as specified above * * container				str			ID of the div which contains the div to be created.  If blank, assume body. * fontFamily				str			As CSS property * fontSize					int			Size of the font, in pixels * fontVariant				str			As CSS property * fontWeight				str			As CSS property * backgroundColor			arr			3 value array with decimal rgb values of the div background color * backgroundImage			str			URL of the div background image * backgroundPosition		str			As CSS property * backgroundRepeat			str			As CSS property * backgroundAttachment		str			As CSS property * letterSpacing			str			As CSS property * lineHeight 				int			Size of the line height, in pixels * textAlign				str			As CSS property * textDecoration			str			As CSS property * textIndent				int			Indentation of text, in pixels * textTransform			str			As CSS property * verticalAlign			str			As CSS property * wordSpacing				str			As CSS property * color					arr			3 value array with decimal rgb values of the div text color * borderStyle				variable	The borderStyle property can be passed in two forms: *											- a string, which specifies the border style for all borders *											- an associative array, which specifies the top, left, right, *											  and bottom border styles individually.  If an array, any *											  sides not specified will be left as their defaults. * borderColor				variable	The borderColor property can be passed in two forms: *											- a single 3 value array with decimal rgb values for all borders *											- an associative array, which specifies the top, left, right, *											  and bottom border colors individually.  Each color is a 3 value *											  array with decimal rgb values for the specified side.  If an *											  array, any sides not specified will be left as their defaults. * borderWidth				variable	The borderWidth property can be passed in two forms: *											- an int, which is the width of all borders in pixels *											- an associative array, which specifies the width (in pixels) *											  of the top, left, right, and bottom borders individually.  If *											  an array, any sides not specified will be left as their defaults. * margin					variable	The margin property can be passed in two forms: *											- an int, which specifies the margin of all sides in pixels *											- an associative array, which specifies the margin (in pixels) *											  of the top, left, right, and bottom margins individually.  If *											  an array, any sides not specified will be left as their defaults. * padding					variable	The padding property can be passed in two forms: *											- an int, which specifies the padding of all sides in pixels *											- an associative array, which specifies the padding (in pixels) *											  of the top, left, right, and bottom sides individually.  If *											  an array, any sides not specified will be left as their defaults. * clipping					arr			An associative array containing the clipping dimensions of the div, in *											pixels.  If a side is not specified, then it is assumed to be auto. * listStyle				str			As CSS property * listStyleImage			str			URL of the image to use for the list style * listStylePosition		str			As CSS property * listStyleType			str			As CSS proeprty * clear					str			As CSS property * cssFloat					str			As CSS property.  This setting applies both to the W3C cssFloat property *											and the IE-specific styleFloat property. * position					str			As CSS property * width					int			Width of the div, in pixels * height					int			Height of the div, in pixels * left						int			Left of the div, in pixels * top						int			Top of the div, in pixels * bottom					int			Bottom of the div, in pixels * right					int			Right of the div, in pixels * minHeight				int			minHeight of the div, in pixels * zindex					int			z-index of the div  * visibility				str			As CSS property * display					str			As CSS property * overflow					variable	The overflow property can be passed in two forms: *											- a string, which sets overflow for both x any y dimensions *											- an associative array, which specifies the overflow in *											  the x and y dimensions seperately.  If an array, any dimension *											  not specified will be left as its default. * whiteSpace				str			As CSS property * cursor					str			Usually as CSS property, but setting cursor to 'pointer' will *											set the cursor as 'pointer' in Moz and 'hand' in IE * html						str			innerHTML of the div * registration				arr			Determines placement of the registration point of the div.  This is a two- *											value array, where the first value determines the vertical placement of the *											registration point and the second value determines the horizontal placement. *											Valid values for the vertical placement are "top", "middle", "bottom", and *											[absolute int].  Valid values for the horizontal placement are "left", *											"center", "right", and [absolute int].  For either axis, [absolute int] *											is measured relative to the top left corner of the div.  Default is *											[0,0] (the top left of the div). * makeFrom					str			Name of a div created elsewhere to use in making the DivPlus object.  The new  *											DivPlus object loads DivPlus defaults, applies the style class of the  *											original div, and then reads the rest of the passed properties normally.   *											Inherited or inline styles that used to be applied to the div are not applied. * onmouseup				str			Function call to be evaluated on mouseup on the div.  Note that since *											this is a string, variables can be passed to the function, unlike *											the normal onmouseup javascript property.  In addition to any  *											variables normally available in the scope of the function call, you can *											also pass the following variables in the function call which are *											defined at the time of the event: *												mousePosition	arr		associative array with x, y coordinates *																		of the mouse at the time of the event *												mouseX			int		x position of the mouse at the time of the event *												mouseY			int		y position of the mouse at the time of the event *												divPlusObject	obj		the DivPlus object from which the event originated *																		Since the function called on mouseup will be *																		without context, this provides a handle back to *																		the original object that is visible to the *																		function. * onmousedown				str			Function to be evaluated on mousedown on the div.  See onmouseup for more info. * onmouseover				str			Function to be evaluated on mouseover on the div.  See onmouseup for more info. * onmousemove				str			Function to be evaluated on mousemove on the div.  See onmouseup for more info. * onmouseout				str			Function to be evaluated on mouseout on the div.  See onmouseup for more info. * dragger					arr			Makes the created div draggable using DivPlusDragger.  dragger should be  *											an associative array with dragLimits (optional) and dragConstraints properties, *											as described in divplusdragger.js.  See divplusdragger.js for more info. * scroller					arr			Makes the created div into a scrolling window using DivPlusScroller.  scroller *											should be an associative array with scrollDirection, windowSize, and *											appearance properties as described in divplusscroller.js.  See *											divplusscroller.js for more info. * divType					variable	Defines the type of the div for use with the functions in divplustypes.js. *											If a string, the div is recorded as only a single type.  If an array,  *											the div is recorded as multiple types. *  * --------  * * @call		DivPlus({argument:value,argument:value...}) or DivPlus(myStyleArray); * @example		myDiv = new DivPlus({divID:'thisDiv',container:'mom',width:50,height:50,x:10,y:30}); *///divList is a global that keeps references to all DivPlus objects.divList = new Array();divListCounter = 0; function DivPlus(){	//DivTools->DivPlus argument translation	if(arguments.length==1){		var args = arguments[0];		if(!defined(args.divID)) args.divID = "DivPlus" + divListCounter;		//Can't use .length because																				//divList only contains objects!	} else {		var args = arguments[1];		args.divID = arguments[0];	}	divListCounter++;		this.objectID = args.divID;	divList[args.divID] = this;		if(defined(args.makeFrom)){		//Copying an existing div into a DivPlus		this.element = args.makeFrom;		if(!defined(this.element.id)) this.element.id = args.divID;		if(defined(args.container)) document.getElementById(args.container).appendChild(this.element);		//Load DivPlus defaults		if(!defined(args.defaults) || args.defaults=="yes") this.loadDefaultStyles(true);				//Load style sheet rules		if(defined(this.element.className)){			if(this.element.className.substr(0,1) == ".") this.loadStyleSheet(this.element.className);			else this.loadStyleSheet("div." + this.element.className);		}	} else {		//New div		this.element = document.createElement("div");		this.element.id = args.divID;		args.container ? document.getElementById(args.container).appendChild(this.element): document.body.appendChild(this.element);				//Load DivPlus defaults		if(!defined(args.defaults) || args.defaults=="yes") this.loadDefaultStyles();		//Load specified style sheet rules		if(defined(args.className)){			this.className = args.className;			this.loadStyleSheet(args.className);		}	}	//Set style property passed from style array	//Do not set the property if it is not specified	if(defined(args.fontFamily)) this.element.style.fontFamily = args.fontFamily;	if(defined(args.fontSize)) this.element.style.fontSize = args.fontSize + "px";	if(defined(args.fontVariant)) this.element.style.fontVariant = args.fontVariant;	if(defined(args.fontWeight)) this.element.style.fontWeight = args.fontWeight;		if(defined(args.backgroundColor)) this.element.style.backgroundColor = "rgb("+args.backgroundColor[0]+","+args.backgroundColor[1]+","+args.backgroundColor[2]+")";	if(defined(args.backgroundImage)) this.element.style.backgroundImage = "url("+args.backgroundImage+")";	if(defined(args.backgroundPosition)) this.element.style.backgroundPosition = args.backgroundPosition;	if(defined(args.backgroundRepeat)) this.element.style.backgroundRepeat = args.backgroundRepeat;	if(defined(args.backgroundAttachment)) this.element.style.backgroundAttachment = args.backgroundAttachment;		if(defined(args.letterSpacing)) this.element.style.letterSpacing = args.letterSpacing;	if(defined(args.lineHeight)) {		var lineHeightStr = args.lineHeight.toString();		if(lineHeightStr.charAt(lineHeightStr.length - 1) == '%') this.element.style.lineHeight = lineHeightStr;		else this.element.style.lineHeight = args.lineHeight + "px";	}	if(defined(args.textAlign)) this.element.style.textAlign = args.textAlign;	if(defined(args.textDecoration)) this.element.style.textDecoration = args.textDecoration;	if(defined(args.textIndent)) this.element.style.textIndent = args.textIndent + "px";	if(defined(args.textTransform)) this.element.style.textTransform = args.textTransform;	if(defined(args.verticalAlign)) this.element.style.verticalAlign = args.verticalAlign;	if(defined(args.wordSpacing)) this.element.style.wordSpacing = args.wordSpacing;	if(defined(args.color)) this.element.style.color = "rgb("+args.color[0]+","+args.color[1]+","+args.color[2]+")";	if(defined(args.borderStyle)){		if(defined(args.borderStyle)=="object"){			if(defined(args.borderStyle.bottom)) this.element.style.borderBottomStyle = args.borderStyle.bottom;			if(defined(args.borderStyle.left)) this.element.style.borderLeftStyle = args.borderStyle.left;			if(defined(args.borderStyle.right)) this.element.style.borderRightStyle = args.borderStyle.right;			if(defined(args.borderStyle.top)) this.element.style.borderTopStyle = args.borderStyle.top;		} else {			this.element.style.borderStyle = args.borderStyle;		}	}	if(defined(args.borderColor)){		if(defined(args.borderColor[0])!="number"){			if(defined(args.borderColor.bottom)) this.element.style.borderBottomColor = "rgb("+args.borderBottomColor[0]+","+args.borderBottomColor[1]+","+args.borderBottomColor[2]+")";			if(defined(args.borderColor.left)) this.element.style.borderLeftColor = "rgb("+args.borderLeftColor[0]+","+args.borderLeftColor[1]+","+args.borderLeftColor[2]+")";			if(defined(args.borderColor.right)) this.element.style.borderRightColor = "rgb("+args.borderRightColor[0]+","+args.borderRightColor[1]+","+args.borderRightColor[2]+")";			if(defined(args.borderColor.top)) this.element.style.borderTopColor = "rgb("+args.borderTopColor[0]+","+args.borderTopColor[1]+","+args.borderTopColor[2]+")";		} else {			this.element.style.borderColor = "rgb("+args.borderColor[0]+","+args.borderColor[1]+","+args.borderColor[2]+")";		}	}	if(defined(args.borderWidth)){		if(defined(args.borderWidth)=="object"){			if(defined(args.borderWidth.bottom)) this.element.style.borderBottomWidth = args.borderWidth.bottom + "px";			if(defined(args.borderWidth.left)) this.element.style.borderLeftWidth = args.borderWidth.left + "px";			if(defined(args.borderWidth.right)) this.element.style.borderRightWidth = args.borderWidth.right + "px";			if(defined(args.borderWidth.top)) this.element.style.borderTopWidth = args.borderWidth.top + "px";		} else {			this.element.style.borderWidth = args.borderWidth + "px";		}	}	if(defined(args.margin)){		if(defined(args.margin)=="object"){			if(defined(args.margin.bottom)) this.element.style.marginBottom = args.margin.bottom + "px";			if(defined(args.margin.left)) this.element.style.marginLeft = args.margin.left + "px";			if(defined(args.margin.right)) this.element.style.marginRight = args.margin.right + "px";			if(defined(args.margin.top)) this.element.style.marginTop = args.margin.top + "px";		} else {			var marginString = args.margin+"px "+args.margin+"px "+args.margin+"px "+args.margin+"px";			this.element.style.margin = marginString;		}	}	if(defined(args.padding)){		if(defined(args.padding)=="object"){			if(defined(args.padding.bottom)) this.element.style.paddingBottom = args.padding.bottom + "px";			if(defined(args.padding.left)) this.element.style.paddingLeft = args.padding.left + "px";			if(defined(args.padding.right)) this.element.style.paddingRight = args.padding.right + "px";			if(defined(args.padding.top)) this.element.style.paddingTop = args.padding.top + "px";		} else {			var paddingString = args.padding+"px "+args.padding+"px "+args.padding+"px "+args.padding+"px";			this.element.style.padding = paddingString;		}	}			if(defined(args.clipping)){		var clipping = new Array();		clipping.top = args.clipping.top=="auto" ? "auto" : args.clipping.top + "px";		clipping.right = args.clipping.right=="auto" ? "auto" : args.clipping.right + "px";		clipping.left = args.clipping.left=="auto" ? "auto" : args.clipping.left + "px";		clipping.bottom = args.clipping.bottom=="auto" ? "auto" : args.clipping.bottom + "px";		this.element.style.clip = "rect("+clipping["top"]+","+clipping["right"]+","+clipping["bottom"]+","+clipping["left"]+")";	}	if(defined(args.listStyle)) this.element.style.listStyle = args.listStyle;	if(defined(args.listStyleImage)) this.element.style.listStyleImage = "url("+args.listStyleImage+")";	if(defined(args.listStylePosition)) this.element.style.listStylePosition = args.listStylePosition;	if(defined(args.listStyleType)) this.element.style.listStyleType = args.listStyleType;		if(defined(args.clear)) this.element.style.clear = args.clear;	if(defined(args.cssFloat)){		if(browsers.ie) this.element.style.styleFloat = args.cssFloat;		else this.element.style.cssFloat = args.cssFloat;	}	if(defined(args.position)) this.element.style.position = args.position;	if(defined(args.width)) {		var widthString = args.width.toString();		if(widthString.charAt(widthString.length - 1) == '%') this.element.style.width = widthString;		else this.element.style.width = args.width + "px";	}	if(defined(args.height)) {		var heightString = args.height.toString();		if(heightString.charAt(heightString.length - 1) == '%') this.element.style.height = heightString;		else this.element.style.height = args.height + "px";	}		if(defined(args.left)) {		var leftString = args.left.toString();		if(leftString.charAt(leftString.length - 1) == '%') this.element.style.left = leftString;		else this.element.style.left = args.left + "px";	}	if(defined(args.top)) {		var topString = args.top.toString();		if(topString.charAt(topString.length - 1) == '%') this.element.style.top = topString;		else this.element.style.top = args.top + "px";	}		if(defined(args.bottom)) this.element.style.bottom = args.bottom + "px";	if(defined(args.right)) this.element.style.right = args.right + "px";	if(defined(args.minHeight)) this.element.style.minHeight = args.minHeight + "px";	if(defined(args.zindex)) this.element.style.zIndex = args.zindex;	if(defined(args.visibility)) this.element.style.visibility = args.visibility;	if(defined(args.display)) this.element.style.display = args.display;	if(defined(args.overflow)){		if(defined(args.overflow)=="object"){			if(defined(args.overflow.x)) this.element.style.overflowX = args.overflow.x;			if(defined(args.overflow.y)) this.element.style.overflowY = args.overflow.y;		} else {			this.element.style.overflow = args.overflow;		}	}	if(defined(args.whiteSpace)) this.element.style.whiteSpace = args.whiteSpace;		if(defined(args.opacity)){		if(browsers.ie) {this.element.style.filter="alpha(opacity="+(args.opacity * 100)+")";}		else this.element.style.opacity = args.opacity;	}	if(defined(args.cursor)){		if(args.cursor = "pointer"){			if(browsers.ie) this.element.style.cursor = "hand";			else if (browsers.ns6) this.element.style.cursor = "pointer";		} else {			this.element.style.cursor = args.cursor;		}	}	if(defined(args.html)) this.element.innerHTML = args.html;		//Initialize registration point	if(defined(args.registration)) this.registration = args.registration;	else this.registration = [0,0];	//Set mouse event handlers and function strings		if(defined(args.onmouseup)){		this.onmouseup = args.onmouseup;	 	this.element.onmouseup = divplus_mouseupHandler;	}	if(defined(args.onmousedown)){		this.onmousedown = args.onmousedown; 		this.element.onmousedown = divplus_mousedownHandler;			}	if(defined(args.onmouseover)){			this.onmouseover = args.onmouseover;		this.element.onmouseover = divplus_mouseoverHandler;	}	if(defined(args.onmousemove)){		this.onmousemove = args.onmousemove;		this.element.onmousemove = divplus_mousemoveHandler;	}	if(defined(args.onmouseout)){		this.onmouseout = args.onmouseout;	 	this.element.onmouseout = divplus_mouseoutHandler; 	} 		this.pathStep = 0;	this.pathType = defined(args.pathType) ? args.pathType : "linear";	this.path = defined(args.path) ? args.path : new Array();		//Accessory setup	//Allows invocation of a divplus accessory in the original DivPlus call	//Make sure that you've included the appropriate .js files.		//DivPlusDragger	if(defined(args.dragger)){		if(defined(args.dragger.dragLimits)) new DivPlusDragger(this, args.dragger.dragConstraints, args.dragger.dragLimits);		else new DivPlusDragger(this, args.dragger.dragConstraints);	}		//DivPlusScroller	if(defined(args.scroller)){		new DivPlusScroller(this, args.scroller.scrollDirection, args.scroller.windowSize, args.scroller.appearance);	}		//DivPlusTypes	this.typeArray = new Array();	if(defined(args.divType)) this.addType(args.divType);}/** * DivPlus.defaults * * Array which defines the default behaviors of DivPlus functions * * getType:  "standard" or "calculated".  If "standard", get* functions which take the  *           getType argument will by default return values from the Javascript style *           array.  If "calculated", they return the calculated style values instead. */DivPlus.defaults = {	getType: "standard"}/** * DivPlus.defaultStyle *  * Array containing the default values of DivPlus divs. */DivPlus.defaultStyle = { 	fontFamily:"sans-serif",	fontSize: "12px",	fontVariant: "normal",	fontWeight: "normal",		backgroundColor: "transparent",	backgroundImage: "none",	backgroundPosition: "0% 0%",	backgroundRepeat: "no-repeat",	backgroundAttachment: "scroll",		letterSpacing: "normal",	lineHeight: "normal",	textAlign: "left",	textDecoration: "none",	textIndent: "0px",	textTransform: "none",	verticalAlign: "baseline",	wordSpacing: "normal",	color: "rgb(0,0,0)",	borderStyle: "solid",	borderColor: "rgb(0,0,0)",	borderWidth: "0px",	margin: "0px 0px 0px 0px",	padding: "0px 0px 0px 0px",	clip: "rect(auto, auto, auto, auto)",	listStyle: "disc outside none",	clear: "none",	cssFloat: "none",	position: "absolute",	width: "auto",	height: "auto",	left: "auto",	top: "auto",	bottom: "auto",	right: "auto",	minHeight: "0px",	zIndex: 1,	visibility: "visible",	display: "block",	overflow: "visible",	whiteSpace: "nowrap",	html: "<span style='font-size:1px;line-height:1px;'>&nbsp</span>"};/** * DivPlus.destroy * * Removes the div from the DOM tree and deletes the DivPlus object * * @argument	divPlusObject	obj		The DivPlus object to be deleted */DivPlus.destroy = function(divPlusObject){	divPlusObject.element.parentNode.removeChild(divPlusObject.element);	delete divPlusObject;	return false;}/** * DivPlus.detach * * Removes and returns the div from the DOM tree but does not delete the DivPlus object * * @argument	divPlusObject	obj		The DivPlus object containing the div to be removed * @returns the DOM object removed from the tree */DivPlus.detach = function(divPlusObject){	divPlusObject.element.parentNode.removeChild(divPlusObject.element);	return divPlusObject.element;}/** * DivPlus.attach * * Attaches the DivPlus objects div element to the DOM tree * * @argument	divPlusObject	obj		DivPlus object containing the div * @argument	parentNode		str		ID of the parent node.  Leave blank for body. */DivPlus.attach = function(divPlusObject, parentNode){	if(parentNode=="") document.body.appendChild(divPlusObject.element);	else document.getElementById(parentNode).appendChild(divPlusObject.element);}/** * DivPlus.loadDefaultStyles * * Sets styles explicitly so they can be accessed in Javascript * whether they are just the defaults or not.  Note that * DivPlus defaults are not necessarily the standard HTML/CSS defaults. * * @argument	copy		bool	If true, the div is being copied, so don't set innerHTML */DivPlus.prototype.loadDefaultStyles = function(copy){	for(property in DivPlus.defaultStyle){		if(property=="html" && !copy) this.element.innerHTML = DivPlus.defaultStyle[property];		else if(property=="cssFloat"){			if(browsers.ie) this.element.style.styleFloat = DivPlus.defaultStyle[property];			else this.element.style.cssFloat = DivPlus.defaultStyle[property];		}		else this.element.style[property] = DivPlus.defaultStyle[property];	}}/** * DivPlus.loadStyleSheet * * Applies any style rules defined in the passed style sheet to the div * * @argument	sheetName	str		Complete name of the style sheet. */DivPlus.prototype.loadStyleSheet = function(sheetName){	var styleSheet = browsers.readStyleSheet(sheetName);		//Set style properties from the style sheet	for(styleProperty in styleSheet){		this.element.style[styleProperty] = styleSheet[styleProperty];	}}/** * DivPlus.clone copy constructor * * Clones the DOM node of the DivPlus object, then creates a new DivPlus * object with id [divID].  Note that while this function clones all of the * DOM nodes underneath the DivPlus div, it only creates a DivPlus object * from the top-level node.  Any child nodes that need to be DivPlus objects should * be converted using DivPlus's makeFrom property. * * @argument	divID		str			ID of the new div to be created (optional) DivPlus.prototype.clone = function(divID){	//Clone DOM node	var newNode = this.element.cloneNode(true);	if(!defined(divID)) newNode.id = "DivPlus" + divListCounter;	else newNode.id = divID;	this.element.parentNode.appendChild(newNode);	var styleArray = {makeFrom:newNode};	if(defined(this.className)) styleArray.className = this.className;	var newDiv = new DivPlus(styleArray);		//Reconstruct DivPlus object	newDiv.registration = this.registration;	if(defined(this.onmouseup)){		newDiv.onmouseup = this.onmouseup;	 	newDiv.element.onmouseup = divplus_mouseupHandler;	}	if(defined(this.onmousedown)){		newDiv.onmousedown = this.onmousedown; 		newDiv.element.onmousedown = divplus_mousedownHandler;			}	if(defined(this.onmouseover)){			newDiv.onmouseover = this.onmouseover;		newDiv.element.onmouseover = divplus_mouseoverHandler;	}	if(defined(this.onmousemove)){		newDiv.onmousemove = this.onmousemove;		newDiv.element.onmousemove = divplus_mousemoveHandler;	}	if(defined(this.onmouseout)){		newDiv.onmouseout = this.onmouseout;	 	newDiv.element.onmouseout = divplus_mouseoutHandler; 	} 	if(defined(this.dragger)) new DivPlusDragger(newDiv, this.dragger.dragConstraints, this.dragger.dragLimits);	if(defined(this.scroller)) new DivPlusScroller(newDiv, this.scroller.scrollDirection, this.scroller.windowSize, this.scroller.appearance);	newDiv.setType(this.getType()); 			return newNode;}*//** * DivPlus.copy copy constructor * Copies the div it is called from to a new div * Note that this does not copy the children of the div, only * the div itself * * @argument	newDiv	ID of the new DivPlus to be made * @returns the new DivPlus, as an object * * depreciated DivTools method.  Do not use. */DivPlus.prototype.copy = function(newDiv){	var args = new Array();	args.container = this.getParentID();	args.width = this.getWidth();	args.height = this.getHeight();	args.left = this.getLeft();	args.top = this.getTop();	args.backgroundColor = this.getBackgroundColor();	args.border = this.getBorderWidth();	args.borderStyle = this.getBorderStyle();	args.borderColor = this.getBorderColor();	args.zindex = this.getZIndex();	args.backgroundImage = this.getBackgroundImage();	args.clipping = this.getClipping();	args.display = this.getDisplay();	args.visibility = this.getVisibility();	args.position = this.getPosition();	args.html = this.getHTML();	args.onmouseup = this.onmouseup;	args.onmousedown = this.onmousedown;	args.onmouseover = this.onmouseover;	args.onmousemove = this.onmousemove;	return new DivPlus(newDiv,args);}/** * DivPlus.getHTML accessor * Returns the HTML code within the div * * @returns .innerHTML of the div as a string */DivPlus.prototype.getHTML = function(){	return this.element.innerHTML;}/** * DivPlus.getParentID accessor * Returns the id of the container object of the div * * @returns ID string of the container object of the div */DivPlus.prototype.getParentID = function(){	return this.element.parentNode.id;}/** * DivPlus.getTop accessor * Returns the distance from the top of the div to the top of the * container object as an integer. * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns value of .style.top or calculated top as an integer, or "auto" if auto. */DivPlus.prototype.getTop = function(){	var getType = defined(arguments[0])? arguments[0] : DivPlus.defaults.getType;	if(getType=="calculated") return parseInt(browsers.calculatedStyle(this.element, "top"));	else return this.element.style.top=="auto" ? "auto" : parseInt(this.element.style.top);}/** * DivPlus.getLeft accessor * Returns the distance from the left of the div to the left * of the container object as an integer.   * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns value of .style.left or calculated left as an integer, or "auto" if auto. */DivPlus.prototype.getLeft = function(){	var getType = defined(arguments[0]) ? arguments[0] : DivPlus.defaults.getType;	if(getType=="calculated") return parseInt(browsers.calculatedStyle(this.element, "left"));	else return this.element.style.left=="auto" ? "auto" : parseInt(this.element.style.left);}/** * DivPlus.getRight accessor * Returns the distance from the right of the div to the right * of the container object as an integer.   * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns value of .style.right or calculated right as an integer, or "auto" if auto. */DivPlus.prototype.getRight = function(){	var getType = defined(arguments[0]) ? arguments[0] : DivPlus.defaults.getType;	if(getType=="calculated") return parseInt(browsers.calculatedStyle(this.element, "right"));	else return this.element.style.right=="auto" ? "auto" : parseInt(this.element.style.right);}/** * DivPlus.getLocation accessor * Returns an array with the top and left position of the * div in pixels, as integers. * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns values of .getTop() and .getLeft() in an associative array */DivPlus.prototype.getLocation = function(){	if(defined(arguments[0])) return {top:this.getTop(arguments[0]),left:this.getLeft(arguments[0])};	else return {top:this.getTop(),left:this.getLeft()};}/** * DivPlus.getHeight accessor * Returns the height of the div as an integer.   * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns value of .style.height or calculated height as an integer, or "auto" if auto. */DivPlus.prototype.getHeight = function(){	var getType = defined(arguments[0])? arguments[0] : DivPlus.defaults.getType;	if(getType=="calculated") return parseInt(browsers.calculatedStyle(this.element, "height"));	else return this.element.style.height=="auto" ? "auto" : parseInt(this.element.style.height);}/** * DivPlus.getWidth accessor * Returns the width of the div as an integer.   * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns value of .style.width or calculated width as an integer, or "auto" if auto. */DivPlus.prototype.getWidth = function(){	var getType = defined(arguments[0])? arguments[0] : DivPlus.defaults.getType;	if(getType=="calculated") return parseInt(browsers.calculatedStyle(this.element, "width"));	else return this.element.style.width=="auto" ? "auto" : parseInt(this.element.style.width);}/** * DivPlus.getSize accessor * Returns the height and width of the div in an associative array, as integers * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns values of .getHeight() and .getWidth() in an associative array */DivPlus.prototype.getSize = function(){	if(defined(arguments[0])) return {height:this.getHeight(arguments[0]), width:this.getWidth(arguments[0])};	else return {height:this.getHeight(),width:this.getWidth()};}/** * DivPlus.getBackgroundColor accessor * Returns the background color of the div as an RGB array * * @returns 3 value array of red, green, and blue decimal values */DivPlus.prototype.getBackgroundColor = function(){	if(this.element.style.backgroundColor=="transparent") return "transparent";	var right = this.element.style.backgroundColor.split("(");	var left = right[1].split(")");	var colors = left[0].split(",");	return [colors[0],colors[1],colors[2]];}/****************************************************************** * DivPlus.getBorderWidth accessor * Returns the width of the divs border in pixels as an integer. * If border widths are set individually, returns an array of  * border width values. * * @argument	getType	str		Optional.  Sets get mode as per getType default, *                              but for this call only. * * @returns value of .style.borderWidth as an integer or associative array, or "auto" *          Note that if getType is "calculated", this can only return an array */DivPlus.prototype.getBorderWidth = function(){	var getType = defined(arguments[0]) ? arguments[0] : DivPlus.defaults.getType;	var borderWidthArray = new Array();	var elementStyle = this.element.style;	if(getType=="calculated"){		browserWidthArray.left = parseInt(browsers.calculatedStyle(this.element, "borderLeftWidth"));		browserWidthArray.right = parseInt(browsers.calculatedStyle(this.element, "borderRightWidth"));		browserWidthArray.top = parseInt(browsers.calculatedStyle(this.element, "borderTopWidth"));		browserWidthArray.bottom = parseInt(browsers.calculatedStyle(this.element, "borderBottomWidth"));		return browserWidthArray;	} else if (!defined(elementStyle.borderLeftWidth) && !defined(elementStyle.borderBottomWidth) && !defined(elementStyle.borderRightWidth) &&!defined(elementStyle.borderTopWidth)){		return parseInt(this.element.style.borderWidth);	} else {		browserWidthArray.left = parseInt(browsers.calculatedStyle(this.element, "borderLeftWidth"));		browserWidthArray.right = parseInt(browsers.calculatedStyle(this.element, "borderRightWidth"));		browserWidthArray.top = parseInt(browsers.calculatedStyle(this.element, "borderTopWidth"));		browserWidthArray.bottom = parseInt(browsers.calculatedStyle(this.element, "borderBottomWidth"));		return browserWidthArray;			}	}/** * DivPlus.getBorderStyle accessor * Returns the border style of the div * * @returns value of .style.borderStyle as a string */DivPlus.prototype.getBorderStyle = function(){	var borderStyleArray = new Array();	browserStyleArray.left = browsers.calculatedStyle(this.element, "border-left-style");	browserStyleArray.top = browsers.calculatedStyle(this.element, "border-top-style");	browserStyleArray.right = browsers.calculatedStyle(this.element, "border-right-style");	browserStyleArray.bottom = browsers.calculatedStyle(this.element, "border-bottom-style");	return browserStyleArray;}/** * DivPlus.getBorderColor accessor * Returns the border color of the div as an RGB array * * @returns 3 value array of red, green, and blue decimal values */DivPlus.prototype.getBorderColor = function(){	var borderColorArray = new Array();	var sides = ["top", "left", "right", "bottom"];	for(var i=0; i<sides.length; i++){		var color = browsers.calculatedStyle(this.element, "border-"+sides[i]+"-color");		if(color=="transparent") borderColorArray[sides[i]] = "transparent";		else{			var right = color.split("(");			var left = right[1].split(")");			var colors = left[0].split(",");			borderColorArray[sides[i]] = [colors[0],colors[1],colors[2]];		}	}	return borderColorArray;}/** * DivPlus.getColor accessor * Returns the text color of the div as an RGB array * * @returns 3 value array of red, green, and blue decimal values */DivPlus.prototype.getColor = function(){	var color = browsers.calculatedStyle(this.element, "color");	if(color=="transparent") return "transparent";	var right = color.split("(");	var left = right[1].split(")");	var colors = left[0].split(",");	return [colors[0],colors[1],colors[2]];}/** * DivPlus.getZIndex accessor * Returns the div's z-index * * @returns .style.zIndex of the div as an integer */DivPlus.prototype.getZIndex = function(){	return browsers.calculatedStyle(this.element, "zIndex");}/** * DivPlus.getPosition accessor * Returns the current positioning type * * @returns .style.position of the div */DivPlus.prototype.getPosition = function(){	return browsers.calculatedStyle(this.element, "position");}/** * DivPlus.getClipping accessor * Returns the clipping rectangle for the div * * @returns a 4 value array with the clipping values for * each edge of the clipping rectangle */DivPlus.prototype.getClipping = function(){	var rawClipping = browsers.calculatedStyle(this.element, "clip");	var right = rawClipping.split("(");	var left = right[1].split(")");	var clipping = left[0].split(" ");	var clipArray = new Array();	clipArray["top"] = clipping[0].slice(0,4)=="auto" ? "auto" : parseInt(clipping[0]);	clipArray["right"] = clipping[1].slice(0,4)=="auto" ? "auto" : parseInt(clipping[1]);	clipArray["bottom"] = clipping[2].slice(0,4)=="auto" ? "auto" : parseInt(clipping[2]);	clipArray["left"] = clipping[3].slice(0,4)=="auto" ? "auto" : parseInt(clipping[3]);	return clipArray;}/** * DivPlus.getMargin accessor * Returns the margins for the div * * @returns a 4 value array with the margins of the div */DivPlus.prototype.getMargin = function(){	var rawMargin = browsers.calculatedStyle(this.element, "margin");	var splitArray = rawMargin.split(" ");	var marginArray = new Array();	marginArray.top = parseInt(splitArray[0]);	marginArray.right = parseInt(splitArray[1]);	marginArray.bottom = parseInt(splitArray[2]);	marginArray.left = parseInt(splitArray[3]);	return marginArray;}/** * DivPlus.getPadding accessor * Returns the padding for the div * * @returns a 4 value array with the padding of the div */DivPlus.prototype.getPadding = function(){	if(defined(this.element.style.padding.split(" ")[1])){		var splitArray = this.element.style.padding.split(" ");		var paddingArray = new Array();		paddingArray.top = parseInt(splitArray[0]);		paddingArray.right = parseInt(splitArray[1]);		paddingArray.bottom = parseInt(splitArray[2]);		paddingArray.left = parseInt(splitArray[3]);		return paddingArray;	} else {		var paddingArray = new Array();		paddingArray.top = parseInt(this.element.style.padding);		paddingArray.right = parseInt(this.element.style.padding);		paddingArray.bottom = parseInt(this.element.style.padding);		paddingArray.left = parseInt(this.element.style.padding);		return paddingArray;	}}/** * DivPlus.getVisibility accessor * Returns the visibility of the div * * @returns string containing the value of .style.visibility */DivPlus.prototype.getVisibility = function(){	return this.element.style.visibility;}/** * DivPlus.getDisplay accessor * Returns the display of the div * * @returns string containing the value of .style.display */DivPlus.prototype.getDisplay = function(){	return this.element.style.display;}/** * DivPlus.getBackgroundImage accessor * Returns the URI currently specified as the background image of the div * * @returns the URI for the background image of the div */DivPlus.prototype.getBackgroundImage = function(){	var right = this.element.style.backgroundImage.split("(");	var left = right[1].split(")");	return left[0];}/** * DivPlus.getOverflow accessor * Returns the overflow value of the div * * @returns string containing the value of .style.overflow */DivPlus.prototype.getOverflow = function(){	return this.element.style.overflow;}/** * DivPlus.getCoordinates * Returns the calculated coordinates of the registration point * * @returns x,y array with the coordinates of the div's registration point */DivPlus.prototype.getCoordinates = function(){	var coords = new Array();	switch(this.registration[0]){		case 'top':		coords.y = this.getTop();									break;		case 'bottom':	coords.y = this.getTop() + this.getHeight();				break;		case 'middle':	coords.y = this.getTop() + parseInt(this.getHeight() / 2);	break;		default: coords.y = this.getTop() + this.registration[0];	}	switch(this.registration[1]){		case 'left':	coords.x = this.getLeft();									break;		case 'right':	coords.x = this.getLeft() + this.getWidth();				break;		case 'center':	coords.x = this.getLeft() + parseInt(this.getWidth() / 2);	break;		default: coords.x = this.getLeft() + this.registration[1];	}	return coords;}/** * DivPlus.setContainer mutator * Sets the container object of the div * * @argument	containerNode	str		The name of the DOM object you wish to be the new container */DivPlus.prototype.setContainer = function(containerNode){	document.getElementById(containerNode).appendChild(this.element);}/** * DivPlus.setHTML mutator * Sets the HTML code within the div * * @argument	html	String of HTML code to be placed in the div */DivPlus.prototype.setHTML = function(html){	this.element.innerHTML = html;}/** * DivPlus.setTop mutator * Sets .style.top of the div and tells you how much it changed * * @argument	top		number of pixels from the top of *						the container object to set the top *						of the div * @returns number of pixels moved vertically */DivPlus.prototype.setTop = function(top){	var oldTop = this.getTop();	this.element.style.top = top + "px";	return top - oldTop;}/** * DivPlus.setLeft mutator * Sets .style.left of the div and tells you how much it changed * * @argument	left	number of pixels from the left of *						the container object to set the left *						of the div * @returns number of pixels moved horizontally */DivPlus.prototype.setLeft = function(left){	var oldLeft = this.getLeft();	this.element.style.left = left + "px";	return left - oldLeft;}/** * DivPlus.setRight mutator * Sets .style.right of the div and tells you how much it changed * * @argument	right	number of pixels from the right of *						the container object to set the right *						of the div * @returns number of pixels moved horizontally */DivPlus.prototype.setRight = function(right){	var oldRight = this.getRight();	this.element.style.right = right + "px";	return right - oldRight;}/** * DivPlus.setLocation mutator * Moves a div to new top,left coordinates * * @argument	top		number of pixels from the top of *						the container object to set the top *						of the div * @argument	left	number of pixels from the left of *						the container object to set the left *						of the div * @returns array with the number of pixels moved vertically, horizontally */DivPlus.prototype.setLocation = function(top, left){	var leftDifference = this.setLeft(left);	var topDifference = this.setTop(top);	return {top:topDifference,left:leftDifference};}/** * DivPlus.setCoordinates mutator * Moves a div to new x,y coordinates using the registration point * * @argument	x	int		x coordinate of the registration point * @argument	y	int		y coordinate of the registration point * * @returns x, y array with the number of pixels moved vertically and horizontally */DivPlus.prototype.setCoordinates = function(x, y){	var oldCoords = this.getCoordinates();	var oldLocation = this.getLocation();	var xOffset = oldCoords.x - oldLocation.left;	var yOffset = oldCoords.y - oldLocation.top;	var newLocation = this.setLocation(y - yOffset, x - xOffset);	return [newLocation.left, newLocation.top];}/** * DivPlus.setWidth mutator * Sets .style.width of the div and tells you how much it changed * * @argument	width	new width of the div, in pixels * @returns difference between new width and old width */DivPlus.prototype.setWidth = function(width){	if(width=="auto"){		var oldWidth = this.getWidth();		this.element.style.width = "auto";		return oldWidth;	} else {		var oldWidth = this.getWidth();		this.element.style.width = width + "px";		return oldWidth=="auto" ? "auto" : width - oldWidth;	}}/** * DivPlus.setHeight mutator * Sets .style.height of the div and tells you how much it changed * * @argument	height	new height of the div, in pixels * @returns difference between new height and old height */DivPlus.prototype.setHeight = function(height){	if(height=="auto"){		var oldHeight = this.getHeight();		this.element.style.height = "auto";		return oldHeight;	} else {		var oldHeight = this.getHeight();		this.element.style.height = height + "px";		return oldHeight=="auto" ? "auto" : height - oldHeight;	}}/** * DivPlus.setSize mutator * Sets .style.height and .style.width of the div and tells you * how much it changed * * @argument	height	new height of the div, in pixels * @argument	width	new width of the div, in pixels * @returns array with the change in height, width in pixels */DivPlus.prototype.setSize = function(height, width){	var heightDifference = this.setHeight(height);	var widthDifference = this.setWidth(width);	return {height:heightDifference,width:widthDifference};}/** * DivPlus.setBackgroundColor mutator * Sets the background color of the div and tells you how much it changed * * @argument	color	array containing decimal red, green, and blue *						values of new background color for the div * @returns array with the amount each value changed */DivPlus.prototype.setBackgroundColor = function(color){	if(color=="transparent"){		this.element.style.backgroundColor = "transparent";		return "transparent";	}	var oldColor = this.getBackgroundColor()=="transparent" ? [0,0,0] : this.getBackgroundColor();	this.element.style.backgroundColor = "rgb("+color[0]+","+color[1]+","+color[2]+")";	return oldColor=="transparent" ? "transparent" :		[color[0]-oldColor[0],color[1]-oldColor[1],color[2]-oldColor[2]];}/** * DivPlus.setColor mutator * Sets the text color of the div and tells you how much it changed * * @argument	color	array containing decimal red, green, and blue *						values of new text color for the div * @returns array with the amount each value changed */DivPlus.prototype.setColor = function(color){	if(color=="transparent"){		this.element.style.color = "transparent";		return "transparent";	}	var oldColor = this.getColor()=="transparent" ? [0,0,0] : this.getColor();	this.element.style.color = "rgb("+color[0]+","+color[1]+","+color[2]+")";	return oldColor=="transparent" ? "transparent" :		[color[0]-oldColor[0],color[1]-oldColor[1],color[2]-oldColor[2]];}/** * DivPlus.setBorderWidth mutator * Sets a new border width and tell you how much it has changed * * @argument	border	width to set the border to, in pixels * @returns difference in pixels between the new and old border widths */DivPlus.prototype.setBorderWidth = function(border){	var oldBorder = this.getBorderWidth();	this.element.style.borderWidth = border + "px";	return border - oldBorder;}/** * DivPlus.setBorderStyle mutator * Sets a new border style * * @argument	style	string with the new border style */DivPlus.prototype.setBorderStyle = function(style){	this.element.style.borderStyle = style;}/** * DivPlus.setBorderColor mutator * Sets a new border color and tells you how much it has changed * * @argument	color	array containing decimal red, green, and blue *						values of new background color for the div * @returns array with the amount each value changed */DivPlus.prototype.setBorderColor = function(color){	if(color=="transparent"){		this.element.style.borderColor = "transparent";		return "transparent";	}	var oldColor = this.getBorderColor()=="transparent" ? [0,0,0] : this.getBorderColor();;	this.element.style.borderColor = "rgb("+color[0]+","+color[1]+","+color[2]+")";	return oldColor=="transparent" ? "transparent" :		[color[0]-oldColor[0],color[1]-oldColor[1],color[2]-oldColor[2]];}/** * DivPlus.setBorder mutator * Sets the border width, style, and color of a div * * @argument	width	New border width, in pixels * @argument	style	String of the new border style * @argument	color	array containing decimal red, green, and blue *						values of new background color for the div * @returns 2 value array containing how much the width and color changed */DivPlus.prototype.setBorder = function(width, style, color){	var widthChange = this.setBorderWidth(width);	this.setBorderStyle(style);	var colorChange = this.setBorderColor(color);	return {width:widthChange,color:colorChange};}/** * DivPlus.setZIndex mutator * Sets the div's z-index * * @argument	z	z-index of the div */DivPlus.prototype.setZIndex = function(z){	this.element.style.zIndex = z;}/** * DivPlus.setVisibility mutator * Sets the div's visibility * * @argument	visibility	visibility of the div */DivPlus.prototype.setVisibility = function(visibility){	this.element.style.visibility = visibility;}/** * DivPlus.setDisplay mutator * Sets the div's display * * @argument	display		display of the div */DivPlus.prototype.setDisplay = function(display){	this.element.style.display = display;}/** * DivPlus.setOverflow mutator * Sets the div's overflow * * @argument	overflow	overflow of the div */DivPlus.prototype.setOverflow = function(overflow){	this.element.style.overflow = overflow;}/** * DivPlus.setBackgroundImage mutator * Sets the div's background image and returns the old image URI * * @argument	URI		URI of the background image to be used * @returns URI of the old background image */DivPlus.prototype.setBackgroundImage = function(URI){	oldBackgroundImage = this.getBackgroundImage();	this.element.style.backgroundImage = "url("+URI+")";	return oldBackgroundImage;}/** * DivPlus.setClipping mutator * Sets the clipping rectangle for the div, and returns the amount * each side changed * * @argument	clipArray	4 value associative array containing the *							top, left, right, and bottom clipping values * @returns a 4 value associative array containing how much each clipping *          value changed */DivPlus.prototype.setClipping = function(clipArray){	var oldClipArray = this.getClipping();	var clipping = new Array();	clipping[0] = clipArray["top"]=="auto" ? "auto" : clipArray["top"] + "px";	clipping[1] = clipArray["right"]=="auto" ? "auto" : clipArray["right"] + "px";	clipping[2] = clipArray["bottom"]=="auto" ? "auto" : clipArray["bottom"] + "px";	clipping[3] = clipArray["left"]=="auto" ? "auto" : clipArray["left"] + "px";	this.element.style.clip = "rect("+clipping[0]+","+clipping[1]+","+clipping[2]+","+clipping[3]+")";	var returnArray = new Array();	returnArray["top"] = clipArray["top"]=="auto" || oldClipArray["top"]=="auto" ? "auto" :		clipArray["top"] - oldClipArray["top"];	returnArray["right"] = clipArray["right"]=="auto" || oldClipArray["right"]=="auto" ? "auto" :		clipArray["right"] - oldClipArray["right"];	returnArray["left"] = clipArray["left"]=="auto" || oldClipArray["left"]=="auto" ? "auto" :		clipArray["left"] - oldClipArray["left"];	returnArray["bottom"] = clipArray["bottom"]=="auto" || oldClipArray["bottom"]=="auto" ? "auto" :		clipArray["bottom"] - oldClipArray["bottom"];	return returnArray;}/** * DivPlus.xMove mutator * Moves the div xShift pixels horizontally relative to its current location * and returns the new absolute left position * * @argument	xShift	Number of pixels to move in the x axis * @returns new .style.left of the div */DivPlus.prototype.xMove = function(xShift){	this.setLeft(this.getLeft() + xShift);	return this.getLeft();}/** * DivPlus.yMove mutator * Moves the div yShift pixels vertically relative to its current location * and returns the new absolute top position * * @argument	yShift	Number of pixels to move in the y axis * @returns new .style.top of the div */DivPlus.prototype.yMove = function(yShift){	this.setTop(this.getTop() + yShift);	return this.getTop();}/** * DivPlus.move mutator * Moves the div xShift pixels horizontally and yShift pixels vertically * relative to its current location and returns an array containing the * new absolute position * * @argument	xShift	Number of pixels to move in the x axis * @argument	yShift	Number of pixels to move in the y axis * @returns array with new .style.top, .style.left of the div */DivPlus.prototype.move = function(xShift, yShift){	this.setLeft(this.getLeft() + xShift);	this.setTop(this.getTop() + yShift);	return {left:this.getLeft(),top:this.getTop()};}/** * DivPlus.hMorph mutator * Changes the height of the div by hShift pixels relative to its * current height and returns the new height in pixels * * @argument	hShift	Number of pixels to change the height by * @returns new .style.height of the div */DivPlus.prototype.hMorph = function(hShift){	if(this.getHeight()=="auto") {alert("hMorph failure: old height was auto"); return 0;}	this.setHeight(this.getHeight() + hShift);	return this.getHeight();}/** * DivPlus.wMorph mutator * Changes the width of the div by wShift pixels relative to its * current width and returns the new width in pixels * * @argument	wShift	Number of pixels to change the width by * @returns new .style.width of the div */DivPlus.prototype.wMorph = function(wShift){	if(this.getWidth()=="auto") {alert("wMorph failure: old width was auto"); return 0;}	this.setWidth(this.getWidth() + wShift)	return this.getWidth();}/** * DivPlus.morph mutator * Changes the width and height of the div by wShift and hShift * pixels relative to its current size and returns the new * width, height in pixels in an array * * @argument	wShift	Number of pixels to change the width by * @argument	hShift	Number of pixels to change the height by * @returns array with the new .style.width, .style.height of the div */DivPlus.prototype.morph = function(wShift, hShift){	this.setWidth(this.getWidth() + wShift);	this.setHeight(this.getHeight() + hShift);	return {width:this.getWidth(),height:this.getHeight()};}/** * DivPlus.zFloat mutator * Moves the div along the z axis by zShift layers relative * to its current position * * @argument	zShift	Number of layers to move * @returns new z-index of the div */DivPlus.prototype.zFloat = function(zShift){	this.setZIndex(this.getZIndex() + zShift);	return this.getZIndex();}/** * DivPlus.writeLine mutator * Add a line of text to the innerHTML of the div * The line ends with a <br> * * @argument	newText	string of text to be added */DivPlus.prototype.writeLine = function(newText){	this.setHTML(this.getHTML() + newText + "<br>");}function divplus_mouseupHandler(e){	var mousePosition = browsers.mousePosition(e);	var mouseX = mousePosition.x;	var mouseY = mousePosition.y;	var divPlusObject = divList[this.id];	var func = divList[this.id].onmouseup;	return eval(func);}function divplus_mousedownHandler(e){	var mousePosition = browsers.mousePosition(e);	var mouseX = mousePosition.x;	var mouseY = mousePosition.y;	var divPlusObject = divList[this.id];		var func = divList[this.id].onmousedown;	return eval(func);}function divplus_mouseoverHandler(e){	var mousePosition = browsers.mousePosition(e);	var mouseX = mousePosition.x;	var mouseY = mousePosition.y;	var divPlusObject = divList[this.id];	var func = divList[this.id].onmouseover;	return eval(func);}function divplus_mouseoutHandler(e){	var mousePosition = browsers.mousePosition(e);	var mouseX = mousePosition.x;	var mouseY = mousePosition.y;	var divPlusObject = divList[this.id];	var func = divList[this.id].onmouseout;	return eval(func);}function divplus_mousemoveHandler(e){	var mousePosition = browsers.mousePosition(e);	var mouseX = mousePosition.x;	var mouseY = mousePosition.y;	var divPlusObject = divList[this.id];	var func = divList[this.id].onmousemove;	return eval(func);}DivPlus.prototype.pathControl = function(state,time){	if(state=="on") this.iterate = setInterval("divList['"+this.objectID+"'].pathAnimation()",time);	else clearInterval(this.iterate);	return;}DivPlus.prototype.pathAnimation = function(){	this.pathStep++;	if(this.path.length==this.pathStep){		switch(this.pathType){			case 'loop':		this.pathStep=0;				break;			case 'bounce':		this.path.reverse();								this.pathStep=1;				break;			default:			this.pathControl("off",0);								this.pathStep=0;								return;		}	}	this.setLocation(this.path[this.pathStep].y,this.path[this.pathStep].x);	return;}DivPlus.prototype.setPath = function(type,pathArray){	this.pathType = type;	this.path = pathArray;	return;}DivPlus.prototype.appendPath = function(pathArray){	for(i=0; i<pathArray.length; i++){		this.path.push(pathArray[i]);	}	return;}