/*************************************************************************************************\
 *																								 *
 *					++++	++	++	++    ++  ++	   ++  ++++++++	 +++++++					 *
 *					+++++	++	++	+++   ++  ++	   ++  ++++++++	 +++++++					 *
 *					++	++	++++++	++++  ++  ++	   ++	  ++	 ++							 *
 *					++	++	++++++	++ ++ ++  ++	   ++	  ++	 ++++++						 *
 *					++	++		++	++	++ +  ++	   ++	  ++	 ++							 *
 *					+++++	++++++	++	 +++  +++++++  ++	  ++	 +++++++					 *
 *					++++	++++++	++	  ++  +++++++  ++	  ++	 +++++++					 *
 *																								 *
 *										DynLite 2.6												 *
 *									  Updated 06/30/01											 *
 *																								 *
 *																								 *	
 *					Lite,fast, and powerful DHTML cross-platform library.						 *
 *								Written by Trung Ngo, 2001.										 *
 *																								 *
 *					Feel free to use and modify it. No authorising quote is needed.				 *
 *	 Visit http://www.trungngo.com/dynlite/index.htm for documents, tutorials, and discussions.	 *
 *																								 *
\*************************************************************************************************/

/*************************************************************************************************\
 *  FEATURES
 *  ========
 *		+ Fully compatiple with: IE4.x, IE5.x, NS4.x, NS6.x 
			>>	wow! NS6 is ok! Very nested code but marvelous result.
 *
 *		+ Really lite 
 *			>>	It's important. Many other library came up with a bunch of code.
 *			>>	So, you don't have many chances to put more graphics and some other good stuffs.
 *
 *		+ No class, OPP
 *			>>	OPP is good, but....don't we need it for just very simple tasks
 *			>>	Some other library have pretty nice and long code.
 *			>>	They are beautiful to watch, easy to study. However, it is not for our real web site.
 *			>>	What can we do if these library spend more than 500 lines just for an popup menu.
 *
 *		+ No redundant code
 *			>>	No thing that is rarely used is combined to this library. You know how to do it if 
 *			>>	you really need it, right?
 *
 *		+ Work well in many cases
 *			>>	This library try to work well even when you pass it some bad thing. I guess.
 *			
 *		+ Support complex animationss
 *			>>	A few functions but enough. 
 *			>>  You don't need to set up anything for preparation, except you want to have 
 *			>>	a really really complicated movement. Just let something fly by one call.
 *		
 *		+ Support Scroll to Appear Effects
 *			>>	Just one function and one call. You can make something fly like a magic 'Start'
 *			>>	button of Window 9.x. 
 *			
 *  SUMMARY
 *	========
 *
 *	Variables:
 *	----------
 *		navName	:	'ie' or 'ns' or ...
 *		navVer	:	int
 *		isOldNS	:	Netscape prior 6.0
 *		isNS4	:	Netscape 4 ?
 *		isNS6	:	Netscape 6 ?
 *		isIE	:	Internet Explore?
 *		isIE4	:	Internet Explore 4?
 *		isIE5	:	Internet Explore 5?
 *		isDOM	:	support DOM?
 *		isFilter:	support filters ?
 *  
 *	Functions:
 *	----------
 *		function preloadImages( [imgsrc] )
 *
 *		function getEl(eln)
 *
 *		function getLeft(el)
 *		function getTop(el)
 *		function getWidth(el)
 *		function getHeight(el)
 *		function getPageOffsetLeft(el)
 *		function getPageOffsetTop(el)
 *		
 *		function moveTo(el,x,y){
 *		function moveLayerTo( [el, x, y] )	
 *
 *		function showElement(el, v){
 *		function showHideLayers(){
 *
 *		function setInnerHTML(el, str){
 *
 *		function swapImages( [eln, src] )
 *		function swapImgRestore()
 *
 *		function snapLayer(eln, elsn,dx,dy, mx1,my1,mx2, my2)
 *		function snapElement(el1, el2,dx,dy, mx1,my1,mx2, my2)
 *	
\*************************************************************************************************/
var navName;
if (navigator.appName.indexOf("Netscape")>=0)	
	navName = "ns";
else if (navigator.appName.indexOf("Internet Explorer")>=0) {  //if it's IE or Opera (operan's appName is the Microsoft Internet Explorer)
	if (navigator.userAgent.indexOf("Opera")>=0)
		navName = "op";			//opera
	else
		navName = "ie";
}
else
	navName = appName;
	
