var objBrowserControl = new Object();

objBrowserControl.nameIframe = 'historyFrame';
objBrowserControl.fileScript = 'Scripts/historyAdd.php';
objBrowserControl.flashLoad = false;
objBrowserControl.scriptLoad = false;
objBrowserControl.idFlash;
objBrowserControl.arHistoryIds;

objBrowserControl.initHistory = function(nameFlash, idDiv){
	this.idFlash = nameFlash;
	var cont = document.getElementById(idDiv);
	cont.innerHTML = '<iframe name="'+this.nameIframe+'" scrolling="no" frameborder="0" width="0px" height="0px"></iframe>';
	this.scriptLoad = true;
	this.checkLoaders();
}

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

objBrowserControl.getNameFrame = function(){
	return this.nameIframe;
}

objBrowserControl.getFileScript = function(){
	return this.fileScript;
}

objBrowserControl.checkLoaders = function(){
	if(this.flashLoad && this.scriptLoad){
		this.arHistoryIds = new Array();
		this.swfObj(this.idFlash).configBrowserControls();
	}
}

objBrowserControl.swfObj = function(id){
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[id];
    }else{
        return document[id];
    }
}

objBrowserControl.addHistory = function(id, title, valor){
	id = Number(id);
	if(this.arHistoryIds[id] != undefined && this.arHistoryIds[id]!=null){
		//Obj para o Safary
			var objText = '';
			for(var i in this.arHistoryIds[id]){
				objText += i+':'+this.arHistoryIds[id][i]+'|';
			}
		this.swfObj(this.idFlash).changeHistory(this.arHistoryIds[id], objText);
	}else if(id == this.arHistoryIds.length){
		this.arHistoryIds[id] = new Object();
		this.arHistoryIds[id].label = title
		this.arHistoryIds[id].value = valor;
	}
}
objBrowserControl.setTitle = function(titlePage){
	document.title = titlePage;
}