var tipImage = new Image();
tipImage.src = "../images/tooltip_frame.gif";


function CreateTip()
{
	var cellpadding = 1;
	var content = "<TABLE border=0 cellspacing=0 cellpadding=";
	
	content += cellpadding;
	content += " width=";
	content += tipImage.width;
	content += " height=";
	content += tipImage.height;
	content += " background='";
	content += tipImage.src;
	content += "'><TR><TD>&nbsp&nbsp</TD><TD align=left valign=top><FONT color='white' size=1>";
	content += this.text;
	content += "</FONT></TD></TR></TABLE>";
	genLayer(this.name,this.x,this.y,tipImage.width,tipImage.height,hideName,content);
}

function CreateItem()
{
	var content = "<A href='";
	var layerName = '"' + this.tip.name + '"';
	
	content += this.href;
	content += "' onMouseOver='showLayer(";
	content += layerName;
	content += ");' onMouseOut='hideLayer(";
	content += layerName;
	content += ");'><IMG border=0 src='";
	content += this.pic.src;
	content += "'></A>" ;
	genLayer(this.name,this.x,this.y,this.pic.width,this.pic.height,showName,content);
	this.tip.CreateTip();
}

function CTip(name,x,y,text)
{
	this.name = name;
	this.x = x;
	this.y = y;
	this.text = text;
	this.CreateTip = CreateTip;
}

function CItem(name,x,y,href,pic,tip)
{
	this.name = name;
	this.x = x;
	this.y = y;
	this.href = href;
	this.tip = tip;
	this.pic = new Image();
	this.pic.src = pic;
	this.CreateItem = CreateItem;
}

function CreateWindow(imageName,comment)
{
	var newWin = window.open("","ImgWin","height=500, width=700");
	var name = "'" + imageName + "'";
	newWin.document.write("<HTML><HEAD><TITLE>" + comment + "</TITLE></HEAD><BODY topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0><IMG src=" + name + "></BODY></HTML>");
}
