
var win = null;

function pup(url, name, w, h, scroll, pos)
{
		x = 0;
		y = 20;

	if (pos == "random")
	{
   	x = screen.width ? Math.floor(Math.random() * (screen.width - w)) : 100;
   	y = screen.height ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
	}
	else if (pos == "centre")
	{
		x = screen.width ? (screen.width - w) / 2 : 100;
		y = screen.height ? (screen.height - h) / 2 : 100;
	}

	settings = 'width=' + w + ',height=' + h + ',top=' + y + ',left=' + x + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win = window.open(url, name, settings);
	return false;
}

function toggle(oElement)
{
	if (!oElement)
		oElement=event.srcElement;
	s=oElement.ShowHideType;
	var SpanIndex=oElement.sourceIndex;
	var oPre=document.all.item(SpanIndex+1);
	var o=oPre;
	var oDiv=oPre;
  	o=o.nextSibling
	if (o && o.nodeName=="DIV")
	{
		oDiv=o;
	}

	var oFC = oDiv.all.item(0);
	if (oPre.style.display=="none")
	{
		oPre.style.display="block";
		if( oFC && (oFC.tagName == "BUTTON" || oFC.className == "clsShowMe") )
			oDiv.style.display="block";
		oElement.innerText="Hide " + s;
	}
	else
	{
		oPre.style.display="none";		
		if( oFC && (oFC.tagName == "BUTTON" || oFC.className == "clsShowMe") )
			oDiv.style.display="none";
		oElement.innerText="Show " + s;
	}
}

function hideStuff(className, typeStr)
{
	var colPre=document.all.tags("PRE");
	for (var i=0;i<colPre.length;i++)
	{
		if (colPre.item(i).className == className)
		{
			if (colPre.item(i).offsetHeight > 200)
			{
				var oSpan=document.createElement("P");			
				colPre.item(i).parentNode.insertBefore(oSpan,colPre.item(i));
				oSpan.onclick=toggle;
				oSpan.ShowHideType = typeStr;
				oSpan.style.textDecorationUnderline=true;
				oSpan.style.fontWeight="bold";
				oSpan.style.cursor="hand";
				toggle(oSpan);
			}
		}
	}		
}

