var objAdSense = new Object();
objAdSense.arAdSenses = new Array();

objAdSense.flashLoad = false;
objAdSense.scriptLoad = false;
objAdSense.idFlash;

objAdSense.addAdSense = function(id_, display_, wAling_, hAling_, width_, height_){
	var element = document.getElementById(id_);
	element.style.position = 'absolute';
	element.style.top = '0px';
	element.style.left = '0px';
	this.hideElement(id_);
	this.arAdSenses.push({id:id_, display:display_, wAling:wAling_, hAling:hAling_, width:width_, height:height_});
}

objAdSense.getAdSense = function(){
	return this.arAdSenses;
}

objAdSense.hideElement = function(id){
	var element = document.getElementById(id);
	element.style.visibility = 'hidden';
}

objAdSense.showElement = function(id){
	var element = document.getElementById(id);
	element.style.visibility = 'visible';
}

objAdSense.moveAdSense = function(objPosition){
	var element = document.getElementById(objPosition.id);
	element.style.top = objPosition._y+'px';
	element.style.left = objPosition._x+'px';
	this.showElement(objPosition.id);
}

objAdSense.initFlash = function(nameFlash){
	this.idFlash = nameFlash;
	this.scriptLoad = true;
	this.checkLoaders();
}

objAdSense.loadFlash = function(){
	this.flashLoad = true;	
	this.checkLoaders();
}

objAdSense.checkLoaders = function(){
	if(this.flashLoad && this.scriptLoad){
		this.swfObj(this.idFlash).configAdSense();
	}
}
objAdSense.swfObj = function(id){
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[id];
    }else{
        return document[id];
    }
}