/* *********************** HEADER *********************** */

function header(scarsinhead) {
	document.write('<div class="header">');
	document.write('<div class="logo">');
	document.write('<a href="/corporate/index.html"><img src="/images/scarsinhead/logo_small.png" align="left"></a>');
	document.write('</div>');
	document.write('<div class="banner">');
	document.write('<img src="/images/scarsinhead/scarsinhead' + scarsinhead + '.jpg">');
	document.write('</div>');
	document.write('</div>');
}

/* *********************** FOOTER *********************** */

function footer() {
	document.write('<div class="footer">');
	document.write('<div class="footerRight">');
	document.write('<a href="/site/sitemap.html">Site Map</a> | ');
	document.write('<a href="/site/privacypolicy.html">Privacy Policy</a> | ');
	document.write('<a href="/site/termsofuse.html">Terms of Use</a> | ');
	document.write('<a href="/contact/contact.html">Contact Us</a>');
	document.write('</div>');
	document.write('<div class="footerLeft">');
	document.write('&copy; 2010 Scarsin Corporation. All rights reserved.');
	document.write('</div>');
	document.write('</div>');
}

/* *********************** MAIN MENU *********************** */

var menu = new Array();
var menuLinks = new Array();

var index = 0;

	menu[index] = null;
	menuLinks[index++] = null;

// **** Corporate ****
	var corporateMenu = new Array();
	var corporateMenuLinks = new Array();

	corporateMenu[0] = 'Corporate'; corporateMenuLinks[0] = '/corporate/index.html';
	corporateMenu[1] = 'Welcome'; corporateMenuLinks[1] = '/corporate/index.html';
	corporateMenu[2] = 'Decision Focus'; corporateMenuLinks[2] = '/corporate/decisionfocus.html';
	corporateMenu[3] = 'President'; corporateMenuLinks[3] = '/corporate/president.html';

	menu[index] = corporateMenu;
	menuLinks[index++] = corporateMenuLinks;

// **** ScarDec ****
	var scardecMenu = new Array();
	var scardecMenuLinks = new Array();

	scardecMenu[0] = 'Scarsin I2E'; scardecMenuLinks[0] = '/scardec/marketneed.html';
	scardecMenu[1] = 'Market Need'; scardecMenuLinks[1] = '/scardec/marketneed.html';
	scardecMenu[2] = 'I2E Vision'; scardecMenuLinks[2] = '/scardec/i2evision.html';
	scardecMenu[3] = 'I2E Overview'; scardecMenuLinks[3] = '/scardec/scardec.html';
	scardecMenu[4] = 'I2E Benefits'; scardecMenuLinks[4] = '/scardec/benefits.html';
	scardecMenu[5] = 'I2E Connectivity'; scardecMenuLinks[5] = '/scardec/connectivity.html';
	scardecMenu[6] = 'I2E Markets'; scardecMenuLinks[6] = '/scardec/markets.html';
	scardecMenu[7] = 'I2E Testimonials'; scardecMenuLinks[7] = '/scardec/testimonials.html';
	scardecMenu[8] = 'I2E Demonstration'; scardecMenuLinks[8] = '/scardec/demonstration.html';

	menu[index] = scardecMenu;
	menuLinks[index++] = scardecMenuLinks;

// **** Decision Approach ****
	var decisionApproachMenu = new Array();
	var decisionApproachMenuLinks = new Array();
	
	decisionApproachMenu[0] = 'Decision Approach'; decisionApproachMenuLinks[0] = '/decisionapproach/planning.html';
	decisionApproachMenu[1] = 'Planning'; decisionApproachMenuLinks[1] = '/decisionapproach/planning.html';
	decisionApproachMenu[2] = 'Development'; decisionApproachMenuLinks[2] = '/decisionapproach/developmenttesting.html';
	decisionApproachMenu[3] = 'Documentation'; decisionApproachMenuLinks[3] = '/decisionapproach/documentation.html';
	decisionApproachMenu[4] = 'Training'; decisionApproachMenuLinks[4] = '/decisionapproach/training.html';
	decisionApproachMenu[5] = 'Decision Analysis'; decisionApproachMenuLinks[5] = '/decisionapproach/decisionanalysis.html';

	menu[index] = decisionApproachMenu;
	menuLinks[index++] = decisionApproachMenuLinks;

