function confirmDelete(confirmMsg)
{
	return confirm('Are you sure you want to delete:\n' + confirmMsg + '\n\nThis action cannot be undone');
}

function confirmRemove(confirmMsg)
{
	return confirm('Are you sure you want to remove:\n' + confirmMsg);
}

function confirmBefore(confirmMsg)
{
	return confirm(confirmMsg);
}

function confirmDeleteForward(confirmMsg, newURL)
{
	if (confirmDelete(confirmMsg))
	{
		window.location = newURL;
	}
}

function cmsSelectPop(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem)
{
	var i, j;
	var prompt;
	// empty existing items
	for (i = selectCtrl.options.length; i >= 0; i--)
	{
		selectCtrl.options[i] = null;
	}

	prompt = (itemArray != null) ? goodPrompt : badPrompt;
	if (prompt == null)
	{
		j = 0;
	}
	else
	{
		selectCtrl.options[0] = new Option(prompt);
		j = 1;
	}

	if (itemArray != null)
	{
		// add new items
		for (i = 0; i < itemArray.length; i++)
		{
			selectCtrl.options[j] = new Option(itemArray[i][0]);
			if (itemArray[i][1] != null)
			{
				selectCtrl.options[j].value = itemArray[i][1];
			}
			j++;
		}

		selectCtrl.options[0].selected = true;
	}
}

function popupPage(pagename)
{
	savevar = 'location=no,menubars=no,toolbars=no';
	window.open(pagename,'pop','scrollbars=yes,resizable=yes,width=550,height=450');
}

function cmsJavaImage(vcName,vcUrl)
{
	document[vcName].src=vcUrl;
	return false;
}


function cmsEnabled(voSelect, voText)
{
	voText.disabled = (voSelect.selectedIndex > 0);
}

function cmsDisable(voText, vbTrue)
{
	voText.disabled = vbTrue;
}

function cmsConfirm(confirmMsg)
{
	return confirm(confirmMsg);
}

//-[AJAX]----

