/*version:1.0.6;last update:27.01.2004*/
function getObject(strID){
	var strTemp=strID;
	if(!isString(strID))return strID;
	if(document.getElementById)strID=document.getElementById(strID);
	else if(document.all)strID=document.all[strID];
	else if(document.layers)strID=getLayer(strID);
	else strID=null;
	return strID;}
function getLayer(strId,objRoot){/*only for nn4*/
	var i=0,objLayer=null,objFound=null;
	if(!objRoot)objRoot=window;
	for(i=0;i<objRoot.document.layers.length;i++){
		objLayer=objRoot.document.layers[i];
		if(objLayer.id==strId)return objLayer;
		if(objLayer.document.layers.length)objFound=getLayer(strId,objLayer);/*recursion*/
		if(objFound)return objFound;}
	return null;}
function getHeight(strID){
	var obj=null;
	if(!(obj=getObject(strID)))return 0;
	if(isDefined(obj.offsetHeight))return obj.offsetHeight;/*mozilla,ie*/
	else if(isDefined(obj.style)&&isDefined(obj.style.pixelHeight))return obj.style.pixelHeight;/*ie*/
	else if(isDefined(obj.clip)&&isDefined(obj.clip.bottom))return obj.clip.bottom;/*ns*/
	return 0;}
function setHeight(strID,intHeight){
	var obj=null;
	if(!(obj=getObject(strID)))return;
	if(isDefined(obj.style)&&isDefined(obj.style.height))setCssHeight(obj,intHeight);
	else if(isDefined(obj.style)&&isDefined(obj.style.pixelHeight))obj.style.pixelHeight=intHeight;
	else if(isDefined(obj.clip)&&isDefined(obj.clip.bottom))obj.clip.bottom=intHeight;}
function setCssHeight(obj,intHeight){/*paddings and borders are not a part of the css height*/
	var intPadTop=0,intPadBottom=0,intBorderTop=0,intBorderBottom=0;
	if(isDefined(document.defaultView)&&isDefined(document.defaultView.getComputedStyle)){/*DOM 1*/
		intPadTop=getComputedCssStyle(obj,"padding-top");
		intPadBottom=getComputedCssStyle(obj,"padding-bottom");
		intBorderTop=getComputedCssStyle(obj,"border-top-width");
		intBorderBottom = getComputedCssStyle(obj,"border-bottom-width");
	}else if(isDefined(obj.currentStyle)&&isDefined(document.compatMode)&&document.compatMode=="CSS1Compat"){
		intPadTop=parseInt(obj.currentStyle.paddingTop);
		intPadBottom=parseInt(obj.currentStyle.paddingBottom);
		intBorderTop=parseInt(obj.currentStyle.borderTopWidth);
		intBorderBottom=parseInt(obj.currentStyle.borderBottomWidth);
	}else if(isDefined(obj.offsetHeight)&&isDefined(obj.style.height)){/*?*/ 
		obj.style.height=intHeight+'px';
		intPadTop=obj.offsetHeight-intHeight;}
	if(isNaN(intPadTop))intPadTop=0; 
	if(isNaN(intPadBottom))intPadBottom=0; 
	if(isNaN(intBorderTop))intBorderTop=0; 
	if(isNaN(intBorderBottom))intBorderBottom=0;
	var intSum=intPadTop+intPadBottom+intBorderTop+intBorderBottom;
	var intCssHeight=intHeight-intSum;
	if(isNaN(intCssHeight)||intCssHeight<0)return;
	obj.style.height=intCssHeight+'px';}
function getComputedCssStyle(obj,what){return parseInt(document.defaultView.getComputedStyle(obj,'').getPropertyValue(what));}
function showLayer(strID){
	var obj=null;
	if(!(obj=getObject(strID)))return;
	if(isDefined(obj.style)&&isDefined(obj.style.visibility))obj.style.visibility='visible';
	else if(isDefined(obj.visibility))obj.visibility='show';/*nn*/}
function showLayer2(strID){
	var obj=null;
	if(!(obj=getObject(strID)))return;
	if(isDefined(obj.style)&&isDefined(obj.style.visibility))obj.style.visibility='hidden';
	else if(isDefined(obj.visibility))obj.visibility='hide';/*nn*/}
function addListener(strID,strEventType,strEventListener,blnUseCapture){
	var obj = null;
	if(!(obj=getObject(strID)))return;
	if(!blnUseCapture)blnUseCapture=false;
	strEventType=strEventType.toLowerCase();
	var strEval="obj.on"+strEventType+"=strEventListener";
	if(isDefined(obj.addEventListener))obj.addEventListener(strEventType,strEventListener,blnUseCapture);/*mozilla,DOM1*/
	else if(isDefined(obj.attachEvent))obj.attachEvent("on"+strEventType,strEventListener);/*semi-DOM;ie5.5*/
	else if( isDefined(obj.captureEvents)){/*NN4-*/ 
		obj.captureEvents(eval("Event."+strEventType.toUpperCase()));eval(strEval);
	}else eval(strEval);}
function changeContent(strID,strNewHTML){/*may need some modification*/
	var obj=null;
	if(!(obj=getObject(strID))) return;	
	if(obj.innerHTML)obj.innerHTML=strNewHTML;/*ie*/
	else{/*mozilla*/
		if(obj.document&&obj.document.open){
			obj.document.open();
			obj.document.write(strNewHTML);
			obj.document.close();}}}
function getDimension(objImage){
	if(objImage&&objImage.width&&objImage.height) return new Dimension(objImage.width,objImage.height);
	else return new Dimension(0,0);}
function Dimension(intWidth,intHeight) {
	this.intWidth=intWidth;this.intHeight=intHeight;
	Dimension.prototype.setWidth=function(intW){this.intWidth=intW;};
	Dimension.prototype.setHeight=function(intH){this.intHeight=intH;}
	Dimension.prototype.getWidth=function(){return this.intWidth;};
	Dimension.prototype.getHeight=function(){return this.intHeight;};}