/*********************************************************************
* EasyDyn.js - Cross-platform DHMTL object API                       *
*                                                                    *
* Copyright © 2000-2002, 5square Software                            * 
*     -- info@5squaresoftware.com  --                                *
*                                                                    *
* Non-commercial use of this software is free, provided this         *
* copyright notice remains in place.  For other uses, please         *
* contact 5square Software for licensing information.  Thanks.       *
*                                                                    *
* Version $Id$                                                       *
*                                                                    *
* Requires: Browser.js                                               *
*********************************************************************/



/********************************************************************
	handle resize bug
*********************************************************************/

function reLoad() {
	//location.reload(true);
	//return false;
	window.location = window.location;
}

if(client.isNN4Plus  && !client.isDOMBrowser && !client.isNN6){ 
	window.captureEvents(Event.RESIZE);
	window.onresize = reLoad;
}


/********************************************************************
	Construct EasyDyn object dynamically --
	You can  pass properties in as a convenience or, set them 
	afterwards. If you don't pass in an id, the object is
	not added to the allObjects array, and is not written by 
	the class method, writeAllEasyDynObjects().
*********************************************************************/

// TO DO : add  a more comprehensive list of 
// attributes you can set
// you have to add them here (defaults)
// and to the setHTML instance methods
 
function EasyDyn( id, winRef, text, visibility,
				 width,x, y, fontFamily, fontSize, fontWeight,
				  bgColor, color, borderColor,
				   borderWidth, borderStyle, padding){

	this.window = winRef || window;
	this.id = id || "";
	this.text = text || "";
	this.vis = visibility || 'hidden';
	this.width = width || "";
	this.x = x || "0";
	this.y = y || "0";
	this.fontFamily = fontFamily || "";
	this.fontSize = fontSize || "";
	this.fontWeight = fontWeight || "";
	this.bgColor = bgColor || "transparent";
	this.color = color || "";
	this.borderColor = borderColor || "";
	this.borderWidth = borderWidth || "";
	this.borderStyle = borderStyle || "";
	
	this.padding = padding || 2;//Navigator always adds 2 always
	
	/* if it's not just prototype assignment
	 * (i.e. it has an id)  add to array
	 */
	if (this.id) {
		if(!this.window.allObjects) this.window.allObjects = new Array();
		this.window.allObjects[this.window.allObjects.length] = this;
 	}
}


/********************************************************************
	construct EasyDyn object from an existing
	statically coded, positioned element. 
	# look out for memory leaks here #
*********************************************************************/
EasyDyn.EasyDynConverter = function(objId, winRef) {
	this.window = winRef || window;
	this.id = objId || '';
	if (this.id != '') {
		this.initElRef();
	}
}
EasyDyn.EasyDynConverter.prototype = new EasyDyn;


/********************************************************************
	write out the CSS/HTML for all DYNAMICALLY created 
	objects - can only write this to the main window
	so window specifications will be lost
*********************************************************************/

EasyDyn.writeAllEasyDynObjects = function(winRef){
	var writeWin = winRef || window;
	var htmlString = "";
	var styleString = "";
	for(var ao = 0; ao < writeWin.allObjects.length; ao++){
		writeWin.allObjects[ao].setHTML();
		if(writeWin.allObjects[ao].styleRule) styleString += writeWin.allObjects[ao].styleRule + '\n';
		htmlString += writeWin.allObjects[ao].HTML + '\n';
	}
	var styleSheet = '<style type="text/css">' + styleString + '</style>';
	//alert(htmlString)
	if(styleString) document.write(styleSheet);
	
	/*
	 * debug
	var newWin = window.open()
	newWin.document.open('text/plain');
	newWin.document.write(htmlString);
	newWin.document.close();
	*/
	
	document.write(htmlString);
	document.close();
	
	//get a handle on the HTML element
	for (ao = 0; ao < writeWin.allObjects.length; ao++){
		thisObject = writeWin.allObjects[ao];
		
		thisObject.initElRef();
		
		/*moved all the below into initElRef()
		
		if(client.isNN4Plus  && !client.isDOMBrowser && !client.isNN6){
			thisObject.layer = doc[thisObject.id];
		}
		if((client.isIE4Plus && !client.isDOMBrowser) || (client.isMacIE5)){
			thisObject.element = doc.all[thisObject.id];
			thisObject.style = thisObject.element.style;
		}
		if(client.isDOMBrowser && !client.isMacIE5){
			thisObject.element = doc.getElementById(thisObject.id);
			thisObject.style = thisObject.element.style;
		}
		*/
		
	}
}


