// JavaScript Document
function GetObjRef (objId) {
	var returnObj = null;
	if (document.getElementById) {
		returnObj = document.getElementById(objId);
	}
	else if (document.all) {
		returnObj = document.all[objId];
	}
	return returnObj;
}

function ValidateSearch (thisForm) {
        if (thisForm.queryText.value == "") {
                alert ("You must enter a keyword before you perform a search.");
                return false;
        }
        return true;
}


function swapImage(name,image) {
    if (document.images)
        document.images[name].src = image;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var newWindow;

function popUp(url,name,width,height) {

winFeatures = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height;

        if (newWindow) {

                if (newWindow.closed == false) {

                        newWindow.focus();

                }

        }

        newWindow = window.open(url,name,winFeatures);

}

/* Portfolio Page */ 

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 GetObjRef (id) {
	if (document.all) {
		return document.all[id];
	}
	else if (document.getElementById) {
		return document.getElementById (id);
	}
	return null;
}

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 OpenWindow (url, windowName, width, height) {
	var tempWindow = window.open (url,windowName,'status=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height);
	return tempWindow;
}
function init () {
		st_onload();
	}