function cms_gethttpobj()
{
	if (window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	else
	{
		return null;
	}
}

function cms_loadsecurity(modid, uid)
{
	httpObj = cms_gethttpobj();
	if (httpObj == null)
	{
		alert("Your browser does not support AJAX.");
	}
	else
	{
		objTable = document.getElementById('cms_sectab');
		objTable.style.display = '';

		lcLoad = '<tbody><tr><td><center>SECURITY</center></td></tr></tbody>';

		document.getElementById('SecurityContent').innerHTML=lcLoad;


		var dateObject = new Date();
		lcGet = "/ajax/security.php?ajax[modid]=" + modid + "&ajax[uid]=" + uid;
		lcGet = lcGet + '&ajax[SFAD]=' + dateObject.getHours() + dateObject.getMinutes() + dateObject.getSeconds();

document.getElementById('secFrame').src = lcGet;

//		httpObj.onreadystatechange = cms_securityupdate;
//		httpObj.open('GET', lcGet, true);
//		httpObj.send(null);
	}

	return false;
}

function cms_cancelsecurity()
{
	objTable = parent.document.getElementById('cms_sectab');
	objTable.style.display = 'none';
}

function cms_securityupdate()
{
	if(httpObj.readyState == 4)
	{
		objTable = document.getElementById('SecurityContent');
		objTable.innerHTML = httpObj.responseText;
	}
}


//-[ HINTS START ]-----------------------------------------------------------------------------------

var cmsHintsCFG = 
{
	'top'        : 10, // a vertical offset of a hint from mouse pointer
	'left'       : 10, // a horizontal offset of a hint from mouse pointer
	'css'        : 'cms_tbody', // a style class name for all hints, TD object
	'show_delay' : 500, // a delay between object mouseover and hint appearing
	'hide_delay' : 90000, // a delay between hint appearing and hint hiding
	'wise'       : true,
	'follow'     : true,
	'z-index'    : 0 // a z-index for all hint layers
}

// Title: Tigra Hints
// URL: http://www.softcomplex.com/products/tigra_hints/
// Version: 1.3
// Date: 09/03/2003 (mm/dd/yyyy)
// Note: Permission given to use this script in ANY kind of applications if
//    header lines are left unchanged.

var THintsS = [];
function THints (o_cfg, items) {
	this.n_id = THintsS.length;
	THintsS[this.n_id] = this;
	this.top = o_cfg.top ? o_cfg.top : 0;
	this.left = o_cfg.left ? o_cfg.left : 0;
	this.n_dl_show = o_cfg.show_delay;
	this.n_dl_hide = o_cfg.hide_delay;
	this.b_wise = o_cfg.wise;
	this.b_follow = o_cfg.follow;
	this.x = 0;
	this.y = 0;
	this.divs = [];
	this.iframes = [];
	this.show  = TTipShow;
	this.showD = TTipShowD;
	this.hide = TTipHide;
	this.move = TTipMove;
	// register the object in global collection
	this.n_id = THintsS.length;
	THintsS[this.n_id] = this;
	// filter Netscape 4.x out
	if (document.layers) return;
	var b_IE = navigator.userAgent.indexOf('MSIE') > -1,
	s_tag = ['<iframe frameborder="0" scrolling="No" id="TTifip%name%" style="visibility:hidden;position:absolute;top:0px;left:0px;',   b_IE ? 'width:1px;height:1px;' : '', o_cfg['z-index'] != null ? 'z-index:' + o_cfg['z-index'] : '', '" width=1 height=1></iframe><div id="TTip%name%" style="visibility:hidden;position:absolute;top:0px;left:0px;',   b_IE ? 'width:1px;height:1px;' : '', o_cfg['z-index'] != null ? 'z-index:' + o_cfg['z-index'] : '', '"><table cellpadding="0" cellspacing="0" border="0"><tr><td class="', o_cfg.css, '" nowrap>%text%</td></tr></table></div>'].join('');


	this.getElem = 
		function (id) { return document.all ? document.all[id] : document.getElementById(id); };
	this.showElem = 
		function (id, hide) { 
		this.divs[id].o_css.visibility = hide ? 'hidden' : 'visible'; 
		this.iframes[id].o_css.visibility = hide ? 'hidden' : 'visible'; 
		};
	this.getWinSz = window.innerHeight != null 
		? function (b_hight) { return b_hight ? innerHeight : innerWidth; }
		: function (b_hight) { return document.body[b_hight ? 'clientHeight' : 'clientWidth']; };	
	this.getWinSc = window.innerHeight != null 
		? function (b_hight) { return b_hight ? pageYOffset : pageXOffset; }
		: function (b_hight) { return document.body[b_hight ? 'scrollTop' : 'scrollLeft']; };	
	if (window.opera) {
		this.getSize = function (id, b_hight) { 
			return this.divs[id].o_css[b_hight ? 'pixelHeight' : 'pixelWidth']
		};
		document.onmousemove = function () {
			for (var n_i in THintsS) {
				THintsS[n_i].x = event.clientX;
				THintsS[n_i].y = event.clientY;
				if (THintsS[n_i].b_follow && THintsS[n_i].visible) 
					THintsS[n_i].move(THintsS[n_i].visible);
			}
			return true;
		};
	}
	else {
		this.getSize = function (id, b_hight) { 
			return this.divs[id].o_obj[b_hight ? 'offsetHeight' : 'offsetWidth'] 
		};
		document.onmousemove = b_IE
		? function () {
			for (var n_i in THintsS) {
				THintsS[n_i].x = event.clientX + document.body.scrollLeft;
				THintsS[n_i].y = event.clientY + document.body.scrollTop;
				if (THintsS[n_i].b_follow && THintsS[n_i].visible) 
					THintsS[n_i].move(THintsS[n_i].visible);
			}
			return true;
		} 
		: function (e) {
			for (var n_i in THintsS) {
				THintsS[n_i].x = e.pageX;
				THintsS[n_i].y = e.pageY;
				if (THintsS[n_i].b_follow && THintsS[n_i].visible) 
					THintsS[n_i].move(THintsS[n_i].visible)
			}
			return true;
		};
	}
	for (i in items) {
		document.write (s_tag.replace(/%text%/g, items[i]).replace(/%name%/g, i));
		this.divs[i] = { 'o_obj' : this.getElem('TTip' + i) };
		this.divs[i].o_css = this.divs[i].o_obj.style;
		this.iframes[i] = { 'o_obj' : this.getElem('TTifip' + i) };
		this.iframes[i].o_css = this.iframes[i].o_obj.style;
		
	}
}
function TTipShow (id) {
	if (document.layers) return;
	this.hide();
	if (this.divs[id]) {
		if (this.n_dl_show) this.divs[id].timer = setTimeout('THintsS[' + this.n_id + '].showD("' + id + '")', this.n_dl_show);
		else this.showD(id);
		this.visible = id;
	}
}

function TTipShowD (id) {
	this.move(id);
	this.showElem(id);
	if (this.n_dl_hide) this.timer = setTimeout("THintsS[" + this.n_id + "].hide()", this.n_dl_hide);
}

function TTipMove (id) {
	var n_x = this.x + this.left, n_y = this.y + this.top;
	if (this.b_wise) {
		var n_w = this.getSize(id), n_h = this.getSize(id, true),
		n_win_w = this.getWinSz(), n_win_h = this.getWinSz(true),
		n_win_l = this.getWinSc(), n_win_t = this.getWinSc(true);
		if (n_x + n_w > n_win_w + n_win_l) n_x = n_win_w + n_win_l - n_w;
		if (n_x < n_win_l) n_x = n_win_l;
		if (n_y + n_h > n_win_h + n_win_t) n_y = n_win_h + n_win_t - n_h;
		if (n_y < n_win_t) n_y = n_win_t;
	}
	this.divs[id].o_css.left = n_x;
	this.divs[id].o_css.top = n_y;
	this.iframes[id].o_css.left = n_x;
	this.iframes[id].o_css.top = n_y;
	this.iframes[id].o_css.height = n_h-this.top;
	this.iframes[id].o_css.width = this.getSize(id, false)-this.left;
}

function TTipHide () {
	if (this.timer) clearTimeout(this.timer);
	if (this.visible != null) {
		if (this.divs[this.visible].timer) clearTimeout(this.divs[this.visible].timer);
		setTimeout('THintsS[' + this.n_id + '].showElem("' + this.visible + '", true)', 10);
		this.visible = null;
	}
}

//-[ HINTS END ]-----------------------------------------------------------------------------------


