<!-- //
// Mike Ross Designs TM.
// I-MarkTools TM Javascript.
// 4:35 PM 11/11/2009.
// Updated: 7:20 PM 11/12/2009.
// Updated: 3:46 PM 11/16/2009.
// Updated: 1:32 AM 11/28/2009.
// Updated: 4:47 PM 11/30/2009 - 7:50 PM 11/30/2009.

// General.
var drop = "<br/>";
var dDrop = "<br/><br/>";

// Actions.
// Page Titles.
// Pages: All.
function pageTitle() {
	var e = "Error with \"pageTitle()\" function!";
	var generalUrl = "http://www.i-marktools.com/";
	var generalUrl2 = "http://www.i-marktools.com/index.php";
	var safariUrl = "http://www.i-marktools.com/";
	var safariUrl2 = "http://www.i-marktools.com/index.php";
	var generalPagesURL = "http://www.i-marktools.com/pages/";
	var safariPagesURL = "http://www.i-marktools.com/pages/";
	var pageName = new Array("null","Home","About","Technology","Products","Contact");
	var pageFile = new Array("null","index.php","about.php","technology.php","products.php","contact.php");
	var pageURL = new Array("null",generalUrl,generalUrl2,safariUrl,safariUrl2,generalPagesURL+pageFile[2],safariPagesURL+pageFile[2],generalPagesURL+pageFile[3],safariPagesURL+pageFile[3],generalPagesURL+pageFile[4],safariPagesURL+pageFile[4],generalPagesURL+pageFile[5],safariPagesURL+pageFile[5]);
	var pageDisplay = new Array("null","Home","About I-MarkTools&#153;","Our Technology","Our Products","Contact Us");
	// 4:59 PM 11/30/2009.
	// var grabURL = window.location.href; For Safari. Changed to 'window.location' and '%20' changed to ' '.
	var grabURL = window.location;
	var titleLocation = document.getElementById("current_page");
	// Home.
	if (grabURL == pageURL[1] || grabURL == pageURL[2] || grabURL == pageURL[3] || grabURL == pageURL[4]) {
		titleLocation.innerHTML = pageDisplay[1];
		titleLocation.style.backgroundImage = "url('http://www.i-marktools.com/images/header/header%20home%20two.gif')";
	}
	// About.
	if (grabURL == pageURL[5] || grabURL == pageURL[6]) {
		titleLocation.innerHTML = pageDisplay[2];
		titleLocation.style.backgroundImage = "url('http://www.i-marktools.com/images/header/header%20about%20three.gif')";
	}
	// Technology.
	if (grabURL == pageURL[7] || grabURL == pageURL[8]) {
		titleLocation.innerHTML = pageDisplay[3];
		titleLocation.style.backgroundImage = "url('http://www.i-marktools.com/images/header/header%20technology%20three.gif')";
	}
	// Products.
	if (grabURL == pageURL[9] || grabURL == pageURL[10]) {
		titleLocation.innerHTML = pageDisplay[4];
		titleLocation.style.backgroundImage = "url('http://www.i-marktools.com/images/header/header%20products%20three.gif')";
	}
	// Contact.
	if (grabURL == pageURL[11] || grabURL == pageURL[12]) {
		titleLocation.innerHTML = pageDisplay[5];
		titleLocation.style.backgroundImage = "url('http://www.i-marktools.com/images/header/header%20contact%20three.gif')";
	}
}