/********************************************************************
	Methods that operate on the EasyDyn Objects
	And some Class methods. Different methods for 
	the three different DOM's.
*********************************************************************/

/* NAVIGATOR 4.x METHODS */

if(client.isNN4Plus  && !client.isDOMBrowser && !client.isNN6){
	
	//create the HTML string
	EasyDyn.prototype.setHTML = function() {
		this.styleString = "";
		this.styleString += '#' + this.id + '{position:absolute;';
		if(this.vis) this.styleString += 'visibility:' + this.vis + ';';
		if(this.width) this.styleString += 'width:' + this.width + ';';
		if(this.x) this.styleString += 'left:' + this.x + ';';
		if(this.y) this.styleString += 'top:' + this.y + ';';
		if(this.fontFamily) this.styleString += 'font-family:' + this.fontFamily + ';';
		if(this.fontSize) this.styleString += 'font-size:' + this.fontSize + 'px;';
		if(this.fontWeight) this.styleString += 'font-weight:' + this.fontWeight + ';';
		if(this.bgColor) this.styleString += 'layer-background-color:' + this.bgColor + ';';
		if(this.color) this.styleString += 'color:' + this.color + ';';
		if(this.borderColor) this.styleString += 'border-color: ' + this.borderColor + ';';
		if(this.borderWidth) this.styleString += 'border-width: ' + this.borderWidth + ';';
		if(this.borderStyle) this.styleString += 'border-style: ' + this.borderStyle + ';';
		if(this.padding && this.padding > 2) this.styleString += 'padding: ' + (this.padding - 2) + ';';
		this.styleString += ' }';
		this.styleRule = this.styleString;
		
		this.htmlString = '<div id="' + this.id + '">';
		this.htmlString += this.text;
		this.htmlString += '</div>'; 
		this.HTML = htmlString;
	}
	//get a handle on the HTML element
	EasyDyn.prototype.initElRef = function() { 
		this.layer = this.window.document[this.id];
	}
	
	EasyDyn.prototype.getElRef = function() { 
		return this.layer;
	}
	
	//physically write the HTML
	EasyDyn.prototype.writeHTML = function(){
		this.setHTML();
		var doc = this.window.document;
		var styleSheet = '<style type="text/css">' + this.styleRule + '</style>'; 
		doc.write(styleSheet);
		doc.write(this.HTML)
		
		this.initElRef();
	}
	
	

	//get background color
	EasyDyn.prototype.getBgColor = function () { return this.layer.bgColor; }		
	//get X (relative to containing layer)
	EasyDyn.prototype.getX = function () { return this.layer.left; }					
	//get Y (relative to containing layer)
	EasyDyn.prototype.getY = function () { return this.layer.top; }					
	//get page  X (relative to top document)
	//get width
	EasyDyn.prototype.getW = function () { return this.layer.clip.width; }			
	//get height
	EasyDyn.prototype.getH = function () { return this.layer.clip.height; }				
	//get Z-index
	EasyDyn.prototype.getZ = function () { return this.layer.zIndex; }				
	//get visibility
	EasyDyn.prototype.getVis = function () { return this.layer.visibility; }			
	
	//set background color
	EasyDyn.prototype.setBgColor = function (color) { this.layer.bgColor = color; }		
	//set X (relative to containing layer)
	EasyDyn.prototype.moveToX = function (X) { this.layer.left = X; }
	//set Y (relative to containing layer)
	EasyDyn.prototype.moveToY = function (Y) { this.layer.top = Y; }
	//set X,Y (relative to containing layer)
	EasyDyn.prototype.moveToXY = function (X,Y) { this.layer.moveTo(X,Y); }
	//move by delta X
	EasyDyn.prototype.moveByX = function (X) { this.layer.moveBy(X,0); }
	//move by delta Y
	EasyDyn.prototype.moveByY = function (Y) { this.layer.moveBy(0,Y); }
	//move by delta X,Y
	EasyDyn.prototype.moveByXY = function (X,Y) { this.layer.moveBy(X,Y); }
	//set Z-Index
	EasyDyn.prototype.setZ = function(Z) { this.layer.zIndex = Z; }
	//set visible width
	EasyDyn.prototype.setW = function (width) { this.layer.clip.width = width; }		
	//set visible width 
	EasyDyn.prototype.setH = function (height) { this.layer.clip.height = height; }	
	//set visible rectangular region
	EasyDyn.prototype.setClipRect = function (top,right,bottom,left) { 				 
		this.layer.clip.top = top;
		this.layer.clip.right = right;
		this.layer.clip.bottom = bottom;
		this.layer.clip.left = left;
	}
	//set visibility to visible
	EasyDyn.prototype.show = function () { this.layer.visibility = 'show'; }	
	//set visibility to hidden
	EasyDyn.prototype.hide = function () { this.layer.visibility = 'hide'; }		
	
	//change the content of the layer
	EasyDyn.prototype.setText = function (newText) { 
		this.layer.document.write(newText);
		this.layer.document.close();
	}
	
	//append MASKS-mapping-array to class -- to use below
	EasyDyn._masks_ = {
		onmouseover:Event.MOUSEOVER, onmouseout:Event.MOUSEOUT,
		onmousemove:Event.MOUSEMOVE, onmousedown:Event.MOUSEDOWN,
		onmouseup:Event.MOUSEUP, onclick:Event.CLICK, ondblclick:Event.DBLCLICK,
		onmove:Event.MOVE, onfocus:Event.FOCUS,
		onblur:Event.BLUR, onselect:Event.SELECT
	}
	
	//add event handlers to the layer	
	EasyDyn.prototype.addEventHandler = function (whichEvent, handler){
		//first capture events so they can't propagate
		this.layer.captureEvents(EasyDyn._masks_[whichEvent]);
		//container to pass a ref to this object to handler
		var thisObject = this;
		
		/* 
		 * set the handler and send it these:
		 * a ref to the object that called the handler
		 * the event type
		 * the layer-relative event X
		 * the layer-relative event Y
		 * the top-relative event X
		 * the top-relative event Y
		 */
		this.layer[whichEvent] = function (event){
			return handler(thisObject, event.type, event.layerX, event.layerY,
							event.pageX, event.pageY);
		}
	}
	
	//drop event handler
	EasyDyn.prototype.dropEventHandler = function(whichEvent) {
		//stop capturing
		this.layer.releaseEvents(EasyDyn._masks_[whichEvent]);
		//delete property
		delete this.layer[whichEvent];
	}
	
	/**********************/
	/* some class methods */
	/**********************/
	
	/* WARNING! these next methods may not
	 * work at all in NN4 !!! This is because
	 * there is no way to reliably access any
	 * element given only and ID.
	 */
	EasyDyn.getStaticElRef = function(elementId) {
		if (thisElRef == document[elementId]) {
			return thisElRef;
		} else {
			return null; 
		}
	}
	EasyDyn.getStaticElX = function(elementId) { 
		if (thisElRef == getStaticElRef(elementId)) {
			return thisElRef.x; 
		} else {
			return null;
		} 
	}
	EasyDyn.getStaticElY = function(elementId) { 
		if (thisElRef == getStaticElRef(elementId)) {
			return thisElRef.y; 
		} else {
			return null;
		} 
	}
	// end warning
	
	EasyDyn.getBrowserHeight = function() { return window.innerHeight; }
	EasyDyn.getBrowserWidth = function() { return window.innerWidth; }
	
}