// **** Decision Solutions ****
	var decisionSolutionMenu = new Array();
	var decisionSolutionMenuLinks = new Array();

	decisionSolutionMenu[0] = 'Decision Solutions'; decisionSolutionMenuLinks[0] = '/decisionsolutions/pharmaceuticals.html';
	decisionSolutionMenu[1] = 'Pharmaceuticals'; decisionSolutionMenuLinks[1] = '/decisionsolutions/pharmaceuticals.html';

	var governmentMenu = new Array();
	var governmentMenuLinks = new Array();

	governmentMenu[0] = 'Government'; governmentMenuLinks[0] = '/decisionsolutions/government.html';
	governmentMenu[1] = 'Overview'; governmentMenuLinks[1] = '/decisionsolutions/government.html';

	var wiseMenu = new Array();
	var wiseLinks = new Array();

	wiseMenu[0] = 'WISE'; wiseLinks[0] = '/decisionsolutions/government/wise.html';
	wiseMenu[1] = 'Overview'; wiseLinks[1] = '/decisionsolutions/government/wise.html';
	wiseMenu[2] = 'W/WW - Tactical Challenges'; wiseLinks[2] = '/decisionsolutions/government/wise/tactical.html';
	wiseMenu[3] = 'W/WW - Strategic Challenges'; wiseLinks[3] = '/decisionsolutions/government/wise/strategic.html';
	wiseMenu[4] = 'Model Engine'; wiseLinks[4] = '/decisionsolutions/government/wise/model.html';
	wiseMenu[5] = 'Benefits'; wiseLinks[5] = '/decisionsolutions/government/wise/benefits.html';
	wiseMenu[6] = 'Deployment'; wiseLinks[6] = '/decisionsolutions/government/wise/deployment.html';

	governmentMenu[2] = wiseMenu; governmentMenuLinks[2] = wiseLinks;

	var smartMenu = new Array();
	var smartLinks = new Array();

	smartMenu[0] = 'SMART'; smartLinks[0] = '/decisionsolutions/government/smart.html';
	smartMenu[1] = 'Market Need'; smartLinks[1] = '/decisionsolutions/government/smart.html';
	smartMenu[2] = 'Overview'; smartLinks[2] = '/decisionsolutions/government/smart/overview.html';
	smartMenu[3] = 'Case Study & Benefits'; smartLinks[3] = '/decisionsolutions/government/smart/case.html';

	governmentMenu[3] = smartMenu; governmentMenuLinks[3] = smartLinks;

	decisionSolutionMenu[2] = governmentMenu; decisionSolutionMenuLinks[2] = governmentMenuLinks;

	menu[index] = decisionSolutionMenu;
	menuLinks[index++] = decisionSolutionMenuLinks;

// **** Partnering ****
	menu[index] = 'Partnering';
	menuLinks[index++] = '/partnering/partnering.html';

// **** Client Login ****
	menu[index] = 'Client Login';
	menuLinks[index++] = '/clientlogin/login.html';

// **** Contact ****
	var clientsMenu = new Array();
	var clientsMenuLinks = new Array();

	clientsMenu[0] = 'Contact'; clientsMenuLinks[0] = '/contact/contact.html';
	clientsMenu[1] = 'Information'; clientsMenuLinks[1] = '/contact/contact.html';
	clientsMenu[2] = 'Location'; clientsMenuLinks[2] = '/contact/location.html';
	clientsMenu[3] = 'Careers'; clientsMenuLinks[3] = '/contact/careers.html';

	menu[index] = clientsMenu;
	menuLinks[index++] = clientsMenuLinks;


// **** Menu Writer Function ****

function menuSystem(){
	document.write('<div class="navdivider"></div>');

	recurseMenu(menu, menuLinks, 1);

	document.write('<div class="navdivider"></div>');
	document.write('<div class="navdivider"></div>');
}

function recurseMenu(oMenu, oLinks, iDepth){
	var i;

	if (oMenu.length > 1){
		if (iDepth == 1){
			document.write('<ul id="navigation-' + iDepth + '">');
		} else {
			document.write('<ul class="navigation-' + iDepth + '">');
		}

		for (i=1; i<oMenu.length; i++){
			if (typeof(oMenu[i]) == 'string'){
				document.write('<li><a href="' + oLinks[i] + '">' + oMenu[i] + '</a>');
			} else {
				if (iDepth == 1){
					document.write('<li><a href="' + oLinks[i][0] + '">' + oMenu[i][0] + ' </a>');
				} else {
					document.write('<li><a href="' + oLinks[i][0] + '">' + oMenu[i][0] + ' &raquo;</a>');
				}

				recurseMenu(oMenu[i], oLinks[i], iDepth+1);
			}

			document.write('</li>');
		}

		document.write('</ul>');
	}
}

