// media lib

var mediaLibWindow

function medialib(id)
{
//	closeMediaLib()

	pageURL = "/mediaLib.asp?id=" + id;

	mediaLibWindow = window.open(pageURL,"mediaLib","width=200,height=200");
	mediaLibWindow.focus();
}

function closeMediaLib()
{	if (window["mediaLibWindow"]!= null) { window["mediaLibWindow"].close(); }
}


function goLink(link)
{
	window.open(link);
}

function goLocal(link)
{
	parent.location = link;
}

function checkStuff()
{
	if (parent.frames.length != 0) parent.location = document.location;

	window.moveTo(0,0);
	window.resizeTo(screen.availWidth, screen.availHeight);
}


function cacheImages(imageList)
{
	if (imageList!=null)
	{
		var ar = new Array();
	
		imagesA = imageList.split(":");
		for(i=0;i<imagesA.length;i++) 
		{
			ar[i] = new Image();
			ar[i].src = imagesA[i] 
		}
	}
}






function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


function nOver(id,title,color)
{
	if ((nID!= "")|(nID !=-1)) document.all("p"+id).bgColor = "#CCCCCC"

	document.all("p"+id).bgColor = color
	
	window.status = title

	nID = id
}

function nOut(id)
{
	document.all("p"+id).bgColor = "#CCCCCC"
	window.status = ""
	nID = -1
}

function rez()
{
	sx = screen.availWidth;
	sy = screen.availHeight
	wx = 900;
	wy = 600;

	rezWin = window.open("/rez.html","rez","top=" + (sy/2 - wy/2) + ",left="+ (sx/2 - wx/2) + ",width=" + wx + ",height=" + wy + ",scrollbars,resizable")

}