/* INTERNET EXPLORER 4+ (NON - DOM1) METHODS */

if((client.isIE4Plus && !client.isDOMBrowser) || (client.isMacIE5)){
	//create the HTML string
	EasyDyn.prototype.setHTML = function() {
		this.htmlString = '<div id="' + this.id + '"';
		this.htmlString += ' style="position:absolute;';
		if(this.vis)this.htmlString += 'visibility:' + this.vis + ';';
		if(this.width)this.htmlString += 'width:' + this.width + 'px;';
		if(this.x)this.htmlString += 'left:' + this.x + 'px;';
		if(this.y)this.htmlString += 'top:' + this.y + 'px;';
		if(this.fontFamily)this.htmlString += 'font-family:' + this.fontFamily + ';';
		if(this.fontSize) this.htmlString += 'font-size:' + this.fontSize + 'px;';
		if(this.fontWeight) this.htmlString += 'font-weight:' + this.fontWeight + ';';
		if(this.bgColor)this.htmlString += 'background-color:' + this.bgColor + ';';
		if(this.color)this.htmlString += 'color:' + this.color + ';';
		if(this.borderColor)this.htmlString += 'border-color:' + this.borderColor + ';';
		if(this.borderWidth)this.htmlString += 'border-width:' + this.borderWidth + 'px;';
		if(this.borderStyle)this.htmlString += 'border-style:' + this.borderStyle + ';';
		if(this.padding)this.htmlString += 'padding:' + this.padding + 'px;';
		this.htmlString += '">';
		this.htmlString += this.text;
		this.htmlString += '</div>'; 
		this.HTML =this.htmlString;
	}
	
	//get a handle on the HTML element
	EasyDyn.prototype.initElRef = function() { 
		this.element = this.window.document.all[this.id]
		this.style = this.element.style;
	}
	
	EasyDyn.prototype.getElRef = function() { 
		return this.element
	}
	
	//physically write the HTML
	EasyDyn.prototype.writeHTML = function(){
		this.setHTML();
		var doc = this.window.document;
		doc.write(this.HTML);
		
		this.initElRef();
	}
	
	//get background color
	EasyDyn.prototype.getBgColor = function () { return this.style.backgroundColor; }		
	//get X (relative to containing layer)
	EasyDyn.prototype.getX = function () { return this.style.pixelLeft; }					
	//get Y (relative to containing layer)
	EasyDyn.prototype.getY = function () { return this.style.pixelTop; }					
	//get width
	EasyDyn.prototype.getW = function () { return this.element.offsetWidth}		
	//get height
	EasyDyn.prototype.getH = function () { return this.element.offsetHeight}				
	//get Z-index
	EasyDyn.prototype.getZ = function () { return this.style.zIndex; }				
	//get visibility
	EasyDyn.prototype.getVis = function () { return this.style.visibility; }			
	
	//set background color
	EasyDyn.prototype.setBgColor = function (color) { this.style.backgroundColor = color; }		
	//set X (relative to containing layer)
	EasyDyn.prototype.moveToX = function (X) { this.style.pixelLeft = X; }
	//set Y (relative to containing layer)
	EasyDyn.prototype.moveToY = function (Y) { this.style.pixelTop = Y; }
	//set X,Y (relative to containing layer)
	EasyDyn.prototype.moveToXY = function (X,Y) { this.style.pixelLeft = X;this.style.pixelTop = Y; }
	//move by delta X
	EasyDyn.prototype.moveByX = function (X) { this.style.pixelLeft += X; }
	//move by delta Y
	EasyDyn.prototype.moveByY = function (Y) { this.style.pixelTop += Y; }
	//move by delta X,Y
	EasyDyn.prototype.moveByXY = function (X,Y) { this.style.pixelLeft += X;this.style.pixelTop += Y; }
	//set Z-Index
	EasyDyn.prototype.setZ = function(Z) { this.style.zIndex = Z; }
	//set visible width
	EasyDyn.prototype.setW = function (width) { this.style.pixelWidth = width; }		
	//set visible height 
	EasyDyn.prototype.setH = function (height) { this.style.pixelHeight = height; }	
	//set visible rectangular region
	EasyDyn.prototype.setClipRect = function (top,right,bottom,left) { 				 
		this.style.clip =  'rect( ' + top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px )';
	}
	//set visibility to visible
	EasyDyn.prototype.show = function () { this.style.visibility = 'visible'; }	
	//set visibility to hidden
	EasyDyn.prototype.hide = function () { this.style.visibility = 'hidden'; }		
	
	//change the content of the layer
	EasyDyn.prototype.setText = function (newText) { 
		this.element.innerHTML = newText;
	}
	
	//add event handlers to the layer	
	EasyDyn.prototype.addEventHandler = function (whichEvent, handler){
		//container to pass a ref to this object to handler
		var thisObject = this;
		/* 
		 * set the handler and send it these:
		 * a ref to the object that called the handler
		 * the event type
		 * the layer-relative event X
		 * the layer-relative event Y
		 * the top-relative event X
		 * the top-relative event Y
		 */
		this.element[whichEvent] = function (){
			var e = thisObject.window.event
			e.cancelBubble = true;
			return handler(thisObject, e.type, e.x, e.y,
							e.clientX, e.clientY);
		}
	}
	
	//drop event handler
	EasyDyn.prototype.dropEventHandler = function(whichEvent) {
		//delete property
		delete this.element[whichEvent];
	}
	
	/**********************/
	/* some class methods */
	/**********************/
	
	EasyDyn.getStaticElRef = function(elementId) { return window.document.all[elementId]; }
	
	/* WARNING! these next methods can't return absolute x,y as IE 
	 * doesn't know this about non-positioned elements! They 
	 * return position relative to next outer container instead
	 */
	EasyDyn.getStaticElX = function(elementId) { return EasyDyn.getStaticElRef(elementId).offsetLeft; }
	EasyDyn.getStaticElY = function(elementId) { return EasyDyn.getStaticElRef(elementId).offsetTop; }
	// end warning
	
	EasyDyn.getBrowserHeight = function() { return window.document.body.clientHeight; }
	EasyDyn.getBrowserWidth = function() { return window.document.body.clientWidth; }
	
}



