function ValidateSearch (thisForm) {
	if (thisForm.queryText.value == "") {
		alert ("You must enter a keyword before you perform a search.");
		return false;
	}
	return true;
}
function HomePageInit () {
	/*
	if (document.all && navigator.platform.indexOf ("Mac") > -1) {
		if (document.all.BottomFeatureContainer) {
			document.all.BottomFeatureContainer.style.position = "absolute";
			document.all.BottomFeatureContainer.style.top = "348px";
			document.all.BottomFeatureContainer.style.left = "10px";
		}
	}
	*/
}
function HomePageImage () {
	document.write ('<img src="/images/index/photos/' + RanNumber + '.jpg" width="334" height="287"  alt="" />');
}
function RanNum () {
	var RootNum = new Date ();
	if (parseInt (RootNum % 3) < 1) {
		return ("003");
	}
	else if (parseInt (RootNum % 2) < 2) {
		return ("002");
	}
	else {
		return ("001");
	}
}
var RanNumber = RanNum ();


function GetObjectRef (ObjId) {
	if (document.getElementById) {
		return document.getElementById (ObjId);
	}
	else if (document.all) {
		return document.all[ObjId];
	}
	else {
		return null;
	}
}
function GetParentObjectRef (ObjId) {
	return GetObjectRef (ObjId.substring (3, ObjId.length));
}
function MenuScriptInit () {
	st_onload();
}
function ChangeCase (thisSelect) {
	this.location.href = thisSelect.options[thisSelect.selectedIndex].value;
}




var LastClickedThumbnail = null;
function ChangeThumbnail (num, urlroot) {
	var ClickedThumbnail = GetObjectRef ("ThumbnailSquare" + num);
	if (LastClickedThumbnail != null) {
		LastClickedThumbnail.className = "SquareUp";
	}
	if (ClickedThumbnail != null) {
		ClickedThumbnail.className = "SquareDown";
		LastClickedThumbnail = ClickedThumbnail;
	}
	var ImgPortfolioThumbnail = document.images.PortfolioThumbnail;
	if (ImgPortfolioThumbnail) {
		ImgPortfolioThumbnail.src = urlroot + "-" + num + "s.gif";
	}
	return false;
}
function OpenPortfolioClient (thisSelect) {
	this.location.href = thisSelect.options[thisSelect.selectedIndex].value;
}
function OpenPortfolioImageWindow () {
	var ImgPortfolioThumbnail = document.images.PortfolioThumbnail;
	if (ImgPortfolioThumbnail) {
		EnlargeImageSrc = ImgPortfolioThumbnail.src.replace ("s.gif", ".gif");
		var PortfolioImageWindow = OpenWindow (EnlargeImageSrc, "PortfolioThumbnail", "600", "400");
		PortfolioImageWindow.focus ();
	}
	return false;
}
function OpenCaseStudiesImageWindow (url) {
	var PortfolioImageWindow = OpenWindow (url, "PortfolioThumbnail", "600", "400");
	PortfolioImageWindow.focus ();
	return false;
}
function OpenWindow (url, windowName, width, height) {
	var tempWindow = window.open (url,windowName,'status=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height);
	return tempWindow;
}


function DivMouseOver (ObjId) {
        if (document.getElementById) {
                objMouseOver = document.getElementById(ObjId);
        }
        else if (document.all) {
                objMouseOver = document.all[ObjId];
        }
        else {
                objMouseOver = document.images[ObjId];
        }
	if (objMouseOver) {
		objMouseOver.className="NavItemOver";
	}
	return true;
}
function DivMouseOut (ObjId) {
        if (document.getElementById) {
                objMouseOver = document.getElementById(ObjId);
        }
        else if (document.all) {
                objMouseOver = document.all[ObjId];
        }
        else {
                objMouseOver = document.images[ObjId];
        }

	if (objMouseOver) {
		objMouseOver.className = "NavItem";
	}
	return true;
}






function init () {

}
function loadURL() { 
  var i, args=loadURL.arguments; 
  document.returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}




function ToggleCaseClientInfo (e) {
	var divMoreInfo = GetObjectRef ("CaseClientInfo");
	var divMinMax = GetObjectRef ("MinMaxIcon");
	if (e.cancelBubble) {
		e.cancelBubble = true;
	}
	if (divMoreInfo != null) {
		if (divMoreInfo.style.display != "none") {
			divMoreInfo.style.display = "none";
			divMinMax.src = "/images/buttons/max.gif";
		}
		else {
			divMoreInfo.style.display = "block";
			divMinMax.src = "/images/buttons/min.gif";
		}
	}
	return false;
}


function ToggleMoreInfo (e) {
	var divMoreInfo = GetObjectRef ("DivMoreInfo");
	if (e.cancelBubble) {
		e.cancelBubble = true;
	}
	if (divMoreInfo != null) {
		if (divMoreInfo.style.display != "none") {
			divMoreInfo.style.display = "none";
		}
		else {
			divMoreInfo.style.display = "block";
			SetObjectOffset (divMoreInfo, e);
		}
	}
	return false;
}

function SetObjectOffset (obj, e) {
	var bodyWidth = -1;
	if (document.body.clientWidth) {
		bodyWidth = document.body.clientWidth;
	}
	else if (window.innerWidth) {
		bodyWidth = window.innerWidth;
	}
	
	var offsetY = -1;
	if (obj.offsetHeight) {
		offsetY = obj.offsetHeight;
	}
	
	var offsetX = -1;
	if (obj.offsetWidth) {
		offsetX = obj.offsetWidth;
	}
	
	if (bodyWidth > -1 && offsetY > -1 && offsetX > -1) {
		// only use offset when we can obtain the bodyWidth and the offset
		var top = 0;
		var left = 0;
		if (e.pageX) {
			top = e.pageY - offsetY;
			left = e.pageX - offsetX;
		}
		else if (e.clientX) {
			var scrollTop = 0;
			if (document.body.scrollTop) {
				scrollTop = document.body.scrollTop;
			}
			top = e.clientY - offsetY + scrollTop;
			left = e.clientX - offsetX;
		}
		if (top < 0) {
			top = 0;
		}
		if (left < 0) {
			left = 0;
		}
		obj.style.top = 298 + "px";
		obj.style.left = 169 + "px";
	}
	
}


function ValidateContactForm (thisForm) {
	if (thisForm.Email.value == "") {
		alert ("You must put in your e-mail address.");
		return false;
	}
	return true;
}


var clientWindow = null;
function OpenClientWindow (url) {
	if (clientWindow != null && clientWindow.closed != true) {
		clientWindow.close ();
	}
	clientWindow = window.open (url, "Client");
	clientWindow.focus ();
	return false;
}