function breadCrumbItem(itemIndex, itemImageURL, isEnabled, clickable, sendToURL, spawnProgress) { this.index = itemIndex; this.itemImageURL = itemImageURL; this.enabled = isEnabled; this.active = "false"; this.canClick = clickable; this.url = sendToURL; this.spawnProgress = spawnProgress; } function breadCrumbItems() { this.items = new Array(); } breadCrumbItems.prototype.add = function(breadCrumbItem) { this.items[breadCrumbItem.index] = breadCrumbItem; } breadCrumbItems.prototype.setActive = function(index) { this.items[index].active = "true"; } function applBreadCrumb(language) { this.breadCrumbs = new breadCrumbItems(); this.language = language; //*****STYLING*****// this.font = "Verdana"; this.fontSize = "12px" this.fontWeight = "bold"; this.fontBaseColor = "black"; this.fontSelectedColor = "red"; this.fontDisabledColor = "gray"; this.fontUnderline = false; } function showUnderline(image, language) { if (image.src.indexOf('underline') == -1) { if(image.src.indexOf('disabled') == -1) { var imageURLSplit = (language==2?image.src.split('_en.'):image.src.split('.gif')); image.src = imageURLSplit[0] + (language==2?"_underline_en.gif":"_underline.gif"); } } } function hideUnderline(image) { image.src = image.src.replace('_underline',''); } applBreadCrumb.prototype.render = function() { this.applbreadcrumbs = document.createElement("div"); this.applbreadcrumbs.style.position = "relative"; this.applbreadcrumbs.style.top = "-30px"; for(var item in this.breadCrumbs.items) { if (this.breadCrumbs.items[item].enabled == "true") { var itemLink = document.createElement("a"); itemLink.style.fontFamily = this.font; itemLink.style.fontSize = this.fontSize; itemLink.style.fontWeight = this.fontWeight; itemLink.style.color = this.fontBaseColor; itemLink.style.textDecorationUnderline = this.fontUnderline; //itemLink.innerHTML = this.breadCrumbs.items[item].text; var imageURLSplit = this.breadCrumbs.items[item].itemImageURL.split(".gif"); if (this.language == 2) //English { itemLink.innerHTML = ""; } else { itemLink.innerHTML = ""; } if (this.breadCrumbs.items[item].active == "true") { //itemLink.style.color = this.fontSelectedColor; itemLink.innerHTML = ""; } if (this.breadCrumbs.items[item].canClick == "false") { //itemLink.style.color = this.fontDisabledColor; itemLink.innerHTML = ""; } else { if (this.breadCrumbs.items[item].spawnProgress == "true") itemLink.onclick = "javascript:SpawnProgress();"; //this won't work for some reason itemLink.href = this.breadCrumbs.items[item].url; } this.applbreadcrumbs.appendChild(itemLink); if (item < this.breadCrumbs.items.length-1) this.applbreadcrumbs.innerHTML += "    "; } } document.getElementById("container").insertBefore(this.applbreadcrumbs,document.getElementById("container").firstChild); }