var navVer = parseInt(navigator.appVersion);	

//everything is ok except for netscape version prior ver 6
//assume that all others surport DOM
var isOldNS = (document.layers);			
var isNS4 = ((navName=="ns") && (navVer == 4));
var isGecko = (navigator.userAgent.indexOf("Gecko") >0)? 1:0;		//"Gecko" is used to allow Mozilla browsers as well ass the Netscape 6 release version
var isSafari = (navigator.userAgent.indexOf("Safari") >0)? 1:0;			// notes: safari is developped on top of gecko -> isGecko = true & isNS6 = true also
var isOpera = navName == "op";

var isNS6 = (isGecko && (navVer==5));
var isIE = (navName=="ie") && (navVer>=4);
var isIE4 = isIE && (navVer == 4);
var isIE5 = (navigator.userAgent.indexOf("MSIE 5.5") > 0 | 
			navigator.userAgent.indexOf("MSIE 6.0") > 0)? 1:0; 

var isDOM = (document.getElementById);
var isFilter = (isIE);
var onLoadCallbacks = new Array();
	
/*************************************************************************************************\
 *	function reloadPage(init)
 *
 *	This function is used to fix the error of Ns4 when it resize.
 *	You don't have to call this function. It automatically call itself.
\*************************************************************************************************/
function reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {
		if (isNS4) {
			document.pgW=innerWidth; document.pgH=innerHeight; 
			onresize=reloadPage; 
		}
	}
	else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}

reloadPage(true);	// register reload function
/*************************************************************************************************\
 *	function preloadImages()
 *
 *	Preload all needed images into memory or cache
\*************************************************************************************************/

function preloadImages() {
	var d=document, arg=preloadImages.arguments; 
	if(d.images){ 
		if(!d.pImg) d.pImg=new Array();		//pImg: preloaded images
	
		//just try to load all needed images in memory
		for(i=0,j=d.pImg.length; i<arg.length; i++,j++)	(d.pImg[j] = new Image).src = arg[i];
	}
}
/*************************************************************************************************\
 * function findObj(eln,d)
 *
 * find and return an element in document.
 *
 * Parameters:
 *		n: element ID
 *		d: root document that it can steart to find		[optional] 
 *
 * Return:
 *		an element have eln as its ID
 *
 * Notes:  + you can call this function without d parameter. In this 
 *		     case, d is default window.document
\*************************************************************************************************/
// if client browser doesn't support DOM. use old mechanism findObj

if (!isDOM) document.getElementById = function findObj(eln, d){

	var el, p,arg = findObj.arguments;
	if (!d) d=document;
	if((p=eln.indexOf("?"))>0&&parent.frames.length) {	// check if this object is belong to another frame
		d=parent.frames[eln.substring(p+1)].document;		//get document object of another frame
		eln=eln.substring(0,p);	//get real element name
	}	

	if (d.all) return d.all[eln];	//document.all?
	if (isOldNS && (el = oldNS_findObj(eln, d))) return el;
};

function getEl(id) {
		return document.getElementById(id);
}

// for Ns4.x. I hate Ns4.x
function oldNS_findObj(eln, d){
	var el, i;
	if (!d) d = document;

	if (el = d[eln]) return el;	//found it
	
	//check in all forms
	for (i=0;!el && i<d.forms.length; i++)	el = d.forms[i][eln];

	//check in all layers
	for(i=0; !el && i<d.layers.length; i++) el = oldNS_findObj(eln, d.layers[i].document);

	return el;
}