/* *********************** SIDE MENU *********************** */

function navSystem(path){
	var path_array = path.split("|");

	recurseNav(menu, menuLinks, path_array, 0);
}

function recurseNav(oMenu, oLinks, oPath, iDepth){
	var i;

	for (i=1; i<oMenu.length; i++){
		if (typeof(oMenu[i]) == 'string'){
			writeNav(oMenu[i], oLinks[i], oPath[iDepth], iDepth, (iDepth == oPath.length-1) && (oMenu[i] == oPath[iDepth]));
		} else {
			writeNav(oMenu[i][0], oLinks[i][0], oPath[iDepth], iDepth, (iDepth == oPath.length-1) && (oMenu[i] == oPath[iDepth]));

			if (oMenu[i][0] == oPath[iDepth])
				recurseNav(oMenu[i], oLinks[i], oPath, iDepth+1);
		}
	}
}

function writeNav(sMenuItem, sLinkItem, sPathItem, iDepth, bSelected){
	if (iDepth == 0){
		if (sMenuItem == sPathItem)
			document.write('<div class="leftnavigation-' + (iDepth+1) + '">' + sMenuItem + '</div>');
	} else {
		if (bSelected){
			document.write('<div class="leftnavigation-' + (iDepth+1) +'"><span class="chosen">&gt; ' + sMenuItem + '</span></div>');
		} else {
			document.write('<div class="leftnavigation-' + (iDepth+1) +'"><a href="' + sLinkItem + '">' + sMenuItem + '</a></div>');
		}
	}
}

/* *********************** SITE MAP *********************** */

function siteMap()
{
	document.write('<div class="detail">');

	recurseSiteMap(menu, menuLinks, 0);

	document.write('<div class="leftnavigation-1"><a href="/site/sitemap.html">Other</a></div>');
	document.write('<div class="leftnavigation-2"><a href="/site/sitemap.html">Site Map</a></div>');
	document.write('<div class="leftnavigation-2"><a href="/site/privacypolicy.html">Privacy Policy</a></div>');
	document.write('<div class="leftnavigation-2"><a href="/site/termsofuse.html">Terms of Use</a></div>');
	document.write('</div>');
}

function recurseSiteMap(oMenu, oLinks, iDepth){
	var i;

	for (i=1; i<oMenu.length; i++){
		if (typeof(oMenu[i]) == 'string'){
			document.write('<div class="leftnavigation-' + (iDepth+1) +'"><a href="' + oLinks[i] + '">' + oMenu[i] + '</a></div>');
		} else {
			document.write('<div class="leftnavigation-' + (iDepth+1) +'"><a href="' + oLinks[i][0] + '">' + oMenu[i][0] + '</a></div>');

			recurseSiteMap(oMenu[i], oLinks[i], iDepth+1);
		}
	}
}


/* *********************** ROUNDED BOXES *********************** */

function roundedBoxOpen(){
	document.write('<div class="boxTop">');
	document.write('<div class="gs1"><b></b></div><div class="gs2">');
	document.write('</div><div class="gs3"><b></b></div><div class="gs4"><b></b></div>');
	document.write('</div><div class="boxMiddle">');
}

function roundedBoxClose(){
	document.write('</div><div class="boxBottom">');
	document.write('<div class="gs4"><b></b></div><div class="gs3"><b></b></div>');
	document.write('<div class="gs2"></div><div class="gs1"><b></b></div></div>');

}

function roundedBoxLightOpen(){
	document.write('<div class="boxTopLight">');
	document.write('<div class="gs1Light"><b></b></div><div class="gs2Light">');
	document.write('</div><div class="gs3Light"><b></b></div><div class="gs4Light"><b></b></div>');
	document.write('</div><div class="boxMiddleLight">');
}

function roundedBoxLightClose(){
	document.write('</div><div class="boxBottomLight">');
	document.write('<div class="gs4Light"><b></b></div><div class="gs3Light"><b></b></div>');
	document.write('<div class="gs2Light"></div><div class="gs1Light"><b></b></div></div>');

}


