<!--

////////////////////////////////////////
// Designates the appropriate page type
////////////////////////////////////////


// Determines which images to write
function getSection(sect) {
whichset=sect

initialfloater=getChip("thework",whichset);
if (initialfloater==null) initialfloater="0";


floater = "img"+initialfloater;

writemainimg();
}

////////////////////////////////////////
// End page type designation
////////////////////////////////////////

// Handles topnav dynamic images
function navClick(thenav,thediv) {
setChip("thework","section",thenav);

if (document.layers || document.all) {

imgOn(thenav,thediv)	
	
if (thenav!=navFloater)	{
	imgOff(navFloater,thediv);
	navFloater=thenav;
}
//alert("hi");
}	
	
	//for (i=1; i<7; i++) {
	//clickednav="nav"+i
	//if (clickednav==thenav) imgOn(thenav,thediv);
	//else imgOff("nav"+i,thediv);
	//}
	
}

function initialNav() {
curSect=getChip("thework","section")

if (curSect==null) nav="nav1";
else if (curSect=="poster" || curSect=="nav1") nav="nav1"; 
else if (curSect=="info" || curSect=="nav2") nav="nav2";
else if (curSect=="page" || curSect=="nav3") nav="nav3";
else if (curSect=="web" || curSect=="nav4") nav="nav4";
else if (curSect=="identity" || curSect=="nav5") nav="nav5";
else if (curSect=="type" || curSect=="nav6") nav="nav6";
else if (curSect=="apps" || curSect=="nav7") nav="nav7";

//else nav="nav1";
//alert (loc);
if (nav==null) nav='nav1';

navFloater=nav;
navClick(nav, 'topnavDiv');


}

// activates the correct section at body onload
function setNav() {
loc=window.location.href; 
if (loc.indexOf('section')=='-1') loc=getChip("thework","section");

if (loc==null) sect="poster";
else if (loc=="nav1" || loc.indexOf('poster')>0) sect="poster";
else if (loc=="nav2" || loc.indexOf('info')>0) sect="info";
else if (loc=="nav3" || loc.indexOf('page')>0) sect="page";
else if (loc=="nav4" || loc.indexOf('web')>0) sect="web";
else if (loc=="nav5" || loc.indexOf('identity')>0) sect="identity";
else if (loc=="nav6" || loc.indexOf('type')>0) sect="type";
else if (loc=="nav7" || loc.indexOf('apps')>0) sect="apps";

else sect="poster";
setChip("thework","section",sect);
whichset=sect;

sectitem=getChip("thework",sect+"item")
	if (sectitem==null) sectitem=0;
//alert(sectitem)
}


setNav();


// Sets the initial floater number when the page first loads.
var initialfloater="0";
var floater="img0";

var initialfloater=sectitem;
var floater="img"+sectitem;

function writenav () {
preload();

if (document.layers) document.naviconDiv.document.open();
navicon="";

for (i=0; i<eval(whichset+"nav").length; i++) {
odd="#";
odd+=i/2;
if (odd.indexOf(".") == -1) vspace=0 ;
else vspace=4;
if (i==initialfloater) imagestate="1";
else imagestate="";


thedimensions=eval(whichset+'size ['+i+']');
thecomma=thedimensions.indexOf(",");
thewidth=thedimensions.substring(0,thecomma);
theheight=thedimensions.substring(thecomma+1,thedimensions.length);
if (thewidth > theheight) navwidth="40";
else navwidth="27";
thefactor=navwidth/thewidth;
navheight=Math.round(theheight*thefactor);
//alert (navwidth+"---"+navheight);
//alert (thefactor);

if (!document.all) {
navicon+="<table width='68' border='0' cellpadding='0' cellspacing='0'>";
navicon+="<tr><td align=right>";
}

if (document.all && navigator.appVersion.indexOf("Mac")=="-1") {
navicon+="<table width='68' border='0' cellpadding='0' cellspacing='0'>";
navicon+="<tr><td align=right>";
}




navicon+="<A HREF = \"javascript:getImage('"+eval(whichset+'main ['+i+']')+"',"+eval(whichset+'size ['+i+']')+","+i+")\" onMouseOver = \"imgOn('img"+i+"','naviconDiv')\" onMouseOut = \"imgOff('img"+i+"','naviconDiv')\" onClick = \"imgClick('img"+i+"','naviconDiv')\"><IMG SRC=\"images/th_"+eval(whichset+'nav ['+i+']')+"_dim"+imagestate+".gif\" name='img"+i+"' BORDER='0' width='"+navwidth+"' height='"+navheight+"' vspace='"+vspace+"'></a><br>";

if (!document.all) {
navicon+="</td></tr>";
navicon+="</table>";
}

if (document.all && navigator.appVersion.indexOf("Mac")=="-1") {
navicon+="</td></tr>";
navicon+="</table>";
}



}

//writes the full complement of icons to the page
if (document.layers) document.naviconDiv.document.write(navicon);
else if (document.all) document.all.naviconDiv.innerHTML=navicon;
else  document.getElementById('naviconDiv').innerHTML=navicon;

if (document.layers) document.naviconDiv.document.close();
}


