//crunchinatorvariable_compressed
var iVersion='1004031957';var sgRoot='http://gtwebpublisher.co.uk/login4/';var aModulesLoaded=new Array;aModulesLoaded[0]='common.js v'+iVersion;var sDebugmode=fDebugState();var sDebuglog='';fDebugPoint('module loaded','common.js v'+iVersion);function fDebugPoint(sFunct,sValue){var sLogStr=fTimeStr()+' : '+sFunct+' : '+sValue+'\n';if(sDebugmode.match(/-a/))alert(sLogStr);sDebuglog=sLogStr+sDebuglog;if(!(sDebugmode.match(/-l/))){var aDebuglog=new Array();aDebuglog=sDebuglog.split('\n');if(aDebuglog.length>500)sDebuglog=(aDebuglog.slice(0,500)).join('\n');}}function fDebugState(){var sKey;var sValue;var sCallingURL=top.location.href;if(sCallingURL.indexOf('?')<0)return '';var sParams=sCallingURL.substring(sCallingURL.indexOf('?')+1,sCallingURL.length);var aValPairs=new Array;aValPairs=sParams.split('&');re=/debug/i;for(var i=0;i<aValPairs.length;i++){if(!(aValPairs[i].match(re)))continue;aValPairs[i]=aValPairs[i].replace(re,'');return aValPairs[i];}return '';}function fRegister(sModule){iNewModule=aModulesLoaded.length;aModulesLoaded[iNewModule]=sModule;fDebugPoint('module loaded',sModule);}function fShowModules(){sLoadedList='Modules Loaded';for(var i=0;i<aModulesLoaded.length;i++)sLoadedList+='\n'+aModulesLoaded[i];alert(sLoadedList);}function fShowDebugLog(){window.event.returnValue=true;if(sDebuglog.length<=0)return;if((document.oModulesLoaded)&&(!document.oModulesLoaded.closed))document.oModulesLoaded.close();document.oModulesLoaded=window.open('','win','scrollbars=yes, width=600, height='+(screen.height-150));with(document.oModulesLoaded){focus();with(document){open('text/html','replace');write('<span style="font-size:8pt; font-family:Arial">');write('<b style="font-size:12pt">Debug Log</b><p>');sDebuglog=sDebuglog.replace(/\n/ig,'<br>');sDebuglog=sDebuglog.replace(/ /ig,'&nbsp;'); write(sDebuglog);write('</span>');close();}}}function fShow(sThese){aShowThese=new Array;aShowThese=sThese.split(',');for(var i=0;i<aShowThese.length;i++)eval('show'+aShowThese[i]+'()');}Array.prototype.indexOf=fArrayIndexOf;Array.prototype.addStuff=fArrayAddStuff;Array.prototype.maxLength=fMaxLength;Array.prototype.removeItem=fArrayRemoveItem;function fArrayIndexOf(vToFind){for(var i=0;i<this.length;i++){if(this[i]==vToFind)return i;}return-1;}function fArrayAddStuff(vObject){if(vObject.length){for(var i=0;i<vObject.length;i++)this[this.length]=vObject[i];}else this[this.length]=vObject;return this.length;}function fMaxLength(aArray){var iMaxLength=0;for(var i=0;i<aArray.length;i++){if(aArray[i].length>iMaxLength)iMaxLength=aArray[i].length;}return iMaxLength;}function fArrayRemoveItem(iItemIndex){if(iItemIndex>=this.length)return;for(var i=iItemIndex;i<this.length-1;i++)this[i]=this[i+1];this.length=this.length-1;}function fURLParameters(oDoc){fDebugPoint('fURLParameters','Parsing URL');var aParams=new Array();var aTempParams=new Array();aParams[0]=new Array();aParams[1]=new Array();var sURL=oDoc.location.href;var sParams=sURL.indexOf('?')<0?'':sURL.substr(sURL.indexOf('?')+1);aTempParams=sParams.split('&');for(var i=0;i<aTempParams.length;i++){aParams[0][i]=aTempParams[i].split('=')[0];aParams[1][i]=aTempParams[i].split('=')[1];}return aParams;}function fTimeStr(){var Tnow=new Date();return Tnow.toLocaleString();}function fIsNS(){if(navigator.appName.indexOf('Netscape')!=-1)return true;return false;}function fNavVersion(){fDebugPoint('fNavVersion','retreiving version of navigator');var sVersion=navigator.appVersion.split(';')[1];if(sVersion.search(/MSIE/i)<0)return 0;return parseFloat(sVersion.replace(/[^\d\.]/ig,''));}function fBrowserError(sMsg,sURL,sLine){fDebugPoint(sURL,'BROWSER-ERROR at Line '+sLine+' '+sMsg);}function fConfirm(sTitle,sMessage,sButtons,sImage){fDebugPoint('fConfirm','showing confirm message '+sTitle);var oArgs=new Object();if(sImage=='default')sImage='questo';oArgs.sTitle=sTitle;oArgs.sMessage=sMessage;oArgs.sButtons=sButtons;oArgs.sImage=sImage;var bValue=showModalDialog(sgRoot+'engines/confirm.htm',oArgs,'dialogHeight:167px;dialogWidth:400px;help:no;resizable:no;scroll:no;status:no');if(bValue==null)bValue=false;return bValue;}function fPrompt(sTitle,sMessage,sValue,sButtons,sImage){fDebugPoint('fPrompt','showing prompt for '+sTitle);var oArgs=new Object();if(sImage='default')sImage='info';if(sButtons=='default')sButtons='ok,cancel';oArgs.sTitle=sTitle;oArgs.sMessage=sMessage;oArgs.sButtons=sValue;oArgs.sButtons=sButtons;oArgs.sImage=sImage;var bValue=showModalDialog(sgRoot+'engines/prompt.htm',oArgs,'dialogHeight:167px;dialogWidth:400px;help:no;resizable:no;scroll:no;status:no');return bValue;}function fComingSoon(){fConfirm('Coming soon...','this functionality is in the pipeline','ok','warning');}function fNotInEditMode(){fDebugPoint('fNotInEditMode','checking oEditor for edit mode');if(document.all.oEditor==null)return true;if((document.all.oEditor.contentEditable==false)||(document.all.oEditor.contentEditable=='false'))return true;return false;}function fParentElement(oElement,sTagName,oTopLevel){fDebugPoint('fParentElement','finding next '+sTagName);if(oTopLevel==null)oTopLevel=top;var oPE=oElement;while(oPE&&(oPE.tagName!=sTagName)){if(oPE==oTopLevel)return null;oPE=oPE.parentElement;}return(oPE);}function fFindToolbarHeight(){fDebugPoint('fFindToolbarHeight','finding space used by toolbar');var totalHeight=0;for(i=0;i<systemTable.length;i++){totalHeight+=systemTable[i].offsetHeight;}return totalHeight;}function fSetFreeAreaHeight(theObj){fDebugPoint('fSetFreeAreaHeight','setting free area height');availHeight=document.body.clientHeight;toolbarHeight=findToolbarHeight();theObj.style.height=(availHeight-toolbarHeight-5);}function fLinebreaks(sText){fDebugPoint('fLinebreaks','replacing linebreaks');var rRe=/\[\[LINEBREAK\]\]/ig;sText=sText.replace(rRe,'\n');return sText;}function fCalcTop(oObject,sLimit){fDebugPoint('fCalcTop','finding top of '+oObject.getAttribute('id'));if((oObject.linkedButton)&&(oObject.linkedButton!=''))return fCalcTop(eval('oForm.'+oObject.linkedButton),sLimit);var oPE=oObject;var iTop=0;if(sLimit==null)sLimit='BODY';while(oPE&&(oPE.tagName!=sLimit)){iTop+=oPE.offsetTop;oPE=oPE.offsetParent;}return iTop;}function fCalcLeft(oObject,sLimit){fDebugPoint('fCalcLeft','finding left of '+oObject.getAttribute('id'));if((oObject.linkedButton)&&(oObject.linkedButton!=''))return fCalcLeft(eval('oForm.'+oObject.linkedButton),sLimit);var oPE=oObject;var iLeft=0;if(sLimit==null)sLimit='BODY';while(oPE&&(oPE.tagName!=sLimit)){iLeft+=oPE.offsetLeft;oPE=oPE.offsetParent;}return iLeft;}function fObjectFromRange(oRange){var oObj=oRange.parentElement?oRange.parentElement():oRange.item[0];return oObj;}function fCheckHexValue(sValue){if(sValue.length<6)return false;if(sValue.match(/[^0-9a-fA-F]/))return false;return true;}
