
// BROWSER

Browser = function()
{
	this.N4 = (document.layers) ? true : false;
	this.IE = (document.all) ? true : false;
	this.N6 = (document.getElementById) ? true : false;
};

Browser.prototype.whichLayer = function(id)
{
	if (this.N4){		return document.layers[id];
	} else if (this.IE){	return document.all[id].style;
	} else if (this.N6){	return document.getElementById(id).style;}
};

Browser.prototype.getLayerXpos = function(id)
{
	return parseInt(this.whichLayer(id).left);
};

Browser.prototype.getLayerYpos = function(id)
{
	return parseInt(this.whichLayer(id).top);
};

Browser.prototype.setLayerPos = function(id, left, top)
{
	var lay = this.whichLayer(id);
	lay.left = left;lay.top = top;
};

Browser.prototype.moveLayer = function(id)
{
	var IE = navigator.appName.indexOf("Microsoft") != -1;
};

Browser.prototype.sendLayerPos = function(id)
{
	var IE = navigator.appName.indexOf("Microsoft") != -1;
};

Browser.prototype.writeToLayer = function(id, obj)
{
	if (this.N4) {
		document.layers[id].document.close();
		document.layers[id].document.write(obj);
		document.layers[id].document.close();
	} else {
        	if (this.IE) {
			eval("document.all." + id + ".innerHTML='" + obj + "'");
		} else {
			document.getElementById(id).innerHTML = obj;
		}
	}
};


// POPUP
	
function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}


// BGCHANGE

function bgChange(menu,image){
	document.getElementById(menu).style.background= 'url(' + image + ')'; 
}


