/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Codewise Presentation Manager - Master Script File

Copyright (c) 2004-2009 Codewise Systems Inc. & Twisted Lime Media Inc. 
All rights reserved.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

if(liveServerName!=''){lPCD=liveServerName.substring(7,liveServerName.length);};URL=location.href;URLProtocol=location.protocol;URLHostName=location.hostname;URLPort=location.port;URLPath=location.pathname;URLHash=location.hash;URLSearch=location.search;URLMinusQueryString=URL;if((URL.indexOf('?')!=-1)||(URL.indexOf('#')!=-1)){var URLMinusQueryStringTemp='';if(URL.indexOf('?')!=-1){URLMinusQueryStringTemp=URL.split('?');URLMinusQueryString=URLMinusQueryStringTemp[0];}else if(URL.indexOf('#')!=-1){URLMinusQueryStringTemp=URL.split('#');URLMinusQueryString=URLMinusQueryStringTemp[0];};};var pathTemp;if(is_wince){fDPO=fDPOFL=rFS;}else{URLPathRegExp=new RegExp('\/','gi');URLPathTemp=URLPath.replace(URLPathRegExp,'\\');masterPathOffset=URLPathTemp.split('\\');URLPathTemp=URLHostName.split('.');URLTopLevelDomain=URLPathTemp[0];if(URLPath.substring(0,1)=='/'){URLPath=URLPath.substring(1,URLPath.length);};if((URLProtocol.indexOf('file')!=-1)&&is_ie&&!is_ie7up){pathTemp=URLPath.split('\\');}else{pathTemp=URLPath.split('/');};if(URLProtocol.indexOf('file')!=-1){if(is_mac&&(URL.indexOf('CSI_')!=-1)){sFDO+=3;};if(is_mac&&isOnCD&&!dM){sFDO+=1;};fD=masterPathOffset.length-3-sFDO;lPCD='';masterCookieDomain='';if(mFPO==''){if(!isOnCD){mFPO='__projects\/'+skinPreference+'\/';};};}else{fD=masterPathOffset.length-2-sFDO;};if(URL.indexOf('http:\/\/codewise')!=-1){};fN=pathTemp[pathTemp.length-1];if(fN==''){fN=dFN;}else if(fN==dFN){isHomePage=1;}else if(fN.indexOf('test_page')!=-1){isTestPage=1;};dMsg+='masterPathOffset = '+masterPathOffset+'|';dMsg+='fD = '+fD+'|';dMsg+='fN = '+fN+'|';if(isRemotePage){fDPO=webServerName+rFS;fDPOFL=liveServerName+rFS;}else if(fD=='unknown'){fDPO=fDPOFL=rFS;}else{for(loop00=0;loop00<fD;loop00++){fDPO+='..\/';fDPOFL+='..\/';};};};dMsg+='fDPO = \''+fDPO+'\'|fDPOFL = \''+fDPOFL+'\'|';whatYear=new Date();thisYear=whatYear.getFullYear();if(thisYear!=copyrightYear){copyrightYear=copyrightYear+'&#8211;'+thisYear;};nextYear=new Date();nextYear.setFullYear(nextYear.getFullYear()+1);lastYear=new Date();lastYear.setFullYear(lastYear.getFullYear()-1);function getCookie(cookieName){if(!is_avantgo){var sOCSS=document.cookie.indexOf(cookieName+'=');var lOCSS=sOCSS+cookieName.length+1;if((!sOCSS)&&(cookieName!=document.cookie.substring(0,cookieName.length))){return null;};if(sOCSS==-1){return null;};var eOCSS=document.cookie.indexOf(';',lOCSS);if(eOCSS==-1){eOCSS=document.cookie.length;};return unescape(document.cookie.substring(lOCSS,eOCSS));}else{return null;};};function setCookie(cookieName,cookieValue,cookieExpirationDate,cookiePath,cookieDomain,cookieSecure){if(!is_avantgo){cC=cookieName+'='+escape(cookieValue);if(cookieExpirationDate){cC+=';expires='+cookieExpirationDate.toGMTString();};if(cookiePath){cC+=';path='+cookiePath;};if(cookieDomain){cC+=';domain='+cookieDomain;};if(cookieSecure){cC+=';secure';};document.cookie=cC;};};function deleteCookie(cookieName,cookiePath,cookieDomain){if(getCookie(cookieName)){cC=cookieName+'=';if(cookiePath){cC+=';path='+cookiePath;};if(cookieDomain){cC+=';domain='+cookieDomain;};cC+=';expires=Thu, 01-Jan-1970 00:00:01 GMT';document.cookie=cC;};};if(URLProtocol=='file:'){masterCookiePath=fDPO;masterCookieDomain=fDPO;};function storeMasterCookie(){if(!getCookie('CodewiseMasterCookie')){setCookie('CodewiseMasterCookie','enabled',nextYear,masterCookiePath,masterCookieDomain);};};function storeIntelligentCookie(cookieName,cookieValue,cookieExpirationDate,cookiePath,cookieDomain){if(getCookie('CodewiseMasterCookie')){var intelligentCookie=getCookie(cookieName);if((!intelligentCookie)||(intelligentCookie!=cookieValue)){setCookie(cookieName,cookieValue,cookieExpirationDate,cookiePath,cookieDomain);intelligentCookie=getCookie(cookieName);if((!intelligentCookie)||(intelligentCookie!=cookieValue)){};};if((cookieName=='developerTestMode')&&(getCookie('developerTestMode'))){setTimeout('aDTM();',500);};};};function aDTM(){alert(ui_note02+':\n\nDeveloper test mode enabled.'+aMWS);};if(getCookie('displayLanguagePreference')){if(skinPreference!='_admin'){displayLanguage=getCookie('displayLanguagePreference');languagePreference=getCookie('displayLanguagePreference');}else{displayLanguage=languagePreference;};}else{displayLanguage=languagePreference;};if((displayLanguage=='en')||(languagePreference=='en')){lPS='_en';}else if((displayLanguage=='fr')||(languagePreference=='fr')){lPS='_fr';}else if((displayLanguage=='es')||(languagePreference=='es')){lPS='_es';};if(getCookie('developerTestMode')){dTM=1;};function HM_f_PopUp(cE,evt){return false;};function HM_f_PopDown(cE,evt){return false;};var popUp=HM_f_PopUp;var popDown=HM_f_PopDown;function splitSearchStringContent(pCPString,textToSplitBy){pCPArray=pCPString.split(textToSplitBy);pCPIndex=pCPArray.length;};if(location.search){searchStringContent=location.search.substring(1,location.search.length);};if(searchStringContent!=''){qSS='&';splitSearchStringContent(searchStringContent,qSS);for(loop01=0;loop01<pCPArray.length;loop01++){cQSE=pCPArray[loop01];if((cQSE=='printMode=on')||(cQSE=='printMode=true')||(cQSE=='print=on')||(cQSE=='print=true')||(cQSE=='print=1')){pM=true;};if(cQSE=='displaySection=1'){sTD=1;};if(cQSE=='displaySection=2'){sTD=2;};if(cQSE=='displaySection=3'){sTD=3;};if(cQSE=='displaySection=4'){sTD=4;};if((cQSE=='skin=noSkin')||(cQSE=='skin=none')||(cQSE=='skin=off')||(cQSE=='skin=false')||(cQSE=='skin=0')){skinPreference='';};if((cQSE=='testMode=on')||(cQSE=='testMode=true')||(cQSE=='debugMode=on')||(cQSE=='debugMode=true')){dM=1;};if(cQSE=='debugMode=noisy'){dM=1;dMN=1;};if((dTM)||(fN.indexOf('sample_page')!=-1)||(fN.indexOf('test_page')!=-1)){if((cQSE=='HM=off')||(cQSE=='HM=false')){iHM=0;};if((cQSE=='windowScroll=on')||(cQSE=='windowScroll=true')||(cQSE=='windowScroll=1')){windowScroll=1;};if((cQSE=='windowScroll=off')||(cQSE=='windowScroll=false')||(cQSE=='windowScroll=0')){windowScroll=0;};if((cQSE=='center=on')||(cQSE=='center=true')||(cQSE=='center=1')){centerUserInterface=1;};if((cQSE=='center=off')||(cQSE=='center=false')||(cQSE=='center=0')){centerUserInterface=1;};if((cQSE=='showHidden=on')||(cQSE=='showHidden=true')||(cQSE=='showHidden=1')){sHC=true;};if((cQSE=='imageBorders=on')||(cQSE=='imageBorders=true')||(cQSE=='imageBorders=1')){imageBorders=true;iBS=1;};if(cQSE.indexOf('skin=')!=-1){if(cQSE=='skin=admin'){skinPreference='_admin';}else if(cQSE=='skin=palmos'){skinPreference='_palmos';}else if(cQSE=='skin=pocketpc'){skinPreference='_pocketpc';}else{};};};if((cQSE=='color=lemon')||(cQSE=='colour=lemon')||(cQSE=='color=yellow')||(cQSE=='colour=yellow')){colourPreference='lemon';};if((cQSE=='color=orange')||(cQSE=='colour=orange')){colourPreference='orange';};if((cQSE=='color=grapefruit')||(cQSE=='colour=grapefruit')||(cQSE=='color=pink')||(cQSE=='colour=pink')){colourPreference='grapefruit';};if(cQSE=='lang=en'){displayLanguage='en';languagePreference='en';lPS='_en';};if(cQSE=='lang=fr'){displayLanguage='fr';languagePreference='fr';lPS='_fr';};if(cQSE=='lang=es'){displayLanguage='es';languagePreference='es';lPS='_es';};if(cQSE=='lang=jp'){displayLanguage='jp';languagePreference='jp';lPS='_jp';};if(cQSE.indexOf('pageType=')!=-1){tempPageType=cQSE.split('=');pageType=tempPageType[(tempPageType.length-1)];};};};btnBlur00HTML+='this.blur(); ';btnBlur01HTML+=' this.blur();';btnBlur02HTML+=' onclick="this.blur();"';function wHC(hCS){if((document.write)&&(!is_blazer)){document.write(hCS);};};var embedScriptTag01HTML='<s'+'cr';var embedScriptTag02HTML='ipt s'+'rc="';var embedScriptTag03HTML='.j'+'s" ty'+'pe="te'+'xt\/ja'+'vas'+'cr'+'ip'+'t"><\/s'+'cr';var embedScriptTag03bHTML='.c'+'3'+'c" ty'+'pe="te'+'xt\/ja'+'vas'+'cr'+'ip'+'t"><\/s'+'cr';var embedScriptTag04HTML='ip'+'t>';function wCSSFL(CSSFileType){if(CSSFileType=='internal'){iSSHTML='<st'+'yle type="te'+'xt\/css" me'+'dia="scr'+'een"><!-'+'-'+iSSHTML+'-'+'-><\/sty'+'le>';wHC(iSSHTML);}else if((CSSFileType=='layout')&&(sSLCSSV!='n\/a')){wHC('<li'+'nk type="te'+'xt\/css" rel="style'+'sheet" me'+'dia="scr'+'een" href="'+fDPO+sSFN+dSFN+skinPreference+'_layout_'+sSLCSSV+'.css" \/>');}else if((CSSFileType=='print')&&(sSPCSSV!='n\/a')){if(pM){wHC('<li'+'nk type="te'+'xt\/css" rel="style'+'sheet" me'+'dia="scr'+'een" href="'+fDPO+sSFN+dSFN+skinPreference+'_print_'+sSPCSSV+'.css" \/>');wHC('<li'+'nk type="te'+'xt\/css" rel="style'+'sheet" me'+'dia="pri'+'nt" href="'+fDPO+sSFN+dSFN+skinPreference+'_print_'+sSPCSSV+'.css" \/>');}else{wHC('<li'+'nk type="te'+'xt\/css" rel="style'+'sheet" me'+'dia="pri'+'nt" href="'+fDPO+sSFN+dSFN+skinPreference+'_print_'+sSPCSSV+'.css" \/>');};};};var CSI_appendScriptCount=0;var CSI_appendScripts=new Array;function CSI_appendScript(){e_head=document.getElementsByTagName('head').item(0);CSI_appendScripts[CSI_appendScriptCount]=document.createElement('script');CSI_appendScripts[CSI_appendScriptCount].id='appendedScript'+CSI_appendScriptCount;if(e_head&&CSI_appendScripts[CSI_appendScriptCount]&&arguments){for(loop00=0;loop00<arguments.length;loop00++){var scriptArgumentsTemp=arguments[loop00].split('=');if(scriptArgumentsTemp[0]=='onload'){if(CSI_appendScripts[CSI_appendScriptCount].addEventListener){CSI_appendScripts[CSI_appendScriptCount].onload=function(){eval(scriptArgumentsTemp[1]);};}else{CSI_appendScripts[CSI_appendScriptCount].onreadystatechange=function(){if(this.readyState=='loaded'||this.readyState=='complete'){eval(scriptArgumentsTemp[1]);};};};}else{CSI_appendScripts[CSI_appendScriptCount].setAttribute(scriptArgumentsTemp[0],scriptArgumentsTemp[1]);};};e_head.appendChild(CSI_appendScripts[CSI_appendScriptCount]);};CSI_appendScriptCount++;};function setWindowStatus(statusMessageText){if(statusMessageText){setTimeout('window.status="'+statusMessageText+'"',10);}else{setTimeout('window.status=""',10);};return true;};function pI(){doNothing();};function sSI(){e_SRM=document.createElement('div');e_SRM.id='skinReseter';e_SRM.className='hidden';e_SRM.onclick=function(){CSI_switchSkins('tlmi');location.reload(1);};e_SRM_Image=document.createElement('img');e_SRM_Image.id='skinSwitcherImage';e_SRM_Image.alt=' '+ui_rS+'... ';e_SRM_Image.title=' '+ui_rS+'... ';e_SRM_Image.style.width='100%';e_SRM_Image.style.height='100%';e_SRM_Image.src=fDPO+'media\/images\/blank\/blank_transparent.gif';e_SRM.appendChild(e_SRM_Image);if(e_body){e_body.appendChild(e_SRM);};};window.onload=function(){storeMasterCookie();highlightingInitialization();pI();sSI();aPI();iPL();};function gCOT(){if(document.getElementsByTagName){tAArray=document.getElementsByTagName('a');tDivArray=document.getElementsByTagName('div');tIFrameArray=document.getElementsByTagName('iframe');tImgArray=document.getElementsByTagName('img');tLiArray=document.getElementsByTagName('li');tObjectArray=document.getElementsByTagName('object');tPArray=document.getElementsByTagName('p');tSpanArray=document.getElementsByTagName('span');};};document.getElementsByClassName=function(classNameReference){var allElementsByClassName=new Array();var allElements=document.getElementsByTagName('*');for(var loop00=0;loop00<allElements.length;loop00++){if(hasClass(allElements[loop00],classNameReference)){allElementsByClassName[allElementsByClassName.length]=allElements[loop00];};};return allElementsByClassName;};document.getElementsByTagNameAndClassName=function(tagNameReference,classNameReference){var allElementsByTagNameAndClassName=new Array();var allElements=document.getElementsByTagName('*');for(var loop00=0;loop00<allElements.length;loop00++){if((allElements[loop00].tagName.toLowerCase()==tagNameReference.toLowerCase())&&(hasClass(allElements[loop00],classNameReference))){allElementsByTagNameAndClassName[allElementsByTagNameAndClassName.length]=allElements[loop00];};};return allElementsByTagNameAndClassName;};function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);};function hasClass(cE,cN){if(cE){var classNameRegExp=new RegExp('(\\s|^)'+cN+'(\\s|$)');return cE.className.match(classNameRegExp);};};function addClass(cE,cN){if(cE){if(!this.hasClass(cE,cN)){if(cE.className==''){cE.className=cN;}else{cE.className+=' '+cN;};};};};function removeClass(cE,cN){if(cE){if(hasClass(cE,cN)){var classNameRegExp=new RegExp('(\\s|^)'+cN+'(\\s|$)');cE.className=cE.className.replace(classNameRegExp,' ');};};};function getStyle(cE,strCssRule){var strValue='';if(document.defaultView&&document.defaultView.getComputedStyle){strValue=document.defaultView.getComputedStyle(cE,'').getPropertyValue(strCssRule);}else if(cE.currentStyle){try{strCssRule=strCssRule.replace(/\-(\w)/g,function(strMatch,p1){return p1.toUpperCase();});strValue=cE.currentStyle[strCssRule];}catch(e){};};return strValue;};function dEV(){if(window.innerHeight){cDIB=screen.pixelDepth;win_IH=window.innerHeight;win_IW=window.innerWidth;win_OH=window.outerHeight;win_OW=window.outerWidth;win_ISH=document.height;win_ISW=document.width;win_PT=window.screenY;win_PL=window.screenX;}else if((document.documentElement)&&(document.documentElement.clientHeight)){cDIB=screen.colorDepth;win_IH=document.documentElement.clientHeight;win_IW=document.documentElement.clientWidth;win_OH='unknown in IE, but it is > '+win_IH;win_OW=(document.documentElement.offsetWidth);win_ISH=document.documentElement.scrollHeight;win_ISW=document.documentElement.scrollWidth;win_PT=window.screenTop;win_PL=window.screenLeft;}else if(document.body){cDIB=screen.colorDepth;win_IH=document.body.clientHeight;win_IW=document.body.clientWidth;win_OH='unknown in IE, but it is > '+win_IH+aMWS;win_OW=(document.body.offsetWidth);win_ISH=document.body.scrollHeight;win_ISW=document.body.scrollWidth;win_PT=window.screenTop;win_PL=window.screenLeft;};if(document.body.scrollHeight){win_ISH=document.body.scrollHeight;};if(document.body.scrollWidth){win_ISW=document.body.scrollWidth;};if(is_nav6){win_ISH=document.height;};if((is_nav6up)||(is_mozilla)||((is_firefox)&&(!is_firefox1r0))){win_ISH=document.documentElement.scrollHeight;};if(is_opera){};if(is_ie7){win_ISH=document.documentElement.scrollHeight;};if((is_winxp)&&(is_ie)&&((win_OW-win_IW)==20)){is_winxp_classic=true;};eVMsg+='|cDIB = '+cDIB+'|'+'scrW = '+scrW+'|'+'scrH = '+scrH+'|'+'win_IW = '+win_IW+'|'+'win_IH = '+win_IH+'|'+'win_OW = '+win_OW+'|'+'win_OH = '+win_OH+'|'+'win_PT = '+win_PT+'|'+'win_PL = '+win_PL+'|'+'win_ISH = '+win_ISH+'|'+'win_ISW = '+win_ISW;dMsg+=eVMsg+'|';};window.onresize=function(){oWR();};var FAC=0;function oWR(){if(wROE){aRITP();};};function aRITP(){pI();};if(skinPreference!=''){if((skinPreference.substring(1,0)!='_')||(skinPreference.match('_csi'))){customSkinEnabled=1;dSFN+='__custom\/'+skinPreference+rFS;}else{if((skinPreference!='_pocketpc')&&(skinPreference!='_palmos')&&(skinPreference!='_admin')){iHM=1;};dSFN+=skinPreference+rFS;};};dMsg+='sSFN = '+sSFN+'|';if((skinPreference=='_admin')||(window.name=='CodewiseAdmin')){skinPreference='_admin';sSPEJSV='1-01';sSIPSJSV='n\/a';}else if(skinPreference=='_palmos'){is_wince=true;iHM=false;sSPEJSV='1-00';sSIPSJSV='n\/a';}else if(skinPreference=='_pocketpc'){is_wince=true;iHM=false;sSPEJSV='1-00';sSIPSJSV='n\/a';};if((iHM)&&(pageType!='blank')){wHC(embedScriptTag01HTML+embedScriptTag02HTML+fDPOFL+'_config\/nav_config'+lPS+embedScriptTag03bHTML+embedScriptTag04HTML);};wHC(embedScriptTag01HTML+embedScriptTag02HTML+fDPO+sSFN+'codewise_functions_'+fJSV+embedScriptTag03HTML+embedScriptTag04HTML);if(skinPreference!=''){if(sSIPSJSV!='n\/a'){wHC(embedScriptTag01HTML+embedScriptTag02HTML+fDPO+sSFN+dSFN+skinPreference+'_in_page_styles_'+sSIPSJSV+embedScriptTag03HTML+embedScriptTag04HTML);};if(sSPEJSV!='n\/a'){wHC(embedScriptTag01HTML+embedScriptTag02HTML+fDPO+sSFN+dSFN+skinPreference+'_page_elements_'+sSPEJSV+embedScriptTag03HTML+embedScriptTag04HTML);};};if(iHM){if(pageType!='blank'){wHC(embedScriptTag01HTML+embedScriptTag02HTML+fDPOFL+'_config\/nav_config'+lPS+embedScriptTag03bHTML+embedScriptTag04HTML);if((!customSkinEnabled)&&(fN=='sample_page.php')){wHC(embedScriptTag01HTML+embedScriptTag02HTML+'http:\/\/www.codewise.ca\/_config\/nav_config'+lPS+embedScriptTag03bHTML+embedScriptTag04HTML);};wHC(embedScriptTag01HTML+embedScriptTag02HTML+fDPO+sSFN+'_menus\/menu_script'+embedScriptTag03HTML+embedScriptTag04HTML);};};iSSHTML=' .lowLevelBrowserContent { display: none; }';iSSHTML+=' div.ExpandOMaticContent { display: none; }';iSSHTML+=' span.ExpandOMaticGraphic { display: inline; }';iSSHTML+=' img.EOMIcon { width: 16px; height: 16px; float: left; margin-right: 3px; margin-bottom: 0px; vertical-align: bottom; border: 0px dashed lime; }';iSSHTML+=' #imageSwapImage { display: block; opacity: 1; }';iSSHTML+=' #imageRotatorImage { display: block; opacity: 1; }';if((is_nav)||(is_mozilla)){if(!is_firefox3r5){};};if(is_ie){iSSHTML+=' #imageSwapImage { filter: opacity(100); }';iSSHTML+=' #imageRotatorImage { filter: opacity(100); }';if(!is_ie7up){iSSHTML+=' a, a:link, a:active, a:hover, a:visited, a img, a:link img, a:active img, a:hover img, a:visited img { border: 0px dashed red !important; }';iSSHTML+=' img { border: 0px dashed red; }';};};wHC('<style type="text\/css"><!-'+'-\n'+iSSHTML+'\n-'+'-><\/style>');function dDMsg(){if(!dTM){return;};var tempArray;cDM='';if(dMN){tempArray=dMsg.split('|');for(loop03=0;loop03<(tempArray.length-1);loop03++){if(tempArray[loop03]!=''){cDM+='- '+tempArray[loop03]+aMWS+'\n';}else{cDM+=aMWS+'\n';};};dMsg='Codewise(TM) debugging information:\n\n'+cDM;}else{tempArray=dMsg.split('|');for(loop04=0;loop04<(tempArray.length-1);loop04++){if(loop04!=0){cDM+=';'+aMWS;};cDM+=tempArray[loop04];};dMsg='Codewise(TM) debugging information:'+cDM;};if(dM){if(dMN){copyToClipboard(dMsg);}else{if(cDM!=''){setScrollWindowStatusMessage(dMsg);};scrollWindowStatus();};}else{dMsg='';};};dMsg+='The _codewise\/codewise_master.js script has loaded...|';