/* *********************** RANDOM QUOTES *********************** */

function quotePanel() {

	roundedBoxOpen();

	document.write('<div class="detail">');
	document.write('<h2>Decision Making</h2>');

	randomQuote();

	document.write('</script>');
	document.write('</div>');

	roundedBoxClose();

}

function randomQuote(){
	var count = 15;
	var quote = new Array(count+1);
	var author = new Array(count+1);
	var desc = new Array(count+1);

	quote[0]="The possibilities are numerous once we decide to act and not react.";
	author[0]="Gloria Anzaldua";
	desc[0]="Mexican American author and poet";

	quote[1]="It’s in your moments of decision that your destiny is shaped.";
	author[1]="Anthony Robins";
	desc[1]="World Renowned Life Coach";

	quote[2]="No sensible decision can be made any longer without taking into account not only the world as it is, but the world as it will be.";
	author[2]="Isaac Asimov";
	desc[2]="Russian-born American author and professor of biochemistry";

	quote[3]="It is the characteristic excellence of the strong man that he can bring momentous issues to the fore and make a decision about them.  The weak are always forced to decide between alternatives they have not chosen themselves.";
	author[3]="Dietrich Bonhoeffer";
	desc[3]="German Lutheran pastor, theologian";

	quote[4]="In any moment of decision the best thing you can do is the right thing, the next best thing is the wrong thing, and the worst thing you can do is nothing.";
	author[4]="Theodore Roosevelt";
	desc[4]="Twenty-Sixth President of the United States";

	quote[5]="We know what happens to people who stay in the middle of the road. They get run down.";
	author[5]="Aneurin Bevan";
	desc[5]="Welsh Labour politician";

	quote[6]="The man who is denied the opportunity of taking decisions of importance begins to regard as important the decisions he is allowed to take.";
	author[6]="C Northcote Parkinson";
	desc[6]="Naval historian and author of some sixty books, the most famous of which was his best seller Parkinson's Law";

	quote[7]="What information consumes is rather obvious: it consumes the attention of its recipients. Hence a wealth of information creates a poverty of attention, and a need to allocate that attention efficiently among the overabundance of information sources that might consume it.";
	author[7]="Computers, Communications and the Public Interest, pages 40-41, Martin Greenberger, ed., The Johns Hopkins Press, 1971";
	desc[7]="";

	quote[8]="Chance favors only the prepared mind.";
	author[8]="Louis Pasteur";
	desc[8]="French chemist best known for his remarkable breakthroughs in microbiology";

	quote[9]="Each indecision brings its own delays and days are lost lamenting over lost days... What you can do or think you can do, begin it. For boldness has magic, power, and genius in it.";
	author[9]="Johann Wolfgang von Goethe";
	desc[9]="German writer";

	quote[10]="Vacillating people seldom succeed. Successful men and women are very careful in reaching their decisions, and very persistent and determined in action thereafter.";
	author[10]="L. G. Elliott";
	desc[10]="Canadian Physicist";

	quote[11]="Thoughts lead on to purposes; purposes go forth in action; actions form habits; habits decide character; and character fixes our destiny.";
	author[11]="Tyron Edwards";
	desc[11]="American theologian";

	quote[12]="Whenever you see a successful business, someone once made a courageous decision.";
	author[12]="Peter Drucker";
	desc[12]="Writer, management consultant and university professor";

	quote[13]="In the long run, men hit only what they aim at.";
	author[13]="Henry David Thoreau";
	desc[13]="American author";

	quote[14]="By three methods we may learn wisdom: first, by reflection, which is noblest; second, by imitation, which is easiest; and third by experience, which is the bitterest.";
	author[14]="Confucius";
	desc[14]="Chinese thinker and social philosopher";

	quote[15]="Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you are wrong. There are always difficulties arising which tempt you to believe that your critics are right. To map out a course of action and follow it to the end, requires some of the same courage which a soldier needs.";
	author[15]="Ralph Waldo Emerson";
	desc[15]="American essayist and poet";

	var randscript = -1;

	while (randscript < 0 || randscript > count || isNaN(randscript)){ 
		randscript = parseInt(Math.random()*(count+1))
	}

	document.write('<div class="quote">"' + quote[randscript] + '"</div>');
	document.write('<div class="quoteAuthor">' + author[randscript] + '</div>');
	document.write('<div class="quoteDescription">' + desc[randscript] + '</div>');
}

