//////////////////////////////////
function Destroy(o)
//////////destroys?  a js object
//////////////////////////////////
{
	o=null;
}

////////////////////////////////
function dqescape(s)
/////////escapes double quotes
///////////////////////////////////////////
{	
	var t;
	t=s.replace(/\"/g, "&quot;");
	
	
	return t;

}
////////////////////////////utility function this is so it sorts the array nicely
function compareString(a, b)
///////
////////////////////////////////////
{
	if(a.name >b.name) 
		return 1;
	if(a.name <= b.name) 
		return 0;
}

//////////////////////////////////////
function trunc(s, c)
////////returns a string truncated to the proper amount...
//////////////////////////////////////
{
	if(s && s.length > 0 && s.length > c)
	{
		s=s.substring(0, c);
		s=s+"...";
	}
	return s;
}

////////////////////////////////////////
function vp(x,y)
//////coverts to virutal 640x480 pixels
//////////////////////////////////////
{
	hw=new Object();
	hw.x=Math.round((x / screen.width) * 640);
	hw.y=Math.round((y / screen.height) * 640);

	return hw;
}

//////////////////////////////////////////////
function showme(y)
////////////////shows object props
//////////////////////////////////////////////
{
	for(x in y)
	{
		alert(x + " = " + eval( "y." + x));
	}

}
//////////////////////////////////////////////
function GrabFocus()
//////this is for the macintosh... it allows 1 frame
///////to call it in aanother frame, shifiting the focus
///////////////////////////////////////////////
{
	top.focus();
}

////////////////////////////////////////////////////////////////
function XToWindow(platform, browser)
///////////////
/////////////////////////////////////////////////////////////////
{
	if(platform=="Mac")
	{
		if(browser=="NS4")
			wwidth=screen.width-25;
		else if(browser=="NS45")
			wwidth=screen.width-10;
		else
			wwidth=screen.width;
	}
	else
	{
		if(browser=="NS4")
			wwidth=screen.width-10;
		else if(browser=="NS45")
			wwidth=screen.width-10;
		else
			wwidth=screen.width-10;
	}
	return wwidth;
}
////////////////////////////////////////////////////////////////
function YToWindow(platform, browser)
///////////////
/////////////////////////////////////////////////////////////////
{
	if(platform=="Mac")
	{
	
		if(browser=="NS4")
			wheight=screen.height-60;		
		else if(browser=="NS45")
			wheight=screen.height-50;		
		else
			wheight=screen.height;		

	}
	else
	{
		if(browser=="NS4")
			wheight=screen.height+16;		
		else if(browser=="NS45")
			wheight=screen.height-30;		
		else
			wheight=screen.height-27;		
	}
	return wheight;
}
////////////////////////////////////////////////////////////////
function Dialog(x, y, h, w, u)
//////////////////////////////
///////////////////////////////////////////////////////////////
{
	var x;
	var props;

	props="dependent=no,";
	props+="directories=no,";
	props+="height=" + h + ",";
	props+="hotkeys=0,";
	props+="location=no,";
	props+="menubar=no,";
	props+="resizeable=no,";
	if(navigator.appName.indexOf("Netscape") > -1)
	{
		props+="screenX=" + x + ",";
		props+="screenY=" + y + ",";
	}
	else
	{
		props+="left=" + x + ",";
		props+="top=" + y + ",";
	}
	props+="scrollbars=no,";
	props+="status=no,";
	props+="titlebar=yes,";
	props+="toolbar=no,";
	props+="width=" + w;
	x=window.open(u, "wind", props);
	return x;
}
////////////////////////////////////////////////////////////////
function ScrollingDialog(x, y, h, w, u)
//////////////////////////////
///////////////////////////////////////////////////////////////
{
	var x;
	var props;

	props="dependent=no,";
	props+="directories=no,";
	props+="height=" + h + ",";
	props+="hotkeys=0,";
	props+="location=no,";
	props+="menubar=no,";
	props+="resizeable=no,";
	if(navigator.appName.indexOf("Netscape") > -1)
	{
		props+="screenX=" + x + ",";
		props+="screenY=" + y + ",";
	}
	else
	{
		props+="left=" + x + ",";
		props+="top=" + y + ",";
	}
	props+="scrollbars=yes,";
	props+="status=no,";
	props+="titlebar=yes,";
	props+="toolbar=no,";
	props+="width=" + w;
	x=window.open(u, "wind", props);
	return x;
}
function FontWrap(pt, s)
{
    return pt;
    tt = new String(pt);
    t = tt+"";
    
//	if(navigator.appName.indexOf("Netscape") > -1)
//	{
		if(t.indexOf(">") > -1)
		{
			//t=t.replace(/>/g, "><font class='" + s.fontcss + "'>");
			//t=t.replace(/</g, "</font><");			
			t=t.replace( /(>)([^<>]*)(<)/g, "><font class='" + s.fontcss + "'>" + "$2" + "</font><");

		}
		else
		{
			t="<font class='" + s.fontcss + "'>" + t + "</font>";
		}
//	}
//	else
//		t="<font class='" + s.fontcss + "'>" + t + "</font>";
	

	return t;
}
