iens6 = document.all || document.getElementById;
ns4 = document.layers;

var thename;
var theobj;
var thename2;
var theobj2;
var thetext;
var winHeight;
var winPositionFromTop;
var winWidth;
var leftPosition;

function setObj(elementpos,theswitch,inwidth,inheight,leftpos) {
	thetext = textArray[elementpos];
	if (iens6) {
		thename = "viewer"
		theobj = document.getElementById? document.getElementById(thename):document.all.thename;
		
		winHeight = 100;
		if (iens6 && document.all) {
			winPositionFromTop = document.body.clientHeight;
			winWidth = (document.body.clientWidth - document.body.leftMargin);
			leftPosition = 0;
		}
		if (iens6 && !document.all) {
			winPositionFromTop = window.innerHeight;
			winWidth = (window.innerWidth - (document.body.offsetLeft + 20));
			leftPosition = 0;
		}
		if (theswitch == "override") {
			winWidth = inwidth;
			winHeight = inheight;
			if(iens6 && document.all) {
				leftPosition = leftpos;
				if(leftpos == "right") {
					leftPosition = 250;
				}else if(leftpos == "left" || leftpos=="" || leftpos==null) {
					leftPosition = 0;
				}else{
					leftPosition = leftpos;
				}
			}
			if (iens6 && !document.all) {
				if (leftpos == "right") {
					leftPosition = 180;
				} else if(leftpos == "left" || leftpos == "" || leftpos == null) {
					leftPosition = 0;
				} else {
					leftPosition=leftpos;
				}
			}
		}
		theobj.style.width = winWidth;
		theobj.style.height = winHeight;
		theobj.style.left = leftPosition;

		if(iens6 && document.all) {
			theobj.style.top = document.body.scrollTop + winPositionFromTop;
			theobj.innerHTML = "";
			theobj.insertAdjacentHTML("BeforeEnd", "<table cellspacing=0 width=" + winWidth + " height=" + winHeight + " border=0><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" + thetext + "</font></td></tr></table>");
		}
		if (iens6 && !document.all) {
			theobj.style.top = window.pageYOffset + winPositionFromTop;
			theobj.innerHTML = "";
			theobj.innerHTML = "<table cellspacing=0 width=" + winWidth + " height=" + winHeight + " border=0><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" + thetext + "</font></td></tr></table>";
		}
	}
	if (ns4){
		thename = "nsviewer";
		theobj = eval("document." + thename);
		winPositionFromTop = window.innerHeight;
		winWidth = window.innerWidth;
		winHeight = 100;
		leftPosition = 0;
		if(theswitch == "override") {
			winWidth = inwidth;
			winHeight = inheight;
			if(leftpos == "right") {
				leftPosition=180;
			} else if(leftpos == "left" || leftpos == "" || leftpos == null) {
				leftPosition = 0;
			} else {
				leftPosition = leftpos;
			}
		}
		theobj.moveTo(leftPosition, eval(window.pageYOffset + winPositionFromTop));
		theobj.width = winWidth;
		theobj.clip.width = winWidth;
		theobj.document.write("<table cellspacing=0 width=" + winWidth + " height=" + winHeight + " border=0><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" + thetext + "</font></td></tr></table>");
		theobj.document.close();
	}
	viewIt();
}

function viewIt() {
		if (iens6) {
			theobj.style.visibility = "visible";
			if(iens6 && document.all) {
				theobj.style.top = (document.body.scrollTop + winPositionFromTop) - winHeight - 40;
			}
			if(iens6 && !document.all) {
				theobj.style.top = (window.pageYOffset + winPositionFromTop) - winHeight - 40;
			}
			theobj.style.height = winHeight;
		}
		if (ns4) {
			theobj.visibility = "visible";
			theobj.moveTo(0, (eval(window.pageYOffset + winPositionFromTop) - winHeight - 40));
			theobj.height = winHeight;
			theobj.clip.height = winHeight;
		}
}

function stopIt() {
	if (iens6) {
		theobj.innerHTML = ""
		theobj.style.visibility="hidden"
	}
	if (ns4) {
		theobj.document.write("");
		theobj.document.close();
		theobj.visibility = "hidden";
		theobj.width = 0;
		theobj.height = 0;
		theobj.clip.width = 0;
		theobj.clip.height = 0;
	}
}

if (iens6) {
	document.write("<div id='viewer' class='PropertyPopup'></div>")
}

if (ns4) {
	hideobj = eval("document.nsviewer")
	hideobj.visibility="hidden"
}

if (!document.layers&&!document.all&&!document.getElementById) event="test";

function showtip(current,e,text) {
	if (document.all || document.getElementById) {
		thetitle = text.split('<br>');
		if (thetitle.length > 1) {
			thetitles = '';
			for (i = 0; i < thetitle.length; i++)
				thetitles += thetitle[i];
			current.title = thetitles;
		}
		else current.title = text;
	}
	else if (document.layers) {
		document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>');
		document.tooltip.document.close();
		document.tooltip.left = e.pageX + 5;
		document.tooltip.top = e.pageY + 5;
		document.tooltip.visibility = "show";
	}
}
	
function hidetip() {
	if (document.layers)
		document.tooltip.visibility="hidden";
}