<!-- 
// -------------------------
function nada()
{
	// NADA!
}
// -------------------------
function ajax_loadContent(divID, tgt)
{
	var qs
	//. catch div
	if (divID.toLowerCase() == 'dropdown')
	{
		divID = 'dropdown_content';
	}
	//. test for div existsance
	if ( !$(divID) )
	{
		alert('DIV '+ divID +' does not exist');
		return false;
	}
	//. catch missing root refer
	if (tgt.substr(0,1) != '/')
	{
		tgt = '/' + tgt;
	}
	//. seperate query_string from file
	if (tgt.indexOf('?') != '-1')
	{
		qs = tgt.substr( (tgt.indexOf('?')+1) , tgt.length);
		tgt = tgt.substr(0, tgt.indexOf('?'));
		
		//. append divid
		qs = 'divid=' + divID + '&' + qs;
	}
	
	//. append randomisation
	if (qs.indexOf('rand=') == '-1')
	{
		qs += '&rand=' + new Date().getTime();
	}
	new Ajax.Updater(divID, tgt, {method:'get', parameters:qs});
}
// -------------------------
function changeclass_nav(parentID, objectID)
{
		var parent, children, currentChild;
		parent = $(parentID);
		children = parent.childNodes;
		
		for (c=0; c < children.length; c++)
		{
			if (children[c].id == objectID)
			{
				children[c].className = 'on';
			}else{
				children[c].className = '';
			}
		}
}
// -------------------------
// for feature boxes
function changeclass()
{
	if (arguments[0] != null)
	{
		selectedElement = arguments[0];
		numElements = arguments[1];
		baseName = selectedElement.id.substr(0, (selectedElement.id.lastIndexOf('_')+1))
	
		for (c=1; c <= numElements; c++)
		{
			document.getElementById(baseName + c).className = '';
		}
		
		selectedElement.className = 'selected';
	}
}
// -------------------------
function removeDiv(divID)
{
	var el = document.getElementById(divID);
	el.parentNode.removeChild(el);
}
// -------------------------
function show_layer(divID, ajaxURL, popW, popH, pageTitle, actiontype, forcescrollbars)
{
	// remove rand if present
	if (ajaxURL.indexOf('&rand=') != -1)
	{
		ajaxURL = ajaxURL.substr(0, ajaxURL.indexOf('&rand='));
	}
	
	var w = screen.availWidth;
	var h = screen.availHeight;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	
	if (ajaxURL.indexOf('?'))
	{
		tmpURL = ajaxURL.substring(0, ajaxURL.indexOf('?'))
		tmpURLB = ajaxURL.substring(ajaxURL.indexOf('?')+1)
		
		ajaxURL = tmpURL;
		ajaxQUERYSTRING = tmpURLB;
	}else{
		ajaxQUERYSTRING = '';
	}
	
	if (popW <= 320)
	{
		scrolling = 'no';
	}else{
		scrolling = 'auto';
	}
	
	if (forcescrollbars == true)
	{
		scrolling = 'yes';
	}
	
	if (pageTitle != '')
	{
		ajaxQUERYSTRING = ajaxQUERYSTRING + '&title=' + pageTitle;
	}
	
	scrolling = 'yes';
	
	window.open('/popup.php?template='+ajaxURL+'&'+ajaxQUERYSTRING, 'window_' + divID, 'width=' + popW + ',height=' + popH + ',left='+leftPos+',top='+topPos+',toolbars=no,status=yes,scrollbars='+scrolling+',resizeable=yes');
}
// -------------------------
function multiselect_operation(targetfield, needle, replacment)
{
	if (targetfield.value.indexOf(needle) != -1)
	{
		var stringreg = needle + ','
		var re = new RegExp(stringreg, 'gi');
		targetfield.value = targetfield.value.replace(re, '');
	}else{
		//. append
		targetfield.value = targetfield.value + needle + ',';
	}
}
// -------------------------
function gettooltip(obj, ajaxURL, w, h)
{
	var posX = calcLeftPosition(obj);
	var posY = calcTopPosition(obj);
	var tooltiplayer = document.getElementById('tooltip');
	if (tooltiplayer.style.visibility == 'visible')
	{
		//. hide
		tooltiplayer.style.visibility = 'hidden';
		tooltiplayer.style.position = 'absolute';
	}else{
		//. show
		tooltiplayer.style.position = 'absolute';
		tooltiplayer.style.left = posX+'px';
		tooltiplayer.style.top = (posY + 20)+'px';
		
		tooltiplayer.style.width = w+'px';
		tooltiplayer.style.height = h+'px';
		
		ajax_loadContent(tooltiplayer.id, ajaxURL);
		tooltiplayer.style.visibility = 'visible';
	}
}
function calcLeftPosition (obj){
    var curleft = 0;
    if (obj.offsetParent) {
while (1) {
    curleft+=obj.offsetLeft;
    if (!obj.offsetParent) {
break;
    }
    obj=obj.offsetParent;
}
    } else if (obj.x) {
curleft+=obj.x;
    }
    return curleft
}

function calcTopPosition(obj){
    var curtop = 0;
    if (obj.offsetParent) {
while (1) {
    curtop+=obj.offsetTop;
    if (!obj.offsetParent) {
break;
    }
    obj=obj.offsetParent;
}
    } else if (obj.y) {
curtop+=obj.y;
    }
    return curtop;
} 
// -------------------------
 -->