function reSizeElement(el, maxHeight, maxWidth){

	if (maxHeight)
	{
		ratio = maxHeight / el.height;
	} else {
		ratio = maxWidth / el.width;
	}
	

	h = el.height * ratio;
	w = el.width * ratio;

	el.height = h;
	el.width = w;

}

function preLoadImages(element){

	


}

function popUp(url, name){

	var w = window.open(url,name,"menubar=no,width=640,height=480,toolbar=no");

}

function ptq(q)
{
/* parse the query */
/* semicolons are nonstandard but we accept them */
var x = q.replace(/;/g, '&').split('&'), i, name, t;
/* q changes from string version of query to object */
for (q={}, i=0; i<x.length; i++)
{
t = x[i].split('=', 2);
name = unescape(t[0]);
if (!q[name])
q[name] = [];
if (t.length > 1)
{
q[name][q[name].length] = unescape(t[1]);
}
/* next two lines are nonstandard */
else
q[name][q[name].length] = true;
}
return q;
}

function parseQuery() {
return ptq(location.search.substring(1).replace(/\+/g, ' '));
}

function preLoadImageList(elementID){
	var elem = document.getElementById(elementID);
	var imageList = new Array();

	var imageElements = elem.getElementsByTagName('img');

	index = 0

	for (x in imageElements)
	{
		imageList[index] = new Image;
		imageList[index].src = imageElements[index].src;
	}
}

function getChildList(element){
	for (x in elem.childNodes)
	{
		if (elem.childNodes[x].nodeName == 'img') // 1: element
		{
			alert(elem.childNodes[x].id);
		}
	}
}