/* DOM-COMPLIANT BROWSER METHODS */

if(client.isDOMBrowser && !client.isMacIE5){
	//create the HTML string
	EasyDyn.prototype.setHTML = function() {
		this.htmlString = '<div id="' + this.id + '"';
		this.htmlString += ' style="position:absolute;';
		if(this.vis)this.htmlString += 'visibility:' + this.vis + ';';
		if(this.width)this.htmlString += 'width:' + this.width + 'px;';
		if(this.x)this.htmlString += 'left:' + this.x + 'px;';
		if(this.y)this.htmlString += 'top:' + this.y + 'px;';
		if(this.fontFamily)this.htmlString += 'font-family:' + this.fontFamily + ';';
		if(this.fontSize) this.htmlString += 'font-size:' + this.fontSize + 'px;';
		if(this.fontWeight) this.htmlString += 'font-weight:' + this.fontWeight + ';';
		if(this.bgColor)this.htmlString += 'background-color:' + this.bgColor + ';';
		if(this.color)this.htmlString += 'color:' + this.color + ';';
		if(this.borderColor)this.htmlString += 'border-color:' + this.borderColor + ';';
		if(this.borderWidth)this.htmlString += 'border-width:' + this.borderWidth + 'px;';
		if(this.borderStyle)this.htmlString += 'border-style:' + this.borderStyle + ';';
		if(this.padding)this.htmlString += 'padding:' + this.padding + 'px;';
		this.htmlString += '">';
		this.htmlString += this.text;
		this.htmlString += '</div>'; 
		this.HTML =this.htmlString;
	}
	
	//get a handle on the HTML element
	EasyDyn.prototype.initElRef = function() { 
		this.element = this.window.document.getElementById(this.id);
		this.style = this.element.style;
	}
	
	EasyDyn.prototype.getElRef = function() { 
		return this.element;
	}
	
	//physically write the HTML
	EasyDyn.prototype.writeHTML = function(){
		this.setHTML();
		var doc = this.window.document;
		doc.write(this.HTML);
		
		this.initElRef();		
	}
	
	//get background color
	EasyDyn.prototype.getBgColor = function () { return this.style.backgroundColor; }		
	//get X (relative to containing layer)
	EasyDyn.prototype.getX = function () { return parseInt(this.style.left); }					
	//get Y (relative to containing layer)
	EasyDyn.prototype.getY = function () { return parseInt(this.style.top); }					
	//get width
	EasyDyn.prototype.getW = function () { return parseInt(this.element.offsetWidth); }			
	//get height
	EasyDyn.prototype.getH = function () { return parseInt(this.element.offsetHeight); }				
	//get Z-index
	EasyDyn.prototype.getZ = function () { return this.style.zIndex; }				
	//get visibility
	EasyDyn.prototype.getVis = function () { return this.style.visibility; }			
	
	//set background color
	EasyDyn.prototype.setBgColor = function (color) { this.style.backgroundColor = color; }		
	//set X (relative to containing layer)
	EasyDyn.prototype.moveToX = function (X) { this.style.left = X + 'px'; }
	//set Y (relative to containing layer)
	EasyDyn.prototype.moveToY = function (Y) { this.style.top = Y + 'px'; }
	//set X,Y (relative to containing layer)
	EasyDyn.prototype.moveToXY = function (X,Y) { this.style.left = X + 'px';this.style.top = Y + 'px'; }
	//move by delta X
	EasyDyn.prototype.moveByX = function (X) { var newPos = this.getX() + X;this.style.left = newPos + 'px'; }
	//move by delta Y
	EasyDyn.prototype.moveByY = function (Y) { var newPos = this.getY() + Y;this.style.top = newPos + 'px'; }
	//move by delta X,Y
	EasyDyn.prototype.moveByXY = function (X,Y) { this.moveByX(X);this.moveByY(Y); }
	//set Z-Index
	EasyDyn.prototype.setZ = function(Z) { this.style.zIndex = Z; }
	//set visible width
	EasyDyn.prototype.setW = function (width) { this.style.width = width + 'px'; }		
	//set visible height 
	EasyDyn.prototype.setH = function (height) { this.style.height = height + 'px'; }	
	//set visible rectangular region
	EasyDyn.prototype.setClipRect = function (top,right,bottom,left) { 				 
		this.style.clip =  'rect( ' + top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px )';
	}
	//set visibility to visible
	EasyDyn.prototype.show = function () { this.style.visibility = 'visible'; }	
	//set visibility to hidden
	EasyDyn.prototype.hide = function () { this.style.visibility = 'hidden'; }		
	
	//change the content of the layer
	//innerHTML isn't strictly DOM compliant, but it's supported for now
	//the DOM way is to set element.firstChild.nodeValue to some string
	EasyDyn.prototype.setText = function (newText) { 
		this.element.innerHTML = newText;
	}
	
	
	
	//add event handlers to the layer -- these are still platform specific
	// 6 for now (Gecko too).  This may change in the future to include 6+
	//captureEvents() is not supported, but the event model s different
	//so you don't really need it
	if (client.isNN6) {
	
		EasyDyn.prototype.addEventHandler = function (whichEvent, handler){
			//container to pass a ref to this object to handler
			var thisObject = this;
			
			/* 
			 * set the handler and send it these:
			 * a ref to the object that called the handler
			 * the event type
			 * the layer-relative event X
			 * the layer-relative event Y
			 * the top-relative event X
			 * the top-relative event Y
			 */
			this.element[whichEvent] = function (event){
				event.cancelBubble = true;
				return handler(thisObject, event.type, event.layerX, event.layerY,
								event.pageX, event.pageY);
			}
		}
	} else {
	
		EasyDyn.prototype.addEventHandler = function (whichEvent, handler){
			//container to pass a ref to this object to handler
			var thisObject = this;
			/* 
			 * set the handler and send it these:
			 * a ref to the object that called the handler
			 * the event type
			 * the layer-relative event X
			 * the layer-relative event Y
			 * the top-relative event X
			 * the top-relative event Y
			 */
			this.element[whichEvent] = function (){
				var e = thisObject.window.event
				e.cancelBubble = true;
				return handler(thisObject, e.type, e.x, e.y,
								e.clientX, e.clientY);
			}
		}
	}
	
	//drop event handler -- two version again
	
	EasyDyn.prototype.dropEventHandler = function(whichEvent) {
		//stop capturing
		if(client.isNN6){this.element.releaseEvents(EasyDyn._masks_[whichEvent]);}
		//delete property
		delete this.element[whichEvent];
	}
	
	/**********************/
	/* some class methods */
	/**********************/
	
	EasyDyn.getStaticElRef = function(elementId) { return window.document.getElementById(elementId); }
	
	/* WARNING! Next methods only work for Navigator 6+
	 * IE DOM browsers don't know absolute x,y
	 * for non-positioned elements!!!
	 */
	EasyDyn.getStaticElX = function(elementId) { 
		if (client.isIE4Plus) {
			return null;
		} else {
			return EasyDyn.getStaticElRef(elementId).x; 
		}
	}
	EasyDyn.getStaticElY = function(elementId) { 
		if (client.isIE4Plus) {
			return null;
		} else {
			return EasyDyn.getStaticElRef(elementId).y; 
		}
	}
	// end warning
	
	EasyDyn.getBrowserHeight = function() { 
		if (client.isNN6Plus) {
			return window.innerHeight;
		} else if (client.isIE4Plus) {
			return window.document.body.clientHeight; 
		} else {
			return window.document.height;
		}
	}
	EasyDyn.getBrowserWidth = function() { 
		if (client.isNN6Plus) {
			return window.innerWidth;
		} else if (client.isIE4Plus) {
			return window.document.body.clientWidth ; 
		} else {
			return window.document.width;
		}
	}
	
}


