var current_active_gallery_picture = new Array();


function fastSearch()
{
	if (fastSearchSelect = document.getElementById('fast_search'))
	{
		if (destination = fastSearchSelect.options[fastSearchSelect.selectedIndex].value)
		{
			if (destination!="") location.href = destination;
		}
	}
}
function getNode(id)
{
	if(document.all)
	{
	    var node = document.all[id];
	}
	else if(document.layers)
	{
	    var node = document.layers[id];
	}
	else
	{
	    var node = document.getElementById(id);
	}
	if(node)return node;
}

function getParentwindowNode(id)
{
	if(document.all)
	{
	    var node = parent.document.all[id];
	}
	else if(document.layers)
	{
	    var node = parent.document.layers[id];
	}
	else
	{
	    var node = parent.document.getElementById(id);
	}
	if(node)return node;
}

function emptyNode(node)
{
    if(node)
	{
	    while(node.firstChild)
		{
		    node.removeChild(node.firstChild);
		}
	}
}

function getNodeContentWidth(node)
{
    if(node)
	{
		if(document.body.scrollWidth)
		{
			var width = node.scrollWidth;
		}
		else if(document.body.offsetWidth)
		{
			var width = node.offsetWidth;
		}
		if(width)return width;
	}
}

function getNodeContentHeight(node)
{
    if(node)
	{
		if(document.body.scrollHeight)
		{
			var height = node.scrollHeight;
		}
		else if(document.body.offsetHeight)
		{
			var height = node.offsetHeight;
		}
		if(height)return height;
	}
}

function getdocumentscrollHeight()
{
  
		if(document.body.scrollHeight)
		{
			var height = document.body.scrollHeight;
		}
		else if(document.body.offsetHeight)
		{
			var height = document.body.offsetHeight;
		}
		if(height)return height;
}

function change_gallery_main_picture(target_name, picID, SizeX, SizeY, Description){
	obj = getNode("gal_" + target_name);
	obj2 = getNode("gal_text_" + target_name);
	obj3 = getNode("gal_" + target_name + "_thumb_" + picID);
	obj4 = getNode("gal_" + target_name + "_thumb_" + current_active_gallery_picture[target_name]);
	obj.style.background = "url('/picture_w.php?ID=" + picID + "&width=" + SizeX + "&height=" + SizeY + "')";
	obj2.innerHTML = Description;
	current_active_gallery_picture[target_name] = picID;
	obj3.style.display = 'none';
	obj4.style.display = 'block';
}
