// Global Variables
// Standard DOM
var browser = navigator.appName;
var body = 'window.self';
var access = 'inner';

// MSIE DOM exceptions
if ( browser == 'Microsoft Internet Explorer') {
  body = 'document.body';
  access = 'client';
}

// Generic Functions
// =================
function get_width()
{
  return eval(body + '.' + access + 'Width');
}

function get_height()
{
  return eval(body + '.' + access + 'Height');
}

//***** Getting the resolution

function get_res_v()
	{
		var sc = self.screen;
		return sc.availHeight;
	}

function get_res_h()
	{
		var sc = self.screen;
		return sc.availWidth;
	}

//***** Returning the object width

function find_wid(id)
{
	nodeObj = document.getElementById(id);
	return nodeObj.offsetWidth;
}

//***** Returning the object height

function find_hght(id)
{
	nodeObj = window.top.document.getElementById(id);
	return nodeObj.offsetHeight;
}

//***** getting the vertical (on x-axis) alignment of the object centered

function cen_obj(id)
	{
		var s1 = find_wid(id)
		var s = eval(s1 + '/2');
		var w = get_width();
		var mid = eval(w + '/2');
		var pos = eval(mid + '-' + s);
		var l = pos + 'px';
		var nodeObj = document.getElementById(id);
		nodeObj.style.left = l;
	}

//***** Returning the object's position on screen

function get_left_pos(id)
{
	var y = window.top.document.getElementById(id);
	return y.offsetLeft;
}

function get_top_pos(id)
{
	var y = window.top.document.getElementById(id);
	return y.offsetTop;
}

function get_bot_pos(id)
{
	var y = document.getElementById(id);
	return y.offsetBottom;
}

// **** Script to load iframe

function load_frame(id,theURL)
	{
		document.getElementById(id).src = theURL;
	}

