// which DOM ?
var isDHTML = 0;
var isNetscape = navigator.appName.indexOf('Netscape') != -1;
var isOpera = navigator.userAgent.indexOf( 'Opera' ) != -1;
var isIE = (navigator.appName.indexOf('Microsoft Internet Explorer') != -1) && ! isOpera;
var isLayers = 0;
var isAll = 0;
var isID = 0;
var browserVersion = parseInt( navigator.appVersion );
if( document.getElementById ) { isID = 1; isDHTML = 1; }
if( document.all ) { isAll = 1; isDHTML = 1; }
if( (browserVersion == 4) && isNetscape )
{ isLayers = 1; isDHTML = 1; }
function whichBrowser()
{
alert( navigator.appName );
alert( navigator.userAgent );
if( isNetscape ) alert( "Netscape" );
if( isOpera ) alert( "Opera" );
if( isIE ) alert( "IE" );
}
function findDOM(objectID,withStyle)
{
if(isLayers)
{
return document.layers[objectID];
}
else
{
if(isID)
{
if(withStyle)
{
//alert( objectID );
theObject = document.getElementById(objectID);
//alert( theObject );
return theObject.style;
}
else
{
return document.getElementById(objectID);
}
}
else if(isAll)
{
if(withStyle)
{
return document.all[objectID].style;
}
else
{
return document.all[objectID];
}
}
}
}
function findDOMInFrame(frameID,objectID,withStyle)
{
if(isLayers)
{
//alert( "isLayers" + objectID );
return top[frameID].document.layers[objectID];
}
else
{
if(isID)
{
if(withStyle)
{
//alert( "isID withStyle" + objectID );
theObject = top[frameID].document.getElementById( objectID );
return theObject.style;
}
else
{
return top[frameID].document.getElementById( objectID );
}
}
else if(isAll)
{
if(withStyle)
{
//alert( "isAll withStyle" + objectID );
return top[frameID].document.all[objectID].style;
}
else
{
return top[frameID].document.all[objectID];
}
}
}
}
function findSideMenuDOM(objectID,withStyle)
{
if(isLayers)
{
return parent.SideMenuFrame.document.layers[objectID];
}
else
{
if(isID)
{
if(withStyle)
{
//alert( objectID );
theObject = parent.SideMenuFrame.document.getElementById(objectID);
//alert( theObject );
return theObject.style;
}
else
{
return parent.SideMenuFrame.document.getElementById(objectID);
}
}
else if(isAll)
{
if(withStyle)
{
return parent.SideMenuFrame.document.all[objectID].style;
}
else
{
return parent.SideMenuFrame.document.all[objectID];
}
}
}
}
function setFocus( target )
{
findDOM( target, 0 ).focus();
}
function centerThem( divID, rightThingID )
{
thing1 = findDOM( divID, 0 );
thing1Style = findDOM( divID, 1 );
thing2 = findDOM( rightThingID, 0 );
thing2Style = findDOM( rightThingID, 1 );
if( window.innerWidth != null )
{
center = window.innerWidth / 2;
}
else if( document.body.clientWidth != null )
{
center = document.body.clientWidth / 2;
}
if( thing1Style.left )
{
width = (thing2Style.left + thing2Style.clip.width) - thing1Style.left;
thing1Style.left = center - ( width / 2 );
}
else if( thing1Style.pixelLeft )
{
width = (thing2Style.pixelLeft + thing2Style.clip.width) - thing1Style.pixelLeft;
thing1Style.pixelLeft = center - ( width / 2 );
}
else if( thing1.offsetLeft )
{
width = (thing2.offsetLeft + thing2.offsetWidth) - thing1.offsetLeft;
//alert( Math.round( center - ( width / 2 )) );
thing1Style.left = Math.round(center - ( width / 2 ));
}
}
function centerIt( thingID )
{
thing = findDOM( thingID, 0 );
thingStyle = findDOM( thingID, 1 );
if( window.innerWidth != null )
{
center = window.innerWidth / 2;
}
else if( document.body.clientWidth != null )
{
center = document.body.clientWidth / 2;
}
if( thing.offsetWidth )
{
thingWidth = thing.offsetWidth;
}
else if( thing.clipWidth )
{
thingWidth = thing.clipWidth;
}
//alert( center - ( thingWidth / 2 ) );
thingStyle.left = center - ( thingWidth / 2 );
}
function centerWithOffset( thingID, offset )
{
thing = findDOM( thingID, 0 );
thingStyle = findDOM( thingID, 1 );
if( window.innerWidth != null )
{
center = window.innerWidth / 2;
}
else if( document.body.clientWidth != null )
{
center = document.body.clientWidth / 2;
}
if( thing.offsetWidth )
{
thingWidth = thing.offsetWidth;
}
else if( thing.clipWidth )
{
thingWidth = thing.clipWidth;
}
//alert( center - ( thingWidth / 2 ) );
thingStyle.left = center - ( thingWidth / 2 ) + offset;
}
function centerWithOffsetAndPegLeft( thingID, offset, pegLeft )
{
thing = findDOM( thingID, 0 );
thingStyle = findDOM( thingID, 1 );
if( window.innerWidth != null )
{
center = window.innerWidth / 2;
}
else if( document.body.clientWidth != null )
{
center = document.body.clientWidth / 2;
}
if( thing.offsetWidth )
{
thingWidth = thing.offsetWidth;
}
else if( thing.clipWidth )
{
thingWidth = thing.clipWidth;
}
//alert( center - ( thingWidth / 2 ) );
var candidate = center - ( thingWidth / 2 ) + offset;
if( candidate < pegLeft )
{
thingStyle.left = pegLeft;
}
else
{
thingStyle.left = candidate;
}
}
function findRight( thingID )
{
result = null;
thing = findDOM( thingID, 0 );
thingStyle = findDOM( thingID, 1 );
if( thingStyle.left )
{
result = thingStyle.left + thingStyle.clip.width;
}
if( thingStyle.pixelLeft )
{
result = thingStyle.pixelLeft + thing.offsetWidth;
}
if( thing.offsetLeft )
{
result = thing.offsetLeft + thing.offsetWidth;
}
return result;
}
function doClick( protoText, sideRoot, parent )
{
top['MenuFrame'].selectMenu( parent );
top['MenuFrame'].eraseIndicators();
findDOMInFrame( 'MenuFrame', protoText + 'MenuIndicatorID', 1 ).visibility="visible";
if( sideRoot )
{
top.SideMenuFrame.location = protoText + 'Side.html';
}
else
{
top.SideMenuFrame.location = 'Blank.html';
}
}
/********************************************************
Pulldown Menus
*********************************************************
Pulldown Menu
tags get written to each html document that will occupy the
ContentFrame frame. The mouse rollover in Menus.html will show and hide the
pulldown menus.
********************************************************/
function MenuItem(title,href,parent,protoText,sideRoot)
{
this.title = title;
this.href = href;
this.parent = parent;
this.protoText = protoText;
this.sideRoot = sideRoot;
this.writeHTML = writeHTMLMenuItem;
}
function writeHTMLMenuItem()
{
accumulator = '
';
accumulator += this.title;
accumulator += '';
document.write( accumulator );
}
function SubMenu(title,href,parent,menuItems)
{
this.title = title;
this.id = title + "ID";
this.href = href;
this.parent = parent;
this.menuItems = menuItems;
this.hasChildren = menuItems.length;
this.writeHTML = writeHTMLSubMenu;
this.hide = hideThis;
}
function hideThis( id )
{
findDOMInFrame( 'ContentFrame', "'" + id + "'" , 1 ).visibility = "visible";
}
function writeHTMLSubMenu()
{
//alert('
');
document.write('
');
for(var i = 0; i
');
}
var overviewSubMenu = new SubMenu( "Overview", "Overview.html", "MainMenuDiv", "" );
var projectManagement = new MenuItem("Project Management","ProjectManagement.html","Skills","ProjectManagement",true);
var design = new MenuItem("Design/Architecture","DesignArchitecture.html","Skills","Design",false);
var programming = new MenuItem("Programming/QA","ProgrammingOverview.html","Skills","ProgrammingQA",true);
var communication = new MenuItem("Communication","TechnicalWriting.html","Skills","Communication",false);
var teaching = new MenuItem("Teaching","Teaching.html","Skills","Teaching",false);
var media = new MenuItem("Media","Art.html","Skills","Media",false);
skillsSubMenu = new SubMenu("Skills","Skills.html","MainMenuDiv",[projectManagement,design,programming,communication,teaching,media]);
var traditional = new MenuItem("Traditional","Traditional.html","Resume","Traditional",false);
var projects = new MenuItem("Projects","AllProjects.html","Resume","Projects",true);
var clients = new MenuItem("Clients","AllClients.html","Resume","Clients",true);
var resumeSubMenu = new SubMenu("Resume","Resume.html","MainMenuDiv",[traditional,projects,clients]);
var initiativeSubMenu = new SubMenu( "Initiative", "Initiative.html", "MainMenuDiv", "" );
var U1Ref = new MenuItem("U1","U1Reference.html","References","U1",false);
var ZoomediaRef = new MenuItem("Zoomedia","ZoomediaReference.html","References","Zoomedia",false);
var ADCORef = new MenuItem("ADCO","ADCOReference.html","References","ADCO",false);
var ZillionsRef = new MenuItem("Zillions","ZillionsReference.html","References","Zillions",false);
var referencesSubMenu = new SubMenu( "References", "References.html", "MainMenuDiv", [U1Ref, ZoomediaRef, ADCORef, ZillionsRef] );
var bioSubMenu = new SubMenu( "Bio", "Bio.html", "MainMenuDiv", "" );
function setupMenus()
{
/*skillsSubMenu.writeHTML();
resumeSubMenu.writeHTML();
referencesSubMenu.writeHTML();
initiativeSubMenu.writeHTML();*/
}
function showSubMenu( subMenuToShow )
{
findDOM( subMenuToShow, 1 ).visibility = "visible";
}
function writeBigInitialCapString( string )
{
var initialCap = '');
}
function changeSidePage( newPage )
{
top["SideMenuFrame"].location = newPage;
}
function getValueFromCookie( PropertyName )
{
var NameValuePair;
var value = "";
//alert( document.cookie);
//debug = PropertyName == "choice";
if( document.cookie.indexOf( PropertyName ) != -1 )
{
var tail = document.cookie.substring( document.cookie.indexOf( PropertyName ) );
var SemicolonPosition = tail.indexOf( ";" );
if( SemicolonPosition != -1 )
{
NameValuePair = tail.substring( 0, SemicolonPosition );
}
else
{
NameValuePair = tail;
}
value = NameValuePair.substring( NameValuePair.indexOf( "=" ) + 1 );
}
return value;
}
function expandoClick( event, offset )
{
var YPosition = 0;
if( isIE )
{
YPosition = document.body.scrollTop + offset;
}
else
{
}
document.cookie = "YPosition=" + YPosition;
}
function saveChoice( choice )
{
document.cookie = "choice=" + choice;
}
function hiliteStoredChoice( defaultChoice )
{
var saver = getValueFromCookie( "choice" );
if( saver != "" && saver != null )
{
setFocus( saver );
}
else
{
setFocus( defaultChoice );
saveChoice( defaultChoice );
}
// fix problem where setFocus() scrolls the tag into view, messing up the expando code
scrollTo( 0, getValueFromCookie( "YPosition" ) );
}
function sideLine()
{
top["SideMenuFrame"].document.write( '
' );
}
function shortLine()
{
top["SideMenuFrame"].document.write( '
' );
}
function centerStuff()
{
//centerWithOffsetAndPegLeft( 'SkillsID', -195, 135 );
//centerWithOffsetAndPegLeft( 'ResumeID', -17, 325 );
//centerWithOffsetAndPegLeft( 'ReferencesID', 160, 520 );
centerBody();
}
function centerBody()
{
if( window.innerWidth != null )
{
c = window.innerWidth / 2;
}
else if( document.body.clientWidth != null )
{
c = document.body.clientWidth / 2;
}
ml = c - 370;
if( ml < 10 ) ml = 10;
this.document.body.style.marginLeft = ml;
mr = c - 230;
if( mr < 0 ) mr = 0;
this.document.body.style.marginRight = mr;
}
function setMargin( pixels )
{
this.document.body.style.marginLeft = pixels;
}
// for convenience, nulls for Netscape or Opera mean use IE values
function setExpandos( IEOffsetArray, NetscapeOffsetArray, OperaOffsetArray )
{
expandos = [ "Expando1ID", "Expando2ID", "Expando3ID", "Expando4ID", "Expando5ID", "Expando6ID", "Expando7ID", "Expando8ID", "Expando9ID", "Expando10ID" ];
var accumulator = 0;
if( isNetscape )
{
accumulator = 11;
}
var offsetArray = null;
if( isIE )
{
offsetArray = IEOffsetArray;
}
else if( isNetscape )
{
offsetArray = NetscapeOffsetArray;
if( NetscapeOffsetArray == null ) offsetArray = IEOffsetArray;
}
else if( isOpera )
{
offsetArray = OperaOffsetArray;
if( OperaOffsetArray == null ) offsetArray = IEOffsetArray;
}
if( offsetArray != null )
{
for( var i = 0; i < offsetArray.length; i++ )
{
accumulator += offsetArray[ i ];
findDOM( expandos[ i ], 1 ).top = accumulator;
}
}
}