
function ClassObject(obj) {

    this._obj = obj;
    this._id = obj.getAttribute("id");
    this._timeout_obj;
    this._timeout_obj;
    this._obj_pos;
    this._obj_opacity;
    this._obj_dimension;

}

//===================================================
// Find X Y Positions
//===================================================

	
	
ClassObject.prototype.determineXYPos = function() {
    
    var obj_local = this._obj;
    
    this._obj_pos = {x: obj_local.offsetLeft||0, y: obj_local.offsetTop||0};
		
	while(obj_local = obj_local.offsetParent) {
			
		this._obj_pos.x += obj_local.offsetLeft||0;
		this._obj_pos.y += obj_local.offsetTop||0;

	}
	
}


ClassObject.prototype.getXPos = function() {
				
	return this._obj_pos.x;

}

ClassObject.prototype.getYPos = function() {
				
	return this._obj_pos.y;

}


ClassObject.prototype.setXForObject = function(x) {
				
	this._obj.style.left = x+'px';

}
	
ClassObject.prototype.setYForObject = function(y){
		
	this._obj.style.top = y+'px';

}

ClassObject.prototype.setXYForObject = function(x,y){
		
	this.setXForObject(x);
	this.setYForObject(y);

}

ClassObject.prototype.determineWidthHieght = function() {
    
    var obj_local = this._obj;
    
    this._obj_dimension = {width: obj_local.offsetWidth, height: obj_local.offsetHeight};   
	
	this._obj_dimension.width = obj_local.offsetWidth;
   
	this._obj_dimension.height = obj_local.offsetHeight;
	
}

ClassObject.prototype.getWidth = function() {
				
	return this._obj_dimension.width;

}

ClassObject.prototype.getHeight = function() {
				
	return this._obj_dimension.height;

}

ClassObject.prototype.setWidthForObject = function(width) {
				
	this._obj.style.width = width+'px';

}
	
ClassObject.prototype.setHeightForObject = function(height){
		
	this._obj.style.height = height+'px';

}

ClassObject.prototype.setWidthHeightForObject = function(width,height){
		
	this.setWidthForObject(width);
	this.setHeightForObject(height);

}

	
ClassObject.prototype.setVisibleForObject = function(value){
		
	this._obj.style.visibility = value;
		
}


ClassObject.prototype.setVisibleWithOpacityForObject = function(){

	this._obj.style.visibility  = 'visible';
	this._obj.style.display     = 'block';
    this._obj.style.opacity     =  1;
    this._obj.style.filter      =  "alpha(opacity=100)"; 
		
}

ClassObject.prototype.setHideWithOpacityForObject = function(value){

	this._obj.style.visibility  = 'hidden';
	this._obj.style.display     = 'none';
    this._obj.style.opacity     =  0;
    this._obj.style.filter      =  "alpha(opacity=0)"; 
		
}

ClassObject.prototype.hideLayerStart = function(){

    var _this = this; 

    //Allow a 300 milli-seconds count before hiding layer:
    this._obj_opacity = this._obj.style.opacity;
 
    this._timeout_obj = _this.hideLayer();
    
}

ClassObject.prototype.hideLayerStop = function(){

    clearTimeout(_timeout_obj);

}

ClassObject.prototype.hideLayer = function(){

    var _this = this;
    
    if (this._obj_opacity > 0.11 && navigator.appName != "Microsoft Internet Explorer"){

        this._obj.style.opacity = this._obj_opacity;

	    this._obj.style.filter = 'alpha(opacity='+(this._obj_opacity*100)+');';

        this._obj_opacity -= 0.1;
        
        setTimeout(function(){_this.hideLayer();},30);
    
    }else{

        this.setVisibleForObject('hidden');
	    this._obj.style.opacity =  0.9;

  }

}


ClassObject.prototype.toggleSlide = function(){

    Effect.toggle(this._id,'slide');
    
    //setTimeout("this.setHideWithOpacityForObject()",1000);
    
}