/*************************************************************************************************\
 *	function getLeft(el)
 *
 *	Return the true x coordinate of an element 
\*************************************************************************************************/
function getLeft(el){	return parseInt(isOldNS? el.left : el.style.left);	}
/*************************************************************************************************\
 *	function getTop(el)
 *	
 *	Return the true x coordinate of an element relative to the page
\*************************************************************************************************/
function getTop(el){	return parseInt(isOldNS? el.top : el.style.top);	}
/*************************************************************************************************\
 *	function getPageOffsetLeft(el)
 *	
 *	Return the true x coordinate of an element relative to the page
\*************************************************************************************************/
function getPageOffsetLeft(el){
	return el.offsetLeft + (el.offsetParent ? getPageOffsetLeft(el.offsetParent) : 0);
}
/*************************************************************************************************\
 *	function getPageOffsetTop(el)
 *	
 *	Return the true y coordinate of an element relative to the page
\*************************************************************************************************/
function getPageOffsetTop(el){
	return el.offsetTop + (el.offsetParent ? getPageOffsetTop(el.offsetParent) : 0);
}
/*************************************************************************************************\
 *	function getWidth(el)
 *	
 *	Return the width value of an element (cross-platform)
\*************************************************************************************************/
function getWidth(el){
	return parseInt((isNS4? (el.document.width? el.document.width:el.clip.width) : (el.offsetWidth?el.offsetWidth : el.style.width )));
}
/*************************************************************************************************\
 *	function getHeight(el)
 *	
 *	Return the height value of an element (cross-platform)
\*************************************************************************************************/
function getHeight(el){
	return parseInt((isNS4? (el.document.height? el.document.height :el.clip.height ): (el.style.height? el.style.height: el.offsetHeight)));
}
/*************************************************************************************************\
	function moveTo(el,x,y)
\*************************************************************************************************/
function moveTo(el,x,y){
	var d = (isOldNS)? el : el.style;
	
	if (!isNS4) { x+='px';   y+='px'; }	d.left=x;	d.top=y;
}
/*************************************************************************************************\
	function moveLayerTo( [eln, x, y] )	
\*************************************************************************************************/
function moveLayerTo( )	{
	var i, arg=moveLayerTo.arguments, len=arg.length-arg.length%3, el;
	for (i=0; i<len; i+=3){
		if (el=document.getElementById(arg[i])) moveTo(el, parseInt(arg[i+1]), parseInt(arg[i+2]));
	}
}
/*************************************************************************************************\
\*************************************************************************************************/
function getVisibilityString(isShown)
{
	if (isOldNS) 
	  return (isShown?'show':'hide');
	else 
		return (isShown?'visible':'hidden');
}

/*************************************************************************************************\
	function showElement(el, v){
\*************************************************************************************************/
function showElement(el, v){
  
	d = (isOldNS)? el : el.style;
	
	if (isOldNS) 
	  v = (v=='visible') ? 'show' : (v=='hidden') ? 'hide':v;
	
	if (v == 'visible' || v == 'hidden')
	  d.visibility = v;
	else if (v == 'none' || v == 'block')
	  d.display = v;
	else
	  alert('invalid visibility setting: ' + v);
}



/*************************************************************************************************\
 *	function toggleVisibility(id)
 *		toggle visibility of an element (visible -> hidden -> visible)
 *  Parameters:
 *    e: the element/or element name to toggle
 *************************************************************************************************/
function toggleVisibility(e) {
  var el = getEl(e);
	var d = (isOldNS)? el : el.style;

  if (d.visibility == (isOldNS? 'show' : 'visible')) 
    d.visibility = (isOldNS? 'hide' : 'hidden');
  else
    d.visibility = (isOldNS? 'show' : 'visible');
	
}

/*************************************************************************************************\
 *	function toggleDisability(id)
 *		toggle disabled property of an form field 
 *  Parameters:
 *    e: the element/or element name to toggle
 *************************************************************************************************/
function toggleDisability(e) {
  var el = getEl(e);
  el.disabled = !el.disabled;
}



/*************************************************************************************************\
 *	function toggleDisplay(e, [display])
 *		toggle display setting of an element
 *  Parameters:
 *    e: the element/or element name to toggle
 *    display: used for "visible" element
 *        it can be: inline or block (default)
 *************************************************************************************************/
function toggleDisplay(e, display) {
  var el = getEl(e);
	var d = (isOldNS)? el : el.style;
	
  var dis = (display==null? 'block' : display);
  if (d.display == 'none') 
    d.display = dis;
  else
    d.display = 'none';
}

/*************************************************************************************************\
 *	function showHideLayers( [eln, v])
 *		show or hide list of layers
 *	
 *	Parameters:
 *		you can put many pairs of two var (eln, v)
 *		eln: element ID or name
 *		v: 'visible' or 'hidden';
 *
 *  Examples:
 *		showHideLayers('divTest1', 'visible', 'divTest2', 'visible', 'divTest3', 'hidden');
\*************************************************************************************************/
function showHideLayers() {
	var d, v, arg = showHideLayers.arguments;

	for (var i=0; i<arg.length-1; i+=2){
		if (el = document.getElementById(arg[i])) {
		  showElement(el, arg[i+1]);
		}
	}
}


