
JADE={version:"5.1",isCCI:false,siteArray:new Array(),agentCode:'HWTKED',userName:null,hideShow:true};JADE.siteArray['sunloveragent']='http://www.agents.sunloverholidays.com/';JADE.siteArray['nswagent']='http://www.agents.nswholidays.com.au/';JADE.siteArray['travelpoint']='http://www.travelpoint.com.au/';sniffer={version:'2.0',versionMajor:0,ver:0.0,browser:null,OS:null,isSupported:false,_construct:function(){this.agentStr=navigator.userAgent.toLowerCase();this.appVer=navigator.appVersion.toLowerCase();if(document.getElementById&&document.createElement){this.isSupported=true;}
this.browser=this.searchString(this.dataBrowser)||null;this.ver=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||null;this.OS=this.searchString(this.dataOS)||null;if(this.browser=='Opera'){this.isOpera=true;}
if(this.browser=='Safari'){this.isSafari=true;this.safariBuild=this.version;str_pos=this.agentStr.indexOf('version/');if(str_pos){this.safariVer=this.agentStr.substr((str_pos+8));this.safariVer=this.safariVer.substring(0,this.safariVer.indexOf(" "));}
if(!this.safariVer){this.safariVer=this.safariBuild;}
this.ver=this.safariVer;}
if(this.browser=='Chrome'){this.isSafari=false;this.isChrome=true;this.chromeBuild=this.version;str_pos=this.agentStr.indexOf('chrome/');if(str_pos){this.chromeVer=this.agentStr.substr((str_pos+7));this.chromeVer=this.chromeVer.substring(0,this.chromeVer.indexOf(" "));}
if(!this.chromeVer){this.chromeVer=this.chromeBuild;}
this.ver=this.chromeVer;}
if(this.browser=='Mozilla'){this.isMozilla=true;}
if(this.browser=='Firefox'){this.isFirefox=true;}
if(this.browser=='Netscape'){this.isNS=true;if(!this.ver){this.ver=navigator.vendorSub;}
if(this.ver>=6){this.isNS6up=true;}}
if(this.browser=='Internet Explorer'){this.isIE=true;if(this.ver>=5){this.isIE5up=true;}
if(this.ver>=5.5){this.isIE5_5up=true;}
if(this.ver>=6){this.isIE6up=true;}
if(this.ver>=7){this.isIE7up=true;}
if(this.ver>=8){this.isIE8up=true;}
if(this.isIE7up&&!this.isIE8up){if(window.XDomainRequest){this.isIE8As7=true;}}}
if(this.OS=='Windows'){this.isWin=true;}
if(this.OS=='Windows 2000'){this.isWin=true;this.isWin2k=true;}
if(this.OS=='Windows XP'){this.isWin=true;this.isWinXP=true;this.isWinXPSP2=(window.navigator.userAgent.indexOf("SV1")!=-1);}
if(this.OS=='Windows Vista'){this.isWin=true;this.isWinVista=true;}
if(this.OS=='Mac'){this.isMac=true;}
if(this.OS=='Linux'){this.isLinux=true;}
if(this.OS=='Ubuntu'){this.isLinux=true;this.isUbuntu=true;}
this.versionMajor=parseInt(this.ver);},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity;}}else if(dataProp){return data[i].identity;}}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1){return;}
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.vendor,subString:"Apple",identity:"Safari"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"Firebird",identity:"Firebird"},{string:navigator.userAgent,subString:"Phoenix",identity:"Phoenix"},{string:navigator.userAgent,subString:"MSIE",identity:"Internet Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.userAgent,subString:"Windows NT 6.0",identity:"Windows Vista"},{string:navigator.userAgent,subString:"Windows NT 5.1",identity:"Windows XP"},{string:navigator.userAgent,subString:"Windows NT 5.0",identity:"Windows 2000"},{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.vendor,subString:"Ubuntu",identity:"Ubuntu"},{string:navigator.platform,subString:"Linux",identity:"Linux"}],breifDescription:function(){var browser=this.browser;if(browser=='Internet Explorer'){browser='IE'
if(this.isIE8As7){var browser='IE8 as '+this.ver}}
var os=this.OS;if(this.isWinXPSP2){os=os+'(SP2)';}
return browser+' '+this.ver+' on '+os;}};sniffer._construct();JSManager=function(application,ver)
{if(!application&&window.JSTESTS){application='JSTESTS';ver=JSTESTS.version;}
this.application=application;this.version=ver;this.defaultDir="";this.includedJSArray=new Array();this.includedJSArray[0]=new Array();this.includedJSArray[0][0]="Document.js";this.includedJSArray[0][1]="JADE - JavaScript And DHTML Extensions";this.includedJSArray[0][2]=JADE.version;this.includedJSArray[0][3]=true;this.includedJSArray[0][4]=false;this.includedCSSArray=[];}
JSManager.prototype.setApplication=function(application,ver)
{this.application=application;this.version=ver;}
JSManager.prototype.getApplicationName=function()
{return this.application;}
JSManager.prototype.getApplicationVersion=function()
{return this.version;}
JSManager.prototype.addVersion=function(filename,module,ver)
{var added=false;for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][0]==filename){this.includedJSArray[i][1]=module;this.includedJSArray[i][2]=ver;added=true;}}
if(!added){var newRecord=this.includedJSArray.length;this.includedJSArray[newRecord]=new Array();this.includedJSArray[newRecord][0]=filename;this.includedJSArray[newRecord][1]=module;this.includedJSArray[newRecord][2]=ver;this.includedJSArray[newRecord][3]=false;this.includedJSArray[newRecord][4]=true;}}
JSManager.prototype.getVersion=function(elName,usemodule)
{var aEl=usemodule?1:0;for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][aEl]==elName){return this.includedJSArray[i][2];}}}
JSManager.prototype.setVersion=function(version,elName,usemodule)
{var aEl=usemodule?1:0;for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][aEl]==elName){this.includedJSArray[i][2]=version;}}}
JSManager.prototype.getmodule=function(filename)
{for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][0]==filename){return this.includedJSArray[i][1];}}}
JSManager.prototype.showVersions=function()
{str="<div class='JSVersions'>";str+="<h2 class='JSVersionHeader'>Version Numbers</h2>";for(var i=0;i<this.includedJSArray.length;i++){str+="<p class='JSPara'><b class='JSModule'>"+this.includedJSArray[i][1]+"</b> <span class='JSVersion'>"+this.includedJSArray[i][2]+'</span></p>';}
str+="</div>";return str;}
JSManager.prototype.setLoaded=function(filename)
{for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][0]==filename){this.includedJSArray[i][3]=true;}}}
JSManager.prototype.isLoaded=function(filename)
{for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][0]==filename){return this.includedJSArray[i][3];}}
return false;}
JSManager.prototype.isIncluded=function(filename)
{for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][0]==filename){return true;}}
return false;}
JSManager.prototype.isAllLoaded=function()
{for(var i=0;i<this.includedJSArray.length;i++){if(this.includedJSArray[i][3]==false){return false;}}
return true;}
JSManager.prototype.waitForLoaded=function(filename,fn)
{if(!this.isLoaded(filename)){var callwrapper=new CCallWrapper(this,10,'waitForLoaded',filename,fn);CCallWrapper.asyncExecute(callwrapper);}else{fn();}}
JSManager.prototype.waitForAllLoaded=function(fn)
{if(!this.isAllLoaded()){var callwrapper=new CCallWrapper(this,10,'waitForAllLoaded',fn);CCallWrapper.asyncExecute(callwrapper);}else{fn();}}
JSManager.prototype.js_include_dom=function(script_filename,dir)
{dir=dir?dir:"";if(dir.length!=0){script_filename=dir+"/"+script_filename;}else{if(this.defaultDir.length!=0){script_filename=this.defaultDir+"/"+script_filename;}}
var op7=(navigator.userAgent.indexOf("Opera 7")!=-1);if(document.getElementsByTagName&&document.createTextNode&&!op7){var html_doc=document.getElementsByTagName('head').item(0);var js=document.createElement('script');js.type="text/javascript";js.src=script_filename;js.language="javascript";if(!html_doc.appendChild(js)){document.write('<script src="'+script_filename+'" type="text/javascript" language="JavaScript"></script>');}}else{document.write('<script src="'+script_filename+'" type="text/javascript" language="JavaScript"></script>');}
return false;}
JSManager.prototype.css_include_dom=function(css_file,dir)
{dir=dir?dir:"";if(dir.length!=0){css_file=dir+"/"+css_file;}else{if(this.defaultDir.length!=0){css_file=this.defaultDir+"/"+css_file;}}
var op7=(navigator.userAgent.indexOf("Opera 7")!=-1);if(document.getElementsByTagName&&document.createTextNode&&!op7){var html_doc=document.getElementsByTagName('head').item(0);var css=document.createElement('link');css.rel="stylesheet";css.type="text/css";css.href=css_file;if(!html_doc.appendChild(css)){document.write('<link href="'+css_file+'" rel="stylesheet" type="text/css" />');}}else{document.write('<link href="'+css_file+'" rel="stylesheet" type="text/css" />');}
return false;}
JSManager.prototype.include=function(script_filename,dir,type)
{type=type?type:"JS";if(type=="CSS"){if(!in_array(script_filename,this.includedCSSArray)){this.includedCSSArray[this.includedCSSArray.length]=script_filename;this.css_include_dom(script_filename,dir);}}else{if(!in_array(script_filename,this.includedJSArray)){var newRecord=this.includedJSArray.length;this.includedJSArray[newRecord]=new Array();this.includedJSArray[newRecord][0]=script_filename;this.includedJSArray[newRecord][1]="Unknown";this.includedJSArray[newRecord][2]="0.1a";this.includedJSArray[newRecord][3]=false;this.includedJSArray[newRecord][4]=false;this.js_include_dom(script_filename,dir);}}}
JSManager.prototype.required=function()
{for(var i=0;i<arguments.length;i++){this.include(arguments[i]);}}
JSManager.prototype.setDefaultDirectory=function(dir)
{this.defaultDir=dir;}
function in_array(needle,haystack)
{for(var i=0;i<haystack.length;i++){if(haystack[i][0]==needle)return true;}
return false;}
JSLib=new JSManager();function CCallWrapper(aObjectReference,aDelay,aMethodName,aArgument0,aArgument1,aArgument2,aArgument3,aArgument4,aArgument5,aArgument6,aArgument7,aArgument8,aArgument9)
{this.mId='CCallWrapper_'+(CCallWrapper.mCounter++);this.mObjectReference=aObjectReference;this.mDelay=aDelay;this.mTimerId=0;this.mMethodName=aMethodName;this.mArgument0=aArgument0;this.mArgument1=aArgument1;this.mArgument2=aArgument2;this.mArgument3=aArgument3;this.mArgument4=aArgument4;this.mArgument5=aArgument5;this.mArgument6=aArgument6;this.mArgument7=aArgument7;this.mArgument8=aArgument8;this.mArgument9=aArgument9;CCallWrapper.mPendingCalls[this.mId]=this;}
CCallWrapper.prototype.execute=function()
{this.mObjectReference[this.mMethodName](this.mArgument0,this.mArgument1,this.mArgument2,this.mArgument3,this.mArgument4,this.mArgument5,this.mArgument6,this.mArgument7,this.mArgument8,this.mArgument9);delete CCallWrapper.mPendingCalls[this.mId];}
CCallWrapper.prototype.cancel=function()
{clearTimeout(this.mTimerId);delete CCallWrapper.mPendingCalls[this.mId];}
CCallWrapper.asyncExecute=function(callwrapper)
{CCallWrapper.mPendingCalls[callwrapper.mId].mTimerId=setTimeout('CCallWrapper.mPendingCalls["'+callwrapper.mId+'"].execute()',callwrapper.mDelay);}
CCallWrapper.mCounter=0;CCallWrapper.mPendingCalls={};function addLoadListener(fn)
{if(typeof window.addEventListener!='undefined'){window.addEventListener('load',fn,false);}
else if(typeof document.addEventListener!='undefined'){document.addEventListener('load',fn,false);}
else if(typeof window.attachEvent!='undefined'){window.attachEvent('onload',fn);}
else{var oldfn=window.onload;if(typeof window.onload!='function'){window.onload=fn;}
else{window.onload=function()
{oldfn();fn();};}}}
function addUnloadListener(fn)
{if(typeof window.addEventListener!='undefined'){window.addEventListener('unload',fn,false);}
else if(typeof document.addEventListener!='undefined'){document.addEventListener('unload',fn,false);}
else if(typeof window.attachEvent!='undefined'){window.attachEvent('onunload',fn);}
else{var oldfn=window.onunload;if(typeof window.onunload!='function'){window.onunload=fn;}
else{window.onunload=function()
{oldfn();fn();};}}}
function vd(object)
{alert(var_dump(object));}
function var_dump(obj)
{if(typeof obj=="object"){return"Type: "+typeof(obj)+((obj.constructor)?"\nConstructor: "+obj.constructor:"")+"\nValue: "+obj;}else{return"Type: "+typeof(obj)+"\nValue: "+obj;}}
var Dumper=(function(){var maxIterations=1000;var maxDepth=-1;var iterations=0;var indent=1;var indentText=" ";var newline="\n";var object=null;var properties=null;function args(a,index){var myargs=new Array();for(var i=index;i<a.length;i++){myargs[myargs.length]=a[i];}
return myargs;}
function pad(len){var ret="";for(var i=0;i<len;i++){ret+=indentText;}
return ret;}
function string(o){var level=1;var indentLevel=indent;var ret="";if(arguments.length>1&&typeof(arguments[1])=="number"){level=arguments[1];indentLevel=arguments[2];if(o==object){return"[original object]";}}
else{iterations=0;object=o;if(arguments.length>1){var list=arguments;var listIndex=1;if(typeof(arguments[1])=="object"){list=arguments[1];listIndex=0;}
for(var i=listIndex;i<list.length;i++){if(properties==null){properties=new Object();}
properties[list[i]]=1;}}}
if(iterations++>maxIterations){return"[Max Iterations Reached]";}
if(maxDepth!=-1&&level>(maxDepth+1)){return"...";}
if(typeof(o)=="undefined"){return"[undefined]";}
if(o==null){return"[null]";}
if(o==window){return"[window]";}
if(o==window.document){return"[document]";}
if(typeof(o)=="function"){return"[function]";}
if(typeof(o)=="boolean"){return(o)?"true":"false";}
if(typeof(o)=="string"){return"'"+o+"'";}
if(typeof(o)=="number"){return o;}
if(typeof(o)=="object"){if(typeof(o.length)=="number"){if(maxDepth!=-1&&level>maxDepth){return"[ ... ]";}
ret="[";for(var i=0;i<o.length;i++){if(i>0){ret+=","+newline+pad(indentLevel);}
else{ret+=newline+pad(indentLevel);}
ret+=string(o[i],level+1,indentLevel-0+indent);}
if(i>0){ret+=newline+pad(indentLevel-indent);}
ret+="]";return ret;}
else{if(maxDepth!=-1&&level>maxDepth){return"{ ... }";}
ret="{";var count=0;for(i in o){if(o==object&&properties!=null&&properties[i]!=1){}
else{if(typeof(o[i])!="unknown"){var processAttribute=true;if(o.ownerDocument||o.tagName||(o.nodeType&&o.nodeName)){processAttribute=false;if(i=="tagName"||i=="nodeName"||i=="nodeType"||i=="id"||i=="className"){processAttribute=true;}}
if(processAttribute){if(count++>0){ret+=","+newline+pad(indentLevel);}
else{ret+=newline+pad(indentLevel);}
ret+="'"+i+"' => "+string(o[i],level+1,indentLevel-0+i.length+6+indent);}}}}
if(count>0){ret+=newline+pad(indentLevel-indent);}
ret+="}";return ret;}}}
string.popup=function(o){var w=window.open("about:blank");w.document.open();w.document.writeln("<HTML><BODY><PRE>");w.document.writeln(string(o,args(arguments,1)));w.document.writeln("</PRE></BODY></HTML>");w.document.close();};string.alert=function(o){alert(string(o,args(arguments,1)));};string.write=function(o){var argumentsIndex=1;var d=document;if(arguments.length>1&&arguments[1]==window.document){d=arguments[1];argumentsIndex=2;}
var temp=indentText;indentText="&nbsp;";d.write(string(o,args(arguments,argumentsIndex)));indentText=temp;};string.setMaxIterations=function(i){maxIterations=i;};string.setMaxDepth=function(i){maxDepth=i;};return string;})();function popUp(url){var width=arguments[1]?arguments[1]:455;var height=arguments[2]?arguments[2]:500;var scrollbars=arguments[3]=='no'?'no':'yes';var popup=window.open(url,'info','top=20,left=20,scrollbars='+scrollbars+',width='+width+',height='+height+',resizable=yes');popup.focus();return false;}
var undefined;function isUndefined(property)
{return(typeof property=='undefined');}
if(isUndefined(Array.prototype.pop)==true){Array.prototype.pop=function()
{var lastItem=undefined;if(this.length>0){lastItem=this[this.length-1];this.length--;}
return lastItem;}}
if(isUndefined(Array.prototype.push)==true){Array.prototype.push=function()
{var currentLength=this.length;for(var i=0;i<arguments.length;i++){this[currentLength+i]=arguments[i];}
return this.length;}}
if(isUndefined(Array.prototype.splice)==true)
{Array.prototype.splice=function(start,deleteCount)
{if(deleteCount==null||deleteCount=='')
deleteCount=this.length-start;var tempArray=this.copy();for(var i=start;i<start+arguments.length-2;i++)
{this[i]=arguments[i-start+2];}
for(var i=start+arguments.length-2;i<this.length-deleteCount+arguments.length-2;i++)
{this[i]=tempArray[i+deleteCount-arguments.length+2];}
this.length=this.length-deleteCount+(arguments.length-2);return tempArray.slice(start,start+deleteCount);}}
if(isUndefined(Array.prototype.copy)==true)
{Array.prototype.copy=function()
{var copy=new Array();for(var i=0;i<this.length;i++)
{copy[i]=this[i];}
return copy;}}
function getElementById(id)
{if(document.getElementById){return document.getElementById(id);}
if(document.all){return document.all(id);}}
function aotGetElementsByClassName(className,parentElm,tagName,fn)
{tagName=tagName||"*";parentElm=parentElm||document;var objColl=parentElm.getElementsByTagName(tagName);if(!objColl.length&&tagName=="*"&&parentElm.all){objColl=parentElm.all;}
var arr=new Array();var delim=className.indexOf('|')!=-1?'|':' ';var arrClass=className.split(delim);for(var i=0,j=objColl.length;i<j;i++){var arrObjClass=objColl[i].className.split(' ');if(delim==' '&&arrClass.length>arrObjClass.length){continue;}
var c=0;comparisonLoop:for(var k=0,l=arrObjClass.length;k<l;k++){for(var m=0,n=arrClass.length;m<n;m++){if(arrClass[m]==arrObjClass[k]){c++;}
if((delim=='|'&&c==1)||(delim==' '&&c==arrClass.length)){arr.push(objColl[i]);if(fn){fn(objColl[i]);}
break comparisonLoop;}}}}
return arr;}
function aotGetElementsByTagName(tagName,parentEle)
{var list=null;tagName=tagName||'*';parentEle=parentEle||document;if(sniffer.isIE4||sniffer.isIE5){if(tagName=='*'){list=parentEle.all;}else{list=parentEle.all.tags(tagName);}}else if(parentEle.getElementsByTagName){list=parentEle.getElementsByTagName(tagName);}
return list||new Array();}
function aotGetElementsByAttribute(sTag,sAtt,sRE,fn)
{var a;var list;var found=new Array();var re=new RegExp(sRE,'i');list=aotGetElementsByTagName(sTag);for(var i=0;i<list.length;++i){a=list[i].getAttribute(sAtt);if(!a){a=list[i][sAtt];}
if(typeof(a)=='string'&&a.search(re)!=-1){found[found.length]=list[i];if(fn){fn(list[i]);}}}
return found;}
function discardElement(element)
{var garbageBin=document.getElementById('IELeakGarbageBin');if(!garbageBin){garbageBin=document.createElement('div');garbageBin.id='IELeakGarbageBin';garbageBin.style.display="none";document.body.appendChild(garbageBin);}
garbageBin.appendChild(element);garbageBin.innerHTML='';}
function isNumeric(val)
{return(parseFloat(val,10)==(val*1));}
function turnOnHourglass()
{document.body.style.cursor="wait";}
function turnOffHourglass()
{document.body.style.cursor="default";}
setSelectOptions=function(select,options){var selected=arguments[2]?arguments[2]:0;clearSelectOptions(select);i=0;for(i=0;i<options.length;i++){select.options[i]=options[i];if(i==selected){select.options[i].selected=true;}}
return select;}
clearSelectOptions=function(select){select.options.length=0;}
var wasSubmitted=false;function submitOnce(btn)
{if(wasSubmitted==true){alert("Request already submitted, please wait....");}else{btn.className='btn_disable';btn.blur();wasSubmitted=true;}}
function changeClass(id,cssClass){var identity=getElementById(id);if(identity){identity.className=cssClass;}}
function doChangeClasses(fld)
{if(fld&&typeof fld=='object'){argStr=fld.value;}else{argStr=fld;}
argStr=argStr.replace(/\s+/g,'');if(argStr.length==0){return;}
var argArray=argStr.split(',');for(var i=0;i<argArray.length;i++){if(i%2==0){if((i+1)!=argArray.length){changeClass(argArray[i],argArray[i+1]);}}}}
function getMousePos(e)
{var docX=0;var docY=0;if(e){if(typeof(e.pageX)=='number'){docX=e.pageX;docY=e.pageY;}else{docX=e.clientX;docY=e.clientY;}}else{e=window.event;docX=e.clientX;docY=e.clientY;if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollLeft)){docX+=document.documentElement.scrollLeft;docY+=document.documentElement.scrollTop;}else if(document.body&&(document.body.scrollTop||document.body.scrollLeft)){docX+=document.body.scrollLeft;docY+=document.body.scrollTop;}}
return[docX,docY];}
document.winWidth=800;document.winHeight=600;function getWindowHeight()
{var myHeight=0;if(typeof(window.innerHeight)=='number')
{myHeight=window.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight)
{myHeight=document.documentElement.clientHeight;}
else if(document.body&&document.body.clientHeight)
{myHeight=document.body.clientHeight;}
return myHeight;}
function getWindowWidth()
{var myWidth=0;if(typeof(window.innerWidth)=='number')
{myWidth=window.innerWidth;}
else if(document.documentElement&&document.documentElement.clientWidth)
{myWidth=document.documentElement.clientWidth;}
else if(document.body&&document.body.clientWidth)
{myWidth=document.body.clientWidth;}
return myWidth;}
function storePageSize()
{document.winHeight=getWindowHeight();document.winWidth=getWindowWidth();}
addLoadListener(storePageSize);window.onresize=storePageSize;function getPageSize()
{var scrollWidth=document.winHeight;var scrollHeight=document.winWidth;var test1=document.body.scrollHeight;var test2=document.body.offsetHeight;if(test1>test2){scrollWidth=document.body.scrollWidth;scrollHeight=document.body.scrollHeight;}else{scrollWidth=document.body.offsetWidth;scrollHeight=document.body.offsetHeight;}
return[scrollWidth,scrollHeight];}
function getPagePosScroll(full)
{full=full?full:false;var x;var y;if(self.pageYOffset)
{x=self.pageXOffset;y=self.pageYOffset;}
else if(document.documentElement&&document.documentElement.scrollTop)
{x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}
else if(document.body)
{x=document.body.scrollLeft;y=document.body.scrollTop;}
if(full){x=x+document.winWidth;y=y+document.winHeight;}
return[x,y];}
document.onMouseMoveHandlers=new Array();document.onClickHandlers=new Array();document.onClickHandlersActive=new Array();document.onKeyUpHandlers=new Array();document.KEY_LEFT=37;document.KEY_UP=38;document.KEY_RIGHT=39;document.KEY_DOWN=40;document.KEY_ENTER=13;document.KEY_TAB=9;document.KEY_DEL=46;document.KEY_BACKSPACE=8;document.stopBubble=function(e)
{if(!e){e=window.event;}
if(document.all){window.event.cancelBubble=true;window.event.returnValue=false;}else if(e.preventDefault){e.cancelBubble=true;e.stopPropagation();e.preventDefault();}
return false;}
document.addOnMouseMoveHandler=function(handler)
{if(!document.isSetOnMouseMoveHandler(handler)){document.onMouseMoveHandlers[document.onMouseMoveHandlers.length]=handler;}}
document.isSetOnMouseMoveHandler=function(handler)
{for(var i=0;i<document.onMouseMoveHandlers.length;i++){if(document.onMouseMoveHandlers[i]==handler){return true;}}
return false;}
document.removeOnMouseMoveHandler=function(handler)
{for(var i=0;i<document.onMouseMoveHandlers.length;i++){if(document.onMouseMoveHandlers[i]==handler){document.onMouseMoveHandlers.splice(i,1);return true;}}
return false;}
document.addOnClickHandler=function(handler)
{if(!document.isSetOnClickHandler(handler)){document.onClickHandlers[document.onClickHandlers.length]=handler;}
document.activateOnClickHandler(handler);}
document.isSetOnClickHandler=function(handler)
{for(var i=0;i<document.onClickHandlers.length;i++){if(document.onClickHandlers[i]==handler){return true;}}
return false;}
document.removeOnClickHandler=function(handler)
{for(var i=0;i<document.onClickHandlers.length;i++){if(document.onClickHandlers[i]==handler){document.onClickHandlers.splice(i,1);document.onClickHandlersActive.splice(i,1);return true;}}
return false;}
document.deactivateOnClickHandler=function(handler)
{for(var i=0;i<document.onClickHandlers.length;i++){if(document.onClickHandlers[i]==handler){document.onClickHandlersActive[i]=false;return true;}}
return false;}
document.activateOnClickHandler=function(handler)
{for(var i=0;i<document.onClickHandlers.length;i++){if(document.onClickHandlers[i]==handler){document.onClickHandlersActive[i]=true;return true;}}
return false;}
document.addOnKeyUpHandler=function(handler)
{if(!document.isSetOnKeyUpHandler(handler)){document.onKeyUpHandlers[document.onKeyUpHandlers.length]=handler;}}
document.isSetOnKeyUpHandler=function(handler)
{for(var i=0;i<document.onKeyUpHandlers.length;i++){if(document.onKeyUpHandlers[i]==handler){return true;}}
return false;}
document.removeOnKeyUpHandler=function(handler)
{for(var i=0;i<document.onKeyUpHandlers.length;i++){if(document.onKeyUpHandlers[i]==handler){document.onKeyUpHandlers.splice(i,1);return true;}}
return false;}
document.onmousemove=function(e)
{if(!document.onMouseMoveHandlers){return false;}
for(var i=0;i<document.onMouseMoveHandlers.length;i++){if(typeof document.onMouseMoveHandlers[i]=="function"){document.onMouseMoveHandlers[i](e);}else{eval(document.onMouseMoveHandlers[i]+'(e)');}}}
document.onclick=function(e)
{if(!document.onClickHandlers){return false;}
for(var i=0;i<document.onClickHandlers.length;i++){if(document.onClickHandlersActive[i]){if(typeof document.onClickHandlers[i]=="function"){document.onClickHandlers[i](e);}else{eval(document.onClickHandlers[i]+'(e)');}}}}
document.onkeypress=function(e)
{if(!document.onKeyUpHandlers){return false;}
var code;if(!e){var e=window.event;}
if(!e){return true;}
if(e.keyCode){code=e.keyCode;}else if(e.which){code=e.which;}
e.bcKeyCode=code;for(var i=0;i<this.onKeyUpHandlers.length;i++){if(typeof document.onKeyUpHandlers[i]=="function"){document.onKeyUpHandlers[i](e);}else{eval(document.onKeyUpHandlers[i]+'(e)');}}}
function htmlEncode(s)
{}
function tidyOnExit()
{document.onMouseMoveHandlers=null;document.onClickHandlers=null;document.onClickHandlersActive=null;document.onKeyUpHandlers=null;if(window.DhtmlLayer){DhtmlLayer.tidyOnExit();}}
addUnloadListener(tidyOnExit);idGroup=function()
{this.ids=new Array();this.useVisability=false;if(arguments.length>0){for(var i=0;i<arguments.length;i++){this.ids[i]=arguments[i];}}}
idGroup.prototype.setUseVisability=function(value)
{this.useVisability=value;}
idGroup.prototype.addIds=function()
{if(arguments.length>0){for(var i=0;i<arguments.length;i++){this.ids[this.ids.length]=arguments[i];}}}
idGroup.prototype.showOne=function(id)
{if(this.ids.length>0){for(var i=0;i<this.ids.length;i++){var el=document.getElementById(this.ids[i]);if(el){if(id==this.ids[i]){if(this.useVisability){el.visibility='visible';}else{el.style.display='block';}}else{if(this.useVisability){el.visibility='hidden';}else{el.style.display='none';}}}}}}
idGroup.prototype.showMultiple=function(ids)
{var showIds=new Array();showIds=ids.split(',');if(this.ids.length>0){for(var i=0;i<this.ids.length;i++){var el=document.getElementById(this.ids[i]);if(el){if(this.useVisability){el.visibility='hidden';}else{el.style.display='none';}
for(var j=0;j<showIds.length;j++){if(showIds[j]==this.ids[i]){if(this.useVisability){el.visibility='visible';}else{el.style.display='block';}}}}}}}
idGroup.prototype.showOneUsingField=function(fld)
{var id=fld.value;if(id.length>0){this.showOne(id);}}
pageIDGroupColection=function()
{this.idGroupsCount=0;this.idGroups=new Array();}
var PageIDGroupColection=new pageIDGroupColection();pageIDGroupColection.prototype.newGroup=function()
{this.idGroupsCount++;this.idGroups[this.idGroupsCount]=new idGroup();return this.idGroupsCount;}
pageIDGroupColection.prototype.addIds=function(group,id)
{this.idGroups[group].addIds(id);}
pageIDGroupColection.prototype.showOneUsingField=function(group,fld)
{this.idGroups[group].showOneUsingField(fld);}
pageIDGroupColection.prototype.showOne=function(group,id)
{this.idGroups[group].showOne(id);}
function initShowHideA(showing,className)
{if(!document.getElementById){return false;}
className=(className)?className:'showHideControl';showing=(showing)?showing:'';var linksContainer=aotGetElementsByClassName(className);if(linksContainer){var idGroupNo=PageIDGroupColection.newGroup();for(var i=0;i<linksContainer.length;i++){var links=aotGetElementsByTagName('a',linksContainer[i]);for(var j=0;j<links.length;j++){if(links[j].href.match(/#(\w.+)/)){var id=links[j].href.match(/#(\w.+)/)[1];var obj=document.getElementById(id);if(obj){PageIDGroupColection.addIds(idGroupNo,id);if(showing==id){obj.style.display='block';}else{obj.style.display='none';}
links[j].idGroupNo=idGroupNo;links[j].showId=id;links[j].orgOnClick=links[j].onclick;links[j].onclick=function(){PageIDGroupColection.showOne(this.idGroupNo,this.showId);if(typeof this.orgOnClick=="function"){this.orgOnClick();}
return false;}}}}}}}
function initShowHideSelect(id)
{if(!document.getElementById){return false;}
id=(id)?id:'showHideSelect';var sel=document.getElementById(id);if(sel){sel.idGroupNo=PageIDGroupColection.newGroup();var opts=sel.options;for(var i=0;i<opts.length;i++){var id=opts[i].value;var obj=document.getElementById(id);if(obj){PageIDGroupColection.addIds(sel.idGroupNo,id);if(opts[i].selected){obj.style.display='block';}else{obj.style.display='none';}}}
sel.orgOnchange=sel.onchange;sel.onchange=function(){PageIDGroupColection.showOneUsingField(this.idGroupNo,this);if(typeof this.orgOnchange=="function"){this.orgOnchange();}}}}
function initShowHide()
{if(!JADE.hideShow){return false;}
initShowHideA(showingID);initShowHideSelect();}
var showingID='';addLoadListener(initShowHide);function GET(argname)
{query=unescape(location.search.substring(1));pairs=query.split("&");for(i=0;i<pairs.length;i++){key=pairs[i].split("=")[0];value=pairs[i].split("=")[1];if(key==argname){return value;}}
return"";}
function makeQueryString()
{var args=makeQueryString.arguments;var searchString="?";var pair;for(var i=0;i<args.length;i++){pair=escape(args[i++])+"=";pair+=escape(args[i]);searchString+=pair+"&";}
return searchString.substring(0,searchString.length-1);}
function getStyle(el,styleProp)
{var x=document.getElementById(el);if(x.currentStyle)
var y=x.currentStyle[styleProp];else if(window.getComputedStyle)
var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);return y;}
if(GET('JSVERSION')=="1"){}
var DOM=(function(){var dom={};dom.addPX=function(value){return parseInt(value)+"px";}
dom.removeChildrenFromNode=function(node){while(node.hasChildNodes()){node.removeChild(node.firstChild);}}
dom.removeNode=function(o){if(o!=null&&o.parentNode&&o.parentNode.removeChild){for(var i in o){if(typeof(o[i])=="function"){o[i]=null;}}
o.parentNode.removeChild(o);return true;}
return false;}
return dom;})();var CSS=(function(){var css={};css.getCuomputedStyleOrValue=function(el,attribute,defaultValue){var computedAttribute=getStyle(el,attribute);if(computedAttribute&&computedAttribute!='auto'&&parseInt(computedAttribute)>0){return parseInt(computedAttribute);}else{return defaultValue;}}
css.getCSSRule=function(ruleName,deleteFlag){ruleName=ruleName.toLowerCase();if(document.styleSheets){for(var i=0;i<document.styleSheets.length;i++){var styleSheet=document.styleSheets[i];var ii=0;var cssRule=false;do{if(styleSheet.cssRules){cssRule=styleSheet.cssRules[ii];}else{cssRule=styleSheet.rules[ii];}
if(cssRule){if(!cssRule.selectorText){return false;}
if(cssRule.selectorText.toLowerCase()==ruleName){if(deleteFlag=='delete'){if(styleSheet.cssRules){styleSheet.deleteRule(ii);}else{styleSheet.removeRule(ii);}
return true;}else{return cssRule;}}}
ii++;}while(cssRule)}}
return false;}
css.killCSSRule=function(ruleName){return CSS.getCSSRule(ruleName,'delete');}
css.addCSSRule=function(ruleName){if(document.styleSheets){if(!CSS.getCSSRule(ruleName)){if(document.styleSheets[0].addRule){document.styleSheets[0].addRule(ruleName,null,0);}else{document.styleSheets[0].insertRule(ruleName+' { }',0);}}}
return CSS.getCSSRule(ruleName);}
return css;})();var SCREEN=(function(){var screen={};screen.getPageBigestSize=function(){var pagePos=getPagePosScroll(true);var pageSize=getPageSize();var w=pagePos[0];var h=pagePos[1];if(pageSize[0]>w){w=pageSize[0];}
if(pageSize[1]>h){h=pageSize[1];}
w=parseInt(w);h=parseInt(h);return[w,h];}
return screen;})();function parseURL(data){var e=/((http|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+\.[^#?\s]+)(#[\w\-]+)?/;if(data.match(e)){return{url:RegExp['$&'],protocol:RegExp.$2,host:RegExp.$3,path:RegExp.$4,file:RegExp.$6,hash:RegExp.$7};}else{return{url:"",protocol:"",host:"",path:"",file:"",hash:""};}}
function parseFilename(data){data=data.replace(/^\s|\s$/g,"");if(data.match(/([^\/\\]+)\.(asp|html|htm|shtml|php)$/i)){return{filename:RegExp.$1,ext:RegExp.$2};}else{return{filename:null,ext:null};}}
function StringBuffer(){this.buffer=[];}
StringBuffer.prototype.append=function append(string){this.buffer.push(string);return this;};StringBuffer.prototype.toString=function toString(){return this.buffer.join("");};shortcut={'all_shortcuts':{},'add':function(shortcut_combination,callback,opt){var default_options={'type':'keydown','propagate':false,'disable_in_input':false,'target':document,'keycode':false}
if(!opt){opt=default_options;}else{for(var dfo in default_options){if(typeof opt[dfo]=='undefined'){opt[dfo]=default_options[dfo];}}}
var ele=opt.target
if(typeof opt.target=='string'){ele=document.getElementById(opt.target);}
var ths=this;shortcut_combination=shortcut_combination.toLowerCase();var func=function(e){e=e||window.event;if(opt['disable_in_input']){var element;if(e.target){element=e.target;}else{if(e.srcElement){element=e.srcElement;}}
if(element.nodeType==3){element=element.parentNode;}
if(element.tagName=='INPUT'||element.tagName=='TEXTAREA'){return;}}
if(e.keyCode){code=e.keyCode;}else{if(e.which){code=e.which;}}
var character=String.fromCharCode(code).toLowerCase();if(code==188){character=",";}
if(code==190){character=".";}
var keys=shortcut_combination.split("+");var kp=0;var shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"}
var special_keys={'esc':27,'escape':27,'tab':9,'space':32,'return':13,'enter':13,'backspace':8,'scrolllock':145,'scroll_lock':145,'scroll':145,'capslock':20,'caps_lock':20,'caps':20,'numlock':144,'num_lock':144,'num':144,'pause':19,'break':19,'insert':45,'home':36,'delete':46,'end':35,'pageup':33,'page_up':33,'pu':33,'pagedown':34,'page_down':34,'pd':34,'left':37,'up':38,'right':39,'down':40,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,'f12':123}
var modifiers={shift:{wanted:false,pressed:false},ctrl:{wanted:false,pressed:false},alt:{wanted:false,pressed:false},meta:{wanted:false,pressed:false}};if(e.ctrlKey){modifiers.ctrl.pressed=true;}
if(e.shiftKey){modifiers.shift.pressed=true;}
if(e.altKey){modifiers.alt.pressed=true;}
if(e.metaKey){modifiers.meta.pressed=true;}
for(var i=0;k=keys[i],i<keys.length;i++){if(k=='ctrl'||k=='control'){kp++;modifiers.ctrl.wanted=true;}else if(k=='shift'){kp++;modifiers.shift.wanted=true;}else if(k=='alt'){kp++;modifiers.alt.wanted=true;}else if(k=='meta'){kp++;modifiers.meta.wanted=true;}else if(k.length>1){if(special_keys[k]==code){kp++;}}else if(opt['keycode']){if(opt['keycode']==code){kp++;}}else{if(character==k){kp++;}else{if(shift_nums[character]&&e.shiftKey){character=shift_nums[character];if(character==k){kp++;}}}}}
if(kp==keys.length&&modifiers.ctrl.pressed==modifiers.ctrl.wanted&&modifiers.shift.pressed==modifiers.shift.wanted&&modifiers.alt.pressed==modifiers.alt.wanted&&modifiers.meta.pressed==modifiers.meta.wanted){callback(e);if(!opt['propagate']){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}
return false;}}}
this.all_shortcuts[shortcut_combination]={'callback':func,'target':ele,'event':opt['type']};if(ele.addEventListener){ele.addEventListener(opt['type'],func,false);}else if(ele.attachEvent){ele.attachEvent('on'+opt['type'],func);}else{ele['on'+opt['type']]=func;}},'remove':function(shortcut_combination){shortcut_combination=shortcut_combination.toLowerCase();var binding=this.all_shortcuts[shortcut_combination];delete(this.all_shortcuts[shortcut_combination]);if(!binding){return;}
var type=binding['event'];var ele=binding['target'];var callback=binding['callback'];if(ele.detachEvent){ele.detachEvent('on'+type,callback);}else if(ele.removeEventListener){ele.removeEventListener(type,callback,false);}else{ele['on'+type]=false;}}}
shortcut.add("Ctrl+Shift+v",function(){var app=JSLib.getApplicationName();if(app==undefined){app='';}
var appVersion=JSLib.getApplicationVersion();if(app){app+=' ';if(appVersion){app+='V'+appVersion+' ';}}
var str="<h3>"+app+"Version Dump:</h3>";for(var i=0;i<JSLib.includedJSArray.length;i++){str+='<b>'+JSLib.includedJSArray[i][1]+'</b> '+JSLib.includedJSArray[i][2]+'<br />';}
JADE.infoWindow.write(str);JADE.infoWindow.writeTitle('Version Dump:');JADE.infoWindow.toggle();return false;});shortcut.add("Ctrl+Shift+d",function(){var str="<h3>Event and Layer Information:</h3>";var pSize=getPageSize();var spSize=getPagePosScroll(false);var spSize2=getPagePosScroll(true);str+="<p>Page size = "+pSize[0]+" x "+pSize[1]+", Scroll = "+spSize[0]+" x "+spSize[1]+" ("+spSize2[0]+" x "+spSize2[1]+")</p>";str+="<p>Global Path Prefix is "+globPathPrefix+"</p>";if(window.AjaxRequest){str+="<P>AJAX Transport: ";if(AjaxRequest.NotSupported){str+="Not supported.<br />";}else{if(AjaxRequest.NativeSupport){str+="Native support.<br />";}else{str+="Supported.<br />";if(AjaxRequest.xmlHttpRequestVersion){str+="   XMLHTTP = "+AjaxRequest.xmlHttpRequestVersion+'<br />';}}
str+="Number AjaxRequests "+AjaxRequest.numActiveAjaxRequests;str+=" / "+AjaxRequest.numAjaxRequests+'<br />';}
str+='</p>';}
str+="onMouseMove handlers = "+document.onMouseMoveHandlers.length+'<br />';str+="onClick handlers = "+document.onClickHandlers.length+'<br />';str+="onClick active handlers = "+document.onClickHandlersActive.length+'<br />';str+="onKeyUp handlers = "+document.onKeyUpHandlers.length+'<br />';if(window.DhtmlLayer_layers){str+="<p>";str+="DHTML Layers = "+DhtmlLayer_layers.length+'<br />';for(var i=0;i<DhtmlLayer_layers.length;i++){obj=DhtmlLayer_layers[i];str+="    "+obj.layerID+' ';if(obj.isVisible()){str+="Visible";}else{str+="Hidden";}
pos=Position.get(obj.getLayer());str+=", L = "+pos.left;str+=", T = "+pos.top;str+=", W = "+pos.width;str+=", H = "+pos.height;str+=", Class = "+obj.cssClass;str+='<br />';}
str+='</p>';}
if(location.search){str+="<p>Query:<br />";query=location.search.substring(1);pairs=query.split("&");for(i=0;i<pairs.length;i++){key=pairs[i].split("=")[0];value=pairs[i].split("=")[1];str+="   "+key+" = "+value+"<br />";}
str+='</p>';}
if(window.PRELOADED_IMAGES){str+="<p>Preloaded Images:<br />";str+="  Images loaded "+PRELOADED_IMAGES.numImagesLoaded+" of "+PRELOADED_IMAGES.numImagesToLoad+"<br />";if(PRELOADED_IMAGES.numErrors>0){str+="  "+PRELOADED_IMAGES.numErrors+" errors:<br />";for(var i=0;i<PRELOADED_IMAGES.numErrors;i++){var url=PRELOADED_IMAGES.errorArray[i];var parsedURL=parseURL(url);var filename=parsedURL.path+parsedURL.file;str+="    "+filename+"<br />";}}
str+='</p>';}
JADE.infoWindow.write(str);JADE.infoWindow.writeTitle('Information');JADE.infoWindow.toggle();return false;});JADE.infoWindow={'containerEl':null,'titleEl':null,'contentEl':null,'iframeEl':null,'width':650,'height':300,'show':function(){var fullPageSize=getPagePosScroll(true);var scrollOffset=getPagePosScroll(false);var midX=(fullPageSize[0]-scrollOffset[0])/2;var midY=(fullPageSize[1]-scrollOffset[1])/2;JADE.infoWindow.containerEl.style.left=(midX-(JADE.infoWindow.width/2))+scrollOffset[0]+"px";JADE.infoWindow.containerEl.style.top=(midY-(JADE.infoWindow.height/2))+scrollOffset[1]+"px";JADE.infoWindow.containerEl.style.display='block';if(JADE.infoWindow.iframeEl){JADE.infoWindow.iframeEl.style.left=JADE.infoWindow.containerEl.style.left;JADE.infoWindow.iframeEl.style.top=JADE.infoWindow.containerEl.style.top;JADE.infoWindow.iframeEl.style.display='block';}},'hide':function(){JADE.infoWindow.containerEl.style.display='none';if(JADE.infoWindow.iframeEl){JADE.infoWindow.iframeEl.style.display='none';}},'toggle':function(){if(JADE.infoWindow.containerEl.style.display=='none'){JADE.infoWindow.show();}else{JADE.infoWindow.hide();}},'write':function(text){JADE.infoWindow.create();JADE.infoWindow.contentEl.innerHTML=text;},'writeTitle':function(text){JADE.infoWindow.create();JADE.infoWindow.titleEl.innerHTML=text;},'append':function(text){JADE.infoWindow.create();JADE.infoWindow.contentEl.innerHTML+=text;},'clear':function(){if(JADE.infoWindow.containerEl){JADE.infoWindow.contentEl.innerHTML='';}},'create':function(){if(JADE.infoWindow.containerEl){return;}else{JADE.infoWindow.containerEl=document.createElement('div');JADE.infoWindow.containerEl.id='AOTInfoWindow';JADE.infoWindow.containerEl.className='JADEWindowContainer';JADE.infoWindow.containerEl.style.position='absolute';JADE.infoWindow.containerEl.style.visibility='visible';JADE.infoWindow.containerEl.style.display='none';JADE.infoWindow.containerEl.style.width=JADE.infoWindow.width;JADE.infoWindow.containerEl.style.zIndex='9999';var winStr='<div class="JADEWindowShadow"></div>';winStr+='<div class="JADEWindow">';winStr+='<div class="JADEWindowTitleBar">';winStr+='<span class="JADEWindowTitleBarText" id="AOTInfoWindowTitle">Information</span>';winStr+='<a href="#" onclick="JADE.infoWindow.hide(); return false;">Close</a>';winStr+='</div>';winStr+='<div class="JADEWindowClientArea" id="AOTInfoWindowContent" style="height:'+JADE.infoWindow.height+'px;">';winStr+='</div>';winStr+='</div>';JADE.infoWindow.containerEl.innerHTML=winStr;document.body.appendChild(JADE.infoWindow.containerEl);JADE.infoWindow.contentEl=document.getElementById('AOTInfoWindowContent');JADE.infoWindow.titleEl=document.getElementById('AOTInfoWindowTitle');if(!CSS.getCSSRule('.JADEWindowContainer')){JADE.infoWindow.containerEl.style.background='#FFF';JADE.infoWindow.containerEl.style.border='1px solid black';JADE.infoWindow.contentEl.style.overflow='auto';JADE.infoWindow.titleEl.style.background='#00F';}
if(sniffer.isIE5_5up&&!sniffer.isIE7up){JADE.infoWindow.iframeEl=document.createElement('iframe');if(document.location.protocol=="https:"){var blankFile=globPathPrefix+'/globals/blank.html';JADE.infoWindow.iframeEl.setAttribute('src',blankFile);}else{JADE.infoWindow.iframeEl.setAttribute('src','JavaScript:void(0);');}
JADE.infoWindow.iframeEl.setAttribute('id','infoWindow_iframe');JADE.infoWindow.iframeEl.setAttribute('frameborder','0');JADE.infoWindow.iframeEl.setAttribute('scrolling','no');JADE.infoWindow.iframeEl.style.position='absolute';JADE.infoWindow.iframeEl.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';JADE.infoWindow.iframeEl.style.zIndex=JADE.infoWindow.containerEl.style.zIndex-1;JADE.infoWindow.iframeEl.style.visibility=JADE.infoWindow.containerEl.style.visibility;JADE.infoWindow.iframeEl.style.display=JADE.infoWindow.containerEl.style.display;JADE.infoWindow.iframeEl.style.width=JADE.infoWindow.containerEl.style.width;JADE.infoWindow.iframeEl.style.height='350px';if(JADE.infoWindow.containerEl.nextSibling){JADE.infoWindow.containerEl.parentNode.insertBefore(JADE.infoWindow.iframeEl,JADE.infoWindow.containerEl.nextSibling);}else{JADE.infoWindow.containerEl.parentNode.appendChild(JADE.infoWindow.iframeEl);}}}
return false;}}
shortcut.add("Ctrl+k",function(){JADE.cli.toggle();return false;});JADE.cli={version:'1.0',cmdVersion:'0.1','containerEl':null,'iframeEl':null,'errorEl':null,'value':null,'width':650,'height':55,'syntaxArray':null,'show':function(){JADE.cli.create();var fullPageSize=getPagePosScroll(true);var scrollOffset=getPagePosScroll(false);var midX=(fullPageSize[0]-scrollOffset[0])/2;var midY=(fullPageSize[1]-scrollOffset[1])/2;JADE.cli.containerEl.style.left=(midX-(JADE.cli.width/2))+scrollOffset[0]+"px";JADE.cli.containerEl.style.top=(midY-(JADE.cli.height/2))+scrollOffset[1]+"px";JADE.cli.containerEl.style.display='block';if(JADE.cli.iframeEl){JADE.cli.iframeEl.style.left=JADE.cli.containerEl.style.left;JADE.cli.iframeEl.style.top=JADE.cli.containerEl.style.top;JADE.cli.iframeEl.style.display='block';}
document.cliForm.cliInput.focus();},'hide':function(){JADE.cli.containerEl.style.display='none';if(JADE.cli.iframeEl){JADE.cli.iframeEl.style.display='none';}},'toggle':function(){if(!JADE.isCCI){return false;}
if(!JADE.cli.containerEl){JADE.cli.create();}
if(JADE.cli.containerEl.style.display=='none'){JADE.cli.show();}else{JADE.cli.hide();}},'showError':function(error){if(JADE.cli.errorEl){JADE.cli.errorEl.innerHTML=error;}},'create':function(){if(JADE.cli.containerEl){return;}else{JADE.cli.containerEl=document.createElement('div');JADE.cli.containerEl.id='cli';JADE.cli.containerEl.className='cliClass';JADE.cli.containerEl.style.position='absolute';JADE.cli.containerEl.style.visibility='visible';JADE.cli.containerEl.style.display='none'
JADE.cli.containerEl.style.width=JADE.cli.width;JADE.cli.containerEl.style.height=JADE.cli.height;JADE.cli.containerEl.style.zIndex='9998';JADE.cli.containerEl.innerHTML='<span>Virtual Keyboard</span> <span id="cliError">&nbsp;</span><form name="cliForm" id="cliForm" action="#"  method="post" onsubmit="JADE.doCLI(); return false;"><input type="text" name="cliInput" id="cliInput" size="100" maxlength="255" /><input type="submit" name="cliSubmit" id="cliSubmit" value="Do" /></form>';document.body.appendChild(JADE.cli.containerEl);if(sniffer.isIE5_5up&&!sniffer.isIE7up){JADE.cli.iframeEl=document.createElement('iframe');if(document.location.protocol=="https:"){var blankFile=globPathPrefix+'/globals/blank.html';JADE.cli.iframeEl.setAttribute('src',blankFile);}else{JADE.cli.iframeEl.setAttribute('src','JavaScript:void(0);');}
JADE.cli.iframeEl.setAttribute('id','cli_iframe');JADE.cli.iframeEl.setAttribute('frameborder','0');JADE.cli.iframeEl.setAttribute('scrolling','no');JADE.cli.iframeEl.style.position='absolute';JADE.cli.iframeEl.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';JADE.cli.iframeEl.style.zIndex=JADE.cli.containerEl.style.zIndex-1;JADE.cli.iframeEl.style.visibility=JADE.cli.containerEl.style.visibility;JADE.cli.iframeEl.style.display=JADE.cli.containerEl.style.display;JADE.cli.iframeEl.style.width='680px';JADE.cli.iframeEl.style.height='115px';if(JADE.cli.containerEl.nextSibling){JADE.cli.containerEl.parentNode.insertBefore(JADE.cli.iframeEl,JADE.cli.containerEl.nextSibling);}else{JADE.cli.containerEl.parentNode.appendChild(JADE.cli.iframeEl);}}
document.addOnClickHandler('JADE.cli.clickCheck');shortcut.add("tab",function(){JADE.cli.showHint();return false;},{'target':JADE.cli.containerEl});JADE.cli.errorEl=document.getElementById('cliError');}
return false;},'clickCheck':function(e){var target=(e&&e.target)||(event&&event.srcElement);if(checkParent(target)){JADE.cli.hide();}
function checkParent(t)
{while(t.parentNode){if(t==JADE.cli.containerEl||t==JADE.infoWindow.containerEl){return false;}
t=t.parentNode;}
return true;}},'crateSyntaxArray':function(){if(!JADE.cli.syntaxArray){JADE.cli.syntaxArray=new Array();JADE.cli.syntaxArray["vb"]="View Booking = vb [slsl795642]";JADE.cli.syntaxArray["vq"]="View Quite = vq [qusl149913]";JADE.cli.syntaxArray["b"]="Brochure (Accom Only) = b[r | i] [22/12 25/12] pacbne";JADE.cli.syntaxArray["sd"]="Service Details = sd [22/12 25/12] BNEACTERBNEHTLI";JADE.cli.syntaxArray["ac"]="Accommodation Search = ac | accom [pacbne | s pacbne | l z5 | h equinox [22/12 25/12 [r | p | n | s |a] [3 [1 0 5]]]]";JADE.cli.syntaxArray["car"]="Hire Car Search = car | cars z5 [aviaus] [20/6 9:00 21/6 12:30 [r | p | a]]";JADE.cli.syntaxArray["tran"]="Transfers Search = tran | transfer | transfers [airbne | s airbne | l r35 [22/4 [a | p | d | r [family] [r | p | a]]]]";JADE.cli.syntaxArray["tour"]="Tours Search = tour | tours [d | e | x arigld | s arigld | l r36 [15/6 [dinner] [r | p | a]]]";JADE.cli.syntaxArray["attr"]="Attractions Search = attr | attraction | attractions [wetgld | s wetgld | l r34 [22/3 [pensioner] [r | p | a]]]";JADE.cli.syntaxArray["op"]="Online Payments = op";JADE.cli.syntaxArray["i"]="Itinerary = i (Also use Current Quote = cq)";JADE.cli.syntaxArray["cq"]="Current Quote = cq (Also use Itinerary = i)";JADE.cli.syntaxArray["sq"]="Saved Quotes = sq [qusl149824 | r qusl149824 | n smith | a karen | c tim 21/1 1/2 | t 2/2 11/2 | e 1/2 14/2]";JADE.cli.syntaxArray["sb"]="Saved Bookings = sb [slsl851450 | r slsl851450 | n smith | a karen | c tim 21/1 1/2 | t 2/2 11/2]";JADE.cli.syntaxArray["site"]="Site = site sl | nsw | tp [Command string]";JADE.cli.syntaxArray["nq"]="New Quote = nq (also use New Booking = nb)";JADE.cli.syntaxArray["nb"]="New Booking = nb (also use New Quote = nq)";if(JADE.isCCI){JADE.cli.syntaxArray["lo"]="Logout (Back to CCI)= lo | logout";}else{JADE.cli.syntaxArray["lo"]="Logout = lo | logout";}
JADE.cli.syntaxArray["version"]="Version = version";JADE.cli.syntaxArray["info"]="Site Info = info";JADE.cli.syntaxArray["help"]="Help = help[+] | h[+] [Command string]";}},'getSyntax':function(cmd){JADE.cli.crateSyntaxArray();return JADE.cli.syntaxArray[cmd];},'getHelp':function(){JADE.cli.crateSyntaxArray();var str="<h3>Help:</h3>";str+="<p>Commands are formed by a set of mnemonics separated by spaces. Commands can be entered in lowercase and will be converted if required.</p>";str+="<ul class='helpTab'>";str+="<li id='helpNav1' class='selected'><a href='#' onclick='JADE.cli.toggleHelp(2); return false;'>Command Hint</a></li>";str+="<li id='helpNav2'><a href='#' onclick='JADE.cli.toggleHelp(1); return false;'>Detailed Help</a></li>";str+="</ul>";str+="<div id='cciHelp1' class='helpPanel'>";if(JADE.isCCI){str+="<p><b>CCI cross site commands:</b><br />";str+="The general syntax is <i>CCI site mnumonic Agent code Command string</i>";str+="<pre>e.g. tm tvlmat bn</pre>";str+="Entering just the CCI site mnemonic will switch to that site using the current Agent Code";str+="<pre>e.g. nsw</pre>";str+="Entering a CCI site followed by a 6 character Agent Code will switch to that site and Agent";str+="<pre>e.g. sl hwtked</pre>";str+="Note: If you enter an invalid Agent Code you will be redirected to the CCI site switcher.";str+="</p>";str+="<p>Valid CCI site mnemonics are:";str+="<ul>";str+="<li>sl for Sunlover Agent</li>";str+="<li>nsw for NSW Agent</li>";str+="<li>tp for Travelpoint Agent</li>";str+="<li>aot for AOTonline</li>";str+="<li>shi for SHIonline</li>";str+="<li>tm for Travelmate Agent</li>";str+="</ul></p>";str+="<p><b>Accessing non-CCI sites:</b><br />";str+="Use the <i>site</i> keyword to access a non-CCI site from within the CCI<br />";str+="The general syntax is site <i>Site mnemonic Command string</i>";str+="<pre>e.g. site sl bn</pre>";str+="Note that the Agent Code used in the CCI is NOT transferred to site.  The site will use the Agent you logged in with last.<br />";str+="Entering just the Site mnemonic will switch to that site.";str+="<pre>e.g. nsw</pre></p>";str+="<p>Valid Site mnemonics are:";str+="<ul><li>sl for Sunlover Agent</li>";str+="<li>nsw for NSW Agent</li>";str+="<li>tp for Travelpoint</li></ul>";str+="</p>";str+="<p><b>Logout</b><br />";str+="When in the CCI the logout command (<i>lo</i>) will return you to the CCI site switcher.</p>";}
str+="<p><b>Using Help</b><br />";str+="Entering <i>help</i> shows the Command Hint Page<br />";str+="Entering <i>help+</i> shows The Detailed Help Page (this page) <br />";str+="Entering <i>help Command displays</i> the syntax for the entered command.<br />";str+="Pressing <TAB> will guess what command you are typing and show its syntax if it can.";str+="</p>";str+="<p><b>Dates</b><br />";str+="Dates can be entered in the following formats.<br />";str+="d/m, d-m (current year is assumed)<br />";str+="d/m/yy, d-mm-yy, d/m/yyyy, d-mm-yyyy<br />";str+="When a command can take a from-to date pair then the to-date can be specified as the number of days.<br />";str+="<pre>e.g. b 22/12 25/12 PACBNE could be entered b 22/12 3 PACBNE </pre>";str+="If not supplied then the appropriate default dates are used.</p>";str+="<p><b>Adults and children</b><br />";str+="If a command can take the number of adults and ages of children travelling, then they can appear at the end of the command string.<br />";str+="The first number is assumed to be the number of adults and each following number the age of the child.<br />";str+="<pre>e.g. ac 22/12 25/12 Z5 3 1 0 5 12</pre> will search for accommodation for 3 adults and 4 children aged 1 year, less than 1 (infant) , 5 years and 12 years.<br />";str+="If not supplied then the appropriate defaults are used.</p>";str+="</div>";str+="<div id='cciHelp2' class='helpPanel'><p><b>Commands:</b><ul>";for(var cmd in JADE.cli.syntaxArray){if(cmd!='copy'){str+="<li>"+JADE.cli.getSyntax(cmd)+"</li>";}}
str+="</ul></p>";str+="<p><b>Command Syntax Key:</b>";str+="<pre>| is or, [] is optional</pre>";str+="e.g.";str+="<pre>a|b is a or b</pre>";str+="<pre>a[z] is either a or az</pre>";str+="<pre>a[z|x] is one of a or az or ax</pre>";str+="</p></div>";str+="<p style='text-align:right'>Copyright &copy; 2008 The AOT Group.</p>";return str;},'paramError':function(str,cmd){var message=JADE.cli.getSyntax(cmd);if(message){var pat=/\((.*?)\)/;message=message.replace(pat,'');var a=new Array();a=message.split(" = ");var name=a.shift();message=a.join(" = ");}else{message='Unknown command.';}
JADE.cli.showError(str+'! '+message);return false;},'showHint':function(){var commandLine=document.cliForm.cliInput.value;var a=new Array();a=commandLine.split(" ");var cmd=a.shift();if(cmd){return JADE.cli.paramError('Hint',cmd);}},'isDate':function(dateStr){var datePat=/^(\d{1,2})(\/|-|)(\d{1,2})((\/|-)(\d{2,4}))?$/;var matchArray=dateStr.match(datePat);if(matchArray==null){return false;}
var day=matchArray[1];var month=matchArray[3];var year=matchArray[6];if(!year){var d=new Date();year=d.getFullYear();}
if(year.length==2){year='20'+year;}
if(month<1||month>12){return false;}
if(day<1||day>31){return false;}
if((month==4||month==6||month==9||month==11)&&day==31){return false;}
if(month==2){var isleap=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!isleap)){return false;}}
return year+'-'+month+'-'+day;},'isTime':function(timeStr){var timePat=/^(([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9]))$/;var matchArray=timeStr.match(timePat);if(matchArray==null){return false;}
var hour=matchArray[1];var minutes=matchArray[5];return hour+':'+minutes+':00';},'isNumber':function(val)
{if(isNaN(val)){return false;}else{return true;}},'addDays':function(dateStr,days)
{var tmpDate=new Date();var d=new Array();d=dateStr.split("-");tmpDate.setFullYear(d[0],d[1]-1,d[2]);tmpDate.setDate(tmpDate.getDate()+parseInt(days));var ret=tmpDate.getFullYear()+'-'+(tmpDate.getMonth()+1)+'-'+tmpDate.getDate();return ret;},'toggleHelp':function(num){var helpEl1=document.getElementById('cciHelp1');var helpEl2=document.getElementById('cciHelp2');var helpNavEl1=document.getElementById('helpNav1');var helpNavEl2=document.getElementById('helpNav2');if(num==1){helpEl1.style.display='block';helpEl2.style.display='none';helpNavEl1.className='';helpNavEl2.className='selected';}else{helpEl1.style.display='none';helpEl2.style.display='block';helpNavEl1.className='selected';helpNavEl2.className='';}}}
JADE.doCLI=function(){JADE.cli.cmdVersion='3.3 (CCI)';function getOrderBy(a){var order='';switch(a){case'r':order='ORDER_PREFERRED_SUPPLIER';break;case'p':order='ORDER_INDICATIVE_RATE';break;case'n':order='ORDER_SUPPLIER_NAME';break;case's':order='ORDER_STAR_RATING';break;case'a':order='ORDER_AVAILABILITY';break;default:order='ORDER_PREFERRED_SUPPLIER';break;}
return'&orderBy='+order;}
var validCmd=true;var commandLine=document.cliForm.cliInput.value;if(!commandLine){JADE.cli.hide();return false;}
commandLine=commandLine.toLowerCase();var baseUrl=JADE.siteArray['current'];var pageUrl="index.php";var site='';var cciSite='';var cciAgent=JADE.agentCode;var a=new Array();a=commandLine.split(" ");var cmd=a.shift();if(cmd=='sl')cciSite='cci-sunloveragent';if(cmd=='nsw')cciSite='cci-nswagent';if(cmd=='tp')cciSite='cci-travelpointagent';if(cmd=='aot')cciSite='cci-aotonline';if(cmd=='shi')cciSite='cci-shionline';if(cmd=='tm')cciSite='cci-travelmateagent';if(cciSite){if(a.length>0){if(cciSite=='travelmateagent'){a[0]='TVLMAT';}
if(a[0].length==6){cciAgent=a.shift();cciAgent=cciAgent.toUpperCase();}else{cciAgent=JADE.agentCode;}}
cmd=a.shift();}
if(cmd=='site'){var cmd=a.shift();if(cmd=='sl')site='sunloveragent';if(cmd=='nsw')site='nswagent';if(cmd=='tp')site='travelpoint';cmd=a.shift();}
JADE.cli.showError('');switch(cmd){case'help':case'h':case'help+':case'h+':if(a.length>=1){return JADE.cli.paramError('Help',a[0]);}
var str=JADE.cli.getHelp();JADE.infoWindow.write(str);JADE.infoWindow.writeTitle('CLI Help');JADE.infoWindow.toggle();var helpEl1=document.getElementById('cciHelp1');var helpEl2=document.getElementById('cciHelp2');var helpNavEl1=document.getElementById('helpNav1');var helpNavEl2=document.getElementById('helpNav2');if(cmd=='help+'||cmd=='h+'){helpEl1.style.display='block';helpEl2.style.display='none';helpNavEl1.style.className='selected';helpNavEl2.style.className='';}else{helpEl1.style.display='none';helpEl2.style.display='block';helpNavEl1.style.className='';helpNavEl2.style.className='selected';}
validCmd=false;break;case'logout':case'lo':var pageUrl="index.php";pageUrl+='?logout=yes';if(JADE.isCCI){baseUrl=JADE.siteArray['cci'];pageUrl="site_switcher.php";}
break;case'version':var pageUrl="index.php";pageUrl+='?VERSION';break;case'info':var str="<p>";if(JADE.isCCI){str+="Hello <b>"+JADE.userName+"</b>,<br />";str+="You are loggen in as CCI Agent Code "+JADE.agentCode+" on ";str+=JSLib.getApplicationName()+"<br />";}else{str+="Application = "+JSLib.getApplicationName()+"<br />";}
var browserInfo=sniffer.breifDescription();str+="Your browser is "+browserInfo+"<br />";if(window.screen){str+="Your screen size is "+screen.width+" ("+screen.availWidth+") x "+screen.height+" ("+screen.availHeight+") Colour depth = "+screen.colorDepth+"<br />";}
str+="</p><p style='position: absolute; bottom: 3px;'><small>CLI Version = "+JADE.cli.version+" Version of Loaded Commands = "+JADE.cli.cmdVersion+"</small></p>";JADE.infoWindow.write(str);JADE.infoWindow.writeTitle('Information:');JADE.infoWindow.toggle();validCmd=false;break;case'op':var pageUrl="onlinepay.php";break;case'i':case'cq':var pageUrl="itinerary.php";break;case'vb':if(a[0]){var pageUrl="view_booking.php";pageUrl+='?bookingRef='+a[0].toUpperCase();}else{var pageUrl="list_bookings.php";}
break;case'b':case'bi':case'br':var pageUrl="accommodation/brochure.php";if(cmd=='bi'){pageUrl+='?panel=info';}else{pageUrl+='?panel=rooms';}
cmd='b';if(a.length==1){if(a[0].length==6){pageUrl+='&supplierCode='+a[0].toUpperCase();}else{return JADE.cli.paramError('Tourplan supplier code must be 6 characters in length.',cmd);}}else{if(a.length==3){var c1=JADE.cli.isDate(a[0]);if(c1){pageUrl+='&dateFrom='+c1;}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[1]);if(c2){pageUrl+='&checkout='+c2;}else{if(JADE.cli.isNumber(a[1])){c2=JADE.cli.addDays(c1,a[1]);pageUrl+='&checkout='+c2;}else{return JADE.cli.paramError('Error checkout',cmd);}}
if(a[2].length==6){pageUrl+='&supplierCode='+a[2].toUpperCase();}else{return JADE.cli.paramError('Tourplan supplier code must be 6 characters in length.',cmd);}}else{return JADE.cli.paramError('Incorect parameters',cmd);}}
break;case'sd':pageUrl="accommodation/service_details.php";if(a.length==1){pageUrl+='?opt='+a[0].toUpperCase();}else{if(a.length==3){var c1=JADE.cli.isDate(a[0]);if(c1){pageUrl+='?dateFrom='+c1;}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[1]);if(c2){pageUrl+='&checkout='+c2;}else{if(JADE.cli.isNumber(a[1])){c2=JADE.cli.addDays(c1,a[1]);pageUrl+='&checkout='+c2;}else{return JADE.cli.paramError('Error checkout',cmd);}}
pageUrl+='&opt='+a[2].toUpperCase();}else{return JADE.cli.paramError('Incorect parameters',cmd);}}
break;case'vq':if(a[0]){var pageUrl="itinerary.php";if(a[0].length>6){a[0]=a[0].substring(4);}
pageUrl+='?quoteId='+a[0];}else{var pageUrl="/list_quotes.php";}
break;case'nq':case'nb':var pageUrl="accommodation/?resetSearch=t";break;case'sq':var pageUrl="itinerary.php";if(a[0]){if(a.length>1){pageUrl="list_quotes.php";pageUrl+="?latestVersion=true&submit=1";switch(a[0]){case'r':pageUrl+="&searchcriteria=Quote+Reference";pageUrl+="&strQuoteRef="+a[1];break;case'n':pageUrl+="&searchcriteria=Booking+Name+%28contains%29";pageUrl+="&bookingName="+a[1];break;case'a':pageUrl+="&searchcriteria=Agent+Ref";pageUrl+="&agentRef="+a[1];break;case'c':if(a.length!=4){return JADE.cli.paramError('Incorect parameters',cmd);}
pageUrl+="&searchcriteria=Consultant";pageUrl+="&consultant="+a[1];var c1=JADE.cli.isDate(a[2]);if(c1){var dateArray=new Array;dateArray=c1.split('-');pageUrl+='&dateFrom_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&dateFrom_day='+dateArray[2];}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[3]);if(c2){var dateArray=new Array;dateArray=c2.split('-');pageUrl+='&checkout_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&checkout_day='+dateArray[2];}else{return JADE.cli.paramError('Error to',cmd);}
break;case't':if(a.length!=3){return JADE.cli.paramError('Incorect parameters',cmd);}
pageUrl+="&searchcriteria=Travel+Date";var c1=JADE.cli.isDate(a[1]);if(c1){var dateArray=new Array;dateArray=c1.split('-');pageUrl+='&dateFrom_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&dateFrom_day='+dateArray[2];}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[2]);if(c2){var dateArray=new Array;dateArray=c2.split('-');pageUrl+='&checkout_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&checkout_day='+dateArray[2];}else{return JADE.cli.paramError('Error to',cmd);}
break;case'e':if(a.length!=3){return JADE.cli.paramError('Incorect parameters',cmd);}
pageUrl+="&searchcriteria=Date+Entered";var c1=JADE.cli.isDate(a[1]);if(c1){var dateArray=new Array;dateArray=c1.split('-');pageUrl+='&enteredFrom_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&enteredFrom_day='+dateArray[2];}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[2]);if(c2){var dateArray=new Array;dateArray=c2.split('-');pageUrl+='&enteredTo_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&enteredTo_day='+dateArray[2];}else{return JADE.cli.paramError('Error to',cmd);}
break;default:return JADE.cli.paramError('Incorect parameters',cmd);break;}}else{var quoteRef=a[0];if(!JADE.cli.isNumber(quoteRef)){quoteRef=quoteRef.substring(4);}
pageUrl+='?quoteId='+quoteRef;}}else{pageUrl="list_quotes.php";}
break;case'sb':var pageUrl="view_booking.php";if(a[0]){if(a.length>1){pageUrl="list_bookings.php?submit.x=0&submit.y=0";switch(a[0]){case'r':pageUrl+="&searchcriteria=Booking+Reference";pageUrl+="&bookingRef="+a[1];break;case'n':pageUrl+="&searchcriteria=Booking+Name+%28contains%29";pageUrl+="&bookingName="+a[1];pageUrl+="&dateFrom_month=2005-01&dateFrom_day=1";break;case'a':pageUrl+="&searchcriteria=Agent+Ref";pageUrl+="&agentRef="+a[1];break;case'c':if(a.length!=4){return JADE.cli.paramError('Incorect parameters',cmd);}
pageUrl+="&searchcriteria=Consultant";pageUrl+="&consultant="+a[1];var c1=JADE.cli.isDate(a[2]);if(c1){var dateArray=new Array;dateArray=c1.split('-');pageUrl+='&dateFrom_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&dateFrom_day='+dateArray[2];}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[3]);if(c2){var dateArray=new Array;dateArray=c2.split('-');pageUrl+='&checkout_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&checkout_day='+dateArray[2];}else{return JADE.cli.paramError('Error to',cmd);}
break;case't':if(a.length!=3){return JADE.cli.paramError('Incorect parameters',cmd);}
pageUrl+="&searchcriteria=Travel+Date";var c1=JADE.cli.isDate(a[1]);if(c1){var dateArray=new Array;dateArray=c1.split('-');pageUrl+='&dateFrom_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&dateFrom_day='+dateArray[2];}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[2]);if(c2){var dateArray=new Array;dateArray=c2.split('-');pageUrl+='&checkout_month='+dateArray[0]+'-';if(dateArray[1].length==1){pageUrl+='0';}
pageUrl+=dateArray[1];pageUrl+='&checkout_day='+dateArray[2];}else{return JADE.cli.paramError('Error to',cmd);}
break;default:return JADE.cli.paramError('Incorect parameters',cmd);break;}}else{pageUrl+='?bookingRef='+a[0].toUpperCase();;}}else{pageUrl="list_bookings.php";}
break;case'ac':case'accom':var pageUrl="accommodation/search_results.php";if(a.length==0){pageUrl="accommodation/index.php";break;}
if(a.length==1){pageUrl+='?supplierCode='+a[0].toUpperCase();pageUrl+='&location=';pageUrl+='&keywords=';}else{if(a[0].length!=1){a.reverse()
a.push('s');a.reverse()}
switch(a[0]){case'l':pageUrl+='?location='+a[1].toUpperCase();pageUrl+='&keywords=';break;case'h':pageUrl+='?keywords='+a[1].toUpperCase().replace(/_/,' ');pageUrl+='&location=';pageUrl+='&supplierCode=';break;case's':pageUrl+='?supplierCode='+a[1].toUpperCase();pageUrl+='&location=';pageUrl+='&keywords=';break;}
if(a.length>3){var c1=JADE.cli.isDate(a[2]);if(c1){pageUrl+='&dateFrom='+c1;}else{return JADE.cli.paramError('Error from',cmd);}
var c2=JADE.cli.isDate(a[3]);if(c2){pageUrl+='&checkout='+c2;}else{if(JADE.cli.isNumber(a[3])){c2=JADE.cli.addDays(c1,a[3]);pageUrl+='&checkout='+c2;}else{return JADE.cli.paramError('Error checkout',cmd);}}
if(a.length>4){if(!JADE.cli.isNumber(a[4])){pageUrl+=getOrderBy(a[4]);a.splice(4,0,' ');}}
if(a.length>5){pageUrl+='&adults='+a[5];if(a.length>6){var numChildren=a.length-6;pageUrl+='&children='+numChildren;for(var c=1;c<=numChildren;c++){pageUrl+='&childAge'+c+'='+a[(c+5)];}}}}}
break;case'car':case'cars':var pageUrl="cars/search_results.php";if(a.length==0){pageUrl="cars/index.php";break;}
if(a.length>1){pageUrl+='?location='+a[0].toUpperCase();pageUrl+='&supplierCode=';}
if(a.length>2){var c1=JADE.cli.isDate(a[1]);if(!c1){pageUrl+='?supplierCode='+a[1].toUpperCase();pageUrl+='&location=';}else{a.splice(1,0,' ');}}
if(a.length>3){var c1=JADE.cli.isDate(a[2]);var t1=JADE.cli.isTime(a[3]);if(!c1){return JADE.cli.paramError('Error pickup',cmd);}
if(!t1){return JADE.cli.paramError('Error pickup time',cmd);}
pageUrl+='&dateFrom='+c1+' '+t1;var c2=JADE.cli.isDate(a[4]);var t2=JADE.cli.isTime(a[5]);if(!c2){return JADE.cli.paramError('Error dropoff',cmd);}
if(!t2){return JADE.cli.paramError('Error dropoff time',cmd);}
pageUrl+='&checkout='+c2+' '+t2;}
if(a.length>6){pageUrl+=getOrderBy(a[6]);}
break;case'tran':case'transfer':case'transfers':var pageUrl="transfers/search_results.php";if(a.length==0){pageUrl="transfers/index.php";break;}
if(a.length==1){pageUrl+='?supplierCode='+a[0].toUpperCase();pageUrl+='&location=';}else{if(a[0].length!=1){a.reverse()
a.push('s');a.reverse()}
switch(a[0]){case'l':pageUrl+='?location='+a[1].toUpperCase();pageUrl+='&supplierCode=';break;case's':pageUrl+='?supplierCode='+a[1].toUpperCase();pageUrl+='&location=';break;}
if(a.length>2){var c1=JADE.cli.isDate(a[2]);if(c1){pageUrl+='&dateFrom='+c1;}else{return JADE.cli.paramError('Error date',cmd);}
if(a.length>3){switch(a[3]){case'a':tranType='any';break;case'p':tranType='TAH';break;case'd':tranType='THA';break;case'r':tranType='TRATRO';break;default:tranType='any';break;}
pageUrl+='&optionClass='+tranType;}else{pageUrl+='&optionClass=any';}
if(a.length>4){if(a[4].length==1&&a[4]!=' '){a[5]=a[4];a[4]='';}else{pageUrl+='&keywords='+a[4].toUpperCase().replace(/_/,' ');}}
if(a.length>5){pageUrl+=getOrderBy(a[5]);}}}
break;case'tour':case'tours':var pageUrl="tours/search_results.php";if(a.length==0){pageUrl="tours/index.php";break;}
switch(a[0]){case'd':pageUrl+='?tourType='+'TOURS_DAY';break;case'e':case'x':pageUrl+='?tourType='+'TOURS_EXTENDED';break;default:pageUrl+='?tourType='+'TOURS_DAY';break;}
if(a.length==2){pageUrl+='&supplierCode='+a[1].toUpperCase();pageUrl+='&location=';}else{if(a[1].length!=1){a.reverse()
a.push('s');a.reverse()}
switch(a[1]){case'l':pageUrl+='?location='+a[2].toUpperCase();pageUrl+='&supplierCode=';break;case's':pageUrl+='?supplierCode='+a[2].toUpperCase();pageUrl+='&location=';break;}
if(a.length>3){var c1=JADE.cli.isDate(a[3]);if(c1){pageUrl+='&dateFrom='+c1;}else{return JADE.cli.paramError('Error date',cmd);}
if(a.length>4){if(a[4].length==1&&a[4]!=' '){a[5]=a[4];a[4]='';}else{pageUrl+='&keywords='+a[4].toUpperCase().replace(/_/,' ');}}
if(a.length>5){pageUrl+=getOrderBy(a[5]);}}}
break;case'attr':case'attraction':case'attractions':var pageUrl="attractions/search_results.php";if(a.length==0){pageUrl="attractions/index.php";break;}
if(a.length==1){pageUrl+='?supplierCode='+a[0].toUpperCase();pageUrl+='&location=';}else{if(a[0].length!=1){a.reverse()
a.push('s');a.reverse()}
switch(a[0]){case'l':pageUrl+='?location='+a[1].toUpperCase();pageUrl+='&supplierCode=';break;case's':pageUrl+='?supplierCode='+a[1].toUpperCase();pageUrl+='&location=';break;}
if(a.length>2){var c1=JADE.cli.isDate(a[2]);if(c1){pageUrl+='&dateFrom='+c1;}else{return JADE.cli.paramError('Error start',cmd);}
if(a.length>3){if(a[3].length==1&&a[3]!=' '){a[4]=a[3];a[3]='';}else{pageUrl+='&keywords='+a[3].toUpperCase().replace(/_/,' ');}}
if(a.length>4){pageUrl+=getOrderBy(a[4]);}}}
break;default:if(cciSite||site){if(cmd){JADE.cli.showError('Unknown command');validCmd=false;}}else{JADE.cli.showError('Unknown command');validCmd=false;}}
if(!validCmd){return true;}else{if(cciSite){var orgPageUrl=pageUrl;baseUrl=JADE.siteArray['cci'];pageUrl="site_switcher.php";pageUrl+='?site='+cciSite;pageUrl+='&agentCode='+cciAgent;pageUrl+='&switchSite=1';if(orgPageUrl){pageUrl+='&page='+orgPageUrl;}}
if(site){baseUrl=JADE.siteArray[site];}
var url=baseUrl+pageUrl;window.location=url;return false;}}
if(window.JSLib){JSLib.setLoaded("Document.js");}
if(window.JSLib){JSLib.addVersion("ClassUtil.js","Class Functions","1.1");}
Function.prototype.Extends=function(fnSuper)
{var prop;if(this==fnSuper){alert("Error - cannot derive from self");return;}
for(prop in fnSuper.prototype){if(typeof(fnSuper.prototype[prop])=="function"&&!this.prototype[prop]){this.prototype[prop]=fnSuper.prototype[prop];}}
this.prototype[fnSuper.StName()]=fnSuper;}
Function.prototype.StName=function()
{var st;st=this.toString();st=st.substring(st.indexOf(" ")+1,st.indexOf("("));if(st.charAt(0)=="("){st="function ...";}
return st;}
Function.prototype.Override=function(fnSuper,stMethod)
{this.prototype[fnSuper.StName()+"_"+stMethod]=fnSuper.prototype[stMethod];}
if(window.JSLib){JSLib.setLoaded("ClassUtil.js");}
if(window.JSLib){JSLib.addVersion("Date.js","Date Functions","1.1");}
var JANUARY=0;var FEBRUARY=1;var MARCH=2;var APRIL=3;var MAY=4;var JUNE=5;var JULY=6;var AUGUST=7;var SEPTEMBER=8;var OCTOBER=9;var NOVEMBER=10;var DECEMBER=11;var SUNDAY=0;var MONDAY=1;var TUESDAY=2;var WEDNESDAY=3;var THURSDAY=4;var FRIDAY=5;var SATURDAY=6;Date.prototype.getCivilianHours=function()
{return(this.getHours()<12)?this.getHours():this.getHours()-12;}
Date.prototype.getMeridiem=function()
{return(this.getHours()<12)?"AM":"PM";}
Date.prototype.to_s=Date.prototype.toString;Date.prototype.dayDiff=function(date)
{var oneDay=(1000*60*60*24);return Math.ceil((this.getTime()-date.getTime())/(oneDay));}
Date.prototype.dayDiff_time=function(date)
{var oneDay=1000*60*60*24;var difference_ms=Math.abs(this.getTime()-date.getTime());return Math.round(difference_ms/oneDay);}
Date.prototype.isDayLightSaving=function(date)
{var rightNow=new Date();var date1=new Date(rightNow.getFullYear(),0,1,0,0,0,0);var date2=new Date(rightNow.getFullYear(),6,1,0,0,0,0);var temp=date1.toGMTString();var date3=new Date(temp.substring(0,temp.lastIndexOf(" ")-1));var temp=date2.toGMTString();var date4=new Date(temp.substring(0,temp.lastIndexOf(" ")-1));var hoursDiffStdTime=(date1-date3)/(1000*60*60);var hoursDiffDaylightTime=(date2-date4)/(1000*60*60);if(hoursDiffDaylightTime==hoursDiffStdTime){return false;}else{return true;}}
Date.prototype.minDiff=function(date)
{var oneMin=1000*60;return Math.ceil((this.getTime()-date.getTime())/(oneMin));}
Date.prototype.addMilliseconds=function(ms)
{return new Date(new Date().setTime(this.getTime()+(ms)));}
Date.prototype.addSeconds=function(s)
{return new Date(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds()+s);}
Date.prototype.addMinutes=function(m)
{return new Date(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes()+m,this.getSeconds());}
Date.prototype.addHours=function(h)
{return new Date(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours()+h,this.getMinutes(),this.getSeconds());}
Date.prototype.addDays=function(d)
{return new Date(this.getFullYear(),this.getMonth(),this.getDate()+d,this.getHours(),this.getMinutes(),this.getSeconds());}
Date.prototype.addWeeks=function(w)
{var d=w*7;return new Date(this.getFullYear(),this.getMonth(),this.getDate()+d,this.getHours(),this.getMinutes(),this.getSeconds());}
Date.prototype.addMonths=function(m)
{return new Date(this.getFullYear(),this.getMonth()+m,this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds());}
Date.prototype.addYears=function(y)
{return new Date(this.getFullYear()+y,this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds());}
Date.prototype.getMonthName=function()
{var index=(0==arguments.length)?this.getMonth():arguments[0];switch(index)
{case JANUARY:return"January";case FEBRUARY:return"February";case MARCH:return"March";case APRIL:return"April";case MAY:return"May";case JUNE:return"June";case JULY:return"July";case AUGUST:return"August";case SEPTEMBER:return"September";case OCTOBER:return"October";case NOVEMBER:return"November";case DECEMBER:return"December";default:throw"Invalid month index: "+index.toString();}}
Date.prototype.getMonthAbbreviation=function()
{var index=(0==arguments.length)?this.getMonth():arguments[0];switch(index)
{case JANUARY:return"Jan";case FEBRUARY:return"Feb";case MARCH:return"Mar";case APRIL:return"Apr";case MAY:return"May";case JUNE:return"Jun";case JULY:return"Jul";case AUGUST:return"Aug";case SEPTEMBER:return"Sep";case OCTOBER:return"Oct";case NOVEMBER:return"Nov";case DECEMBER:return"Dec";default:throw"Invalid month index: "+index.toString();}}
Date.prototype.getDayName=function()
{var index=(0==arguments.length)?this.getDay():arguments[0];switch(index)
{case SUNDAY:return"Sunday";case MONDAY:return"Monday";case TUESDAY:return"Tuesday";case WEDNESDAY:return"Wednesday";case THURSDAY:return"Thursday";case FRIDAY:return"Friday";case SATURDAY:return"Saturday";default:throw"Invalid day index: "+index.toString();}}
Date.prototype.getDayAbbreviation=function()
{var index=(0==arguments.length)?this.getDay():arguments[0];switch(index)
{case SUNDAY:return"Sun";case MONDAY:return"Mon";case TUESDAY:return"Tue";case WEDNESDAY:return"Wed";case THURSDAY:return"Thu";case FRIDAY:return"Fri";case SATURDAY:return"Sat";default:throw"Invalid day index: "+index.toString();}}
Date.prototype.getDaysInMonth=function()
{var month=arguments[0]!=null?arguments[0]:this.getMonth();var year=arguments[1]!=null?arguments[1]:this.getFullYear();switch(month)
{case JANUARY:return 31;case FEBRUARY:return Date.isLeapYear(year)?29:28;case MARCH:return 31;case APRIL:return 30;case MAY:return 31;case JUNE:return 30;case JULY:return 31;case AUGUST:return 31;case SEPTEMBER:return 30;case OCTOBER:return 31;case NOVEMBER:return 30;case DECEMBER:return 31;default:throw"Invalid month index: "+index.toString();}}
Date.prototype.isLeapYear=function()
{if(0==this.getFullYear()%400)return true;if(0==this.getFullYear()%100)return false;return(0==this.getFullYear()%4)?true:false;}
Date.isLeapYear=function(year)
{if(0==year%400)return true;if(0==year%100)return false;return(0==year%4)?true:false;}
Date.prototype.getFirstDayOfMonth=function()
{return new Date(this.getFullYear(),this.getMonth(),1,12,0,0);}
Date.prototype.getLastDayOfMonth=function()
{return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth(),12,0,0);}
Date.prototype.clone=function()
{var dt=new Date();dt.setTime(this.getTime());return dt;}
Date.prototype.zeroTime=function()
{var dt=this.clone();dt.setHours(0);dt.setMinutes(0);dt.setSeconds(0);dt.setMilliseconds(0);return dt;}
Date.prototype.noonTime=function()
{var dt=this.clone();dt.setHours(12);dt.setMinutes(0);dt.setSeconds(0);dt.setMilliseconds(0);return dt;}
Date.prototype.endTime=function()
{var dt=this.clone();dt.setHours(23);dt.setMinutes(59);dt.setSeconds(59);dt.setMilliseconds(999);return dt;}
Date.prototype.format=function(fs)
{fs=fs.replace(/%YYYY/,this.getFullYear().toString());fs=fs.replace(/%YY/,this.getFullYear().toString().substr(2,2));fs=fs.replace(/%MMMM/,this.getMonthName(this.getMonth()).toString());fs=fs.replace(/%MMM/,this.getMonthAbbreviation(this.getMonth()).toString());fs=fs.replace(/%MM/,(this.getMonth()+1)>9?(this.getMonth()+1).toString():"0"+(this.getMonth()+1).toString());fs=fs.replace(/%M/,(this.getMonth()+1).toString());fs=fs.replace(/%DDDD/,this.getDayName(this.getDay()).toString());fs=fs.replace(/%DDD/,this.getDayAbbreviation(this.getDay()).toString());fs=fs.replace(/%DD/,this.getDate()>9?this.getDate().toString():"0"+this.getDate().toString());fs=fs.replace(/%D/,this.getDate().toString());fs=fs.replace(/%HH/,this.getHours()>9?this.getHours().toString():"0"+this.getHours().toString());fs=fs.replace(/%H/,this.getHours().toString());fs=fs.replace(/%hh/,this.getCivilianHours()>9?this.getCivilianHours().toString():"0"+this.getCivilianHours().toString());fs=fs.replace(/%h/,this.getCivilianHours());fs=fs.replace(/%mm/,this.getMinutes()>9?this.getMinutes().toString():"0"+this.getMinutes().toString());fs=fs.replace(/%m/,this.getMinutes().toString());fs=fs.replace(/%ss/,this.getSeconds()>9?this.getSeconds().toString():"0"+this.getSeconds().toString());fs=fs.replace(/%s/,this.getSeconds().toString());fs=fs.replace(/%nnn/,this.getMilliseconds().toString());fs=fs.replace(/%p/,this.getMeridiem());return fs;}
Date.prototype.toString=function()
{if(0==arguments.length||1<arguments.length)return this.to_s();return this.format(arguments[0].toString());}
if(window.JSLib){JSLib.setLoaded("Date.js");}
if(window.JSLib){JSLib.addVersion("String.js","String Functions","1.2");}
String.prototype.trim=function()
{return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim=function(){return this.replace(/\s+$/,"");}
function formatNumber(num,prefix){prefix=prefix||'';num+='';var splitStr=num.split('.');var splitLeft=splitStr[0];var splitRight=splitStr.length>1?'.'+splitStr[1]:'';var regx=/(\d+)(\d{3})/;while(regx.test(splitLeft)){splitLeft=splitLeft.replace(regx,'$1'+','+'$2');}
return prefix+splitLeft+splitRight;}
function unformatNumber(num){return num.replace(/([^0-9\.\-])/g,'')*1;}
if(window.JSLib){JSLib.setLoaded("String.js");}
if(window.JSLib){JSLib.addVersion("Image.js","Image Functions","2.0");}
var IMG_STATE_GLOBAL=0;var IMG_STATE_NORMAL=1;var IMG_STATE_OVER=2;var IMG_STATE_DOWN=3;var IMG_STATE_DISABLED=4;var PRELOADED_ARRAY=new Array();var PRELOADED_ARRAY_COUNTER=-1;imageCollection=function(preloadId)
{this.preloadId=preloadId;this.normalImg=null;this.overImg=null;this.downImg=null;this.disabledImg=null;}
imageCollection.prototype.addImage=function(state,filename)
{switch(state){case IMG_STATE_NORMAL:this.normalImg=new Image();this.normalImg.preloadId=this.preloadId;this.normalImg.onload=doImageLoad;this.normalImg.onerror=doImageError;this.normalImg.src=filename;break;case IMG_STATE_OVER:this.overImg=new Image();this.overImg.preloadId=this.preloadId;this.overImg.onload=doImageLoad;this.overImg.onerror=doImageError;this.overImg.src=filename;break;case IMG_STATE_DOWN:this.downImg=new Image();this.downImg.preloadId=this.preloadId;this.downImg.onload=doImageLoad;this.downImg.onerror=doImageError;this.downImg.src=filename;break;case IMG_STATE_DISABLED:this.disabledImg=new Image();this.disabledImg.preloadId=this.preloadId;this.disabledImg.onload=doImageLoad;this.disabledImg.onerror=doImageError;this.disabledImg.src=filename;break;}
function doImageError()
{PRELOADED_ARRAY[this.preloadId].doOnError(this.src);}
function doImageLoad()
{PRELOADED_ARRAY[this.preloadId].doOnLoad(this.src);}}
preloadCollection=function()
{PRELOADED_ARRAY_COUNTER++;this.preloadId=PRELOADED_ARRAY_COUNTER;this.allImagesLoaded=false;this.numImagesToLoad=0;this.numImagesLoaded=0;this.onImageLoad=null;this.onComplete=null;this.imageArray=new Array();this.errorArray=new Array();this.numErrors=0;this.storedElArray=new Array();this.storedParentArray=new Array();this.useALTStatus=false;this.forceBlankStatus=false;PRELOADED_ARRAY[this.preloadId]=this;}
preloadCollection.prototype.addImage=function(id,filename)
{if(typeof this.imageArray[id]!="object"){this.imageArray[id]=new imageCollection(this.preloadId);}
this.imageArray[id].addImage(IMG_STATE_GLOBAL,filename);}
preloadCollection.prototype.loadImageSequence=function(id,prefix,ex,start,end,dir)
{for(var i=start;i<=end;i++){var filename=dir+prefix+i+"."+ex;this.addImage(id,filename);}}
preloadCollection.prototype.addImageRoll=function(id,state,filename)
{if(typeof this.imageArray[id]!="object"){this.imageArray[id]=new imageCollection(this.preloadId);}
this.imageArray[id].addImage(state,filename);}
preloadCollection.prototype.getImage=function(id,state)
{if(!this.imageArray[id]){return null;}
switch(state){case IMG_STATE_NORMAL:if(this.imageArray[id].normalImg){if(!this.imageArray[id].normalImg.complete){return null;}else{return this.imageArray[id].normalImg.src;}}else{return null;}
break;case IMG_STATE_OVER:if(this.imageArray[id].overImg){if(!this.imageArray[id].overImg.complete){return null;}else{return this.imageArray[id].overImg.src;}}else{return null;}
break;case IMG_STATE_DOWN:if(this.imageArray[id].downImg){if(!this.imageArray[id].downImg.complete){return null;}else{return this.imageArray[id].downImg.src;}}else{return null;}
break;case IMG_STATE_DISABLED:if(this.imageArray[id].disabledImg){if(!this.imageArray[id].disabledImg.complete){return null;}else{return this.imageArray[id].disabledImg.src;}}else{return null;}
break;default:return null;}}
preloadCollection.prototype.swapImage=function(id,imgId,state,message)
{if(document.images&&document.getElementById){if(!window.PRELOADED_IMAGES){return;}
var imgObj=document.getElementById(id);if(imgObj.disabled){var disImage=this.getImage(imgId,IMG_STATE_DISABLED);if(disImage!=null){imgObj.src=disImage;}}else{if(imgObj.filters&&imgObj.filters.length>0){imgObj.filters[0].apply();}
var newImage=this.getImage(imgId,state);if(newImage!=null){if(state==IMG_STATE_OVER){this.checkNormal(id,imgId)}
imgObj.src=newImage;}
if(imgObj.filters&&imgObj.filters.length>0){imgObj.filters[0].play();}}
if(this.setUseALTStatus){var altMessage=imgObj.alt;window.setTimeout('window.status="'+altMessage+'"',1);}}
if(message){window.setTimeout('window.status="'+message+'"',1);}else{if(this.forceBlankStatus){window.setTimeout('window.status=" "',1);}}}
preloadCollection.prototype.setImageDesabled=function(id,imgId,value)
{var imgObj=document.getElementById(id);if(imgObj.tagName=="INPUT"){imgObj.disabled=value;this.swapImage(id,imgId,IMG_STATE_NORMAL);}else{if(value){var linkObj=imgObj.parentNode;this.storedElArray[id]=linkObj;var linkParent=linkObj.parentNode;this.storedParentArray[id]=linkParent;var img=this.getImage(imgId,IMG_STATE_DISABLED);if(img==null){var newEl=document.createElement('span');}else{var newEl=document.createElement('img');newEl.alt="Disabled. "+imgObj.alt;newEl.src=img;}
newEl.id=id;linkParent.replaceChild(newEl,linkObj);}else{this.storedParentArray[id].replaceChild(this.storedElArray[id],imgObj);}}}
preloadCollection.prototype.doOnComplete=function(filename)
{}
preloadCollection.prototype.doOnLoad=function(filename)
{this.numImagesLoaded++;if(this.numImagesToLoad>0){if(this.numImagesToLoad==this.numImagesLoaded){this.allImagesLoaded=true;}}}
preloadCollection.prototype.doOnError=function(file)
{this.errorArray[this.numErrors]=file;this.numErrors++;}
preloadCollection.prototype.checkNormal=function(id,imgId)
{var normImage=this.getImage(imgId,IMG_STATE_NORMAL);if(normImage==null){var imgObj=document.getElementById(id);var filename=imgObj.src;this.imageArray[imgId].addImage(IMG_STATE_NORMAL,filename);}}
preloadCollection.prototype.hilight=function(id,imgId,message)
{this.swapImage(id,imgId,IMG_STATE_OVER,message);}
preloadCollection.prototype.norm=function(id,imgId,message)
{this.swapImage(id,imgId,IMG_STATE_NORMAL,message);}
preloadCollection.prototype.down=function(id,imgId,message)
{this.swapImage(id,imgId,IMG_STATE_DOWN,message);}
preloadCollection.prototype.up=function(id,imgId,message)
{this.swapImage(id,imgId,IMG_STATE_OVER,message);}
preloadCollection.prototype.setForceBlankStatus=function(value)
{this.forceBlankStatus=value;}
preloadCollection.prototype.setUseALTStatus=function(value)
{this.useALTStatus=value;}
var PRELOADED_IMAGES=new preloadCollection();changeState=function(btnId,state)
{btn=getElementById(btnId);btn.disabled=state;btn.onmouseout();}
if(window.JSLib){JSLib.setLoaded("Image.js");}
if(window.JSLib){JSLib.addVersion("AjaxRequest.js","Ajax Request","2.0");}
function AjaxRequest(){var req=new Object();req.timeout=null;req.generateUniqueUrl=true;req.url=window.location.href;req.method="GET";req.async=true;req.username=null;req.password=null;req.parameters=new Object();req.requestIndex=AjaxRequest.numAjaxRequests++;req.responseReceived=false;req.groupName=null;req.queryString="";req.responseText=null;req.responseXML=null;req.status=null;req.statusText=null;req.aborted=false;req.elementId=null;req.ahahName=null;req.refreshDelay=0;req.xmlHttpRequest=null;this.NotSupported=false;this.NativeSupport=false;this.xmlHttpRequestVersion=null;req.onTimeout=null;req.onLoading=null;req.onLoaded=null;req.onInteractive=null;req.onComplete=null;req.onSuccess=null;req.onError=null;req.onGroupBegin=null;req.onGroupEnd=null;req.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(req.xmlHttpRequest==null){AjaxRequest.NotSupported=true;return null;}
req.xmlHttpRequest.onreadystatechange=function(){if(req==null||req.xmlHttpRequest==null){return;}
if(req.xmlHttpRequest.readyState==1){req.onLoadingInternal(req);}
if(req.xmlHttpRequest.readyState==2){req.onLoadedInternal(req);}
if(req.xmlHttpRequest.readyState==3){req.onInteractiveInternal(req);}
if(req.xmlHttpRequest.readyState==4){req.onCompleteInternal(req);}};req.onLoadingInternalHandled=false;req.onLoadedInternalHandled=false;req.onInteractiveInternalHandled=false;req.onCompleteInternalHandled=false;req.onLoadingInternal=function(){if(req.onLoadingInternalHandled){return;}
AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof(window['AjaxRequestBegin'])=="function"){AjaxRequestBegin();}
if(req.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[req.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]=0;}
AjaxRequest.numActiveAjaxGroupRequests[req.groupName]++;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==1&&typeof(req.onGroupBegin)=="function"){req.onGroupBegin(req.groupName);}}
if(typeof(req.onLoading)=="function"){req.onLoading(req);}
req.onLoadingInternalHandled=true;};req.onLoadedInternal=function(){if(req.onLoadedInternalHandled){return;}
if(typeof(req.onLoaded)=="function"){req.onLoaded(req);}
req.onLoadedInternalHandled=true;};req.onInteractiveInternal=function(){if(req.onInteractiveInternalHandled){return;}
if(typeof(req.onInteractive)=="function"){req.onInteractive(req);}
req.onInteractiveInternalHandled=true;};req.onCompleteInternal=function(){if(req.onCompleteInternalHandled||req.aborted){return;}
req.onCompleteInternalHandled=true;AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}
if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0&&typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}
req.responseReceived=true;req.status=req.xmlHttpRequest.status;req.statusText=req.xmlHttpRequest.statusText;req.responseText=req.xmlHttpRequest.responseText;req.responseXML=req.xmlHttpRequest.responseXML;if(typeof(req.onComplete)=="function"){req.onComplete(req);}
if(req.xmlHttpRequest.status==200&&typeof(req.onSuccess)=="function"){req.onSuccess(req);}
else if(typeof(req.onError)=="function"){req.onError(req);}
delete req.xmlHttpRequest['onreadystatechange'];req.xmlHttpRequest=null;};req.onTimeoutInternal=function(){if(req!=null&&req.xmlHttpRequest!=null&&!req.onCompleteInternalHandled){req.aborted=true;req.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}
if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0&&typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}
if(typeof(req.onTimeout)=="function"){req.onTimeout(req);}
delete req.xmlHttpRequest['onreadystatechange'];req.xmlHttpRequest=null;}};req.process=function(){if(req.xmlHttpRequest!=null){if(req.generateUniqueUrl&&req.method=="GET"){req.parameters["AjaxRequestUniqueId"]=new Date().getTime()+""+req.requestIndex;}
if(location.search.indexOf('showwidgets')>=0)req.parameters["showwidgets"]='';var content=null;for(var i in req.parameters){if(i!="toJSONString"){if(req.queryString.length>0){req.queryString+="&";}
req.queryString+=encodeURIComponent(i)+"="+encodeURIComponent(req.parameters[i]);}}
if(req.method=="GET"){if(req.queryString.length>0){req.url+=((req.url.indexOf("?")>-1)?"&":"?")+req.queryString;}}
if(req.method=="HEAD"){if(req.queryString.length>0){req.url+=((req.url.indexOf("?")>-1)?"&":"?")+req.queryString;}}
req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader('Content-type','application/x-www-form-urlencoded');}
content=req.queryString;}
if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}
req.xmlHttpRequest.send(content);}};req.handleArguments=function(args){for(var i in args){if(i!="toJSONString"){if(typeof(req[i])=="undefined"){req.parameters[i]=args[i];}else{req[i]=args[i];}}}};req.getAllResponseHeaders=function(){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getAllResponseHeaders();}
alert("Cannot getAllResponseHeaders because a response has not yet been received");}};req.getResponseHeader=function(headerName){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getResponseHeader(headerName);}
alert("Cannot getResponseHeader because a response has not yet been received");}};return req;}
AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){AjaxRequest.NativeSupport=true;return new XMLHttpRequest();}
else if(window.ActiveXObject){/*@cc_on @*//*@if (@_jscript_version >= 5)
        var tryActiveXVersion = [
            'Msxml2.XMLHTTP.5.0',
            'Msxml2.XMLHTTP.4.0',
            'MSXML2.XMLHTTP.3.0',
            'MSXML2.XMLHTTP',
            'Microsoft.XMLHTTP'
        ];
        for (var iVn = 0; iVn < tryActiveXVersion.length; iVn++) {
            AjaxRequest.xmlHttpRequestVersion = tryActiveXVersion[iVn];
            try {
                return new ActiveXObject(tryActiveXVersion[iVn]);
            } catch (objException) {};
        }
        AjaxRequest.xmlHttpRequestVersion = "ActiveX control not found";
        return null;
        @end @*/}else{AjaxRequest.xmlHttpRequestVersion=null;return null;}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0);};AjaxRequest.get=function(args){AjaxRequest.doRequest("GET",args);};AjaxRequest.post=function(args){AjaxRequest.doRequest("POST",args);};AjaxRequest.head=function(args){AjaxRequest.doRequest("HEAD",args);};AjaxRequest.doRequest=function(method,args){if(typeof(args)!="undefined"&&args!=null){var myRequest=new AjaxRequest();myRequest.method=method;myRequest.handleArguments(args);myRequest.process();}};AjaxRequest.submit=function(theform,args){var myRequest=new AjaxRequest();if(myRequest==null){return false;}
var serializedForm=AjaxRequest.serializeForm(theform);myRequest.method=theform.method.toUpperCase();myRequest.url=theform.action;myRequest.handleArguments(args);myRequest.queryString=serializedForm;myRequest.process();return true;};AjaxRequest.serializeForm=function(theform){var els=theform.elements;var len=els.length;var queryString="";this.addField=function(name,value){if(queryString.length>0){queryString+="&";}
queryString+=encodeURIComponent(name)+"="+encodeURIComponent(value);};for(var i=0;i<len;i++){var el=els[i];if(!el.disabled){switch(el.type){case'text':case'password':case'hidden':case'textarea':this.addField(el.name,el.value);break;case'select-one':if(el.selectedIndex>=0){this.addField(el.name,el.options[el.selectedIndex].value);}
break;case'select-multiple':for(var j=0;j<el.options.length;j++){if(el.options[j].selected){this.addField(el.name,el.options[j].value);}}
break;case'checkbox':case'radio':if(el.checked){this.addField(el.name,el.value);}
break;}}}
return queryString;};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0;
if(window.JSLib){JSLib.addVersion("brochure_reviews.js","Brochure Consumer Reviews","1.0");}
function toggleReviewDetails(id){var panelId='rd_'+id;var e=document.getElementById(panelId);if(e){e.style.display=e.style.display!='none'?'none':'block';changeReviewText(id);}else{e=document.createElement('div');e.id=panelId;e.innerHTML='<p>Retrieving information. Please wait...</p>';e.style.clear='both';document.getElementById('review_'+id).appendChild(e);var file=globPathPrefix+'/globals/ajax/brochure_reviews.xml?reviewId='+id;AjaxRequest.get({'url':file,'timeout':10000,'onSuccess':function(req){e.innerHTML=req.responseText;changeReviewText(id);},'onTimeout':function(req){e.innerHTML='<p>Our site is currently experiencing a high level of activity.<br/>Please try again by refreshing your browser.<br/>To do this click the refresh button or press F5.</p>';},'onError':function(req){e.innerHTML='<p><b>Ajax Error!</b><br/>Status = '+req.statusText+'.</p>';}});}
var expanded=e.style.display!='none';document.getElementById('show_'+id).style.display=expanded?'none':'inline';document.getElementById('hide_'+id).style.display=expanded?'inline':'none';return false;}
function changeReviewText(id){if(document.getElementById('detail_text_'+id)!=null){var tmp=document.getElementById('text_'+id).innerHTML;document.getElementById('text_'+id).innerHTML=document.getElementById('detail_text_'+id).innerHTML;document.getElementById('detail_text_'+id).innerHTML=tmp;}}
if(window.JSLib){JSLib.setLoaded("brochure_reviews.js");}