//highslide settings
    hs.graphicsDir = 'highslide/graphics/';
	hs.allowSizeReduction = false;
	hs.dimmingOpacity = 0.75;
    hs.outlineType = 'rounded-white';
	hs.expandDuration = 1000;
	hs.restoreduration = 0;

//color change on mouseover of topics
function mover(aa) {
 aa.classname = 'row1a';
}
function mout(aa) {
 aa.classname = 'row1';
}



function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
	return false;
}

function jumpto()
{
	var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
	var perpage = '{PER_PAGE}';
	var base_url = '{A_BASE_URL}';

	if (page !== null && !isNaN(page) && page > 0)
	{
		document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * perpage);
	}
}

/**
* Find a member
*/
function find_username(url)
{
	popup(url, 760, 570, '_usersearch');
	return false;
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}

	if (!parent)
	{
		return;
	}

	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}


	/**
	* Play quicktime file by determining it's width/height
	* from the displayed rectangle area
	*
	* Only defined if there is a file block present.
	*/
	function play_qt_file(obj)
	{
		var rectangle = obj.GetRectangle();

		if (rectangle)
		{
			rectangle = rectangle.split(',')
			var x1 = parseInt(rectangle[0]);
			var x2 = parseInt(rectangle[2]);
			var y1 = parseInt(rectangle[1]);
			var y2 = parseInt(rectangle[3]);

			var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
			var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
		}
		else
		{
			var width = 200;
			var height = 0;
		}

		obj.width = width;
		obj.height = height + 16;

		obj.SetControllerVisible(true);

		obj.Play();
	}
//more custom stuff
function findPosX(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 findPosY(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;
}


function dropdown(theid, parentelement) {
	var curr = document.getElementById(theid);
	curr.style.left = findPosX(parentelement) - 15 + 'px';
	curr.style.top = findPosY(parentelement) + 12 + 'px';


}

function resizeimg(element) {
	var isMSIE = /*@cc_on!@*/false;
	if(element.width > 640 && isMSIE) {
		element.height = Math.floor(element.height * 640 / element.width);
		element.width = 640;
	}
	else {
		element.style.maxWidth="640px"
		element.style.height="auto";
	}
}

function isIE() {
	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}
