//AUTO-GENERATED-DO NOT MODIFY 

﻿
var Page,V3;if(!Page){Page={__namespace:true};}
if(!V3){V3={__namespace:true};}
if(!V3.Utils){V3.Utils={__namespace:true};}
if(!V3.Utils.Collections){V3.Utils.Collections={__namespace:true};}
if(!V3.Utils.Html){V3.Utils.Html={__namespace:true};}
if(!V3.Utils.Html.Specialised){V3.Utils.Html.Specialised={__namespace:true};}
if(!V3.Utils.WebServices){V3.Utils.WebServices={__namespace:true};}
if(!V3.CustomisationSettings){V3.CustomisationSettings={__namespace:true};}
function CreateEnum(fun,e1,e2,e3,etc){var i,lookupArray=[];for(i=1;i<arguments.length;i++){fun.prototype[arguments[i]]=i;fun[arguments[i]]=i;lookupArray[i]=arguments[i];}
fun.getFriendlyString=function(enumValue){return lookupArray[enumValue];};fun.__enum=true;}
UserAgentsEnum=function(){throw new Error();};CreateEnum(UserAgentsEnum,'Unknown','iPad','IE7');if(!Page.WebMethods){Page.WebMethods={GetAvailability:function(searchCriteria,duration,callbackOnSuccess,callbackOnError){alert('An error has occurred');}};}
if(!V3.CustomisationSettings.Words){V3.CustomisationSettings.Words={ProviderName:'',ProductSingular:'',ProductMultiple:'',CommencingDate:'',CommencingCheckIn:'',ConcludingDate:'',ConcludingCheckOut:'',GuestNamesAdult:'',GuestNamesChild:'',GuestNamesConcession:'',SpecialRequestTitle:'',TabAccommodation:'',TabToursEventsAttractions:'',Guests:'',Nights:''};}
V3.Utils.PageIsLoaded=false;V3.Utils.IsDebugMode=false;if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj){var i;for(i=this.length-1;i>=0;i--){if(this[i]==obj){return i;}}return-1;};}
if(!Array.prototype.clear){Array.prototype.clear=function(){this.length=0;};}
Date.prototype.addDays=function(days){var dat=new Date(this.valueOf());dat.setDate(dat.getDate()+days);return dat;};Date.prototype.equals=function(date){return this.valueOf()==date.valueOf();};Date.prototype.getDayOfWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][this.getDay()];};Date.prototype.getDaysBetween=function(date){var ONE_DAY=1000*60*60*24;var a=this.valueOf();var b=date.valueOf();return Math.round((a-b)/ONE_DAY);};Date.prototype.isFirstDateCloser=function(date1,date2){var a=Math.abs(this.getDaysBetween(date1));var b=Math.abs(this.getDaysBetween(date2));return a<b;};String.prototype.lpad=function(padString,length){var str=this;while(str.length<length){str=padString+str;}
return str;}
String.prototype.rpad=function(padString,length){var str=this;while(str.length<length){str=str+padString;}
return str;}
V3.Utils.Collections.addToArray=function(array,newItem){var i=array.indexOf(newItem);if(i!=-1){return false;}else{array.push(newItem);return true;}};V3.Utils.Collections.removeFromArray=function(array,item){var i=array.indexOf(item);if(i==-1){return false;}else{array.splice(i,1);return true;}};V3.Utils.setInnerText=function(e,msg){e.innerHTML=msg.replace(/\r\n/g,'<br />');};V3.Utils.QueryString=[];V3.Utils.QueryString.Keys=[];(function(){var m,k,v,regex=/[\?&](.*?)=([^&#]*)/gi,t='?';while((m=regex.exec(window.location.href))!=null){if(t.length>1){t=t+'&';}
k=m[1];v=decodeURIComponent(m[2]);V3.Utils.QueryString.Keys.push(k);V3.Utils.QueryString.push(v);t=t+k+'='+v
if(typeof V3.Utils.QueryString[k]=='undefined'){V3.Utils.QueryString[k]=v;if(typeof V3.Utils.QueryString[k.toLowerCase()]=='undefined'){V3.Utils.QueryString[k.toLowerCase()]=v;}}}
var e=function(){};V3.Utils.QueryString.Keys.push=e;V3.Utils.QueryString.Keys.pop=e;V3.Utils.QueryString.push=e;V3.Utils.QueryString.pop=e;V3.Utils.QueryString.toString=function(){return t;};})();V3.Utils.UserAgent=UserAgentsEnum.Unknown;if(V3.Utils.QueryString["ipad"]=='true'||navigator.userAgent.match(/iPad/)){V3.Utils.UserAgent=UserAgentsEnum.iPad;}
else if(V3.Utils.QueryString["ie7"]=='true'||navigator.userAgent.match(/MSIE 7\./)){V3.Utils.UserAgent=UserAgentsEnum.IE7;}
V3.Utils.StopWatch=function(namedWatch){if(!V3.Utils.StopWatch.NamedWatches){V3.Utils.StopWatch.NamedWatches={};}
if(!namedWatch){this.name='{Unnamed}';}else{this.name=namedWatch;if(V3.Utils.StopWatch.NamedWatches[namedWatch]){return V3.Utils.StopWatch.NamedWatches[namedWatch];}else{V3.Utils.StopWatch.NamedWatches[namedWatch]=this;}}
this.reset=function(){this.startTime=new Date();this.stopTime=new Date();this.duration=0;this.isRunning=false;return this;};this.start=function(){if(!this.isRunning){this.reset();}this.isRunning=true;return this;};this.stop=function(){if(!this.isRunning){throw'not running';}else{this.stopTime=new Date();this.isRunning=false;this.duration=(this.stopTime.valueOf()-this.startTime.valueOf());}return this;};this.getCurrentDuration=function(){return(this.stopTime.valueOf()-this.startTime.valueOf());};this.startTime=new Date();this.stopTime=new Date();this.reset();};V3.Utils.EventType=function(eventName,optionalArgsString,optionalDisableDebugOutput){this.__delegates=[];var me=this;this.fireWithParamArray=function(paramArray){var i;for(i=0;i<me.__delegates.length;i++){try{me.__delegates[i].apply(me,paramArray);}
catch(err){V3.Log.Error('Error while firing event '+eventName,'error','err',err);V3.Log.Watch('',{handler:me.__delegates[i].toString(),args:paramArray},'error',true);}}};this.fire=function(args){me.fireWithParamArray.apply(me,[arguments]);};if(optionalArgsString&&optionalArgsString!=''){eval('this.fire = function('+optionalArgsString+') { return me.fireWithParamArray.apply(this, [arguments]); };');}
this.addEventHandler=function(targetFunction){return V3.Utils.Collections.addToArray(this.__delegates,targetFunction)};this.removeEventHandler=function(targetFunction){return V3.Utils.Collections.removeFromArray(this.__delegates,targetFunction)};if(V3.Utils.IsDebugMode&&!optionalDisableDebugOutput){this.addEventHandler(function(){var i,msg='',obj=[];for(i=0;i<arguments.length;i++){obj.push(arguments[i]);}
V3.Utils.Console.WriteDebug('firing event: '+eventName,obj);});}};V3.Utils.EventType.__class=true;V3.Utils.OnLoad=new V3.Utils.EventType('Document.OnLoad');V3.Utils.OnSubmit=new V3.Utils.EventType('OnSubmit','form');V3.Utils.OnUnload=new V3.Utils.EventType('Document.OnUnload');V3.Utils.OnFinalise=new V3.Utils.EventType('OnFinalise');V3.Utils.OnScroll=new V3.Utils.EventType('OnScroll');V3.Utils.OnLoaded=new V3.Utils.EventType('OnLoaded');(function(){var internalFunction=V3.Utils.OnLoad.fireWithParamArray;var hasFired;V3.Utils.OnLoad.fireWithParamArray=function(params){if(!hasFired){hasFired=true;internalFunction.apply(V3.Utils.OnLoad,[params]);}};})();if(window.$){window.$(document).ready(V3.Utils.OnLoad.fire);}
(function(){var internalFunction=V3.Utils.OnLoaded.fireWithParamArray;var hasFired;V3.Utils.OnLoaded.fireWithParamArray=function(params){if(!hasFired){hasFired=true;V3.Utils.PageIsLoaded=true;internalFunction.apply(V3.Utils.OnLoaded,[params]);}
else{alert('already fired!');}};if(typeof window.onload=='function'){V3.Utils.OnLoaded.addEventHandler(window.onload);}
window.onload=V3.Utils.OnLoaded.fire;})();if(window.onscroll){V3.Utils.OnScroll.addEventHandler(window.onscroll);}
window.onscroll=V3.Utils.OnScroll.fire;(function(){var internalFunction=V3.Utils.OnUnload.fireWithParamArray;V3.Utils.OnUnload.fireWithParamArray=function(params){if(V3.Utils._hasUnloaded){return;}
V3.Utils._hasUnloaded=true;internalFunction(params);};})();V3.Utils.OnLoad.addEventHandler(function(){if(window.onunload){V3.Utils.OnFinalise.addEventHandler(window.onunload);}
window.onunload=function(){V3.Utils.OnFinalise.fire();};V3.Utils.OnSubmit.addEventHandler(function(sender){if(sender.target!="_blank"){V3.Utils.OnUnload.fire();}});var f=document.getElementById('aspnetForm');if(!f){f=document.getElementById('V3_FORM');}
if(!f){if(document.forms.length==0){return;}
f=document.forms[0];}
if(f.onsubmit){V3.Utils.OnSubmit.addEventHandler(f.onsubmit);}
f.onsubmit=function(){V3.Utils.OnSubmit.fire(f);};});V3.Utils.Console={_e:null,OnStartup:new V3.Utils.EventType('ConsoleStartup','sender',false),Enabled:false,Visible:false,_constructConsole:function(){if(V3.Utils.Console._e){return;}
var e=document.createElement('div');e.className='debuggingConsole';var s=e.style;s.backgroundColor='Black';s.color='#aaa';s.borderStyle='inset';s.borderColor='White';s.borderWidth='2';s.overflow='scroll';s.textAlign='left';s.position='fixed';s.top='12px';s.left='5px';s.bottom='5px';s.right='850px';V3.Utils.Console._e=e;V3.Utils.Console.OnStartup.fire();},_getColor:function(debugLevel){switch(debugLevel?debugLevel.toString().toLowerCase():null){case'debug':return'#0C2';case'info':return'#48F';case'error':return'#F44';case'warn':case'warning':return'#FF0';default:return'#EEE';}},_addEntry:function(text,debugLevel){var e=document.createElement('div');e.style.width='auto';e.style.color=V3.Utils.Console._getColor(debugLevel);var l=document.createElement('span');l.innerHTML=('<span style="">'+formatDate(new Date(),'HH:mm:ss.ffff')+'</span>:'+text);e.appendChild(l);V3.Utils.Console._e.appendChild(e);return e;},_createActivator:function(elementToControl){var activator=document.createElement('span');var s=activator.style;s.cursor='default';s.color='White';s.fontSize='12px';s.fontWeight='bold';s.display='inline-block';s.lineHeight='14px';s.textAlign='center';s.width='14px';s.height='14px';s.borderStyle='solid';s.borderWidth='1px';s.borderColor='#888888';s.marginRight='3px';activator.Target=elementToControl;activator.innerHTML='+';activator.Target.innerHTML=activator.Target.Data.toString();activator.onclick=function(){if(this.IsExpanded){this.IsExpanded=false;this.innerHTML='+'
this.Target.style.color="inherit";this.Target.innerHTML=this.Target.Data.toString();}else{try{this.IsExpanded=true;this.innerHTML='-';this.Target.style.color="Orange";var prop,wasError=false;for(prop in this.Target.Data){try{if(typeof this.Target.Data[prop]!='function'){var c=document.createElement('div');c.style.marginLeft='7px';c.style.paddingLeft='6px';c.style.borderLeft='solid 1px #888';V3.Utils.Console._addWatch(prop,this.Target.Data[prop],null,c);this.Target.appendChild(c);}}
catch(err){wasError=true;}}
if(wasError){throw'There was errors while expanding';}}
catch(err){this.style.color='#A66';this.style.borderColor='#A66';}}};return activator;},_addWatch:function(objectName,objData,optionalDebugLevel,optionalParentElement){var dataContainer,l;if(!optionalParentElement){if(typeof objData=='number'||typeof objData=='string'||typeof objData=='boolean'){V3.Utils.Console._addEntry(objectName+': <i style="font-size:smaller;">('+(typeof objData)+')</i> <b style="color:white;">'+objData+'</b>',optionalDebugLevel);}else if(objData==null){V3.Utils.Console._addEntry(objectName+': <i>null</i>',optionalDebugLevel);}else{V3.Utils.Console._addEntry(objectName+': <i>(object)</i>',optionalDebugLevel);l=document.createElement('span');l.style.color=V3.Utils.Console._getColor(optionalDebugLevel);l.innerHTML=objectName;dataContainer=document.createElement('span');dataContainer.Data=objData;var c=(optionalParentElement?optionalParentElement:V3.Utils.Console._e);c.appendChild(V3.Utils.Console._createActivator(dataContainer));c.appendChild(l);c.appendChild(document.createTextNode(': '));c.appendChild(dataContainer);}}
else{var e=document.createElement('span');e.style.color='#FFF';e.style.paddingLeft='14px';e.style.lineHeight='16px';if(typeof objData=='number'||typeof objData=='string'||typeof objData=='boolean'){e.innerHTML=objectName+': <i style="font-size:smaller;">('+(typeof objData)+')</i> <b style="color:white;">'+objData+'</b>',optionalDebugLevel
optionalParentElement.appendChild(e);}else if(objData==null){e.innerHTML=objectName+': <i>null</i>';optionalParentElement.appendChild(e);}else{e.style.paddingLeft='0px';dataContainer=document.createElement('span');dataContainer.Data=objData;optionalParentElement.appendChild(V3.Utils.Console._createActivator(dataContainer));e.innerHTML=objectName+': ';optionalParentElement.appendChild(e);optionalParentElement.appendChild(dataContainer);}}},AddWatch:function(objectName,objData,optionalDebugLevel){if(!V3.Utils.PageIsLoaded){V3.Utils.OnLoaded.addEventHandler(V3.Utils.Console.Show);V3.Utils.Console.OnStartup.addEventHandler(function(){V3.Utils.Console.AddWatch(objectName,objData,optionalDebugLevel);});return;}
if(!V3.Utils.Console.Enabled){return;}
V3.Utils.Console._addWatch(objectName,objData,optionalDebugLevel);},WriteLine:function(msg,debugLevel){try{if(!V3.Utils.PageIsLoaded){V3.Utils.OnLoaded.addEventHandler(V3.Utils.Console.Show);V3.Utils.Console.OnStartup.addEventHandler(function(){V3.Utils.Console.WriteLine(msg,debugLevel);});return;}
if(!V3.Utils.Console.Enabled){return;}
V3.Utils.Console._addEntry(msg,debugLevel);}
catch(err){if(V3.Utils.IsDebugMode){alert('Exception thrown from V3.Utils.Console.WriteLine(..)\r\nerr='+err);}}},WriteInfo:function(msg){V3.Utils.Console.WriteLine(msg,'info');},WriteDebug:function(msg){V3.Utils.Console.WriteLine(msg,'debug');},WriteWarning:function(msg){V3.Utils.Console.WriteLine(msg,'warn');},WriteError:function(msg){V3.Utils.Console.WriteLine(msg,'error');},Show:function(){if(!V3.Utils.Console.Enabled){return;}
if(V3.Utils.Console.Visible){return;}
if(!V3.Utils.PageIsLoaded){V3.Utils.Console.OnStartup.addEventHandler(V3.Utils.Console.Show);return;}
$("div.container_middle_body").css('marginRight','3px');document.body.appendChild(V3.Utils.Console._e);V3.Utils.Console.Visible=true;},Hide:function(){if(!V3.Utils.Console.Enabled){return;}
if(!V3.Utils.Console.Visible){return;}
$(".container_middle_body").css('marginRight','auto');V3.Utils.Console._e.parentElement.removeChild(V3.Utils.Console._e);V3.Utils.Console.WriteLine=function(){};V3.Utils.Console.Visible=false;},EnableConsole:function(){V3.Utils.Console.Enabled=true;if(V3.Utils.PageIsLoaded){V3.Utils.Console._constructConsole();}else{V3.Utils.OnLoaded.addEventHandler(V3.Utils.Console._constructConsole);}}};V3.Utils.Console.OnStartup.addEventHandler(function(){V3.Utils.Console.Show();V3.Utils.Console.AddWatch('QueryString',V3.Utils.QueryString);V3.Utils.Console.WriteInfo('Detected browser as being: '+UserAgentsEnum.getFriendlyString(V3.Utils.UserAgent));});V3.Utils.DebugBanner={element:null,Show:function(){V3.Utils.Console.Show();if(V3.Utils.DebugBanner.element){V3.Utils.DebugBanner.element.style.display='block';}},Hide:function(){V3.Utils.Console.Hide();if(V3.Utils.DebugBanner.element){V3.Utils.DebugBanner.element.style.display='none';}
if(!document.body.ondblclick){document.body.ondblclick=V3.Utils.DebugBanner.Show;}}};V3.Utils.EnableDebugMode=function(){if(V3.Utils.IsDebugMode){return;}
V3.Utils.IsDebugMode=true;V3.Utils.Console.EnableConsole();};V3.Utils.DisableDebugMode=function(){if(!V3.Utils.IsDebugMode){return;}
V3.Utils.IsDebugMode=false;if(!V3.Utils.PageIsLoaded){V3.Utils.OnLoad.removeEventHandler(V3.Utils.EnableDebugMode);V3.Utils.OnLoad.addEventHandler(V3.Utils.DisableDebugMode);return;}
V3.Utils.Console.Hide();};V3.Utils.debugOutput=function(obj,optionalPrefix,optionalCss){if(typeof optionalPrefix=='undefined'){optionalPrefix='';}
if(typeof obj!='string'){V3.Utils.Console.WriteLine(optionalPrefix,obj,optionalCss);}else{V3.Utils.Console.WriteLine(optionalPrefix+obj,null,optionalCss);}};V3.Utils.Html.appendVisibilityShorthand=function(element,optionalUseDisplay,optionalAnimate){if(typeof(optionalUseDisplay)=='object'){optionalAnimate=optionalUseDisplay['useAnimated'];optionalUseDisplay=optionalUseDisplay['useDisplay'];}
if(optionalAnimate){element.show=function(optionalForceInstant){if(optionalForceInstant){element.style.display='block';}else{$(element).fadeIn();}element.visible=true;}
element.hide=function(optionalForceInstant){if(optionalForceInstant){element.style.display='none';}else{$(element).fadeOut();}element.visible=false;}}
else if(optionalUseDisplay==true){element.show=function(){element.style.display='block';element.visible=true;}
element.hide=function(){element.style.display='none';element.visible=false;}}
else{element.show=function(){element.style.visibility='visible';element.visible=true;}
element.hide=function(){element.style.visibility='hidden';element.visible=false;}}};V3.Utils.Html.createElement=function(tagName,optionalClassName,optionalAppendVisibilityShorthand){var e=document.createElement(tagName);if(optionalClassName){e.className=optionalClassName;}
V3.Utils.Html.appendVisibilityShorthand(e,optionalAppendVisibilityShorthand);return e;};V3.Utils.Html.createSelect=function(name,optionalId,optionalOnChangeEvent,optionalEventArgs,optionalOnValueChangedOnBlur){var e=document.createElement('select');e.setAttribute('name',name);if(optionalId){e.id=optionalId;}
if(typeof(optionalOnChangeEvent)=='function'){e.onchange=function(){optionalOnChangeEvent(e,optionalEventArgs);};}
if(typeof(optionalOnValueChangedOnBlur)=='function'){e.onfocus=function(){e.__focusValue=e.value;};e.onblur=function(){if(e.value!=e.__focusValue){e.__focusValue=e.value;optionalOnValueChangedOnBlur(e,optionalEventArgs,e.__focusValue);}};}
e.clear=function(){e.options.length=0;};return e;};V3.Utils.Html.appendSelectItem=function(eSelect,label,value){var opt=document.createElement('option');opt.innerHTML=label;opt.value=value;eSelect.appendChild(opt);};V3.Utils.Html.removeSelectItem=function(eSelect,value){var i;for(i=0;i<eSelect.options.length;i++){if(eSelect.options[i].value==value){eSelect.removeChild(eSelect.options[i]);break;}}};V3.Utils.Html.getSelectedOptions=function(eSelect){var ret=[],i;for(i=0;i<eSelect.options.length;i++){if(eSelect.options[i].selected){ret.push({index:i,option:eSelect.options[i]});}}
return ret;};V3.Utils.Html.applyShorthand=function(element,shorthand,optionalArrayOfPropertiesToIgnore){try{var propsToIgnore=null;if(typeof(optionalArrayOfPropertiesToIgnore)=='object'&&typeof(optionalArrayOfPropertiesToIgnore.indexOf)=='function'){propsToIgnore=optionalArrayOfPropertiesToIgnore;}
var key;for(key in shorthand){if(propsToIgnore&&propsToIgnore.indexOf(key)!=-1){continue;}
if(key=='className'){AddCssStyle(element,shorthand[key]);}else{element[key]=shorthand[key];}}
return true;}
catch(err){V3.Log.Error('exception thrown in V3.Utils.HTML.applyShorthand(..)','err',err);return false;}};V3.Utils.Html.createTable=function(optionalRows,optionalColumns,optionalCssClassName,optionalAppendVisibilityShorthand){var e=V3.Utils.Html.createElement('table',optionalCssClassName,optionalAppendVisibilityShorthand);V3.Utils.Html.appendVisibilityShorthand(e,optionalAppendVisibilityShorthand);e.TBody=V3.Utils.Html.createElement('tbody','');e.Rows=new Array();e.addRow=function(optionalColumns,optionalAtIndex,optionalCssClassName){var atIndex=e.Rows.length;var r=V3.Utils.Html.createElement('tr',optionalCssClassName,true);if(optionalAtIndex==atIndex){optionalAtIndex=null;}
if(typeof(optionalAtIndex)=='number'&&isFinite(optionalAtIndex)){atIndex=optionalAtIndex;if(atIndex==0){RemoveCssStyle(r.Rows[0],'first');r.className=r.className+' first';}
e.TBody.insertBefore(r,e.Rows[atIndex]);e.Rows.splice(atIndex,0,r);}else{if(e.Rows.length==0){r.className=r.className+' first';}else{RemoveCssStyle(e.Rows[e.Rows.length-1],'last');}
e.TBody.appendChild(r);e.Rows.push(r);r.className=r.className+' last';}
r.Cells=new Array();r.addCell=function(optionalAtIndex,optionalCssClassName){var atIndex=r.Cells.length;var c=V3.Utils.Html.createElement('td',optionalCssClassName);if(optionalAtIndex==atIndex){optionalAtIndex=null;}
if(typeof(optionalAtIndex)=='number'&&isFinite(optionalAtIndex)){atIndex=optionalAtIndex;if(atIndex==0){RemoveCssStyle(r.Cells[0],'first');c.className=c.className+' first';}
r.insertBefore(c,r.Cells[atIndex]);r.Cells.splice(atIndex,0,c);}else{if(r.Cells.length==0){c.className=c.className+' first';}else{RemoveCssStyle(r.Cells[r.Cells.length-1],'last');}
r.appendChild(c);r.Cells.push(c);c.className=c.className+' last';}
return c;};r.removeCellAt=function(atIndex){if(atIndex==0&&r.Cells.length>1){r.Cells[1].className=r.Cells[1].className+' first';}
else if(atIndex>0&&atIndex==r.Cells.length-1){r.Cells[atIndex-1].className=r.Cells[atIndex-1].className+' last';}
r.removeChild(r.Cells[atIndex]);r.Cells.splice(atIndex,1);};r.removeCell=function(cell){var i=r.Cells.indexOf(cell);if(i!=-1){r.removeCellAt(i);}};if(typeof(optionalColumns)=='number'&&isFinite(optionalColumns)){var i;for(i=0;i<optionalColumns;i++){r.addCell();}}
return r;};e.removeRowAt=function(atIndex){if(atIndex==0&&e.Rows.length>1){e.Rows[1].className=e.Rows[1].className+' first';}
else if(atIndex>0&&atIndex==e.Rows.length-1){e.Rows[atIndex-1].className=e.Rows[atIndex-1].className+' last';}
e.TBody.removeChild(e.Rows[atIndex]);e.Rows.splice(atIndex,1);};e.removeRow=function(row){var i=e.Rows.indexOf(row);if(i!=-1){e.removeRowAt(i);}};var i;if(typeof(optionalRows)=='object'&&typeof(optionalRows.indexOf)=='function'){var j,r,c;for(i=0;i<optionalRows.length;i++){r=e.addRow();V3.Utils.Html.applyShorthand(r,optionalRows[i],['Cells']);if(optionalRows[i].Cells){for(j=0;j<optionalRows[i].Cells.length;j++){c=r.addCell();V3.Utils.Html.applyShorthand(c,optionalRows[i].Cells[j]);}}}}
else if(typeof(optionalRows)=='number'&&isFinite(optionalRows)){for(i=0;i<optionalRows;i++){e.addRow(optionalColumns);}}
e.appendChild(e.TBody);return e;};V3.Utils.Html.Specialised.setDaysOfMonth=function(ddlM,ddlD){var firstDayOfMonth,i,lastDayOfMonth=parseInt(ddlM.value.substr(8,2),10),selectedDay=parseInt(ddlD.value,10);if(isFinite(lastDayOfMonth)){firstDayOfMonth=(ddlM.value.length<13?1:parseInt(ddlM.value.substring(11,13),10));if(!isFinite(firstDayOfMonth))firstDayOfMonth=1;ddlD.options.length=0;for(i=firstDayOfMonth;i<=lastDayOfMonth;i++){var text=i.toString();if(i<10){text='0'+i;}
ddlD.options[ddlD.options.length]=new Option(i,text);if(i==selectedDay)ddlD.selectedIndex=ddlD.options.length-1;}
if(selectedDay<firstDayOfMonth){ddlD.selectedIndex=0;}else if(selectedDay>lastDayOfMonth){ddlD.selectedIndex=ddlD.options.length-1;}}};V3.Utils.Html.Specialised.setDateOnDropLists=function(ddlMonth,ddlDayOfMonth,newDate){var dateString=formatDate(newDate,'yyyy MM dd');var seekingText=dateString.substr(0,7);if(ddlMonth.options[ddlMonth.selectedIndex]!=seekingText){for(i=0;i<ddlMonth.options.length;i++){if(ddlMonth.options[i].value.substring(0,7)==seekingText){ddlMonth.selectedIndex=i;break;}}
V3.Utils.Html.Specialised.setDaysOfMonth(ddlMonth,ddlDayOfMonth);}
var day=dateString.substr(8,2);for(i=0;i<ddlDayOfMonth.options.length;i++){if(ddlDayOfMonth.options[i].value==day){ddlDayOfMonth.selectedIndex=i;break;}}};V3.Utils.NotifyUser=function(msg,optionalCode){if(typeof(msg)=='number'){optionalCode=msg;msg='An unexpected error has occurred.';}
if(optionalCode||optionalCode==0){alert(msg+'\r\nError Code: '+optionalCode);}else{alert(msg);}};V3.Utils.WebServices.isAborting=function(obj,msg,exc){return(msg=='abort'||(obj&&(obj.statusText=='abort'||(obj.status!=500&&obj.readyState==4)||obj.readyState==0)));};V3.Utils.ScrollTo=function(target){$("html:not(:animated),body:not(:animated)").animate({scrollTop:$(target).offset().top},500);};V3.Utils._busySettings={BackgroundColor:null};V3.Utils.OnLoaded.addEventHandler(function(){var container=V3.Utils.Html._container;if(!container){container=V3.Utils.Html.createElement('div','busyContainer',{useDisplay:true});if(V3.Utils.UserAgent==UserAgentsEnum.iPad){container.style.cssText='display:none; position:absolute;left:0px;top:0px;right:0;bottom:0;float:none;';}else{container.style.cssText='display:none; position:fixed;left:0px;top:0px;right:0;bottom:0;float:none;';}
var bg=V3.Utils.Html.createElement('div','busyBackground',false);if(V3.Utils.UserAgent==UserAgentsEnum.iPad){bg.style.cssText='position:absolute;left:0px;top:0px;right:0;bottom:0;float:none;';}else{bg.style.cssText='position:fixed;left:0px;top:0px;right:0;bottom:0;float:none;';}
container.bg=bg;container.appendChild(bg);var img=document.createElement('img');img.id='waitingAnimation';img.className='busyAnimation';img.src='../Resources/Images/ajax-loader.gif';container.img=img;if(V3.Utils.UserAgent==UserAgentsEnum.iPad){img.style.position='absolute';centerElement(img,true);V3.Utils.OnScroll.addEventHandler(function(){centerElement(img,true);});container.appendChild(img);}else{img.style.cssText='display:block; position:absolute; left:50%; top:50%;';container.appendChild(img);}
document.body.appendChild(container);V3.Utils.Html._container=container;V3.Utils._applyBusySettings();}
V3.Utils.OnUnload.addEventHandler(function(){container.show();setTimeout(function(){container.onclick=container.hide;},10000);});V3.Utils.OnFinalise.addEventHandler(container.hide);});V3.Utils._applyBusySettings=function(){if(!V3.Utils._busySettings||!V3.Utils.Html._container){return;}
if(V3.Utils._busySettings.BackgroundColor){V3.Utils.Html._container.bg.style.backgroundColor=V3.Utils._busySettings.BackgroundColor;}};V3.Utils.SetBusySettings=function(args){if(typeof args!='object'||!args){return;}
if(args.BackgroundColor){V3.Utils._busySettings.BackgroundColor=args.BackgroundColor;}
V3.Utils._applyBusySettings();};if(self!=top){(function(){var p;p=V3.Utils.QueryString["if_url"];if(p){V3.Utils.OnLoad.addEventHandler(function(){var width=$(document.body).outerWidth();var height=$(document.body).outerHeight();var e=document.createElement('iframe');e.width=0;e.height=0;e.style.display='none';e.src=V3.Utils.QueryString["if_url"]+(V3.Utils.QueryString["if_url"].indexOf('?')==-1?'?':'&')+'contentFrameName='+V3.Utils.QueryString["if_name"]+
(V3.Utils.QueryString["if_hostframename"]?'&hostFrameName='+V3.Utils.QueryString["if_hostframename"]:'')+'&size='+width+','+height;document.body.appendChild(e);});}
p=V3.Utils.QueryString["if_bgcolor"];if(p){try{document.body.style.backgroundColor=p;document.getElementsByTagName('html')[0].style.backgroundColor=p;}
catch(err){alert('Invalid value in parameter if_bgcolor\r\nErr='+err);}}
p=V3.Utils.QueryString["if_loadingcolor"];if(p){try{V3.Utils.SetBusySettings({BackgroundColor:p});}
catch(err){alert('Invalid value in parameter if_loadingcolor\r\nErr='+err);}}
p=V3.Utils.QueryString["if_padding"];if(p){try{document.body.style.padding=p;}
catch(err){alert('Invalid value in parameter if_padding\r\nErr='+err);}}})();}
V3.Log=function(){throw'Not Supported';};V3.Log.__class=true;V3.Log.Watch=function(name,object,optionalDebugLevel,optionalUnwind){try{if(typeof object=='undefined'){return;}
if(!object||!optionalUnwind||typeof object!='object'){V3.Utils.Console.AddWatch(name,object,optionalDebugLevel);}else{var p;for(p in object){if(typeof object[p]=='function'){V3.Utils.Console.AddWatch(name+'.'+p,"<i>function</i>",optionalDebugLevel);}else{V3.Utils.Console.AddWatch(name+'.'+p,object[p],optionalDebugLevel);}}}}
catch(err){try{V3.Log.Error('Exception thrown from V3.Log.Watch(..)','err',err);}catch(anotherErr){}}};V3.Log.Debug=function(msg,optionalObjectName,optionalObject,optionalUnwind){V3.Utils.Console.WriteDebug(msg);V3.Log.Watch(optionalObjectName,optionalObject,'debug',optionalUnwind);};V3.Log.Info=function(msg,optionalObjectName,optionalObject,optionalUnwind){V3.Utils.Console.WriteInfo(msg);V3.Log.Watch(optionalObjectName,optionalObject,'info',optionalUnwind);};V3.Log.Warn=function(msg,optionalObjectName,optionalObject,optionalUnwind){V3.Utils.Console.WriteWarning(msg);V3.Log.Watch(optionalObjectName,optionalObject,'warn',optionalUnwind);};V3.Log.Error=function(msg,optionalObjectName,optionalObject,optionalUnwind){V3.Utils.Console.WriteError(msg);V3.Log.Watch(optionalObjectName,optionalObject,'error',optionalUnwind);};V3.Utils.hideDebug=function(){};
