/*!
 * CKBE Common Functions
 * http://www.ckbe.com/
 *
 * Copyright 2010, CKBE
 * All Rights Reserved.
 *
 * Requires jQuery JavaScript Library v1.4.2
 * Copyright 2010, John Resig
 * http://www.jquery.com/
 * Released under the MIT or GPL Version 2 licenses.
 *
 * Date: Sun Jun 06 18:57:26 2010
 */

// ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Window Functions.

function ckbeCommon_windowModal(address, width, height) {
	
	if (window.showModalDialog) {
		
		window.showModalDialog(address,'mWindow', 'dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;scroll:no;');
		
	} else {
		
		window.open(address,'mWindow', 'width=' + width + ',height=' + height + ' ,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
		
	}
	
}

// ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Value Functions.

function ckbeCommon_getValue_position(obj) {
	
	var _x = 0;
	var _y = 0;
	
	while(obj) {
	
		_x += obj.offsetLeft;
		_y += obj.offsetTop;
		obj = obj.offsetParent;
	
	}
	
	return { x: _x, y: _y };
	
}

function ckbeCommon_getValue_dimension(obj) {
	
	var _w = 0;
	var _h = 0;
	
	_w = obj.offsetWidth;
	_h = obj.offsetHeight;
	
	return { w: _w, h: _h };
	
}