function writemainimg () {

initialNav();
theimagetoget=eval(whichset+'main ['+initialfloater+']');
thedimensions=eval(whichset+'size ['+initialfloater+']');
thecomma=thedimensions.indexOf(",");
thewidth=thedimensions.substring(0,thecomma);
theheight=thedimensions.substring(thecomma+1,thedimensions.length);
getImage(theimagetoget,thewidth,theheight,initialfloater);

writenav();

if (!document.layers && !document.all) {
document.getElementById('topnavDiv').style.width=window.innerWidth-160;
}

}

function writedesc (number,txtwidth) {

texttoget=eval(whichset+'text ['+number+']');
//thedimensions=eval(whichset+'size ['+number+']');
thecomma=thedimensions.indexOf(",");
thewidth=thedimensions.substring(0,thecomma);
theheight=thedimensions.substring(thecomma+1,thedimensions.length);

whichsetalt=whichset.toLowerCase();
if (window.innerHeight) {
bookmark="bookmark";
bookmarkalt="link to the "+whichsetalt+" section";
}
else {
bookmark="favorites";
bookmarkalt="link to the "+whichsetalt+" section";
}
currentloc=window.location.href;
quest=currentloc.indexOf('?');
if (quest=="-1") bookmarkloc=currentloc;
else bookmarkloc=currentloc.substring(0,quest);

tableopen="<table width='"+txtwidth+"' cellpadding=0 cellspacing=0 border=0><tr><td valign=top>";
tableclose="</td></tr></table>"

// for IE5 for Mac
if (navigator.appVersion.indexOf("MSIE 5")!="-1" && navigator.appVersion.indexOf("Mac")!="-1" ) {
tableopen=""
tableclose=""
}

if (document.layers || document.all) {
maintext=tableopen+texttoget+"<A HREF = \""+bookmarkloc+"?thesection="+whichset+"\" title=\""+bookmarkalt+"\" onmouseover=\"window.status='"+bookmarkalt+"';return true\" onmouseout=\"window.status=' ';return true\"><img src=\"images/designlink.gif\" name=\""+bookmark+"\" border=0 width=8 height=9 alt=\""+bookmarkalt+"\"></a>"+tableclose;
}

else {
maintext=tableopen+texttoget+tableclose;
}


if (eval(whichset+'more ['+number+']')) {
var icon=eval(whichset+'more ['+number+']')
}
else icon="";

if (document.layers) {
	document.maintxtDiv.document.open();
	document.maintxtDiv.document.write (maintext);
	document.maintxtDiv.document.close();
	
	document.moreiconDiv.document.open();
	document.moreiconDiv.document.write (icon);
	document.moreiconDiv.document.close();	
	}
	
else if (document.all) {
	document.all.maintxtDiv.innerHTML = maintext;
	document.all.moreiconDiv.innerHTML = icon;	
	}

else {
	document.getElementById('maintxtDiv').innerHTML = maintext;
	document.getElementById('moreiconDiv').innerHTML = icon;	
	}

}







// -->
