
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Codewise Systems Inc. - Master Script File

Copyright (c) 2007 Codewise Systems Inc. All rights reserved. 

Created: 2004-06-25

Revision History:
  1.00	Initial version. TB, 2004-06-25
  1.01	Updated for v2 of our site. TB, 2004-11-12
  1.02	Updated for client login section. TB, 2005-10-18, 18:23
  1.03	Updated for removal of CCO section, and addition of Strategic
	Alliances section. TB, 2005-11-28, 13:04

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Browser/platform/OS detection */

var agent = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_win = (agent.indexOf("win") != -1);
var is_winxp = (agent.indexOf("windows nt 5.1") != -1);
var is_winxp_classic = false;

var is_mac = (agent.indexOf("mac") != -1);

var is_ie = (agent.indexOf("msie") != -1);
var is_ie6 = (is_ie && (is_major == 4) && (agent.indexOf("msie 6.0")!=-1));

var is_nav  = ((agent.indexOf('mozilla') != -1) && (agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera') == -1) && (agent.indexOf('webtv') == -1));
var is_nav6up = (is_nav && (is_major >= 5));

var is_mozilla = ((agent.indexOf('mozilla') != -1) && (agent.indexOf('netscape') == -1) && (!is_ie));
	if (is_mozilla) {
		is_ie = false;
		is_nav6up = false;
	};

var is_safari = ((agent.indexOf("mac os x") != -1) && (agent.indexOf("safari") != -1));
	if (is_safari) {
		is_nav = false;
		is_mozilla = false;
	};

var is_opera = (agent.indexOf('opera') != -1);
	if (is_opera) { 
		is_ie = false; 
	};


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Parse query string to determine page display modes: 

function splitSearchStringContent(pCPString, text) {
	// pCPString = pageConfigParameterString

	pCPArray = pCPString.split(text); // pCPArray = pageConfigParameterArray
	pCPIndex = pCPArray.length; // pCPIndex = pageConfigParameterIndex
};

var defaultSearchStringContent = '';
var searchStringContent = '';
if (location.search) {
	searchStringContent = location.search.substring(1,location.search.length);
};

if (searchStringContent != '') {
	splitSearchStringContent(searchStringContent, '&');
	for (loop01 = 0; loop01 < pCPArray.length; loop01++) {

		if (pCPArray[loop01] == 'skinType=Skin02') { sectionToLoad = 'aboutUs'; };
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Variable declaration */

var bMHO; 			// bottomMarginHeightOffset
var bMS = 30;			// bodyMarginSize
var bObject;			// bodyObject
var bS = 2;			// borderSize
var cDIB;			// colourDepthInBits
var cE; 			// currentElement
var cSH = 35;			// copyrightStatementHeight
var hOFAPE = 10;		// horizontalOffsetForAbsolutelyPositionedElements
var pW = 700;			// pageWidth
var pM = false;			// printMode
var rCHPO; 			// rightColumnHPositionOffset
var sBW = 18; 			// scrollBarWidth
var sH = screen.height; 	// screenHeight
var sW = screen.width; 		// screenWidth
var tAArray;			// tagAnchorArray 
var tDivArray; 			// tagDivArray
var tLiArray; 			// tagListItemArray
var tSpanArray; 		// tagSpanArray
var tH = 60;			// titleHeight
var winIH; 			// windowInnerHeight
var winIW; 			// windowInnerWidth
var winISH; 			// windowInnerHeight
var winISW; 			// windowInnerWidth
var winOH; 			// windowOuterHeight
var winOW; 			// windowOuterWidth
var winPT; 			// windowPositionTop
var winPL; 			// windowPositionLeft


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Event handling */

onload = function() { 
	iRPD(); 	// initializeRightPanelDisplay
	pI();		// initializePage
};

onresize = function() { 
	window.location.reload();
};

document.oncontextmenu = dCM; // disableContextMenu
document.onclick = hCM; // hideContextMenu


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page initialization */

function gCOT() {
	tAArray = document.getElementsByTagName('a'); 
	tDivArray = document.getElementsByTagName('div'); 
	tLiArray = document.getElementsByTagName('li'); 
	tSpanArray = document.getElementsByTagName('span'); 
};

function pI() {
	if (!document.getElementById) {
		return;
	};

	gCOT(); 	// getCollectionsOfTags
	dEV(); 		// determineEnvironmentVariables
	hRPC(); 	// hideRightPaneContent
	iRPC();		// initializeRightPaneContent
	hTL(); 		// hideTopLinks
	rSB(); 		// reStyleBody
	// rSLP(); 	// reStyleLeftPane
	// rSRP();	// reStyleRightPane
	// rSCS();	// reStyleCopyrightStatement
	aPL();		// animatePageLoad
};

function doNothing() {
	// Do nothing...
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code for trapping mouse position */

var evt;
var xPosn = 0;
var yPosn = 0;

function tMP(evt) { // trapMousePosition
	if (!document.getElementById) {
		// return;
	};

	// var e = evt ? evt : window.event;
	var e = (evt) ? evt : (window.event) ? window.event : '';
	// alert(e);
	// if (!e) { return; };
 
	if (e.pageX) {
		xPosn = e.pageX;
	} else if (e.x) {
		xPosn = e.x;
	};

	if (e.pageY) {
		yPosn = e.pageY;
	} else if (e.y) {
		yPosn = e.y;
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Context menu code */

function dCM() { // disableContextMenu
	if (!document.getElementById) {
		return;
	};

	var cMOP = 30; // contextMenuOuterPadding
	var cMW = 160; // contextMenuWidth
	var cMH = 256; // contextMenuHeight

	tMP(evt);

	var bMI = 'Add to <a class="contextMenuLink" href="javascript:void();" onclick="return aTF();">Favorites<\/a>...'; // bookMarkInstructions
	if (is_nav) {
		bMI = 'Press Ctrl+D to Bookmark this page...';
	};

	var cME = document.getElementById('contextMenu'); // contextMenuElement
	cME.style.width = (cMW) + 'px';
	cME.style.height = (cMH) + 'px';
	cME.style.overflow = 'hidden';
	cME.style.border = '2px outset #fff';
	cME.innerHTML = '<img src="media\/images\/codewise_site\/logos\/codewise_logo_02_162x40.gif" width="162" height="40" alt="" \/><br \/><hr class="contextMenu" \/>Thank you for visiting us at Codewise.ca!<hr class="contextMenu" \/>' + bMI;
	// cME.innerHTML += '<hr class="contextMenu" \/>Open <a class="contextMenuLink" href="javascript:pP();">print version<\/a> of page...';
	cME.innerHTML += '<hr class="contextMenu" \/>Site design and implementation by us, using 100% Flash&trade;-free, frame-free, highly compliant, compatible, and accessible DHTML. Hand-coded in Canada.<hr class="contextMenu" \/>Copyright &copy; 2007 Codewise Systems Inc. All rights reserved.'
	if (xPosn < (winIW - cMW - cMOP)) {
		cME.style.left = xPosn;
	} else {
		cME.style.left = (xPosn - cMW - sBW - 1);
	};
	if (yPosn < (winIH - cMH - cMOP)) {
		cME.style.top = yPosn;
	} else {
		cME.style.top = (yPosn - cMH - sBW - 1);
	};
	if (is_nav6up) {
		cME.style.left = Math.round(((sWW - cMW) / 2));
		cME.style.top = Math.round(((sWH - cMH) / 2));
	};
	cME.style.visibility = 'visible';

	return;
};

function hCM () { // hideContextMenu
	if (!document.getElementById) {
		return;
	};

	var cME = document.getElementById('contextMenu'); // contextMenuElement
	cME.style.visibility = 'hidden';	
};

function aTF() { // addToFavourites
	window.external.AddFavorite(location.href,document.title);
	return false;
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Determine environment variables */

function dEV() { // determineEnvironmentVariables
	if (window.innerHeight) {
		cDIB = screen.pixelDepth;

		winIH = window.innerHeight;
		winIW = window.innerWidth;

		winOH = window.outerHeight;
		winOW = window.outerWidth;

		winISH = document.height;
		winISW = document.width;

		winPT = window.screenY;
		winPL = window.screenX;

	} else if ((document.documentElement) && (document.documentElement.clientHeight)) {
		cDIB = screen.colorDepth;

		winIH = document.documentElement.clientHeight;
		winIW = document.documentElement.clientWidth;

		winOH = 'unknown in IE, but it is > ' + winIH;
		winOW = (document.documentElement.offsetWidth);
 
		winISH = document.documentElement.scrollHeight;
		winISW = document.documentElement.scrollWidth;

		winPT = window.screenTop;
		winPL = window.screenLeft;

	} else if (document.body) {
		cDIB = screen.colorDepth;

		winIH = document.body.clientHeight;
		winIW = document.body.clientWidth;

		winOH = 'unknown in IE, but it is > ' + winIH;
		winOW = (document.body.offsetWidth);

		winISH = document.body.scrollHeight;
		winISW = document.body.scrollWidth;

		winPT = window.screenTop;
		winPL = window.screenLeft;
	};

	if (document.body.scrollHeight) {
		winISH = document.body.scrollHeight;
	};

	if (document.body.scrollWidth) {
		winISW = document.body.scrollWidth;
	};

	if ((is_winxp) && (is_ie) && ((winOW - winIW) == 20)) {
		is_winxp_classic = true;
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Document Object Model code */

var sansStyle = false;
var DOMObjectHandler = '';

function determineDOM(elementName,sansStyle) {
	if (document.layers) {
		DOMObjectHandler = eval('document.' + elementName);	
	};
	if (sansStyle) {

		if (document.getElementById) {
			DOMObjectHandler = document.getElementById(elementName);
		} else if (document.all) {
			DOMObjectHandler = eval('document.all.' + elementName);
		};
	} else {
		if (document.getElementById) {
			DOMObjectHandler = document.getElementById(elementName).style;
		} else if (document.all) {
			DOMObjectHandler = eval('document.all.' + elementName + '.style');
		};
	};
	// alert(DOMObjectHandler)
	return DOMObjectHandler;
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hiding/displaying layers */

var displayState = '';

function changeElementVisibility(currentElement, changedState) {
	determineDOM(currentElement,0);
	displayState = DOMObjectHandler.visibility;
	if ((changedState == 'toggle') && (displayState == ('' || 'inherit' || 'undefined'))) {
		if ((displayState == 'visible') || (displayState == 'show')) { 
			DOMObjectHandler.visibility = 'visible'; 
		} else { 
			DOMObjectHandler.visibility = 'hidden'; 
		};
	} else if ((changedState == 'toggle') && (displayState != ('' || 'inherit' || 'undefined'))) {
		if ((displayState == 'visible') || (displayState == 'show')) { 
			DOMObjectHandler.visibility = 'hidden'; 
		} else { 
			DOMObjectHandler.visibility = 'visible'; 
		};
	};
	if (changedState == 'show') { DOMObjectHandler.visibility = 'visible'; };
	if (changedState == 'hide') { DOMObjectHandler.visibility = 'hidden'; };
};

function cED(elementName) {
	cE.style.display = 'none';

	var cObject = document.getElementById(elementName); // currentObject
	cObject.style.visibility = 'hidden';
	cObject.style.display = 'block';

	setTimeout('scrollToTop();', 1);

	cE = cObject;

	return false;
};

function scrollToTop() {
	if (document.getElementById('rightPane')) {
		document.getElementById('rightPane').scrollTop = 0;
		cE.style.visibility = 'visible';
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Horizontally centering an object */

var marginLeftOffset = 0;

function cEH(objectName,objectWidth,hOffset) { // centerElementHorizontally
	determineDOM(objectName);
	DOMObjectHandler.marginLeft = 'auto';
	DOMObjectHandler.marginRight = 'auto';

	// marginLeftOffset = Math.max((Math.ceil(((winIW - objectWidth) / 2) - (sBW / 2))), 0);
	marginLeftOffset = Math.floor(((winIW - objectWidth) / 2) - (sBW / 2));

	// Code for IE running on Windows XP
	if ((is_winxp) && (is_ie6)) {
		marginLeftOffset = Math.ceil(((winIW - objectWidth) / 2) - (sBW / 2));

		// Code for XP running in classic theme
		if (is_winxp_classic) {
			if (((Math.abs(winIW - objectWidth)) % 2) == 1) {
				if ((winIW - objectWidth) < 20) {
					marginLeftOffset -= 1;
				};
			};
		};
	};

	if (hOffset) {
		marginLeftOffset += hOffset;
	};

	DOMObjectHandler.marginLeft = marginLeftOffset + 'px';
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Embed email addresses safely */

function CCOCloakEmailAddress(emailHost,account,contact) {
	var cloakedEmailAddressHTML = '<span class="cloakedMailtoLink">';
	var hasContactName = true;
	var theContact = contact;
	if (theContact == '') { 
		hasContactName = false; 
		theContact = account + '&#64;' + emailHost; 
	};
	if (pM) {
		if (hasContactName) { 
			cloakedEmailAddressHTML += theContact + ': ' + account + '&#64;' + emailHost; 
		} else {
			cloakedEmailAddressHTML += theContact; 
		};
	} else {
		cloakedEmailAddressHTML += '<a class="textLink" href="' + 'mail' + 'to:' + account + '&#64;' + emailHost + '">' + theContact + '<\/a>';
	};
	cloakedEmailAddressHTML += '<\/span>';
	document.write(cloakedEmailAddressHTML);
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page animation */

function aPL() { // animatePageLoad
	var dI = 100; // delayInterval
	var dIT = 200; // delayIntervalTimer
	if ((!pM) && (document.getElementById)) {
		setTimeout("showPageContainer();",dIT);
		dIT += dI;
		setTimeout("showPageBackground();",dIT);
		dIT += dI;
		setTimeout("showLogo();",dIT);
		dIT += dI;
		setTimeout("showLeftPane();",dIT);
		dIT += dI;
		setTimeout("showMenu();",dIT);
		dIT += dI;
		setTimeout("showValidation();",dIT);
		dIT += dI;
		setTimeout("showRightPane();",dIT);
		dIT += dI;
		setTimeout("showContent();",dIT);
		dIT += dI;
		setTimeout("showFooter();",dIT);
		dIT += dI;
		setTimeout("showCopyright();",dIT);
		dIT += dI;
	};
};

function showPageBackground() {
	changeElementVisibility('pageBackground','show');
};

function showPageContainer() {
	changeElementVisibility('pageContainer','show');
};

function showLogo() {
	changeElementVisibility('logo','show');
};

function showLeftPane() {
	changeElementVisibility('leftPane','show');
};

function showMenu() {
	changeElementVisibility('menu','show');
};

function showValidation() {
	changeElementVisibility('validation','show');
};

function showContentMaskTop() {
	changeElementVisibility('contentMaskTop','show');
};

function showRightPane() {
	changeElementVisibility('rightPane','show');
};

function showContent() {
	changeElementVisibility('content','show');
};

function showFooter() {
	changeElementVisibility('footer','show');
};

function showCopyright() {
	changeElementVisibility('copyright','show');
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page reflow and restyling */

function iRPD() { // initializeRightPanelDisplay
	if (document.getElementById('aboutUs')) {
		cE = document.getElementById('aboutUs'); // currentElement
		cE.style.display = 'block';
		cE.style.border = '0px dashed #366180';
	};
};

function rSB() { // reStyleBody
	if (!document.getElementById('pageContainer')) {
		return;
	};

	// Define all elements to be restyled
	var pCEle = document.getElementById('pageContainer'); // pageContainerElement
	var lPEle = document.getElementById('leftPane'); // leftPaneElement
	var rPEle = document.getElementById('rightPane'); // rightPaneElement

	// Reset page container and left and right pane heights
	pCEle.style.height = (winIH - 21) + 'px';
	lPEle.style.height = (winIH - 78 - 30) + 'px'; // 78 = leftPaneTopMargin, 30 = footerHeight
	rPEle.style.height = (winIH - 78 - 30 - 7) + 'px'; // 78 = leftPaneTopMargin, 30 = footerHeight, 7 = bottomPaddingSoItLinesUpWithThePageBackground

	if ((is_nav6up) || (is_mozilla) || (is_safari)) {
		rPEle.style.height = (winIH - 78 - 30 - 0) + 'px'; // 78 = leftPaneTopMargin, 30 = footerHeight, 7 = bottomPaddingSoItLinesUpWithThePageBackground
	};

	// Center various elements of the GUI
	cEH('pageContainer', pW, hOFAPE);
	cEH('logo', pW, hOFAPE);
	cEH('validation', pW, hOFAPE);
	cEH('leftPane', pW, hOFAPE);
	cEH('rightPane', pW, hOFAPE);
	cEH('footer', pW, hOFAPE);
	cEH('pageBackground', pW, hOFAPE);
};

function iRPC() { // initializeRightPaneContent
	if (location.hash == '#about_us') {
		cED('aboutUs');
	} else if (location.hash == '#web_development') {
		cED('webDevelopment');
	} else if (location.hash == '#codewise_presentation_manager') {
		cED('CodewisePresentationManager');
	} else if (location.hash == '#new_media_design') {
		cED('newMediaDesign');
	} else if (location.hash == '#graphic_design_services') {
		cED('graphicDesignServices');
	} else if (location.hash == '#visual_identity') {
		cED('visualIdentity');
	} else if (location.hash == '#portfolio') {
		cED('portfolio');
	} else if (location.hash == '#strategic_alliances') {
		cED('strategicAlliances');
	} else if (location.hash == '#contact_us') {
		cED('contactUs');
	} else if (location.hash == '#client_login') {
		cED('clientLogin');
	};
};

function hRPC() { // hideRightPaneContent
	var loop; 

	for (loop = 0; loop < (tDivArray.length - 1); loop++) {
		if (tDivArray[loop].className == 'rightPaneContent') {
			tDivArray[loop].style.backgroundColor = 'transparent';
			tDivArray[loop].style.border = '0px dashed orange';
			tDivArray[loop].style.marginBottom = '0px';
		};
		if ((tDivArray[loop].className == 'rightPaneContent') && (tDivArray[loop].id != 'aboutUs')) {
			tDivArray[loop].style.display = 'none';
		};
	};
};

function hTL() { // hideTopLinks
	var loop; 

	for (loop = 0; loop < tAArray.length; loop++) {
		if (tAArray[loop].className == 'backToTopLink') {
			tAArray[loop].style.display = 'none';
		};

		if ((tAArray[loop].className == 'textLink') && (is_nav)) {
			tAArray[loop].style.borderWidth = '1px';
		};
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Internal style sheet code */

var iSSHTML = '';

// HTML tags
iSSHTML += ' body { color: #333; background-color: #366180; background-image:url(media\/images\/codewise_site\/backgrounds\/page_bg_01_228x340.gif);background-repeat:no-repeat;background-position:bottom right;background-attachment:fixed; margin: 0px; } ';
iSSHTML += ' h1 { display: none; } ';
iSSHTML += ' h2 { border-top: 0px solid #366180; margin-top: 11px; padding-top: 0px; } ';

// Ids
iSSHTML += ' #topAnchor { display: none; } ';
iSSHTML += ' #pageContainer { visibility: hidden; position: absolute; top: 0px; left: 0px; background-color: #fff; width: 700px; height: 400px; overflow: hidden; padding: 10px; border-right: 1px dashed #94adc4; border-bottom: 1px dashed #94adc4; border-left: 1px dashed #94adc4; } ';
iSSHTML += ' #logo { visibility: hidden; position: absolute; top: 16px; left: 1px; width: 700px; padding-left: 16px; border: 0px dashed orange; } ';
iSSHTML += ' #leftPane { visibility: hidden; position: absolute; top: 78px; left: 10px; z-index: 1000; width: 180px; height: 400px; border: 1px dashed #d0e1f2; border-left: 0px dashed #d0e1f2; } ';
iSSHTML += ' #menu { visibility: hidden; margin-top: 5px; background-color: #fff; border: 0px dashed orange; } #menu ul { line-height: 1.3em; margin-left: 20px; } #menu ul li { margin-top: 3px; } ';
iSSHTML += ' #validation { visibility: hidden; position: absolute; bottom: 38px; left: 10px; z-index: 100; width: 180px; text-align: center; border: 0px dashed orange; } ';
iSSHTML += ' #rightPane { visibility: hidden; position: absolute; top: 78px; z-index: 1000; left: 190px; width: 500px; height: 400px; overflow: auto; padding: 8px 10px 0px 10px; border: 0px dashed orange; border-top: 1px dashed #d0e1f2; } ';
iSSHTML += ' #content { visibility: hidden; } ';
iSSHTML += ' #footer { visibility: hidden; position: absolute; bottom: 0px; left: 0px; z-index: 1000; height: 30px; width: 700px; border: 0px dashed orange; } ';
iSSHTML += ' #copyright { visibility: hidden; margin-top: 7px; margin-left: 12px; } #copyright span.backToTopLink { display: none; } ';
iSSHTML += ' #pageBackground { visibility: hidden; position: absolute; bottom: 0px; left: 0px; z-index: 10; width: 720px; height: 184px; background-color: #fff; background-image: url(media/images/codewise_site/backgrounds/page_bg_02_trans_700x184.gif);  background-repeat: no-repeat;  background-position: bottom right; border: 0px dashed orange; } ';
iSSHTML += ' #contextMenu { visibility: hidden; display: block; position: absolute; top: 0px; left: 0px; z-index: 100000; width: 180px; height: 250px; overflow: hidden; background-color: rgb(212,208,200); border: 10px outset fff; color: black; font-family: Arial, sans-serif; font-size: 8pt; font-weight: normal; padding: 5px; } ';

// Classes
iSSHTML += '';

// Browser/platform/operating-system styles
if ((is_ie) && (is_win)) {
	iSSHTML += ' body { scrollbar-3dlight-color: #366180; scrollbar-arrow-color: #366180; scrollbar-base-color: #366180; scrollbar-darkshadow-color: #366180; scrollbar-face-color: #366180; scrollbar-highlight-color: #366180; scrollbar-shadow-color: #366180; scrollbar-track-color: #366180; } '; // Why doesn't this work anymore?!? It did... &%*$!, Bill Gates!!!
	iSSHTML += ' #rightPane { scrollbar-3dlight-color: #d8d8d8; scrollbar-arrow-color: #000; scrollbar-base-color: #d8d8d8; scrollbar-darkshadow-color: #404040; scrollbar-face-color: #d8d8d8; scrollbar-highlight-color: #fff; scrollbar-shadow-color: #808080; scrollbar-track-color: #dfdfdf; } ';

	iSSHTML += ' #pageBackground { filter: alpha(opacity=15); } ';
};

if ((is_nav6up) || (is_mozilla) || (is_safari)) {
	iSSHTML += ' #menu ul { margin-left: 0px; padding-left: 20px; line-height: 1.6em; } h2.navHeading { padding-top: 0px; margin-top: 7px; margin-bottom: -2px; } ';
	iSSHTML += ' #rightPane, #content { padding-top: 0px; } ';
	iSSHTML += ' #content { margin-top: -4px; } ';
	iSSHTML += ' #copyright { margin-top: 9px; } ';

        if ((is_nav6up) || (is_mozilla)) {
		iSSHTML += ' table.portfolio { margin-top: 0px; } ';
		iSSHTML += ' #pageBackground { -moz-opacity: 0.15; } ';
        } else if (is_safari) {
		// iSSHTML += ' #pageBackground { opacity: 0.15; } '; // For some reason this affects the whole page!
		iSSHTML += ' #pageBackground { background-image: url(media/images/codewise_site/backgrounds/page_bg_02_safari_trans_700x184.gif); } ';
        };
};

// Case-based styles
iSSHTML += '';

iSSHTML = '<style type="text\/css"><!-' + '- ' + iSSHTML + ' -' + '-><\/style>';
document.write(iSSHTML);