/*************************************************************************************************\
 *	function setInnerHTML(el, str){
 *
\*************************************************************************************************/
function setInnerHTML(el, str){
	if (isOldNS){		
		el.document.open();
		el.document.writeln(str);		
		el.document.close();
	}
	else if (el.innerHTML) el.innerHTML = str;
}
/*************************************************************************************************\
 *	function swapImages( [eln, src] )
 *
 *	swap image objects to another source
 *
 *	Parameters:
 *		
 *		You can put many pairs of two var (eln, src)
 *		eln: element name or ID 
 *		src: path to new image source
 *
 *  Examples:
 *		swapImages('imgNote','images/opennote.gif', 'imgDoc','images/htmldoc.gif');
 * 
 *	Notes:
 *		After each call of this function, the list of old image source will be 
 *      automatically saved in order to restore them with out using swapImages()
 *		function one more time. see swapImageRestore() for more information.
 *
\*************************************************************************************************/
function swapImages(){
	var i, el, arg = swapImages.arguments, d = document;

	d.swImg =  new Array;	//swImg = save swap Image
	for (i=0, j=0; i<arg.length-1; i+=2){
		if (el=d.getElementById(arg[i])){
			d.swImg[j++] = el;
			el.osrc = el.src;	//osrc: old src
			el.src =  arg[i+1];
		}
	}
}
/*************************************************************************************************\
 *	function swapImgRestore()
 *
 *	restore to orginal state of previous swap operation
\*************************************************************************************************/
function swapImgRestore(){
	var i, el;
	for (i=0; i<document.swImg.length;i++){	
		el = document.swImg[i];		el.src = el.osrc;
	}
}
/*************************************************************************************************\
 *	function snapLayer(eln, elsn,dx,dy, mx1,my1,mx2, my2)
 *
 *	Parameters:
 *		eln			: element NAME or ID (string) of the layer that you want to be change its position
 *		elsn		: name or ID of the anchored object that you want your layer to be sticked in
 *		dx,dy		: distance from 2 linking points
 *
 *		mx1: 0,1,2;	(left, center, right)	: linking mode for layer	(default = 0)
 *		my1: 0,1,2;	(top, center, bottom)	: linking mode for layer	(default = 0)
 *		mx2: 0,1,2;	(left, center, right)	: linking mode for source	(default = 0)
 *		my2: 0,1,2;	(top, center, bottom)	: linking mode for source	(default = 0)
 *
 *  Examples:
 *		snapLayer('divTest', 'divAnchor', 0,0, 2,2,2,2);
 *		snap those two layes center by center.
 * 
 *	Notes:
 *		+ You can snap a layer with moving object by using onAniTick event 
 *			of that moving object. See "Animation Event"  for more.
\*************************************************************************************************/
function snapLayer(eln, elsn,dx,dy, mx1,my1,mx2, my2){
	var el1, el2;
	if ((el1 = document.getElementById(eln))&&(el2 = document.getElementById(elsn))) 
	snapElement(el1, el2,dx,dy, mx1,my1,mx2, my2);
}

/*************************************************************************************************\
 *	function snapElement(el1, el2,dx,dy, mx1,my1,mx2, my2)
 *
 *	Parameters:
 *		el1			: element NAME or ID (string) of the layer that you want to be change its position
 *		el2		: name or ID of the anchored object that you want your layer to be sticked in
 *
 *	Notes:
 *		the other parameters have the same meaning with function snapLayer(). See description above
 *		for more details
\*************************************************************************************************/
function snapElement(el1, el2,dx,dy, mx1,my1,mx2, my2){
	var d1, d2,x,y,w,h;
	//get top, left, width, height of source
	x = getPageOffsetLeft(el2);	y = getPageOffsetTop(el2);
	w = getWidth(el2);	h = getHeight(el2);
	//calculate new x&y
	dx = (mx2==2)? x+w+dx : (mx2==1)? x+w/2+dx : x+dx;
	dy = (my2==2)? y+h+dy : (my2==1)? y+h/2+dy : y+dy;

	w = getWidth(el1);	h = getHeight(el1);
	
	//calculate new x&y
	dx = (mx1==2)? dx-w : (mx1==1)? dx-w/2 : dx;
	dy = (my1==2)? dy-h : (my1==1)? dy-h/2 : dy;

	moveTo(el1, dx,dy);
}