function getLinks() {
	// 7:20 PM 11/12/2009
	// Additions: 3:47 PM 11/16/2009.
	var e = "Error with \"getLinks()\" function!";
	var siteThemeColor_Brown1 = "#9f8855";
	var linkDisplay = new Array("null","Home","About I-MarkTools&#153;","Our Technology","Our Products","Contact Us");
	var linkLocation = new Array("null","link_home","link_about","link_technology","link_products","link_contact");
	var linkHome = document.getElementById(linkLocation[1]);
	linkHome.innerHTML = linkDisplay[1];
	linkHome.style.display = "block";
	linkHome.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
	var linkAbout = document.getElementById(linkLocation[2]);
	linkAbout.innerHTML = linkDisplay[2];
	linkAbout.style.display = "block";
	linkAbout.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
	var linkTechnology = document.getElementById(linkLocation[3]);
	linkTechnology.innerHTML = linkDisplay[3];
	linkTechnology.style.display = "block";
	linkTechnology.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
	var linkProducts = document.getElementById(linkLocation[4]);
	linkProducts.innerHTML = linkDisplay[4];
	linkProducts.style.display = "block";
	linkProducts.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
	var linkContact = document.getElementById(linkLocation[5]);
	linkContact.innerHTML = linkDisplay[5];
	linkContact.style.display = "block";
	linkContact.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
	// Page Location.
	// 4:36 PM 11/16/2009.
	var pageLocation = window.location;
	var generalURL = "http://www.i-marktools.com/";
	var safariURL = "http://www.i-marktools.com/";
	var generalHomeURL = "http://www.i-marktools.com/";
	var generalHomeURL2 = "http://www.i-marktools.com/index.php";
	var safariHomeURL = "http://www.i-marktools.com/";
	var safariHomeURL2 = "http://www.i-marktools.com/index.php";
	var generalAboutURL = generalURL + "pages/about.php";
	var generalTechnologyURL = generalURL + "pages/technology.php";
	var generalProductsURL = generalURL + "pages/products.php";
	var generalContactURL = generalURL + "pages/contact.php";
	var safariAboutURL = safariURL + "pages/about.php";
	var safariTechnologyURL = safariURL + "pages/technology.php";
	var safariProductsURL = safariURL + "pages/products.php";
	var safariContactURL = safariURL + "pages/contact.php";
	// 5:34 PM 11/30/2009. Added link background image.
	if (pageLocation == generalHomeURL || pageLocation == generalHomeURL2 || pageLocation == safariHomeURL || pageLocation == safariHomeURL2) {
		// linkHome.style.color = "#000000";
		// linkHome.style.backgroundColor = siteThemeColor_Brown1;
		linkHome.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
		// alert("home");
	}
	if (pageLocation == generalAboutURL || pageLocation == safariAboutURL) {
		// linkAbout.style.color = "#000000";
		// linkAbout.style.backgroundColor = siteThemeColor_Brown1;
		linkAbout.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
	}
	if (pageLocation == generalTechnologyURL || pageLocation == safariTechnologyURL) {
		// linkTechnology.style.color = "#000000";
		// linkTechnology.style.backgroundColor = siteThemeColor_Brown1;
		linkTechnology.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
	}
	if (pageLocation == generalProductsURL || pageLocation == safariProductsURL) {
		// linkProducts.style.color = "#000000";
		// linkProducts.style.backgroundColor = siteThemeColor_Brown1;
		linkProducts.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
	}
	if (pageLocation == generalContactURL || pageLocation == safariContactURL) {
		// linkContact.style.color = "#000000";
		// linkContact.style.backgroundColor = siteThemeColor_Brown1;
		linkContact.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
	}
	// Home.
	linkHome.onmouseover = function homeActive() {
		var e2 = "Error with \"homeActive()\" function!";
		// linkHome.style.color = "#000000";
		linkHome.style.backgroundColor = siteThemeColor_Brown1;
		if (pageLocation == generalHomeURL || pageLocation == generalHomeURL2 || pageLocation == safariHomeURL || pageLocation == safariHomeURL2) {
			linkHome.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
		} else {
			linkHome.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped.gif')";
		}
		if (!linkHome) {
			alert(e2);
		}
	}
	linkHome.onmouseout = function homeInactive() {
		var e3 = "Error with \"homeInactive()\" function!";
		if (pageLocation == generalHomeURL || pageLocation == generalHomeURL2 || pageLocation == safariHomeURL || pageLocation == safariHomeURL2) {
			// linkHome.style.color = "#000000";
			linkHome.style.backgroundColor = siteThemeColor_Brown1;
		} else {
			linkHome.style.backgroundColor = siteThemeColor_Brown1;
			linkHome.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
		}
		if (!linkHome) {
			alert(e3);
		}
	}
	// About.
	linkAbout.onmouseover = function aboutActive() {
		var e4 = "Error with \"aboutActive()\" function!";
		// linkAbout.style.color = "#000000";
		linkAbout.style.backgroundColor = siteThemeColor_Brown1;
		if (pageLocation == generalAboutURL || pageLocation == safariAboutURL) {
			linkAbout.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
		} else {
			linkAbout.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped.gif')";
		}
		if (!linkAbout) {
			alert(e4);
		}
	}
	linkAbout.onmouseout = function aboutInactive() {
		var e5 = "Error with \"aboutInactive()\" function!";
		if (pageLocation == generalAboutURL || pageLocation == safariAboutURL) {
			// linkAbout.style.color = "#000000";
			linkAbout.style.backgroundColor = siteThemeColor_Brown1;
		} else {
			linkAbout.style.backgroundColor = siteThemeColor_Brown1;
			linkAbout.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
		}
		if (!linkAbout) {
			alert(e5);
		}
	}
	// Technology.
	linkTechnology.onmouseover = function technologyActive() {
		var e6 = "Error with \"technologyActive()\" function!";
		// linkTechnology.style.color = "#000000";
		linkTechnology.style.backgroundColor = siteThemeColor_Brown1;
		if (pageLocation == generalTechnologyURL || pageLocation == safariTechnologyURL) {
			linkTechnology.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
		} else {
			linkTechnology.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped.gif')";
		}
		if (!linkTechnology) {
			alert(e6);
		}
	}
	linkTechnology.onmouseout = function technologyInactive() {
		var e7 = "Error with \"technologyInactive()\" function!";
		if (pageLocation == generalTechnologyURL || pageLocation == safariTechnologyURL) {
			// linkTechnology.style.color = "#000000";
			linkTechnology.style.backgroundColor = siteThemeColor_Brown1;
		} else {
			linkTechnology.style.backgroundColor = siteThemeColor_Brown1;
			linkTechnology.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
		}
		if (!linkTechnology) {
			alert(e7);
		}
	}
	// Products.
	linkProducts.onmouseover = function productsActive() {
		var e8 = "Error with \"productsActive()\" function!";
		// linkProducts.style.color = "#000000";
		linkProducts.style.backgroundColor = siteThemeColor_Brown1;
		if (pageLocation == generalProductsURL || pageLocation == safariProductsURL) {
			linkProducts.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
		} else {
			linkProducts.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped.gif')";
		}
		if (!linkProducts) {
			alert(e8);
		}
	}
	linkProducts.onmouseout = function productsInactive() {
		var e9 = "Error with \"productsInactive()\" function!";
		if (pageLocation == generalProductsURL || pageLocation == safariProductsURL) {
			// linkProducts.style.color = "#000000";
			linkProducts.style.backgroundColor = siteThemeColor_Brown1;
		} else {
			linkProducts.style.backgroundColor = siteThemeColor_Brown1;
			linkProducts.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
		}
		if (!linkProducts) {
			alert(e9);
		}
	}
	// Contact.
	linkContact.onmouseover = function contactActive() {
		var e10 = "Error with \"contactActive()\" function!";
		// linkContact.style.color = "#000000";
		linkContact.style.backgroundColor = siteThemeColor_Brown1;
		if (pageLocation == generalContactURL || pageLocation == safariContactURL) {
			linkContact.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped triangle.gif')";
		} else {
			linkContact.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background flipped.gif')";
		}
		if (!linkContact) {
			alert(e10);
		}
	}
	linkContact.onmouseout = function contactInactive() {
		var e11 = "Error with \"contactInactive()\" function!";
		if (pageLocation == generalContactURL || pageLocation == safariContactURL) {
			// linkContact.style.color = "#000000";
			linkContact.style.backgroundColor = siteThemeColor_Brown1;
		} else {
			linkContact.style.backgroundColor = siteThemeColor_Brown1;
			linkContact.style.backgroundImage = "url('http://www.i-marktools.com/images/buttons/button background.gif')";
		}
		if (!linkContact) {
			alert(e11);
		}
	}
}

function preloadImages() {
	// 9:03 PM 11/12/2009.
	var e = "Error with \"preloadImages()\" function!";
	var imageLocation = "../images/";
	function preloadGeneral() {
		// 7:28 PM 11/30/2009.
		var e3 = "Error with \"preloadGeneral()\" function!";
		var buttonActive = new Image(190,30);
		buttonActive.src = imageLocation + "buttons/button background flipped face.gif";
		var buttonCurrentActive = new Image(190,30);
		buttonCurrentActive.src = imageLocation + "buttons/button background flipped triangle.gif";
		var buttonInactive = new Image(190,30);
		buttonInactive.src = imageLocation + "buttons/button background.gif";
		if (!buttonActive || !buttonCurrentActive || !buttonInactive) {
			alert(e3 + " Could not find image.");
		}
	}
	function preloadHome() {
		var e2 = "Error with \"preloadHome()\" function!";
		var featureImage = new Image(450,475);
		featureImage.src = "../images/feature/marking tape measure 16ft feature.jpg";
		if (!featureImage) {
			alert(e2);
		}
	}
	preloadGeneral();
	preloadHome();
	if (!imageLocation) {
		alert(e);
	}
}
// -->
