function AdjustDialogHeight(requestedHeight)
{
	if (window.dialogHeight)
	{
		var i = parseInt(window.dialogHeight);
		window.dialogHeight = i + requestedHeight - document.body.clientHeight + "px";
	}
}

function GetRandomParameter()
{
	return "&preventCache=" + (Math.random() * 100000);
}

function OpenDaStuff(id, url, left, top, width, height) 
{ 
	return open(url, id, 'scrollbars=0,resizable=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); 
} 

function string_replaceAll(from, to)
{
	return this.split(from).join(to);
}

function ValidateFileName(oSrc, args)
{
	var reg = new RegExp("((.+\\.jp(e)?g)|(.+\\.gif)|(.+\\.swf))$", "i");
	var m = args.Value.match(reg);

	//no invalid extension
	args.IsValid = m != null;
	
	return m != null;
}

String.prototype.replaceAll = string_replaceAll;
var G = document.getElementById;