/*************************************************************************************************\
 *	function resizeIFrame(e, w, h)
 *	Resizes element by number of pixels passed in w and h
 *	
 *	Parameters:
 *		e			: element NAME or ID (string) 
 *		h			: number of pixels to add (or subtract if a negative number) from the height
 *		w			: number of pixels to add (or subtract if a negative number) from the width
 *
\*************************************************************************************************/
function resizeIFrame(e, w, h){
	var el = document.getElementById(e);
	
	//removed by Ramesh.  el.style is not used in this function
	//if (!el || !el.style)
	//	return;
	//el = el.style;
	
	if (!el) return;
	
	var origH = parseInt(el.height);
	var origW = parseInt(el.width);
	
	//find out if % signs where originally in the 
	var hPerc = el.height.indexOf('%') >= 0;
	var wPerc = el.width.indexOf('%') >= 0;


	if (origH + h > 0) el.height = origH + h;
	if (hPerc) el.height = el.height + "%";
	
	if (origW + w > 0) el.width = origW + w;
	if (wPerc) el.width = el.width + "%";

}

// added for faculty central,
// this funcion is supposed to work on IE6+ NS6+
function setSize(el, w, h) {
	
	if (!el || !el.style)
		return;
	el.style.height = h;
	el.style.width = w;
}

// added for faculty central,
// this funcion is supposed to work on IE6+ NS6+
function setSizeElement(eln, w, h) {
	var el = document.getElementById(eln);
	setSize(el, w, h);
}

// added for faculty central,
// this funcion is supposed to work on IE6+ NS6+
function setPositionElement(eln, x, y) {
	var el = document.getElementById(eln);
	setPosition(el, w, h);
}

function setPosition(el, x, y) {
	if (!el || !el.style)
		return;
		
	el.style.left = x;
	el.style.top = y;
}

// added for FacultyCentral
function isVisible(eln) {
	var el = document.getElementById(eln);
	
	if (el)
		return isVisibleElement(el);
	else 
		return false;
}

// added for FacultyCentral
function isVisibleElement(el) {
	return el.style.visibility == getVisibilityString(true);
}

// added for FacultyCentral
function getIFrame(eln) {
	if (document.all)
		return document.frames[eln];
	else
		return document.getElementById(eln);
}


// added for FacultyCentral
function setIfrmHref(ifrmId, href) {
  var ifrm;
	if (document.all) 
		ifrm = document.frames[ifrmId];
	else 
		ifrm = document.getElementById(ifrmId).contentDocument;
  
  ifrm.location.href = href;
}


// added for FacultyCentral
function getIFrameContentDocument(ifrm) {

	if (document.all)
		return ifrm.document;
	else 
		return ifrm.contentDocument; 
}

// added for FacultyCentral
function alignPopupWindow(pPopupWin, pAnchor) {
  // Notes: this code is copied from datepicker
  // TODO: combine this with common.adjustWinPosition

  var x=0;   // left 
  var y=0;   // top
  var dF = pPopupWin;
  
  for(var p=pAnchor; p&&p.tagName!='BODY'; p=p.offsetParent){
    x+=p.offsetLeft;
    y+=p.offsetTop;
  }

  var eH=pAnchor.offsetHeight;   
  var eW=pAnchor.offsetWidth;   
  
  var h=dF.offsetHeight;
  var w=dF.offsetWidth;
  var sT=document.body.scrollTop;
  var sL=document.body.scrollLeft;

	//alert(eH + " " + eW + " " + h + " " + w + " " + sT + " " + sL);
  if(/*x - w >= sL && */ x + w + eW > document.body.clientWidth + sL) {
    dF.style.left = x - w + eW; 
  }
  else {
    dF.style.left = x;
  }
  
	if (dF.style.left < 0) {
		dF.style.left = 0;
	}
	
  
  if(y - h >= sT && y + h + eH > document.body.clientHeight + sT) {
    dF.style.top = y - h;
  }
  else {
    dF.style.top = y + eH;
  }  

	if (dF.style.top < 0) {
		dF.style.top = 0;
	}

}



/*************************************************************************************************\
 *	public function setCssClass(el, cssClassName)
 *    change css class name of an element
\*************************************************************************************************/
function setCssClass(el, cssClassName) {
	el.className = cssClassName;
}


/*************************************************************************************************\
 *	public function setCssClassElement(eln, cssClassName)
 *    change css class name of an element
\*************************************************************************************************/
function setCssClassElement(eln, cssClassName) {
	var el = document.getElementById(eln);
	setCssClass(el, cssClassName);
}

function registerOnLoadCallBack(func) {
  onLoadCallbacks.push(func);
}


