function getDivObj(id,parentId){
	return document.getElementById(id);
}

function getWindowWidth(){
	var w=0;
	w=document.body.clientWidth;
	return w;
}

function getWindowHeight(){
	var h=0;
	h=document.body.clientHeight;
	return h;
}

if(navigator.family=='ie4' && navigator.version<5)
	document.getElementById=new Function("id","return document.all[id];");

// xbClipRect

function xbClipRect(a1,a2,a3,a4){
	this.top=0;
	this.right=0;
	this.bottom=0;
	this.left=0;

	if(typeof(a1)=='string'){
		var val;
		var ca;
		var i;
		
		if(a1.indexOf('rect(')==0){
			ca=a1.substring(5,a1.length-1).split(' ');
			for(i=0;i<4;++i){
				val=parseInt(ca[i]);
				ca[i]=val;
			}
			this.top=ca[0];
			this.right=ca[1];
			this.bottom=ca[2];
			this.left=ca[3];
		}
	}
	else if(typeof(a1)=='number' && typeof(a2)=='number' && typeof(a3)=='number' && typeof(a4)=='number'){
		this.top=a1;
		this.right=a2;
		this.bottom=a3;
		this.left=a4;
	}
}

xbClipRect.prototype.top=0;
xbClipRect.prototype.right=0;
xbClipRect.prototype.bottom=0;
xbClipRect.prototype.left=0;


function xbClipRectGetWidth(){
	return this.right-this.left;
}
xbClipRect.prototype.getWidth=xbClipRectGetWidth;

function xbClipRectSetWidth(width){
	this.right=this.left+width;
}
xbClipRect.prototype.setWidth=xbClipRectSetWidth;

function xbClipRectGetHeight(){
	return this.bottom-this.top;
}
xbClipRect.prototype.getHeight=xbClipRectGetHeight;

function xbClipRectSetHeight(height){
	this.bottom=this.top+height;
}
xbClipRect.prototype.setHeight = xbClipRectSetHeight;

function xbClipRectToString(){
	return 'rect('+this.top+' '+this.right+' '+this.bottom+' '+this.left+' '+')';
}
xbClipRect.prototype.toString=xbClipRectToString;

// xbStyle
function xbStyle(obj,position){
	if (navigator.DOMCSS1) this.SO=obj.style;
	this.object=obj;
}

xbStyle.prototype.SO=null;
xbStyle.prototype.object=null;

function xbGetClip(){
	return this.SO.clip;
}

function xbSetClip(sClipString){
	this.SO.clip=sClipString;
}

function xbGetClipTop(){
	var rect=new xbClipRect(this.SO.clip);
	return rect.top;
}

function xbSetClipTop(t){
	var rect=new xbClipRect(this.SO.clip);
	rect.top=t;
	this.SO.clip=rect.toString();
}

function xbGetClipRight(){
	var rect=new xbClipRect(this.SO.clip);
	return rect.right;
}

function xbSetClipRight(r){
	var rect=new xbClipRect(this.SO.clip);
	rect.right=r;
	this.SO.clip=rect.toString();
}

function xbGetClipBottom(){
	var rect=new xbClipRect(this.SO.clip);
	return rect.bottom;
}

function xbSetClipBottom(b){
	var rect=new xbClipRect(this.SO.clip);
	rect.bottom=b;
	this.SO.clip=rect.toString();
}

function xbGetClipLeft(){
	var rect = new xbClipRect(this.SO.clip);
	return rect.left;
}

function xbSetClipLeft(l){
	var rect=new xbClipRect(this.SO.clip);
	rect.left=l;
	this.SO.clip=rect.toString();
}

function xbGetClipWidth(){
	var rect=new xbClipRect(this.SO.clip);
	return rect.getWidth();
}

function xbSetClipWidth(w){
	var rect=new xbClipRect(this.SO.clip);
	rect.setWidth(w);
	this.SO.clip=rect.toString();
}

function xbGetClipHeight(){
	var rect=new xbClipRect(this.SO.clip);
	return rect.getHeight();
}

function xbSetClipHeight(ht){
	var rect=new xbClipRect(this.SO.clip);
	rect.setHeight(ht);
	this.SO.clip=rect.toString();
}

function xbGetLeft(){
	var l=this.SO.left;
	if(l=='') this.SO.left='0px';
	return parseInt('0'+this.SO.left,10);
}

function xbSetLeft(l){
	this.SO.left=l+'px';
}

function xbGetTop(){
	var t= this.SO.top;
	if(t=='') this.SO.top = '0px';
	return parseInt('0' + this.SO.top,10);
}

function xbSetTop(t){
	this.SO.top=t+'px';
}

function xbGetHeight(){
	var ht=this.SO.height;
	ht=parseInt('0'+this.SO.height,10);
	if(ht==0) ht=this.object.offsetHeight;
	return ht;
}

function xbSetHeight(ht){
	this.SO.height=ht+'px';
}

function xbGetWidth(){
	var w=this.SO.width;
	w=parseInt('0'+this.SO.width,10);
	if(w==0) w=this.object.offsetWidth;
	return w;
}

function xbSetWidth(w){
	this.SO.width=w+'px';
}

function xbGetVisibility(){
	return this.SO.visibility;
}

function xbSetVisibility(visibility){
	this.SO.visibility=visibility;
}

function xbSetBackgroundColor(color){
	this.SO.backgroundColor=color;
}

xbStyle.prototype.getClip=xbGetClip;
xbStyle.prototype.setClip=xbSetClip;
xbStyle.prototype.getClipTop=xbGetClipTop;
xbStyle.prototype.setClipTop=xbSetClipTop;
xbStyle.prototype.getClipRight=xbGetClipRight;
xbStyle.prototype.setClipRight=xbSetClipRight;
xbStyle.prototype.getClipBottom=xbGetClipBottom;
xbStyle.prototype.setClipBottom=xbSetClipBottom;
xbStyle.prototype.getClipLeft=xbGetClipLeft;
xbStyle.prototype.setClipLeft=xbSetClipLeft;
xbStyle.prototype.getClipWidth=xbGetClipWidth;
xbStyle.prototype.setClipWidth=xbSetClipWidth;
xbStyle.prototype.getClipHeight=xbGetClipHeight;
xbStyle.prototype.setClipHeight=xbSetClipHeight;
xbStyle.prototype.getLeft=xbGetLeft;
xbStyle.prototype.setLeft=xbSetLeft;
xbStyle.prototype.getTop=xbGetTop;
xbStyle.prototype.setTop=xbSetTop;
xbStyle.prototype.getVisibility=xbGetVisibility;
xbStyle.prototype.setVisibility=xbSetVisibility;
xbStyle.prototype.getHeight=xbGetHeight;
xbStyle.prototype.setHeight=xbSetHeight;
xbStyle.prototype.getWidth=xbGetWidth;
xbStyle.prototype.setWidth=xbSetWidth;
xbStyle.prototype.setBackgroundColor=xbSetBackgroundColor;