
window.focus();
window.status = "Impact";

if ( window.name == "" )
{
	window.name = "Corporate" ;
}

Explorer = (document.all);
function SetTxtDate(objtxt, daysToAdd)
{
	var vTodayDate = new Date();
	var vDateToShow = new Date((vTodayDate.getYear() < 1000 ? (parseInt(vTodayDate.getYear())+1900) : vTodayDate.getYear()), vTodayDate.getMonth(), (parseInt(vTodayDate.getDate())+daysToAdd), 0, 0, 0);
	var vTxtValue = vDateToShow.getDate() + "/" + (parseInt(vDateToShow.getMonth())+1) + "/" + (vDateToShow.getYear() < 1000 ? (parseInt(vDateToShow.getYear())+1900) : vDateToShow.getYear()) ;

	document.getElementById(objtxt).value = vTxtValue;
}

function SearchSite(popurl)
{
	var sKeyword = document.getElementById("txtSearch").value;
	sKeyword = replaceAll(sKeyword, "'", " ");
	sKeyword = replaceAll(sKeyword, "\"", " ");
	OpenPopup(popurl + "?Keyword=" + escape(sKeyword), "Corporate", "", "", 'true');
}

function OpenPopup(popurl, target, width, height, resizable)
{
	var vAttributes = "";
	if ( width != "" ){ vAttributes += "width=" + width + ", " }
	if ( height != "" ){ vAttributes += "height=" + height + ", " }
	if ( resizable == "true" ){ vAttributes += "status=yes,resizable=yes,scrollbars=yes,location=yes,menubar=yes,toolbar=yes" }
	else if ( resizable == "popup" ){ vAttributes += "status=yes,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no" } 
	else{ vAttributes += "status=no,resizable=no,scrollbars=no,location=no,menubar=no,toolbar=no" }

	var winpops = window.open(popurl, target, vAttributes);
}

function rollImage(img)
{
	var sExt = "_off";
	var sExt2Replace = "_on";

	if (img.src.indexOf("_on") > 0 )
	{
		sExt = "_on";
		sExt2Replace = "_off";
	}

	img.src = img.src.replace(sExt, sExt2Replace) ;
}

function ToggleTopMenu(link, divid)
{
	var div = document.getElementById(divid);

	if (div.style.display == 'none' || div.style.display == "")
		div.style.display = "block";

	link.onmouseout = function() {
		t = setTimeout("closeMenu('" + divid + "')", 100);
	}

	div.onmouseover = function() {
		clearTimeout(t);
	}

	div.onmouseout = function(e) {
		if (Explorer)
		{
			if (!event.fromElement.contains(event.toElement) && !div.contains(event.toElement))
				t = setTimeout("closeMenu('" + divid + "')", 100);
		}
		else
		{
			var targetAncestor = e.relatedTarget;
			while (targetAncestor.parentNode) {
				if (targetAncestor === e.currentTarget) {
					return; // ITS MOVING OUT OF US, BUT INTO OUR PROGENY, SO NOT REALLY OUT!
				}
				targetAncestor = targetAncestor.parentNode;
			}

			t = setTimeout("closeMenu('" + divid + "')", 200);
		}
	}
}

function closeMenu(divid)
{
	var div = document.getElementById(divid);
	div.style.display = "none";
}

function popupMessage()
{
	// SET MESSAGE VALUES
	var to = "";
	var cc = "";
	var bcc = "";
	var subject = "Impact Site";
	var body = "This page link is sent from Information Systems Impact' site:\r\n" + window.location.href;

	var doc = "mailto:" + to + "&subject=" + escape(subject) + "&body=" + escape(body); 
	window.location = doc;
}

function colorObjects(objArr)
{
	for (var x = 1; x < eval("document.forms[0].elements.length"); x++)
	{
		if ( document.forms[0].elements[x].type == "select-multiple" || 
			 document.forms[0].elements[x].type == "select-one" || 
			 document.forms[0].elements[x].type == "text" || 
			 document.forms[0].elements[x].type == "password" || 
			 document.forms[0].elements[x].type == "textarea" )
		{
			document.forms[0].elements[x].style.backgroundColor = "";
			document.forms[0].elements[x].style.color = "#333333";
		}
	}

	var objectToColor = objArr.split("#") ;
	for (var i = 0; i < objectToColor.length ; i++)
	{
		if ( document.getElementById(objectToColor[i]) != null )
		{
			document.getElementById(objectToColor[i]).style.backgroundColor = "#9EC4CD";
			document.getElementById(objectToColor[i]).style.color = "#ffffff";
		}
	}
}

function ConvertAllFlash()
{
	if ( isIE() )
	{
		E=document.getElementsByTagName("object");
		for(i=0;i<=E.length-1;i++)
		{
			E[i].outerHTML = E[i].outerHTML;
			E[i].play();
		}
	}
}

function isIE()
{
	var strBrwsr = navigator.userAgent.toLowerCase();
	if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0)
		return true;
	else
		return false;
}

setTimeout("ConvertAllFlash();", 1);

window.onunload = function ()
{
	if ( isIE() )
	{
		E=document.getElementsByTagName("object");
		for(i=0;i<=E.length-1;i++)
		{
			E[i].outerHTML = "";
		}
	}
}