/*************************************************************************************************\
 *	private function dynliteLibOnLoad()
 *      this function must be called to set up the enviroment
\*************************************************************************************************/
function dynliteLibOnLoad() {
  var func;
  while (func = onLoadCallbacks.pop()) {
    // run all registered callback functions
    func();
  }
}

/*************************************************************************************************\
 *  public function registerDynliteLibOnloadHandler()
 *    this function should be called anywhere in the html body to
 *    register dynliteLibOnLoad() as the handler for body.onload event
\*************************************************************************************************/
function registerDynliteLibOnloadHandler() {
  if (isIE || isOpera)
    window.attachEvent('onload', dynliteLibOnLoad);
    
  else if (isGecko)
    window.addEventListener('load', dynliteLibOnLoad, false);
    
  else
    alert("ERROR: cannot register dynliteOnLoad() handler!" +
          "Please use <body onload=''> option.");
}


/*************************************************************************************************\
 *	public function swapCssClasses( [eln, cssClassName])
 *
 *	swap css class name of an object with another source
 *
 *	Parameters:
 *		
 *		You can put many pairs of two var (eln, src)
 *		eln: element name or ID 
 *		cssClassName: the new css classname
 *
 *  Examples:
 *		swapCssClasses('divA','someCssClassA', 'divB','someCssClassB');
 * 
 *	Notes:
 *		After each call of this function, the list of old css classes will be 
 *      automatically saved in order to restore them with out using swapCssClasses()
 *		function one more time. see swapCssClassesRestore() for more information.
 *
\*************************************************************************************************/
function swapCssClasses(){
	var i, el, arg = swapCssClasses.arguments, d = document;

	var swCssClasses =  new Array;	//swImg = save swap Image
	for (i=0, j=0; i<arg.length-1; i+=2){
	  el = d.getElementById(arg[i]);
		if (el){ // arg[i] = element name
			swCssClasses[j++] = el;
			el.oClassName = el.className;	  //oClassName = old css name
			el.className =  arg[i+1];     // arg[i+1] = new css name
		}
	}
	
	d.swCssClasses = swCssClasses;
}

function setSwapCssClasses(){
	var i, el, arg = setSwapCssClasses.arguments, d = document;

	d.swCssClasses =  new Array;	//swImg = save swap css classes
	for (i=0, j=0; i<arg.length-1; i+=2){
	  el = d.getElementById(arg[i]);
	  if (el){ // arg[i] = element name
		el.oClassName = arg[i+1];	
	  }
	}
}
/*************************************************************************************************\
 *	public function swapCssClassesRestore()
 *
 *	restore to orginal state of previous css swap operation
\*************************************************************************************************/
function swapCssClassesRestore(){
	var sw = document.swCssClasses;
	var i, el;
	for (i=0; i < sw.length; i++){	
		el = sw[i];		
		el.className = el.oClassName;
	}
}
function standardizeEvent(ev) {
  if (isIE) {
		ev.target = ev.srcElement;
		
		ev.stopPropagation = function () { ev.cancelBuble = true ; };
		ev.preventDefault = function () { ev.returnValue = true ; };
		
		ev.pageOffsetLeft = screenX = ev.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
		ev.pageOffsetTop = ev.clientY + document.documentElement.scrollTop + document.body.scrollTop;

  } else if (isDOM) {
  
		ev.pageOffsetLeft = ev.clientX + window.scrollX;
		ev.pageOffsetTop = ev.clientY + window.scrollY;	
		
	} else {
	
    // just ignore this, hopefully the browser can support 	
	  if (isDebugEnabled)
	    alert("ERROR: Dynlite doesn't support this browser");
	}
	
	return ev;
}


/*****************************************************************************************\
 *	addEventListener(el, eventType, func, useCapture)
\*****************************************************************************************/
function addEventListener(el, eventType, func, useCapture){
	if (el.addEventListener) 
	  el.addEventListener(eventType, func, useCapture);
	  
	// CP: else if statement removed to avoid conflict with jQuery 
	/*else if (isIE)	{
		el.attachEvent('on'+eventType, func);

		//something is wrong here
		//if (useCapture && el.setCapture) el.setCapture();
	}*/
	//else if (isOldNS) 
	//  eval('el.on'+eventType+'=func')
}

registerDynliteLibOnloadHandler();

/*************************************************************************************************\
										END OF LIBRARY
\*************************************************************************************************/
