// JavaScript Image State

// written by Raymond Dowe
// for nataliebernstein.com
// february 2nd, 2008
// www.raydowe.com


//address of page
var thisAddress = location.href;


//split into pieces @ "/"
afterSplit = thisAddress.split("/");


//remove file extension
filenameSplit = afterSplit[afterSplit.length-1].split(".");
filename = filenameSplit[0];
firstLetter = filename.charAt(0);


//thank you and error get contact header
if (thisAddress == "http://www.nataliebernstein.com/" || thisAddress == "http://nataliebernstein.com/") {
	filename = "home";
} else if (filename == "thankyou" || filename == "error") {
	filename = "contacts";
} else if (filename == "resume") {
	filename = "resume";
} else if (firstLetter == "d") {
	filename = "design";
} else if (firstLetter == "i" && filename != "index") {
	filename = "illustration";
} else if (firstLetter == "a") {
	filename = "aboutme";
} else if (filename == "contacts") {
	filename = "contacts";
} else if (filename == "index") {
	filename = "home";
} else if (filename == "website") {
	filename = "websites";
} else {
	var qo = getQueryObject();
	filename = qo.section;
};

//path of desired image
headerImagePath = "images/header_" + filename + ".gif";


//set header image
var headerImage = new Image();
headerImage.src = headerImagePath;
document.pageHeader.src = headerImage.src;


// id of nav image to indent
var idToChange = new String("nav" + filename);


//id of variable holding desired nav image
var variableId = new String("down" + filename.toUpperCase());


//alert("image state working!"); 