 
function DisneyQuickQuote() {

	this.arrAttributes = {
		'curOpenCalendar': -1,			
		'curOpenCalendarBtn': '',		
		'fAfterInit': '',				
		'qqCalendarPadding': 10,		
		'qqCalendars': Array(),			
		'qqElement': 'DisneyQuickQuote',	
		'qqTravelMinLength': Array(),	
		'qqWidth': 220		
	};

	this.arrSupport = [
		'SQQTravelDates',
		'SQQPartyMix',
		'SQQDropDownMulti',
		'SQQDropDown',
		'SQQTextBox',
		'SQQGrouping',
		'SQQBusinessUnit',
		'SQQProductOption'
	];
	
	this.objData = null; 
	this.autoCompleteObj = new Array(); 
}
 
DisneyQuickQuote.AutoComplete = function(strParent, aStr, oText, oDiv){

	this.parent = strParent;
	this.oText = oText;
	this.oDiv = oDiv;
	this.arr = aStr;
	this.arSaved=[];   
	this.curCount=0;
	this.selectedIndex = -1;

	oText.AutoComplete = this;
	oText.onkeyup = DisneyQuickQuote.AutoComplete.prototype.onKeyUp;
	oText.onblur = DisneyQuickQuote.AutoComplete.prototype.onTextBlur;
};
DisneyQuickQuote.AutoComplete.prototype.onKeyUp = function(e){
	var code;
	var prev = -1;
	if(!e){
		var e = window.event
	}	
	code = e.keyCode;

	switch(code){
		case(37):

			break;
		case(39):

			break;
		case(38):

			if(this.AutoComplete.oDiv.style.visibility == 'visible'){
				if(this.AutoComplete.oDiv.hasChildNodes()){
					var children = this.AutoComplete.oDiv.childNodes;
					if(this.AutoComplete.selectedIndex < 0 || this.AutoComplete.selectedIndex >= children.length){
						this.AutoComplete.selectedIndex = children.length-1;
					}
					else if(this.AutoComplete.selectedIndex == 0){
						prev = this.AutoComplete.selectedIndex;
						this.AutoComplete.selectedIndex = children.length-1;
					}
					else{
						prev = this.AutoComplete.selectedIndex;
						this.AutoComplete.selectedIndex -= 1;
					}
					children.item(this.AutoComplete.selectedIndex).className = "AutoCompleteHighlight";
					if(prev > -1){
						children.item(prev).className ='AutoCompleteBackground';
					}
					this.AutoComplete.oText.value = children.item(this.AutoComplete.selectedIndex).innerHTML;
				}
			}
			break;
		case(40):

			if(this.AutoComplete.oDiv.style.visibility == 'visible'){
				if(this.AutoComplete.oDiv.hasChildNodes()){

					var children = this.AutoComplete.oDiv.childNodes;
					if(this.AutoComplete.selectedIndex < 0 || this.AutoComplete.selectedIndex >= children.length){
						this.AutoComplete.selectedIndex = 0;
					}
					else if(this.AutoComplete.selectedIndex == children.length-1){
						prev = this.AutoComplete.selectedIndex;
						this.AutoComplete.selectedIndex = 0;
					}
					else{
						prev = this.AutoComplete.selectedIndex;
						this.AutoComplete.selectedIndex += 1;
					}
					children.item(this.AutoComplete.selectedIndex).className = "AutoCompleteHighlight";
					if(prev > -1){
						children.item(prev).className ='AutoCompleteBackground';
					}
					this.AutoComplete.oText.value = children.item(this.AutoComplete.selectedIndex).innerHTML;
				}
			}
			break;
		default:
			this.AutoComplete.getMatches();
			this.AutoComplete.selectedIndex = -1;

			break;
	}
}

DisneyQuickQuote.AutoComplete.prototype.verify = function(txt){
	var subArr;
	var len = txt.length;

	if(txt){
		subArr = this.arSaved[len-1];
		if(subArr){
			if(subArr.length > 0){
				bool = false;
				for(i = 0; i < subArr.length; i++){				
					var strTemp = this.arr[subArr[i]];
					if(strTemp.substring(0, len).toLowerCase() != txt.toLowerCase()){
						bool = true;
						break;
					}
				}
				if(bool){
					if(this.arSaved[txt.length-1].length > 0){
						this.arSaved[txt.length-1] = [];
						this.curCount = this.curCount - 1;
					}
					if(len > 0){
						this.verify(txt.substring(0, len-1));
					}
				}
			}
		}
	}
};

DisneyQuickQuote.AutoComplete.prototype.addArr = function(str, subArray){
	var arr=[];
	if(str){
		if(subArray){
			if(subArray.length != 0){
				for(i = 0; i < subArray.length; i++){
					if(str.toLowerCase() == this.arr[subArray[i]].substring(0, str.length).toLowerCase()){
						arr[arr.length] = subArray[i];
					}
				}
			}			
		}
		else{
			if(this.arSaved.length == 1){
				for(i = 0; i < this.arr.length; i++){
					if(str.toLowerCase() == this.arr[i].substring(0, str.length).toLowerCase()){
						arr[arr.length] = i;
					}
				}		
			}
		}		
		if(arr.length > 0){
			this.curCount = this.curCount + 1;
		}
		this.arSaved[str.length-1] = arr;
	}
};

DisneyQuickQuote.AutoComplete.prototype.getMatches = function(){
	var txt = this.oText.value;
	var array = this.arr;

	if(txt.length == 0){
		this.arSaved = [];
		this.curCount = 0;
	}

	else if(this.arSaved.length == 0){
		var subArray = [];
		for(i = 0; i < array.length; i++){
			if(txt.toLowerCase() == array[i].substring(0, txt.length).toLowerCase()){
				subArray[subArray.length] = i;
			}
		}
		if(subArray.length != 0){
			this.curCount+=1;
		}
		this.arSaved[this.arSaved.length] = subArray;
	}

	else{
		if(this.arSaved.length > txt.length){

			this.arSaved.splice(txt.length, this.arSaved.length - txt.length);

			if(this.curCount > txt.length){
				this.curCount = txt.length;
			}
		}
		
		this.verify(txt.substring(0, this.arSaved.length));
		
		if(this.curCount == 0 && this.arSaved[0].length == 0){
			this.arSaved.splice(1,this.arSaved.length-1);
		}

		var len = this.curCount;
		for(k = len;  k < txt.length; k++){
			this.addArr(txt.substring(0,k+1), this.arSaved[k-1]);
		}
	}

	while(this.oDiv.hasChildNodes()){
		this.oDiv.removeChild(this.oDiv.firstChild);
	}

	if(this.arSaved.length > 0){
		var lastArray = this.arSaved[this.arSaved.length-1];
		
		if(lastArray && lastArray.length > 0){
			for(i = 0; i < lastArray.length; i++){
				var oDiv = document.createElement('div');
				this.oDiv.appendChild(oDiv);
				oDiv.innerHTML = this.arr[lastArray[i]];
				oDiv.onmousedown = DisneyQuickQuote.AutoComplete.prototype.onDivMouseDown;
				oDiv.onmouseover = DisneyQuickQuote.AutoComplete.prototype.onDivMouseOver;
				oDiv.onmouseout = DisneyQuickQuote.AutoComplete.prototype.onDivMouseOut;
				oDiv.AutoComplete = this;

			}
			this.oDiv.style.visibility = "visible";
			this.oText.className = '';
			this.oText.setAttribute("autoMatch",true);

		}
		else{
			this.oDiv.style.visibility = "hidden";
			this.oText.className = 'redFlag';
			this.oText.setAttribute("autoMatch", false);
		}
	}

};

DisneyQuickQuote.AutoComplete.prototype.onblur = function()
{
	this.oDiv.style.visibility = "hidden";

	this.oText.value = this.oText.value.replace(/^\s+|\s+$/g,"");
	this.selectedIndex = -1;
	
	var textID =  this.oText.id;
	textID = textID.substring(0, textID.lastIndexOf("_Text"));
	var selId = this.parent + '_'+ textID;
	
	var selEl  = document.getElementById(selId);
	if(selEl){
		selEl.selectedIndex = -1;

		for(var i = 0; i < this.arr.length; i++){
			var strTemp = selEl.options[i].text;
			if(strTemp.toLowerCase() == this.oText.value.toLowerCase()){
				selEl.selectedIndex = i;
			}
		}
	}
	
	if(this.oText.value.length > 0){
		var bool = false;
		for(var i = 0; i < this.arr.length; i++){
			if(this.oText.value.toLowerCase() == this.arr[i].toLowerCase()){
				bool = true;
			}
		}
		if(bool == false){
				this.oText.className = 'redFlag';
				this.oText.setAttribute("autoMatch", false);
		}
	}
	else{
			this.oText.className = '';
			this.oText.setAttribute("autoMatch", true);
	}
};

DisneyQuickQuote.AutoComplete.prototype.onDivMouseDown = function()
{
	this.AutoComplete.oText.value = this.innerHTML;
};

DisneyQuickQuote.AutoComplete.prototype.onDivMouseOver = function()
{
	if(this.AutoComplete.oDiv.hasChildNodes()){
		var children = this.AutoComplete.oDiv.childNodes;
		for(var i = 0; i < children.length; i++){		
			var child = children.item(i);
			if( child == this){
				this.AutoComplete.selectedIndex = i;
				child.className ='AutoCompleteHighlight';
			}
			else{
				child.className ='AutoCompleteBackground';
			}
		}
	}
};

DisneyQuickQuote.AutoComplete.prototype.onDivMouseOut = function()
{
	this.className = "AutoCompleteBackground";
};

DisneyQuickQuote.AutoComplete.prototype.onTextBlur = function()
{
	this.AutoComplete.onblur();
};

DisneyQuickQuote.prototype.setResetTag = function (){

	var objGroups = this.objData.Groups["Custom Reset Elements"];
	if (objGroups != null){
		if(objGroups.length != 0){

			for (i = 0; i < objGroups.length; i++){
				var that = this;
				var elSelector="";
				var elTarget="";

				var elementsID = objGroups[i].l.split(':');
				var action = objGroups[i].d;

				elSelector = document.getElementById(elementsID[0]);
				elTarget = document.getElementById(elementsID[1]);

				if(elSelector && elTarget){
				
					if(action=="change"){
						if(!elSelector.onChangeFlag){
							elSelector.onChangeFlag = elementsID[1];
						}
						else{
							elSelector.onChangeFlag = elSelector.onChangeFlag + "," + elementsID[1];
						}
						this._handleResetElementToDefault(elSelector, action);
					}
				}
			}
		}
	}
};

DisneyQuickQuote.prototype._handleResetElementToDefault = function(el, action){
	var that = this;
	this.addEvent(el, action, function(){that.resetElementToDefault(el, action)}, false);
};

DisneyQuickQuote.prototype.resetElementToDefault = function (el, action){
  if(el){
	switch (action){
	    case ("change"):
		if(el.onChangeFlag){
		    var arr = el.onChangeFlag.split(',');
		    for(i = 0; i < arr.length; i++){
		        var resetEl = document.getElementById(arr[i]);
			if(resetEl){

			    switch(resetEl.type){
				case "text":
				    resetEl.value="";
				    resetEl.setAttribute('autoMatch','true');
				    resetEl.className='';
				    break;
				case "select-one":
				    resetEl.selectedIndex = 0;
				    break;
				default:

				    break;
			    }
			}
		    }
		}
	    break;
	    case ("click"):
		break;
	    default:
		break;
	}
  }
};

DisneyQuickQuote.prototype.loopElementsWithCallback = function( nodeElements, funcCallback ) {
	if ( !nodeElements || !funcCallback ) {
		return false;
	}
	if ( typeof( nodeElements ) === 'object') {
		var intLength = ( nodeElements.length - 1 );
		
		if ( intLength < 0 ) {
			return false;
		}
		
		do {
			funcCallback( nodeElements[intLength] );
		} while ( intLength-- );
	} else {
		nodeElements = Array.prototype.slice.call( nodeElements );
		
		while ( nodeElements.length > 0 ) {
			funcCallback( nodeElements.pop() );
		}
	}
	
	return true;
};

DisneyQuickQuote.prototype.displayError = function( strMessage ) {
	document.getElementById( 'qqPleaseWaitLabel' ).innerHTML = strMessage;
	document.getElementById( this.arrAttributes.qqElement ).style.display = 'none';
	document.getElementById( 'qqPleaseWait' ).style.display = 'block';
	return false;
};

DisneyQuickQuote.prototype.displaySubmitError = function( strElement, strMessage ) {
	this.displayMessage( strMessage, this.objData.Prop.errors.strHead, this.objData.Prop.errors.strCloseLabel );
	
	return false;
};

DisneyQuickQuote.prototype.displayMessage = function( strMessage, strTitle, strClose, bHideInnerBox ) {
	var nodeQQ = document.getElementById( this.arrAttributes.qqElement );
	var nodeWarn = document.getElementById( 'qqWarning' );
	if ( typeof( document.body.style.maxHeight ) == 'undefined' ) {
		this.loopElementsWithCallback( nodeQQ.getElementsByTagName( 'select' ), function( node ) {
			node.style.visibility = 'hidden';
		} );
	}
	
	if ( !nodeWarn ) {
		var that = this;
		nodeWarn = document.createElement( 'div' );
		nodeWarn.id = 'qqWarning';
		nodeWarn.style.display = 'block';
		
		var nodeBg = nodeWarn.appendChild( document.createElement( 'div' ) );
		nodeBg.className = 'qqWarningBackground';
		nodeBg.id = 'qqWarningBackground';
		nodeBg = undefined;
		
		var nodeContainer = nodeWarn.appendChild( document.createElement( 'div' ) );
		nodeContainer.className = 'qqWarningContainer';
		nodeContainer.id = 'qqWarningContainer';
		
		if ( document.all ) {
			nodeContainer.style.position = 'relative';
		}
		
		var nodeBox = nodeContainer.appendChild( document.createElement( 'div' ) );
		nodeBox.className = 'qqWarningBox';
		nodeContainer = undefined;
		
		var nodeText = nodeBox.appendChild( document.createElement( 'div' ) );
		nodeText.id = 'qqWarningTitle';
		nodeText.innerHTML = '&nbsp;';
		nodeText = undefined;
		
		nodeText = nodeBox.appendChild( document.createElement( 'div' ) );
		nodeText.id = 'qqWarningMessage';
		nodeText.innerHTML = '&nbsp;';
		nodeText = undefined;
		
		nodeText = nodeBox.appendChild( document.createElement( 'div' ) );
		nodeText.id = 'qqWarningClose';
		nodeText.innerHTML = 'Close';
		this.addEvent( nodeText, 'click', function() { that.hidePopup( 'qqWarning', 'click' ); }, false );
		nodeText = undefined;
		
		nodeBox = undefined;
		nodeQQ.appendChild( nodeWarn );
	} else {
		nodeWarn.style.display = 'block';
	}
	
	if ( bHideInnerBox ) {
		document.getElementById( 'qqWarningContainer' ).style.visibility = 'hidden';
	} else {
		document.getElementById( 'qqWarningContainer' ).style.visibility = 'visible';
	}
	document.getElementById( 'qqWarningTitle' ).innerHTML = strTitle;
	document.getElementById( 'qqWarningMessage' ).innerHTML = strMessage;
	document.getElementById( 'qqWarningClose' ).innerHTML = strClose;
	
	if ( document.all ) {
		if ( typeof( document.body.style.maxHeight )== 'undefined' ) {
			nodeWarn.style.display = 'block';
			nodeWarn.style.height = document.getElementById( this.arrAttributes.qqElement ).offsetHeight + 'px';
			document.getElementById( 'qqWarningBackground' ).style.height = nodeWarn.offsetHeight + 'px';
			document.getElementById( 'qqWarningBackground' ).style.width = nodeWarn.offsetWidth + 'px';
		}
		
		nodeWarn.style.display = 'block';
		document.getElementById( 'qqWarningContainer' ).style.top = ( Math.floor( nodeWarn.offsetHeight / 2 ) - Math.floor( document.getElementById( 'qqWarningContainer' ).offsetHeight / 2 ) ) + 'px';
	} else {
		nodeWarn.style.display = 'block';
	}
};

DisneyQuickQuote.prototype.startOnload = function() {
	if ( !this.arrAttributes.qqElement ) {
		return this.displayError( 'Unable to find the Disney Quick Quote placeholder.' );
	}

	this.displayPleaseWait( true );

	that = this;

	setTimeout( 'that.execute();', 1 );
	
	return true;
};

DisneyQuickQuote.prototype.execute = function() {
	that = undefined;
	
	this.requestPage();
	this.requestBusinessRules();

	if ( this.objData && this.objData.Prop ) {

		this.processBusinessRules();
		this.setResetTag();
	} else {
		return this.displayError( 'Unable to find the Disney Quick Quote object data.' );
	}
	
	if ( typeof( this.arrAttributes.fAfterInit ) == 'function' ) {
		this.arrAttributes.fAfterInit();
	}
	
	this.displayPleaseWait( false );
	
	return true;
};


DisneyQuickQuote.prototype.displayPleaseWait = function( bDisplay ) {
	var nodeQQ = document.getElementById( this.arrAttributes.qqElement );
	var nodePleaseWait = document.getElementById( 'qqPleaseWait' );

	if ( !nodeQQ ) {
		nodeQQ = document.createElement( 'div' );
		nodeQQ.id = this.arrAttributes.qqElement;
		
		document.body.appendChild( nodeQQ );
	}
	
	if ( bDisplay ) {

		if ( nodePleaseWait ) {
			nodeQQ.style.display = 'none';
			nodePleaseWait.style.display = 'block';
		} else {
			nodePleaseWait = document.createElement( 'div' );
			nodePleaseWait.id = 'qqPleaseWait';

			if ( this.arrAttributes.qqWidth && this.arrAttributes.qqWidth > 0 ) {
				nodePleaseWait.style.width = this.arrAttributes.qqWidth + 'px';
				nodeQQ.style.width = this.arrAttributes.qqWidth + 'px';
			}
			
			nodePleaseWait.style.display = 'block';
			
			var nodeContainer = nodePleaseWait.appendChild( document.createElement( 'div' ) );
			nodeContainer.className = 'qqPleaseWaitContainer';
			
			var nodeText = nodeContainer.appendChild( document.createElement( 'p' ) );
			nodeText.className = 'qqPleaseWaitLabel';
			nodeText.id = 'qqPleaseWaitLabel';
			nodeText.innerHTML = 'Please wait...';
			
			nodeText = undefined;
			nodeContainer = undefined;
			
			nodeQQ.style.display = 'none';

			nodeQQ.parentNode.insertBefore( nodePleaseWait, nodeQQ );
		}
	} else {
		nodePleaseWait.parentNode.removeChild( nodePleaseWait );
		nodeQQ.style.display = 'block';
	}
	
	nodePleaseWait = undefined;
	nodeQQ = undefined;
	
	return true;
};

DisneyQuickQuote.prototype.requestPage = function() {
	document.getElementById( this.arrAttributes.qqElement ).innerHTML = '<div id="DCL2SQQProperties_BookingGenie_en_US" class="SQQProperties"><div id="DCL_Container" class="SQQBusinessUnit"><div class="SQQBUProductOptions"><form action="#" onsubmit="return false;"><div id="DCL_DCL2CruisesSQQProductOption_InputContainer" class="SQQProductOptionContainer"><div id="DCL_DCL2CruisesSQQProductOption_InputDisplay" class="SQQProductOptionOnContainer"><input type="radio" class="SQQProductOptionInput" name="BusinessType" id="DCL_DCL2CruisesSQQProductOption" value="DCL2Cruises" checked="checked" /><span class="SQQProductOptionInputLabel"><label for="DCL_DCL2CruisesSQQProductOption">Cruise Search</label></span></div></div><div id="DCL_DCL2ReservationSQQProductOption_InputContainer" class="SQQProductOptionContainer"><div id="DCL_DCL2ReservationSQQProductOption_InputDisplay" class="SQQProductOptionOffContainer"><input type="radio" class="SQQProductOptionInput" name="BusinessType" id="DCL_DCL2ReservationSQQProductOption" value="DCL2Reservation" /><span class="SQQProductOptionInputLabel"><label for="DCL_DCL2ReservationSQQProductOption">Get Reservation</label></span></div></div><div class="clearBoth"><!-- --></div></form><div class="clearBoth"><!-- --></div></div><div id="DCL_DCL2CruisesSQQProductOption_Container" class="SQQProductOption"><form action="//disneycruise.disney.go.com/reservations/customize" method="GET" id="DCL_DCL2CruisesSQQProductOption_Form" name="DCL_DCL2CruisesSQQProductOption_Form"><input type="hidden" name="publishedKey" value="DCL2CruisesSQQProductOption_BookingGenie_en_US" /><input type="hidden" name="BusinessType" value="DCL2Cruises" /><input type="hidden" name="BusinessUnit" value="DCL" /><div class="SQQProductOptionTitle"><span class="SQQProductOptionLabel">Cruise Search</span></div><div id="DCL_DCL2CruisesSQQProductOption_DCL2DateSQQDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="dates" id="DCL_DCL2CruisesSQQProductOption_DCL2_Dates" size="1"><option value="">Choose a Date</option><option value="2012-01-01">January 2012</option><option value="2012-02-01">February 2012</option><option value="2012-03-01">March 2012</option><option value="2012-04-01">April 2012</option><option value="2012-05-01">May 2012</option><option value="2012-06-01">June 2012</option><option value="2012-07-01">July 2012</option><option value="2012-08-01">August 2012</option><option value="2012-09-01">September 2012</option><option value="2012-10-01">October 2012</option><option value="2012-11-01">November 2012</option><option value="2012-12-01">December 2012</option><option value="2013-01-01">January 2013</option><option value="2013-02-01">February 2013</option><option value="2013-03-01">March 2013</option><option value="2013-04-01">April 2013</option><option value="2013-05-01">May 2013</option><option value="2013-06-01">June 2013</option><option value="2013-07-01">July 2013</option><option value="2013-08-01">August 2013</option><option value="2013-09-01">September 2013</option><option value="2013-10-01">October 2013</option><option value="2013-11-01">November 2013</option><option value="2013-12-01">December 2013</option></select></div><div id="DCL_DCL2CruisesSQQProductOption_DCL2DestinationSQQDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="destination" id="DCL_DCL2CruisesSQQProductOption_DCL2_Destinations" size="1"><option value="">Choose a Destination</option><option value="ALASKA">Alaska & Pacific Coast</option><option value="BAHAMAS">Bahamas</option><option value="CANADA">Canada & New England Coast</option><option value="CARIBBEAN">Caribbean</option><option value="EUROPE">Europe</option><option value="HAWAII">Hawaii</option><option value="MEXICAN_RIVIERA">Mexican Riviera</option><option value="TRANS_PANAMA_CANAL">Panama Canal</option><option value="TRANS_ATLANTIC">Transatlantic</option></select></div><div id="DCL_DCL2CruisesSQQProductOption_DCL2DeparturePortSQQDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="departurePorts" id="DCL_DCL2CruisesSQQProductOption_DCL2_DeparturePort" size="1"><option value="">Choose a Departure Port</option><option value="BCN">Barcelona, Spain</option><option value="GLS">Galveston, TX</option><option value="LAX">Los Angeles, California</option><option value="MIA">Miami, FL</option><option value="NYC">New York, NY</option><option value="PCV">Port Canaveral, Florida</option><option value="SEA">Seattle, WA</option><option value="VAN">Vancouver, Canada</option></select></div><div id="DCL_DCL2CruisesSQQProductOption_DCL2MoreGuestsSQQFloatingText" class="SQQFloatingText"><div class="SQQFloatingTextContainer"><span class="SQQFloatingTextLabel"><a id="DCL_DCL2CruisesSQQProductOption_DCL2MoreGuestsSQQFloatingText_Link" href="#" class="SQQFloatingTextAnchor">More than 5 Guests?</a></span></div></div><div id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix" class="SQQPartyMix"><div class="SQQPartyMixAdultsContainer"><span class="SQQPartyMixAdultLabel">Adults</span><select class="SQQPartyMixAdultsSelect" name="numberOfAdults" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_numAdults" size="1"><option value="1">1</option><option value="2" selected="selected">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select></div><div class="SQQPartyMixChildrenContainer"><span class="SQQPartyMixChildrenLabel">Children (0-17)</span><select class="SQQPartyMixChildrenSelect" name="numberOfChildren" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_numChildren" size="1"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option></select></div><div class="SQQPartyMixChildAgeContainer" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_childContainer"><div class="SQQPartyMixLabel" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_Label"><span class="SQQPartyMixChildInstructionsLabel">Children\'s Ages at Time of Travel</span></div><div class="SQQPartyMixSelectContainer"><div class="SQQPartyMixChildAgeCount" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_ageContainer1"><span class="SQQPartyMixChildAgeLabel">1</span><select class="SQQPartyMixChildAgeSelect" name="child1" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_child1" size="1"><option value="17" selected="selected">17</option><option value="16">16</option><option value="15">15</option><option value="14">14</option><option value="13">13</option><option value="12">12</option><option value="11">11</option><option value="10">10</option><option value="9">9</option><option value="8">8</option><option value="7">7</option><option value="6">6</option><option value="5">5</option><option value="4">4</option><option value="3">3</option><option value="2">2</option><option value="1">Inf</option></select></div><div class="SQQPartyMixChildAgeCount" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_ageContainer2"><span class="SQQPartyMixChildAgeLabel">2</span><select class="SQQPartyMixChildAgeSelect" name="child2" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_child2" size="1"><option value="17" selected="selected">17</option><option value="16">16</option><option value="15">15</option><option value="14">14</option><option value="13">13</option><option value="12">12</option><option value="11">11</option><option value="10">10</option><option value="9">9</option><option value="8">8</option><option value="7">7</option><option value="6">6</option><option value="5">5</option><option value="4">4</option><option value="3">3</option><option value="2">2</option><option value="1">Inf</option></select></div><div class="SQQPartyMixChildAgeCount" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_ageContainer3"><span class="SQQPartyMixChildAgeLabel">3</span><select class="SQQPartyMixChildAgeSelect" name="child3" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_child3" size="1"><option value="17" selected="selected">17</option><option value="16">16</option><option value="15">15</option><option value="14">14</option><option value="13">13</option><option value="12">12</option><option value="11">11</option><option value="10">10</option><option value="9">9</option><option value="8">8</option><option value="7">7</option><option value="6">6</option><option value="5">5</option><option value="4">4</option><option value="3">3</option><option value="2">2</option><option value="1">Inf</option></select></div><div class="SQQPartyMixChildAgeCount" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_ageContainer4"><span class="SQQPartyMixChildAgeLabel">4</span><select class="SQQPartyMixChildAgeSelect" name="child4" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_child4" size="1"><option value="17" selected="selected">17</option><option value="16">16</option><option value="15">15</option><option value="14">14</option><option value="13">13</option><option value="12">12</option><option value="11">11</option><option value="10">10</option><option value="9">9</option><option value="8">8</option><option value="7">7</option><option value="6">6</option><option value="5">5</option><option value="4">4</option><option value="3">3</option><option value="2">2</option><option value="1">Inf</option></select></div><div class="clearBoth"><!-- --></div></div><div class="SQQPartyMixDisclaimer" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_disclaimer"><a href="#" class="SQQPartyMixDisclaimerLink" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_disclaimerLink">Why is this required?</a></div><div class="SQQPartyMixAlert" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_disclaimerAlert"><span class="SQQPartyMixAlertHead" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_disclaimerHead">Why is this required?</span><p class="SQQPartyMixAlertBody" id="DCL_DCL2CruisesSQQProductOption_DCL2SQQPartyMix_disclaimerBody">We require the ages of all children in your group because ticket package prices are calculated based on this information.</p></div></div><div class="clearBoth"><!-- --></div></div><div id="DCL_DCL2CruisesSQQProductOption_DCLCruisesSQQCurrencyDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="currencyCode" id="DCL_DCL2CruisesSQQProductOption_DCLCurrencies" size="1"><option value="USD">US Dollars (USD)</option><option value="GBP">GB Pounds (GBP)</option><option value="EUR">Euros (EUR)</option></select></div><div class="SQQProductOptionSubmitContainer"><input type="button" name="inputSubmit" class="SQQProductOptionInputSubmit" id="DCL_DCL2CruisesSQQProductOption_Submit" value=" " /></div><div class="clearBoth"><!-- --></div></form><div class="SQQProductOptionsDisclaimerContainer" id="DCL_DCL2CruisesSQQProductOption_Disclaimer"><span id="DclQqDisclaimerDefault">Book online, call (800) 951-3532 or contact your travel agent.</span>\n<span id="DclQqDisclaimerUK" style="display: none;">Book online, call 0800 028 3179 or contact your travel agent.</span>\n<span id="DclQqDisclaimerAccessibleRoomsLink"><a href="/reservations/booking">Need an accessible stateroom?</a></span></div></div><div id="DCL_DCL2ReservationSQQProductOption_Container" class="SQQProductOption"><form action="https://disneycruise.disney.go.com/planning-center/dashboard/?webBindCommandName=landingForm&_eventId_SubmitLoginRetrieveReservation=SubmitLoginRetrieveReservation&stillShopping=false&decode=false&clearPreviousReservation=true" method="POST" id="DCL_DCL2ReservationSQQProductOption_Form" name="DCL_DCL2ReservationSQQProductOption_Form"><input type="hidden" name="publishedKey" value="DCL2ReservationSQQProductOption_BookingGenie_en_US" /><input type="hidden" name="webBindCommandName" value="landingForm" /><input type="hidden" name="_eventId_SubmitLoginRetrieveReservation" value="SubmitLoginRetrieveReservation" /><input type="hidden" name="stillShopping" value="false" /><input type="hidden" name="decode" value="false" /><input type="hidden" name="clearPreviousReservation" value="true" /><input type="hidden" name="BusinessType" value="DCL2Reservation" /><input type="hidden" name="BusinessUnit" value="DCL" /><div class="SQQProductOptionTitle"><span class="SQQProductOptionLabel">Get Reservation</span></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationNotLoggedInSQQGrouping" class="SQQGrouping SQQGroupingDisplay"><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationNotLoggedInSQQGrouping_Group" class="SQQGroupingContainer"><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationNotLoggedInHeaderSQQFloatingText" class="SQQFloatingText"><div class="SQQFloatingTextContainer"><span class="SQQFloatingTextLabel">Please provide the information requested. Your reservation number and birth date are required for security purposes.</span></div></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationEmailSQQTextBox" class="SQQTextBox"><div class="SQQTextBoxInputContainer"><span id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationEmailSQQTextBox_Overlay" class="SQQTextBoxOverlayLabel">Email Address or Member Name</span><input type="text" class="SQQTextBoxInput" name="userName" id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationEmailSQQTextBox_Text" /></div></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationPasswordSQQTextBox" class="SQQTextBox"><div class="SQQTextBoxInputContainer"><span id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationPasswordSQQTextBox_Overlay" class="SQQTextBoxOverlayLabel">Password</span><input type="password" class="SQQTextBoxInput" name="gspw" id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationPasswordSQQTextBox_Text" /></div></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationForgotPasswordSQQFloatingText" class="SQQFloatingText"><div class="SQQFloatingTextContainer"><span class="SQQFloatingTextLabel"><a id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationForgotPasswordSQQFloatingText_Link" href="http://www.disneycruise.disney.go.com/forgot-password/" class="SQQFloatingTextAnchor">Forgot your password? >></a></span></div></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationNotLoggedInNumberSQQTextBox" class="SQQTextBox"><div class="SQQTextBoxInputContainer"><span id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationNotLoggedInNumberSQQTextBox_Overlay" class="SQQTextBoxOverlayLabel">Reservation Number</span><input type="text" class="SQQTextBoxInput" name="reservationNumber" id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationNotLoggedInNumberSQQTextBox_Text" /></div></div><div class="clearBoth"><!-- --></div></div></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationBirthDateSQQFloatingText" class="SQQFloatingText"><div class="SQQFloatingTextContainer"><span class="SQQFloatingTextLabel">Date of Birth</span></div></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationMonthSQQDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="birthdayMonth" id="DCL_DCL2ReservationSQQProductOption_BirthDateMonth" size="1"><option value="">Month</option><option value="1">January</option><option value="2">February</option><option value="3">March</option><option value="4">April</option><option value="5">May</option><option value="6">June</option><option value="7">July</option><option value="8">August</option><option value="9">September</option><option value="10">October</option><option value="11">November</option><option value="12">December</option></select></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationDaySQQDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="birthdayDay" id="DCL_DCL2ReservationSQQProductOption_BirthDateDay" size="1"><option value="">Day</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select></div><div id="DCL_DCL2ReservationSQQProductOption_DCL2ReservationYearSQQDropDown" class="SQQDropDown"><select class="SQQDropDownSelect" name="birthdayYear" id="DCL_DCL2ReservationSQQProductOption_BirthDateYear" size="1"><option value="">Year</option><option value="1900">1900</option><option value="1901">1901</option><option value="1902">1902</option><option value="1903">1903</option><option value="1904">1904</option><option value="1905">1905</option><option value="1906">1906</option><option value="1907">1907</option><option value="1908">1908</option><option value="1909">1909</option><option value="1910">1910</option><option value="1911">1911</option><option value="1912">1912</option><option value="1913">1913</option><option value="1914">1914</option><option value="1915">1915</option><option value="1916">1916</option><option value="1917">1917</option><option value="1918">1918</option><option value="1919">1919</option><option value="1920">1920</option><option value="1921">1921</option><option value="1922">1922</option><option value="1923">1923</option><option value="1924">1924</option><option value="1925">1925</option><option value="1926">1926</option><option value="1927">1927</option><option value="1928">1928</option><option value="1929">1929</option><option value="1930">1930</option><option value="1931">1931</option><option value="1932">1932</option><option value="1933">1933</option><option value="1934">1934</option><option value="1935">1935</option><option value="1936">1936</option><option value="1937">1937</option><option value="1938">1938</option><option value="1939">1939</option><option value="1940">1940</option><option value="1941">1941</option><option value="1942">1942</option><option value="1943">1943</option><option value="1944">1944</option><option value="1945">1945</option><option value="1946">1946</option><option value="1947">1947</option><option value="1948">1948</option><option value="1949">1949</option><option value="1950">1950</option><option value="1951">1951</option><option value="1952">1952</option><option value="1953">1953</option><option value="1954">1954</option><option value="1955">1955</option><option value="1956">1956</option><option value="1957">1957</option><option value="1958">1958</option><option value="1959">1959</option><option value="1960">1960</option><option value="1961">1961</option><option value="1962">1962</option><option value="1963">1963</option><option value="1964">1964</option><option value="1965">1965</option><option value="1966">1966</option><option value="1967">1967</option><option value="1968">1968</option><option value="1969">1969</option><option value="1970">1970</option><option value="1971">1971</option><option value="1972">1972</option><option value="1973">1973</option><option value="1974">1974</option><option value="1975">1975</option><option value="1976">1976</option><option value="1977">1977</option><option value="1978">1978</option><option value="1979">1979</option><option value="1980">1980</option><option value="1981">1981</option><option value="1982">1982</option><option value="1983">1983</option><option value="1984">1984</option><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option></select></div><div class="SQQProductOptionSubmitContainer"><input type="button" name="inputSubmit" class="SQQProductOptionInputSubmit" id="DCL_DCL2ReservationSQQProductOption_Submit" value=" " /></div><div class="clearBoth"><!-- --></div></form><div class="SQQProductOptionsDisclaimerContainer" id="DCL_DCL2ReservationSQQProductOption_Disclaimer"><span id="DclQqDisclaimerDefault">Book online, call (800) 951-3532 or contact your travel agent.</span>\n<span id="DclQqDisclaimerUK" style="display: none;">Book online, call 0800 028 3179 or contact your travel agent.</span>\n<span id="DclQqDisclaimerAccessibleRoomsLink"><a href="/reservations/booking">Need an accessible stateroom?</a></span></div></div></div><div class="SQQBusinessUnitBottom"><!-- --></div></div>';
	
	return true;
};

DisneyQuickQuote.prototype.requestBusinessRules = function() {
	
	try {
		this.objData = eval( '({"Prop":{"name":"DCL2SQQProperties_BookingGenie_en_US","nextGenAnalytics":true,"listAllErrors":true,"timezone":"America/Los_Angeles","monthLabels":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"errors":{"strTooManyGuests":"Sorry, you can only book a maximum of [N] guests. For parties greater than [N], you will be able to select a 2nd stateroom for more guests further into your booking.","strArriveAfterDepart":"The check-in date you selected is after your check-out date. Please select a different date(s).","strArriveIsAfterMaxDate":"Currently, <b>Walt Disney World</b>® Resort reservations are only available for check-in dates up to and including December 31, 2012. Please modify your travel dates accordingly.","strArriveIsBeforeAllowable":"Arrival date is before the first allowable booking day, please select a later arrival date.","strCloseLabel":"OK","strHead":"Warning","strStayTooLong":"Sorry, this package must be booked for a maximum stay of [N] nights. Please adjust your vacation dates.","strStayTooShort":"Sorry, this package must be booked for a minimum stay of at least [N] nights. Please adjust your vacation dates."},"BU":[{"value":"DCL","name":"DCL2SQQBusinessUnit","PO":[{"name":"DCL2CruisesSQQProductOption","trackingLinkId":"DCLQQModSubmit_link","value":"DCL2Cruises","SQQDropDown":[{"name":"DCL2DateSQQDropDown","dependency":"Filter:DCL2_CruiseFilter","autocomplete":"false","isRequired":true,"requiredError":"Please choose a date.","htmlObjectName":"dates","xmlPointer":"DCL2_Dates"},{"name":"DCL2DestinationSQQDropDown","dependency":"Filter:DCL2_CruiseFilter","autocomplete":"false","isRequired":true,"requiredError":"Please choose a destination.","htmlObjectName":"destination","xmlPointer":"DCL2_Destinations"},{"name":"DCL2DeparturePortSQQDropDown","dependency":"Filter:DCL2_CruiseFilter","autocomplete":"false","isRequired":false,"htmlObjectName":"departurePorts","xmlPointer":"DCL2_DeparturePort"},{"name":"DCLCruisesSQQCurrencyDropDown","autocomplete":"false","isRequired":false,"htmlObjectName":"currencyCode","xmlPointer":"DCLCurrencies"}],"SQQPartyMix":{"name":"DCL2SQQPartyMix","maxGuests":5}},{"name":"DCL2ReservationSQQProductOption","trackingLinkId":"DCLQQModSubmit_link","value":"DCL2Reservation","SQQTextBox":[{"name":"DCL2ReservationEmailSQQTextBox","htmlObjectName":"userName","isRequired":true,"requiredError":"You must specify an email address or member name to continue.","overlayLabel":"Email Address or Member Name"},{"name":"DCL2ReservationPasswordSQQTextBox","htmlObjectName":"gspw","isRequired":true,"requiredError":"You must type in your password to continue.","overlayLabel":"Password"},{"name":"DCL2ReservationNotLoggedInNumberSQQTextBox","htmlObjectName":"reservationNumber","isRequired":true,"requiredError":"You must specify your reservation number to continue.","overlayLabel":"Reservation Number"}],"SQQDropDown":[{"name":"DCL2ReservationMonthSQQDropDown","autocomplete":"false","isRequired":true,"requiredError":"You must select the month of your birth date.","htmlObjectName":"birthdayMonth","xmlPointer":"BirthDateMonth"},{"name":"DCL2ReservationDaySQQDropDown","autocomplete":"false","isRequired":true,"requiredError":"You must select the day of your birth date.","htmlObjectName":"birthdayDay","xmlPointer":"BirthDateDay"},{"name":"DCL2ReservationYearSQQDropDown","autocomplete":"false","isRequired":true,"requiredError":"You must select the year of your birth date.","htmlObjectName":"birthdayYear","xmlPointer":"BirthDateYear"}],"SQQGrouping":["DCL2ReservationNotLoggedInSQQGrouping"]}]}]},"OptInfo":{},"Filters":{"DCL2_CruiseFilter":{ids:["DCL2_Destinations","DCL2_Dates","DCL2_DeparturePort"],fields:["destination","dates","departurePorts"],values:{"destination":["BAHAMAS","TRANS_ATLANTIC","CARIBBEAN","CANADA","EUROPE","MEXICAN_RIVIERA","HAWAII","ALASKA","TRANS_PANAMA_CANAL"],"dates":["2012-01-01","2012-02-01","2012-03-01","2012-04-01","2012-05-01","2012-06-01","2012-07-01","2012-08-01","2012-09-01","2012-10-01","2012-11-01","2012-12-01","2013-01-01","2013-02-01","2013-03-01","2013-04-01","2013-05-01","2013-06-01","2013-07-01","2013-08-01","2013-09-01","2013-10-01","2013-11-01","2013-12-01"],"departurePorts":["PCV","NYC","MIA","BRV","GLS","BCN","LAX","VAN","SEA"]},catalog:[[0,0,0],[0,1,0],[0,2,0],[0,2,0],[0,3,0],[0,3,0],[0,4,0],[0,4,0],[0,4,1],[0,5,0],[0,5,0],[0,5,1],[0,6,0],[0,6,0],[0,6,1],[0,7,0],[0,7,0],[0,7,1],[0,8,0],[0,8,1],[0,9,0],[0,10,0],[0,11,0],[0,11,0],[0,12,0],[0,12,2],[0,13,0],[0,13,2],[0,14,0],[0,14,2],[0,15,0],[0,15,2],[0,16,0],[0,16,2],[0,17,0],[0,18,0],[0,19,0],[0,20,0],[0,21,0],[0,22,0],[0,23,0],[1,1,3],[1,16,4],[2,2,0],[2,3,0],[2,4,0],[2,5,0],[2,6,0],[2,7,0],[2,8,0],[2,8,4],[2,9,0],[2,9,4],[2,10,0],[2,10,4],[2,11,0],[2,11,4],[2,11,2],[2,11,4],[2,12,0],[2,12,4],[2,12,2],[2,12,4],[2,13,0],[2,13,4],[2,13,2],[2,13,4],[2,14,0],[2,14,4],[2,14,2],[2,14,4],[2,15,0],[2,15,4],[2,15,2],[2,15,4],[2,16,0],[2,16,4],[2,16,4],[2,17,0],[2,18,0],[2,19,0],[2,20,0],[2,21,0],[2,22,0],[2,23,0],[2,1,0],[3,5,1],[3,5,1],[3,6,1],[3,6,1],[3,7,1],[3,7,1],[3,8,1],[4,17,5],[4,17,5],[4,18,5],[4,18,5],[4,19,5],[4,19,5],[5,0,6],[5,1,6],[5,2,6],[5,3,6],[5,9,6],[5,10,6],[5,11,6],[6,3,6],[6,9,6],[7,4,6],[7,4,7],[7,4,8],[7,5,8],[7,6,8],[7,7,8],[7,8,8],[7,8,7],[7,8,6],[7,9,6],[7,16,6],[7,16,7],[7,17,7],[7,18,7],[7,19,7],[7,20,7],[8,11,6],[8,16,2]]}},"Groups":{"BirthDateMonth":[{l:"Month"},{l:"January",d:"1"},{l:"February",d:"2"},{l:"March",d:"3"},{l:"April",d:"4"},{l:"May",d:"5"},{l:"June",d:"6"},{l:"July",d:"7"},{l:"August",d:"8"},{l:"September",d:"9"},{l:"October",d:"10"},{l:"November",d:"11"},{l:"December",d:"12"}],"DCLCurrencies":[{l:"US Dollars (USD)",d:"USD"},{l:"GB Pounds (GBP)",d:"GBP"},{l:"Euros (EUR)",d:"EUR"}],"DCLShip":[{l:"Ship"}],"DCLDates":[{l:"Choose a Date"}],"BirthDateDay":[{l:"Day"},{l:"1",d:"1"},{l:"2",d:"2"},{l:"3",d:"3"},{l:"4",d:"4"},{l:"5",d:"5"},{l:"6",d:"6"},{l:"7",d:"7"},{l:"8",d:"8"},{l:"9",d:"9"},{l:"10",d:"10"},{l:"11",d:"11"},{l:"12",d:"12"},{l:"13",d:"13"},{l:"14",d:"14"},{l:"15",d:"15"},{l:"16",d:"16"},{l:"17",d:"17"},{l:"18",d:"18"},{l:"19",d:"19"},{l:"20",d:"20"},{l:"21",d:"21"},{l:"22",d:"22"},{l:"23",d:"23"},{l:"24",d:"24"},{l:"25",d:"25"},{l:"26",d:"26"},{l:"27",d:"27"},{l:"28",d:"28"},{l:"29",d:"29"},{l:"30",d:"30"},{l:"31",d:"31"}],"DCL2Data":[{l:"Disney Magic",d:"DM"},{l:"Disney Wonder",d:"DW"},{l:"Disney Dream",d:"DD"},{l:"Caribbean",d:"CARIBBEAN"},{l:"Transatlantic",d:"TRANS_ATLANTIC"},{l:"Europe",d:"EUROPE"},{l:"Bahamas",d:"BAHAMAS"},{l:"Alaska &amp; Pacific Coast",d:"ALASKA"},{l:"Mexican Riviera",d:"MEXICAN_RIVIERA"},{l:"Panama Canal",d:"TRANS_PANAMA_CANAL"},{l:"Hawaii",d:"HAWAII"},{l:"Canada &amp; New England Coast",d:"CANADA"},{l:"Port Canaveral, Florida",d:"PCV"},{l:"Barcelona, Spain",d:"BCN"},{l:"Dover, England",d:"DVR"},{l:"Los Angeles, California",d:"LAX"},{l:"Vancouver, Canada",d:"VAN"},{l:"Seattle, WA",d:"SEA"},{l:"Galveston, TX",d:"GLS"},{l:"New York, NY",d:"NYC"},{l:"Miami, FL",d:"MIA"}],"DCLDestinations":[{l:"Choose a Destination"}],"DCLDeparturePort":[{l:"Choose a Departure Port"}],"BirthDateYear":[{l:"Year"},{l:"1900",d:"1900"},{l:"1901",d:"1901"},{l:"1902",d:"1902"},{l:"1903",d:"1903"},{l:"1904",d:"1904"},{l:"1905",d:"1905"},{l:"1906",d:"1906"},{l:"1907",d:"1907"},{l:"1908",d:"1908"},{l:"1909",d:"1909"},{l:"1910",d:"1910"},{l:"1911",d:"1911"},{l:"1912",d:"1912"},{l:"1913",d:"1913"},{l:"1914",d:"1914"},{l:"1915",d:"1915"},{l:"1916",d:"1916"},{l:"1917",d:"1917"},{l:"1918",d:"1918"},{l:"1919",d:"1919"},{l:"1920",d:"1920"},{l:"1921",d:"1921"},{l:"1922",d:"1922"},{l:"1923",d:"1923"},{l:"1924",d:"1924"},{l:"1925",d:"1925"},{l:"1926",d:"1926"},{l:"1927",d:"1927"},{l:"1928",d:"1928"},{l:"1929",d:"1929"},{l:"1930",d:"1930"},{l:"1931",d:"1931"},{l:"1932",d:"1932"},{l:"1933",d:"1933"},{l:"1934",d:"1934"},{l:"1935",d:"1935"},{l:"1936",d:"1936"},{l:"1937",d:"1937"},{l:"1938",d:"1938"},{l:"1939",d:"1939"},{l:"1940",d:"1940"},{l:"1941",d:"1941"},{l:"1942",d:"1942"},{l:"1943",d:"1943"},{l:"1944",d:"1944"},{l:"1945",d:"1945"},{l:"1946",d:"1946"},{l:"1947",d:"1947"},{l:"1948",d:"1948"},{l:"1949",d:"1949"},{l:"1950",d:"1950"},{l:"1951",d:"1951"},{l:"1952",d:"1952"},{l:"1953",d:"1953"},{l:"1954",d:"1954"},{l:"1955",d:"1955"},{l:"1956",d:"1956"},{l:"1957",d:"1957"},{l:"1958",d:"1958"},{l:"1959",d:"1959"},{l:"1960",d:"1960"},{l:"1961",d:"1961"},{l:"1962",d:"1962"},{l:"1963",d:"1963"},{l:"1964",d:"1964"},{l:"1965",d:"1965"},{l:"1966",d:"1966"},{l:"1967",d:"1967"},{l:"1968",d:"1968"},{l:"1969",d:"1969"},{l:"1970",d:"1970"},{l:"1971",d:"1971"},{l:"1972",d:"1972"},{l:"1973",d:"1973"},{l:"1974",d:"1974"},{l:"1975",d:"1975"},{l:"1976",d:"1976"},{l:"1977",d:"1977"},{l:"1978",d:"1978"},{l:"1979",d:"1979"},{l:"1980",d:"1980"},{l:"1981",d:"1981"},{l:"1982",d:"1982"},{l:"1983",d:"1983"},{l:"1984",d:"1984"},{l:"1985",d:"1985"},{l:"1986",d:"1986"},{l:"1987",d:"1987"},{l:"1988",d:"1988"},{l:"1989",d:"1989"},{l:"1990",d:"1990"},{l:"1991",d:"1991"},{l:"1992",d:"1992"},{l:"1993",d:"1993"},{l:"1994",d:"1994"},{l:"1995",d:"1995"},{l:"1996",d:"1996"},{l:"1997",d:"1997"},{l:"1998",d:"1998"},{l:"1999",d:"1999"},{l:"2000",d:"2000"},{l:"2001",d:"2001"},{l:"2002",d:"2002"},{l:"2003",d:"2003"},{l:"2004",d:"2004"},{l:"2005",d:"2005"},{l:"2006",d:"2006"},{l:"2007",d:"2007"},{l:"2008",d:"2008"},{l:"2009",d:"2009"}],"DCLLength":[{l:"Cruise Length"}]}})' );
	} catch ( e ) {
		return this.displayError( 'An error has occurred while loading the Disney Quick Quote business rules.' );
	}
	
	return true;
};

DisneyQuickQuote.prototype.processBusinessRules = function() {
	var intChild = 0;

	intChild = ( this.arrSupport.length - 1 );
	do {
		this.processGroup( this.arrSupport[ intChild ] );
	} while ( intChild-- );
	
	return true;
};

DisneyQuickQuote.prototype.createCalendarConfig = function( strId, dtRangeStart, dtRangeEnd ) {
	var objConfig = {
		target: document.body,
		dateRangeStart: new Date( dtRangeStart ),
		dateRangeEnd: new Date( dtRangeEnd ),
		showInput: true,
		monthLabels: this.objData.Prop.monthLabels.join( ',' )
	};
	
	return objConfig;
};

DisneyQuickQuote.prototype.processGroup = function( strTagName ) {
	var intCount = 0;
	var intBU = 0;
	var intPO = 0;
	var strName = null;
	var strParentName = null;
	var nodeElement = null;
	var that = this;

	switch ( strTagName ) {
		case 'SQQTravelDates':
			var bSingleTextField = false;
			var bUseDropDown = false;
			var dtEnd;
			var dtStart;
			var dtToday;
			var dtTravel;
			var intChild = 0;
			var intCal1 = null;
			var intCal2 = null;
			var intMinBookTime = 1;
			var intTravelStartDate = 0;
			var intTravelStartMonth = 0;
			var intTravelStartYear = 0;
			var intDisplayStartDate = 0;
			var intDisplayStartMonth = 0;
			var intDisplayStartYear = 0;
			var intDisplayEndYear = 0;
			var intStartDaysFromToday = 0;
			var intRiskFactorDays = 0;
			var intRiskFactorMinutes = 0;
			var intDisplayDateRange = 0;
			var intUpdateAfter = -1;
			var strOperationalStartTime = null;
			var strOperationalEndTime = null;
			var strDateTimeType = null;
			var nodeArrivalMonth = null;
			var nodeArrivalDay = null;
			var nodeArrivalYear = null;
			var nodeArrivalDate = null;
			var nodeCalendarBtn1 = null;
			var nodeCalendarBtn2 = null;
			var nodeDepartureMonth = null;
			var nodeDepartureDay = null;
			var nodeDepartureYear = null;
			var nodeDepartureDate = null;
			var nodeTravelTime = null;
			var nodeOption = null;
			var objGroup;
			var objTravelTimeDropDown;
			var objData;

			this.addOpenCalendarMouseCheckEvent();

			if ( !this.objData.Prop.monthLabels && typeof this.objData.Prop.monthLabels.length != 'undefined' ) {
				this.objData.Prop.monthLabels = Array( '' );
			}

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				do {
					if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates ) != 'undefined' ) {
						dtToday = new Date();
						dtToday.setToCalendarDate();
						bUseDropDown = false;
						intUpdateAfter = -1;
						
						strName = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.name;
						bSingleTextField = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.singleTextField;
						intMinBookTime = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.minBookTime;
						intTravelStartDate = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.travelStartDate;
						intTravelStartMonth = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.travelStartMonth;
						intTravelStartYear = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.travelStartYear;
						intDisplayStartDate = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.displayStartDate;
						intDisplayStartMonth = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.displayStartMonth;
						intDisplayStartYear = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.displayStartYear;
						intDisplayEndYear = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.displayEndYear;
						intStartDaysFromToday = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.startDaysFromToday;
						intRiskFactorDays = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.riskFactorDays;
						intRiskFactorMinutes = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.riskFactorMinutes;						
						intDisplayDateRange = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.displayDateRange;
						strOperationalStartTime = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.operationalStartTime;
						strOperationalEndTime = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.operationalEndTime ;
						strTravelDateType = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.travelDateType;
						objTravelTimeDropDown = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.timeDropDown;
																	
						strParentName = this.objData.Prop.BU[ intBU ].value + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name;
						nodeCalendarBtn1 = document.getElementById( strParentName + '_' + strName + '_arrivalCalendarBtn' );
						nodeCalendarBtn2 = document.getElementById( strParentName + '_' + strName + '_departureCalendarBtn' );
						nodeTravelTime = document.getElementById( strParentName + '_' + objTravelTimeDropDown );
		
						if ( bSingleTextField ) {
							nodeArrivalDate = document.getElementById( strParentName + '_' + strName + '_arrivalDate' );
							nodeDepartureDate = document.getElementById( strParentName + '_' + strName + '_departureDate' );
						} else {
							nodeArrivalMonth = document.getElementById( strParentName + '_' + strName + '_arrivalMonth' );
							nodeArrivalDay = document.getElementById( strParentName + '_' + strName + '_arrivalDay' );
							nodeArrivalYear = document.getElementById( strParentName + '_' + strName + '_arrivalYear' );
							nodeDepartureMonth = document.getElementById( strParentName + '_' + strName + '_departureMonth' );
							nodeDepartureDay = document.getElementById( strParentName + '_' + strName + '_departureDay' );
							nodeDepartureYear = document.getElementById( strParentName + '_' + strName + '_departureYear' );
						}
						
						if ( !intRiskFactorDays ) {
							intRiskFactorDays = 0;
						}

						if ( nodeCalendarBtn1 && ( ( !bSingleTextField && nodeArrivalMonth && nodeArrivalDay && nodeArrivalYear ) || ( bSingleTextField && nodeArrivalDate ) ) ) {

							if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown ) != 'undefined' && typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown.length ) != 'undefined' ) {
								intCount = ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown.length - 1 );

								if ( intCount > -1 ) {

									do {

										if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].dependency ) != 'undefined' && this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].dependency && typeof( this.objData.Groups[ this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].xmlPointer ] ) != 'undefined' ) {

											objGroup = this.objData.Groups[ this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].xmlPointer ][ document.getElementById( strParentName + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].xmlPointer ).selectedIndex ];
											if ( !objGroup || objGroup.length < 1 ) {
												continue;
											}

											if ( typeof( objGroup.t ) == 'undefined' || !this.objData.OptInfo[ objGroup.t ] ) {
												continue;
											}

											dtStart = new Date( dtToday );
											dtStart.setFullYear( this.objData.OptInfo[ objGroup.t ].travelStartYear, ( ( this.objData.OptInfo[ objGroup.t ].travelStartMonth * 1 ) - 1 ), 1 );
											if ( typeof( this.objData.OptInfo[ objGroup.t ].travelStartDate ) != 'undefined' && this.objData.OptInfo[ objGroup.t ].travelStartDate !== null ) {
												dtStart.setDate( this.objData.OptInfo[ objGroup.t ].travelStartDate );
											}

											intTravelStartDate = dtStart.getDate();
											intTravelStartMonth = ( dtStart.getMonth() + 1 );
											intTravelStartYear = dtStart.getFullYear();
											bUseDropDown = true;

											this.updateTravelDates( strParentName + '_' + strName + '_arrival', bSingleTextField, ( dtStart.getMonth() + 1 ), dtStart.getDate(), dtStart.getFullYear() );

											if (this.objData.OptInfo[ objGroup.t ].minBookTime && intDisplayDateRange > this.objData.OptInfo[ objGroup.t ].minBookTime) {
												dtStart.setDate( dtStart.getDate() + intDisplayDateRange );
											} else {
												dtStart.setDate( dtStart.getDate() + this.objData.OptInfo[ objGroup.t ].minBookTime );
											}

											this.updateTravelDates( strParentName + '_' + strName + '_departure', bSingleTextField, ( dtStart.getMonth() + 1 ), dtStart.getDate(), dtStart.getFullYear() );

											intUpdateAfter = intCount;
											break;
										}

										if ( strTravelDateType == 'date-time' && nodeTravelTime ) {
											if(this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[intCount].name == objTravelTimeDropDown) {

												nodeTravelTimeDropdown = document.getElementById( strParentName + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[intCount].xmlPointer );
												intRiskFactorDays += this.setDefaultTime(nodeTravelTimeDropdown, new Date(), intRiskFactorMinutes, strOperationalStartTime, strOperationalEndTime);
												nodeTravelTime.className = 'SQQDropDownSelect';
											}
										}

									} while ( intCount-- );
								}
							}

							nodeCalendarBtn1.style.display = 'block';

							if ( document.all ) {
								if ( this.arrAttributes.qqWidth < 260 ) {
									nodeCalendarBtn1.parentNode.style.width = '100%';
								}
							}

							dtStart = new Date( dtToday );

										
						
							if ( strTravelDateType == 'date-time'){

							if ( intTravelStartYear > 0 && intTravelStartMonth > 0 && intTravelStartDate > 0 ) {
								dtTravel = new Date( dtStart );
								dtTravel.setFullYear( intTravelStartYear, ( intTravelStartMonth - 1 ), intTravelStartDate );

								if ( dtStart.compare( dtTravel ) == -1 ) {
									dtStart = new Date( dtTravel );
								} else if ( !bUseDropDown ) {  
									dtStart.setDate( ( dtStart.getDate() * 1 ) + intRiskFactorDays );
								}

								dtTravel = undefined;
							} else if ( !bUseDropDown ) { 
								dtStart.setDate( ( dtStart.getDate() * 1 ) + intRiskFactorDays );
							}

							if ( !bUseDropDown ) {
								dtTravel = new Date( dtStart );

								if ( intStartDaysFromToday > 0 && intRiskFactorDays < intStartDaysFromToday ) {
									dtTravel.setDate( ( dtTravel.getDate() * 1 ) + (intStartDaysFromToday - intRiskFactorDays) );
								}

								this.updateTravelDates( strParentName + '_' + strName + '_arrival', bSingleTextField, ( dtTravel.getMonth() + 1 ), dtTravel.getDate(), dtTravel.getFullYear() );

								if ( intDisplayDateRange > 0 ) {
									dtTravel.setDate( ( dtTravel.getDate() * 1 ) + intDisplayDateRange );
								}
							}

							intCal1 = ( this.arrAttributes.qqCalendars.length );

							this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.arrival = intCal1;


							this.arrAttributes.qqCalendars[ intCal1 ] = {};

							objData = {
								minBookTime: intMinBookTime,
								displayDateRange: intDisplayDateRange,
								isArrival: true,
								departure: null,
								parentName: strParentName,
								name: strParentName + '_' + strName + '_arrival',
								config: this.createCalendarConfig( strParentName + '_' + strName + '_arrivalCalendar', dtStart, dtEnd ),
								singleTextField: bSingleTextField,
								timeDropDown: nodeTravelTimeDropdown,
								riskFactorMinutes: intRiskFactorMinutes,								
								operationalStartTime: strOperationalStartTime,
								operationalEndTime: strOperationalEndTime
							};

							this.addDisplayCalendarEvent( nodeCalendarBtn1, objData, intCal1, true );

							if ( bSingleTextField ) {
								this.addDisplayCalendarEvent( nodeArrivalDate, null, intCal1, false );
							}

							dtStart.setDate( ( ( dtStart.getDate() * 1 ) + intMinBookTime ) );

							objData = {
								minBookTime: intMinBookTime,
								isArrival: false,
								arrival: intCal1,
								parentName: strParentName,
								singleTextField: bSingleTextField
							};

							this.addTravelEvents( this.arrAttributes.qqCalendars[ intCal1 ], null);

							if ( intUpdateAfter > -1 ) {
								this.updateDropDownSelection( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intUpdateAfter ].xmlPointer, strParentName, intUpdateAfter, 'initTravel', intBU, intPO );
							}

							} else {

							if ( nodeCalendarBtn2 && ( ( nodeDepartureMonth && nodeDepartureDay && nodeDepartureYear ) || nodeDepartureDate  ) ) {

								nodeCalendarBtn2.style.display = 'block';

								if ( document.all ) {
									if ( this.arrAttributes.qqWidth < 260 ) {
										nodeCalendarBtn2.parentNode.style.width = '100%';
									}
								}

								dtEnd = new Date( dtToday );

								if ( intTravelStartYear > 0 && intTravelStartMonth > 0 && intTravelStartDate > 0 ) {
									dtTravel = new Date( dtStart );
									dtTravel.setFullYear( intTravelStartYear, ( intTravelStartMonth - 1 ), intTravelStartDate );

									if ( dtStart.compare( dtTravel ) == -1 ) {
										dtStart = new Date( dtTravel );
									} else if ( !bUseDropDown ) { 
										dtStart.setDate( ( dtStart.getDate() * 1 ) + intRiskFactorDays );
									}

									dtTravel = undefined;
								} else if ( !bUseDropDown ) { 
									dtStart.setDate( ( dtStart.getDate() * 1 ) + intRiskFactorDays );
								}

								if ( !bUseDropDown ) {
									dtTravel = new Date( dtStart );

									if ( intStartDaysFromToday > 0 && intRiskFactorDays < intStartDaysFromToday ) {
										dtTravel.setDate( ( dtTravel.getDate() * 1 ) + (intStartDaysFromToday - intRiskFactorDays) );
									}

									this.updateTravelDates( strParentName + '_' + strName + '_arrival', bSingleTextField, ( dtTravel.getMonth() + 1 ), dtTravel.getDate(), dtTravel.getFullYear() );

									if ( intDisplayDateRange > 0 ) {
										dtTravel.setDate( ( dtTravel.getDate() * 1 ) + intDisplayDateRange );
									}

									this.updateTravelDates( strParentName + '_' + strName + '_departure', bSingleTextField, ( dtTravel.getMonth() + 1 ), dtTravel.getDate(), dtTravel.getFullYear() );
								}

								if ( intDisplayEndYear ) {
									dtEnd.setFullYear( intDisplayEndYear, 11, ( 31 - intMinBookTime ) );
								} else {
									dtEnd.setFullYear( ( dtStart.getFullYear() + 2 ), 11, ( 31 - intMinBookTime ) );
								}

								intCal1 = ( this.arrAttributes.qqCalendars.length );
								intCal2 = ( intCal1 + 1 );

								this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.arrival = intCal1;
								this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTravelDates.departure = intCal2;

								this.arrAttributes.qqCalendars[ intCal1 ] = {};
								this.arrAttributes.qqCalendars[ intCal2 ] = {};

								objData = {
									minBookTime: intMinBookTime,
									displayDateRange: intDisplayDateRange,
									isArrival: true,
									departure: intCal2,
									parentName: strParentName,
									name: strParentName + '_' + strName + '_arrival',
									config: this.createCalendarConfig( strParentName + '_' + strName + '_arrivalCalendar', dtStart, dtEnd ),
									singleTextField: bSingleTextField
								};

								this.addDisplayCalendarEvent( nodeCalendarBtn1, objData, intCal1, true );

								if ( bSingleTextField ) {
									this.addDisplayCalendarEvent( nodeArrivalDate, null, intCal1, false );
								}

								dtStart.setDate( ( ( dtStart.getDate() * 1 ) + intMinBookTime ) );
								dtEnd.setDate( ( ( dtEnd.getDate() * 1 ) + intMinBookTime ) );

								objData = {
									minBookTime: intMinBookTime,
									isArrival: false,
									arrival: intCal1,
									parentName: strParentName,
									name: strParentName + '_' + strName + '_departure',
									config: this.createCalendarConfig( strParentName + '_' + strName + '_departureCalendar', dtStart, dtEnd ),
									singleTextField: bSingleTextField
								};

								this.addDisplayCalendarEvent( nodeCalendarBtn2, objData, intCal2, true );

								if ( bSingleTextField ) {
									this.addDisplayCalendarEvent( nodeDepartureDate, null, intCal2, false );
								}

								this.addTravelEvents( this.arrAttributes.qqCalendars[ intCal1 ], this.arrAttributes.qqCalendars[ intCal2 ] );

								if ( intUpdateAfter > -1 ) {
									this.updateDropDownSelection( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intUpdateAfter ].xmlPointer, strParentName, intUpdateAfter, 'initTravel', intBU, intPO );
								}
							}
						}
					}
					}
				} while ( intPO-- );
			} while ( intBU-- );
			
			break;
		case 'SQQPartyMix':
			var nodeChildren = null;
			var nodeContainer = null;
			var nodeDisclaimer = null;
			var nodeLink = null;
			var nodeAlert = null;

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				do {
					if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQPartyMix ) != 'undefined' ) {
						strName = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQPartyMix.name;
						strParentName = this.objData.Prop.BU[ intBU ].value + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name;
						nodeChildren = document.getElementById( strParentName + '_' + strName + '_numChildren' );
						nodeContainer = document.getElementById( strParentName + '_' + strName + '_childContainer' );
						nodeDisclaimer = document.getElementById( strParentName + '_' + strName + '_disclaimer' );
						nodeLink = document.getElementById( strParentName + '_' + strName + '_disclaimerLink' );
						nodeAlert = document.getElementById( strParentName + '_' + strName + '_disclaimerAlert' );
						this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQPartyMix.currentChildren = -1;

						if ( nodeChildren && nodeContainer ) {
							this.addPartyMixEvent( strParentName, strName );

							this.updateNumChildren( strParentName, strName, 'init', intBU, intPO );
						}

						if ( nodeDisclaimer && nodeLink && nodeAlert ) {

							nodeLink.href = 'javascript:void(0);';
							nodeDisclaimer.style.display = 'block';
							nodeAlert.style.display = 'none';

							this.addChildAgeDisclaimerEvent( strParentName + '_' + strName + '_disclaimer' );
						}
					}
				} while ( intPO-- );
			} while ( intBU-- );
			
			break;
		case 'SQQDropDownMulti':
			var strHTMLVarName1 = null;
			var strHTMLVarName2 = null;
			var bTargetSecond = null;
			nodeElement = null;
			var nodeSelect1 = null;
			var nodeSelect2 = null;

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				do {
					if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti ) != 'undefined' ) {
						intCount = ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti.length - 1 );
						do {
							bTargetSecond = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intCount ].targetSecond;

							if ( bTargetSecond ) {
								strName = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intCount ].name;
								strParentName = this.objData.Prop.BU[ intBU ].value + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name;
								strHTMLVarName1 = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intCount ].htmlVarName1;
								strHTMLVarName2 = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intCount ].htmlVarName2;
								nodeElement = document.getElementById( strParentName + '_' + strName );
								nodeSelect1 = document.getElementById( strParentName + '_' + strName + '_' + strHTMLVarName1 );
								nodeSelect2 = document.getElementById( strParentName + '_' + strName + '_' + strHTMLVarName2 );
								
								if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intCount ].xmlPointer2 ) == 'undefined' ) {
									this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intCount ].xmlPointer2 = '';
								}
								
								if ( nodeElement && nodeSelect1 && nodeSelect2 ) {

									this.addDropDownMultiEvent( nodeSelect1, intCount, strParentName + '_' + strName + '_' + strHTMLVarName1, strParentName + '_' + strName + '_' + strHTMLVarName2 );

									this.updateDropDownMultiSelection( intCount, strParentName + '_' + strName + '_' + strHTMLVarName1, strParentName + '_' + strName + '_' + strHTMLVarName2, 'init', intBU, intPO );
								}
							}
						} while ( intCount-- );
					}
				} while ( intPO-- );
			} while ( intBU-- );
			
			break;
		case 'SQQDropDown':
			var intChildCount = 0;

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				do {

					if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown ) != 'undefined' ) {
						intCount = ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown.length - 1 );
						do {
							strName = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].xmlPointer;
							strParentName = this.objData.Prop.BU[ intBU ].value + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name;
							nodeElement = document.getElementById( strParentName + '_' + strName );
							
							if ( nodeElement ) {
								if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].dependency ) != 'undefined' ) {
                                    var m = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].dependency.match(/^filter:(.*)$/i);
                                    if (m) {
                                        if (this.objData.Filters && this.objData.Filters[ m[1] ]) {
                                            this.addFilterEvent(nodeElement, strParentName, this.objData.Filters[ m[1] ]);
                                        }
                                    } else {

                                        intChildCount = ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown.length - 1 );
                                        
                                        do {
                                            if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intChildCount ].htmlObjectName ) != 'undefined' && this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].dependency == this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intChildCount ].htmlObjectName ) {

                                                this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intCount ].child = intChildCount;
                                                this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDown[ intChildCount ].targetData = null;
                                                this.addDropDownEvent( nodeElement, strName, strParentName, intCount );
                                                
                                                if ( strName == 'DCLCruises' ) {
                                                    this.updateDropDownSelection( strName, strParentName, intCount, 'init', intBU, intPO );
                                                }
                                                
                                                break;
                                            }
                                        } while ( intChildCount-- );
                                    }
								}
							}
						} while ( intCount-- );
					}
				} while ( intPO-- );
			} while ( intBU-- );
			
			break;
		case 'SQQTextBox':
			var nodeOverlay = null;

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				do {

					if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTextBox ) != 'undefined' ) {
						intCount = ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTextBox.length - 1 );
						do {
							strName = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTextBox[ intCount ].name;
							strParentName = this.objData.Prop.BU[ intBU ].value + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name;
							nodeElement = document.getElementById( strParentName + '_' + strName + '_Text' );
							nodeOverlay = document.getElementById( strParentName + '_' + strName + '_Overlay' );
							
							if ( nodeElement && nodeOverlay ) {
								if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQTextBox[ intCount ].overlayLabel ) != 'undefined' ) {

									this.addTextBoxOverlayEvent( nodeElement, nodeOverlay, strName, strParentName );
								}
							}

							var objList = this.objData.Groups[strParentName + '_' + strName];
							if(objList){
								if(objList.length != 0){
									nodeAutoComp = document.getElementById(strParentName + '_' + strName +'_AutoCmp');
									var aNames = [];
									for (i = 0; i < objList.length; i++){
										aNames[i] = objList[i].l;
									}
									if(nodeElement && nodeAutoComp && aNames.length !=0){
										this.autoCompleteObj.push(new DisneyQuickQuote.AutoComplete(strParentName, aNames,nodeElement, nodeAutoComp));
									}
								}
							}
						} while ( intCount-- );
					}
				} while ( intPO-- );
			} while ( intBU-- );
			
			break;
		case 'SQQGrouping':
			var nodeLabel = null;
			var nodeGroup = null;

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				do {

					if ( typeof( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQGrouping ) != 'undefined' ) {
						intCount = ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQGrouping.length - 1 );
						do {
							strName = this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQGrouping[ intCount];
							strParentName = this.objData.Prop.BU[ intBU ].value + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name;
							nodeLabel = document.getElementById( strParentName + '_' + strName + '_Label' );
							nodeGroup = document.getElementById( strParentName + '_' + strName + '_Group' );

							if ( nodeLabel && nodeGroup ) {

								this.addGroupEvent( strParentName + '_' + strName );
							}
						} while ( intCount-- );
					}
				} while ( intPO-- );
			} while ( intBU-- );
			
			break;
		case 'SQQProductOption':
			var bChecked = false;
			nodeContainer = null;

			intBU = ( this.objData.Prop.BU.length - 1 );
			do {
				bChecked = false;
				strName = this.objData.Prop.BU[ intBU ].value;

				intPO = ( this.objData.Prop.BU[ intBU ].PO.length - 1 );
				
				do {
					nodeElement = document.getElementById( strName + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name );
					nodeContainer = document.getElementById( strName + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name + '_Container' );
					
					if ( nodeElement || nodeContainer ) {

						this.addProductOptionsEvent( strName + '_' + this.objData.Prop.BU[ intBU ].PO[ intPO ].name, intPO );
						
						if ( nodeElement && nodeContainer ) {

							if ( nodeElement.checked ) {
								bChecked = true;
								this.objData.Prop.BU[ intBU ].currentPO = intPO;
							} else if ( intPO > 0 || ( intPO === 0 && bChecked ) ) {
								nodeContainer.className = 'SQQProductOption hidden';
							}
						} else {
							bChecked = true;
							this.objData.Prop.BU[ intBU ].currentPO = intPO;
						}
					}
				} while ( intPO-- );

				if ( !bChecked ) {

					if ( this.objData.Prop.BU[ intBU ].PO.length > 1 ) {
						document.getElementById( strName + '_' + this.objData.Prop.BU[ intBU ].PO[ 0 ].name ).checked = true;
					}
					
					this.objData.Prop.BU[ intBU ].currentPO = 0;
				}
			} while ( intBU-- );
			
			break;
		case 'SQQBusinessUnit':
			var bSelected = false;

			var nodeMulti = document.getElementById( 'SQQMultiBU' );

			if ( typeof( nodeMulti ) != 'undefined' && nodeMulti !== null ) {
				this.addMultiBusinessUnitEvent();

				intBU = ( this.objData.Prop.BU.length - 1 );
				do {
					strName = this.objData.Prop.BU[ intBU ].value;
					nodeContainer = document.getElementById( strName + '_Container' );
					
					if ( nodeContainer ) {
						if ( nodeMulti.value == strName ) {
							bSelected = true;
							this.objData.Prop.currentBU = intBU;
						} else {
							nodeContainer.className = 'SQQBusinessUnit hidden';
						}
					}
				} while ( intBU-- );

				if ( !bSelected ) {
					document.getElementById( this.objData.Prop.BU[ 0 ].value + '_Container' ).className = 'SQQBusinessUnit';
				}
			}

			if ( !bSelected ) {
				this.objData.Prop.currentBU = 0;
			}
			
			break;
		default:
			break;
	}
	
	return true;
};

DisneyQuickQuote.prototype.addMultiBusinessUnitEvent = function() {
	var that = this;
	var nodeMulti = document.getElementById( 'SQQMultiBU' );
	
	this.addEvent( nodeMulti, 'change', function() { that.updateMultiBUSelection( 'change' ); }, false );
	this.addEvent( nodeMulti, 'keyup', function() { that.updateMultiBUSelection( 'keyup' ); }, false );
};

DisneyQuickQuote.prototype.addProductOptionsEvent = function( strElement, intPO ) {
	var that = this;
	var nodeElement = document.getElementById( strElement );
	var nodeSubmit = document.getElementById( strElement + '_Submit' );

	if ( nodeElement ) {

		if ( document.all ) {

			this.addEvent( nodeElement, 'click', function() {
				that.switchProductOptions( strElement, intPO, 'click' );
				setTimeout( function() {
					that.switchProductOptions( strElement, intPO, 'click' );
					document.getElementById( strElement + '_Submit' ).parentNode.style.height = '100%';
					document.getElementById( strElement + '_Submit' ).parentNode.style.height = 'auto';
				}, 1 );
			}, false );
			this.addEvent( nodeElement, 'keyup', function() { that.switchProductOptions( strElement, intPO, 'keyup' ); }, false );
		} else {

			this.addEvent( nodeElement, 'change', function() { that.switchProductOptions( strElement, intPO, 'change' ); }, false );
		}
	}

	if ( nodeSubmit ) {
		this.addEvent( nodeSubmit, 'click', function() { that.submitProductOption( strElement, 'click' ); }, false );
	}
	
	return true;
};

DisneyQuickQuote.prototype.addGroupEvent = function( strName ) {
	var that = this;

	this.addEvent( document.getElementById( strName + '_Label' ), 'click', function() { that.displayGroup( strName, 'click' ); }, false );
	
	if ( document.getElementById( strName + '_OpenedLabel') ) {
		this.addEvent( document.getElementById( strName + '_OpenedLabel' ), 'click', function() { that.displayGroup( strName, 'click' ); }, false );
	}
	
	return true;
};

DisneyQuickQuote.prototype.addPartyMixEvent = function( strParentName, strName ) {
	var that = this;
	var nodeChildren = document.getElementById( strParentName + '_' + strName + '_numChildren' );

	if ( document.all ) {

		this.addEvent( nodeChildren, 'change', function() {
			that.updateNumChildren( strParentName, strName, 'change' );
			setTimeout(function() {
				document.getElementById( strParentName + '_Submit' ).parentNode.style.height = '100%';
				document.getElementById( strParentName + '_Submit' ).parentNode.style.height = 'auto';
			}, 1 );
		}, false );
		this.addEvent( nodeChildren, 'keyup', function() {
			that.updateNumChildren( strParentName, strName, 'keyup' );
			setTimeout(function() {
				document.getElementById( strParentName + '_Submit' ).parentNode.style.height = '100%';
				document.getElementById( strParentName + '_Submit' ).parentNode.style.height = 'auto';
			}, 1 );
		}, false );
	} else {
		this.addEvent( nodeChildren, 'change', function() { that.updateNumChildren( strParentName, strName, 'change' ); }, false );
		this.addEvent( nodeChildren, 'keyup', function() { that.updateNumChildren( strParentName, strName, 'keyup' ); }, false );
	}
	
	return true;
};

DisneyQuickQuote.prototype.addChildAgeDisclaimerEvent = function( strName ) {
	var that = this;

	this.addEvent( document.getElementById( strName ), 'click', function() { that.displayChildAgeDisclaimer( strName, 'click' ); }, false );
	return true;
};

DisneyQuickQuote.prototype.addDropDownMultiEvent = function( nodeSelect, intNode, strElement, strElement2 ) {
	var that = this;

	this.addEvent( nodeSelect, 'change', function() { that.updateDropDownMultiSelection( intNode, strElement, strElement2, 'change' ); }, false );
	this.addEvent( nodeSelect, 'keyup', function() { that.updateDropDownMultiSelection( intNode, strElement, strElement2, 'keyup' ); }, false );
	return true;
};

DisneyQuickQuote.prototype.addDropDownEvent = function( nodeSelect, strName, strParentName, intNode ) {
	var that = this;

	this.addEvent( nodeSelect, 'change', function() { that.updateDropDownSelection( strName, strParentName, intNode, 'change' ); }, false );
	this.addEvent( nodeSelect, 'keyup', function() { that.updateDropDownSelection( strName, strParentName, intNode, 'keyup' ); }, false );
	return true;
};

DisneyQuickQuote.prototype.addFilterEvent = function( nodeSelect, strParentName, objFilter ) {
	var that = this;

	this.addEvent( nodeSelect, 'change', function(evt) { that.updateFilteredSelection( evt, strParentName, objFilter, 'change' ); }, false );
	this.addEvent( nodeSelect, 'keyup', function(evt) { that.updateFilteredSelection( evt, strParentName, objFilter, 'keyup' ); }, false );
	return true;
};

DisneyQuickQuote.prototype.addTextBoxOverlayEvent = function( nodeInput, nodeOverlay, strName, strParentName ) {
	var that = this;

	this.addEvent( nodeInput, 'focus', function() { that.updateTextBoxOverlay( strName, strParentName, true, false, 'focus' ); }, false );
	this.addEvent( nodeOverlay, 'click', function() { that.updateTextBoxOverlay( strName, strParentName, true, true, 'overlay' ); }, false );
	this.addEvent( nodeInput, 'blur', function() { that.updateTextBoxOverlay( strName, strParentName, false, false, 'blur' ); }, false );
	return true;
};

DisneyQuickQuote.prototype.addDisplayCalendarEvent = function( nodeButton, objData, intCal, bSetData ) {
	var that = this;
	if ( bSetData ) {
		this.arrAttributes.qqCalendars[ intCal ] = objData;
	}
	
	this.addEvent( nodeButton, 'click', function() { that.displayCalendar( that.arrAttributes.qqCalendars[ intCal ], intCal, 'click' ); }, false );
	return true;
};

DisneyQuickQuote.prototype.addTravelEvents = function( objArrival, objDeparture ) {
	var that = this;

	if ( objArrival.singleTextField ) {

		this.addEvent( document.getElementById( objArrival.name + 'Date' ), 'change', function() { that.updateSingleTravelDate( objArrival, false, 'change' ); }, false );

		if (objDeparture) {
			this.addEvent( document.getElementById( objDeparture.name + 'Date' ), 'change', function() { that.updateSingleTravelDate( objDeparture, false, 'change' ); }, false );
		}

		objArrival._fChange = function() {
			that.updateSingleTravelDate( objArrival, true, 'click' );
		};

		if (objDeparture) {
			objDeparture._fChange = function() {
				that.updateSingleTravelDate( objDeparture, true, 'click' );
			};
		}
	} else {
		var nodeArrivalMonth = document.getElementById( objArrival.name + 'Month' );
		var nodeArrivalDay = document.getElementById( objArrival.name + 'Day' );
		var nodeArrivalYear = document.getElementById( objArrival.name + 'Year' );
		var nodeDepartureMonth = document.getElementById( objDeparture.name + 'Month' );
		var nodeDepartureDay = document.getElementById( objDeparture.name + 'Day' );
		var nodeDepartureYear = document.getElementById( objDeparture.name + 'Year' );

		this.addEvent( nodeArrivalMonth, 'change', function() { that.updateTravelDate( objArrival, false, 'change' ); }, false );
		this.addEvent( nodeArrivalMonth, 'keyup', function() { that.updateTravelDate( objArrival, false, 'keyup' ); }, false );
		this.addEvent( nodeArrivalDay, 'change', function() { that.updateTravelDate( objArrival, false, 'change' ); }, false );
		this.addEvent( nodeArrivalDay, 'keyup', function() { that.updateTravelDate( objArrival, false, 'keyup' ); }, false );
		this.addEvent( nodeArrivalYear, 'change', function() { that.updateTravelDate( objArrival, false, 'change' ); }, false );
		this.addEvent( nodeArrivalYear, 'keyup', function() { that.updateTravelDate( objArrival, false, 'keyup' ); }, false );
		this.addEvent( nodeDepartureMonth, 'change', function() { that.updateTravelDate( objDeparture, false, 'change' ); }, false );
		this.addEvent( nodeDepartureMonth, 'keyup', function() { that.updateTravelDate( objDeparture, false, 'keyup' ); }, false );
		this.addEvent( nodeDepartureDay, 'change', function() { that.updateTravelDate( objDeparture, false, 'change' ); }, false );
		this.addEvent( nodeDepartureDay, 'keyup', function() { that.updateTravelDate( objDeparture, false, 'keyup' ); }, false );
		this.addEvent( nodeDepartureYear, 'change', function() { that.updateTravelDate( objDeparture, false, 'change' ); }, false );
		this.addEvent( nodeDepartureYear, 'keyup', function() { that.updateTravelDate( objDeparture, false, 'keyup' ); }, false );

		objArrival._fChange = function() {
			that.updateTravelDate( objArrival, true, 'click' );
		};
		objDeparture._fChange = function() {
			that.updateTravelDate( objDeparture, true, 'click' );
		};
	}
	
	return true;
};

DisneyQuickQuote.prototype.addOpenCalendarMouseCheckEvent = function() {
	var that = this;

	if ( document.all ) {

		this.addEvent( document, 'click', function() { that.checkOpenCalendar( arguments[0], that ); }, false );
	} else {
		this.addEvent( window, 'click', function() { that.checkOpenCalendar( arguments[0], that ); }, false );
	}
	return true;
};

DisneyQuickQuote.prototype.updateMultiBUSelection = function( x ) {
	var nodeMulti = document.getElementById( 'SQQMultiBU' );

	if ( typeof( document.getElementById( nodeMulti.value + '_Container' ) ) == 'undefined' ) {
		return false;
	}

	document.getElementById( this.objData.Prop.BU[ this.objData.Prop.currentBU ].value + '_Container' ).className = 'SQQBusinessUnit hidden';
	document.getElementById( nodeMulti.value + '_Container' ).className = 'SQQBusinessUnit';

	this.objData.Prop.currentBU = nodeMulti.selectedIndex;
};

DisneyQuickQuote.prototype.switchProductOptions = function( strElement, intPO, x ) {

	var strName = this.objData.Prop.BU[ this.objData.Prop.currentBU ].value + '_' + this.objData.Prop.BU[ this.objData.Prop.currentBU ].PO[ this.objData.Prop.BU[ this.objData.Prop.currentBU ].currentPO ].name;

	document.getElementById( strName  + '_Container' ).className = 'SQQProductOption hidden';
	document.getElementById( strName + '_InputDisplay' ).className = 'SQQProductOptionOffContainer';
	document.getElementById( strElement + '_Container' ).className = 'SQQProductOption';
	document.getElementById( strElement + '_InputDisplay' ).className = 'SQQProductOptionOnContainer';
	
	this.objData.Prop.BU[ this.objData.Prop.currentBU ].currentPO = intPO;
	
	return true;
};

DisneyQuickQuote.prototype.displayGroup = function( strElement, x ) {
	var nodeElement = document.getElementById( strElement );
	var nodeOpened = document.getElementById( strElement + '_OpenedLabel' );
	var nodeClosed = document.getElementById( strElement + '_Label' );
	
	if ( nodeElement.className == 'SQQGrouping SQQGroupingHide' ) {
		nodeElement.className = 'SQQGrouping SQQGroupingDisplay';
		
		if ( nodeOpened && nodeClosed ) {
			nodeOpened.style.display = 'block';
			nodeClosed.style.display = 'none';
		}
	} else {
		nodeElement.className = 'SQQGrouping SQQGroupingHide';
		
		if ( nodeOpened && nodeClosed ) {
			nodeOpened.style.display = 'none';
			nodeClosed.style.display = 'block';
		}
	}
};

DisneyQuickQuote.prototype.submitProductOption = function( strElement, x ) {
	if ( !document.getElementById( strElement + '_Form' ) ) {
		return false;
	}

	var objBU = this.objData.Prop.BU[ this.objData.Prop.currentBU ];
	var objPO = objBU.PO[ objBU.currentPO ];
	var dtArrival;
	var dtDeparture;
	var intCount;
	var intMax;
	var nodeElement;
	var arrErrors = [];

	if ( objBU.value + '_' + objPO.name != strElement ) {
		document.getElementById( strElement + '_Form' ).submit();
		return true;
	}

	if ( typeof( objPO.SQQTravelDates ) != 'undefined' ) {
		var bDropDown = false;
		var objTravel = objPO.SQQTravelDates;
		dtArrival = new Date();
		dtArrival.setToCalendarDate();
		dtDeparture = new Date( dtArrival );
		var strTime = "";
		
		if ( typeof( objPO.SQQDropDown ) != 'undefined'  ) {
			var nodeDropDown;
			var nodeTarget;
			var strTarget = '';
			var intDropDown = ( objPO.SQQDropDown.length - 1 );
			
			do {

				if(objPO.SQQTravelDates.timeDropDown == objPO.SQQDropDown[ intDropDown ].name){
					nodeDropDown = document.getElementById( strElement + '_' + objPO.SQQDropDown[ intDropDown ].xmlPointer );

					if (typeof(this.objData.Groups[ objPO.SQQDropDown[ intDropDown ].xmlPointer ][ nodeDropDown.selectedIndex ].d) == 'undefined') {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( this.objData.Prop.errors.strDiningTimeBlank );
						} else {
							return this.displaySubmitError( strElement, this.objData.Prop.errors.strDiningTimeBlank );
						}
					}

					if ( nodeDropDown.options[nodeDropDown.selectedIndex].disabled ) {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( this.objData.Prop.errors.strPastDiningTime );
						} else {
							return this.displaySubmitError( strElement, this.objData.Prop.errors.strPastDiningTime );
						}
					}
				}

				if ( typeof( objPO.SQQDropDown[ intDropDown ].dependency ) == 'undefined' || typeof( objPO.SQQDropDown[ intDropDown ].child ) == 'undefined' ) {
					continue;
				}
				
				nodeDropDown = document.getElementById( strElement + '_' + objPO.SQQDropDown[ intDropDown ].xmlPointer );
				nodeTarget = document.getElementById( strElement + '_' + objPO.SQQDropDown[ intDropDown ].dependency );

				if ( !nodeDropDown || !nodeTarget ) {
					continue;
				}

				if ( this.objData.Groups[ objPO.SQQDropDown[ intDropDown ].xmlPointer ][ nodeDropDown.selectedIndex ].d == nodeDropDown.value ) {
					strTarget = this.objData.Groups[ objPO.SQQDropDown[ intDropDown ].xmlPointer ][ nodeDropDown.selectedIndex ].t;
				} else {
					intCount = ( this.objData.Groups[ objPO.SQQDropDown[ intDropDown ].xmlPointer ].length - 1 );
					do {
						if ( this.objData.Groups[ objPO.SQQDropDown[ intDropDown ].xmlPointer ][ intCount ].d == nodeDropDown.value ) {
							strTarget = this.objData.Groups[ objPO.SQQDropDown[ intDropDown ].xmlPointer ][ nodeDropDown.selectedIndex ].t;
							break;
						}
					} while ( intCount-- );
				}

				if ( !strTarget ) {
					continue;
				}

				if ( typeof( this.objData.OptInfo[ strTarget ].travelStartDate ) == 'undefined' && typeof( this.objData.OptInfo[ strTarget ].travelStartMonth ) == 'undefined' && typeof( this.objData.OptInfo[ strTarget ].travelStartYear ) == 'undefined' && typeof( this.objData.OptInfo[ strTarget ].travelEndDate ) == 'undefined' && typeof( this.objData.OptInfo[ strTarget ].travelEndMonth ) == 'undefined' && typeof( this.objData.OptInfo[ strTarget ].travelEndYear ) == 'undefined' ) {
					continue;
				}

				bDropDown = true;

				if ( typeof( this.objData.OptInfo[ strTarget ].travelStartDate ) == 'undefined' || this.objData.OptInfo[ strTarget ].travelStartDate === null ) {
					this.objData.OptInfo[ strTarget ].travelStartDate = 1;
				}
				
				var nodeArrivalDate = document.getElementById( strElement + '_' + objTravel.name + '_arrivalDate' );
				var nodeDepartureDate = document.getElementById( strElement + '_' + objTravel.name + '_departureDate' );

				if ( objPO.SQQTravelDates.singleTextField ) {
					if ( dtArrival.validate( nodeArrivalDate.value ) ) {
						dtArrival.setTime( Date.parse( nodeArrivalDate.value ) );
					}
					
					if ( dtDeparture.validate( nodeDepartureDate.value ) ) {
						dtDeparture.setTime( Date.parse( nodeDepartureDate.value ) );
					}
				} else {
					dtArrival.setFullYear( document.getElementById( strElement + '_' + objTravel.name + '_arrivalYear' ).value, ( ( document.getElementById( strElement + '_' + objTravel.name + '_arrivalMonth' ).value * 1 ) - 1 ), document.getElementById( strElement + '_' + objTravel.name + '_arrivalDay' ).value );
					dtDeparture.setFullYear( document.getElementById( strElement + '_' + objTravel.name + '_departureYear' ).value, ( ( document.getElementById( strElement + '_' + objTravel.name + '_departureMonth' ).value * 1 ) - 1 ), document.getElementById( strElement + '_' + objTravel.name + '_departureDay' ).value );
				}
				
				objTravel = this.objData.OptInfo[ strTarget ];
				break;
			} while ( intDropDown-- );
		}

		if ( !bDropDown ) {
			nodeArrivalDate = document.getElementById( strElement + '_' + objTravel.name + '_arrivalDate' );
			nodeDepartureDate = document.getElementById( strElement + '_' + objTravel.name + '_departureDate' );
			if ( nodeArrivalDate && nodeDepartureDate ) {
				if ( dtArrival.validate( nodeArrivalDate.value ) ) {
					dtArrival.setTime( Date.parse( nodeArrivalDate.value ) );
				}
				
				if ( dtDeparture.validate( nodeDepartureDate.value ) ) {
					dtDeparture.setTime( Date.parse( nodeDepartureDate.value ) );
				}
			} else if (nodeArrivalDate) {
				if ( dtArrival.validate( nodeArrivalDate.value ) ) {
					dtArrival.setTime( Date.parse( nodeArrivalDate.value ) );
				}
			} else {
				dtArrival.setFullYear( document.getElementById( strElement + '_' + objTravel.name + '_arrivalYear' ).value, ( ( document.getElementById( strElement + '_' + objTravel.name + '_arrivalMonth' ).value * 1 ) - 1 ), document.getElementById( strElement + '_' + objTravel.name + '_arrivalDay' ).value );
				dtDeparture.setFullYear( document.getElementById( strElement + '_' + objTravel.name + '_departureYear' ).value, ( ( document.getElementById( strElement + '_' + objTravel.name + '_departureMonth' ).value * 1 ) - 1 ), document.getElementById( strElement + '_' + objTravel.name + '_departureDay' ).value );
			}
		}

		if (!(nodeDepartureDate || document.getElementById( strElement + '_' + objTravel.name + '_departureYear' ))) {
			dtDeparture = dtArrival;
		}

		if ( dtArrival > dtDeparture ) {
			if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
				arrErrors.push( this.objData.Prop.errors.strArriveAfterDepart );
			} else {
				return this.displaySubmitError( strElement, this.objData.Prop.errors.strArriveAfterDepart );
			}
		}
		
		var intDayDiff = Math.round( ( dtDeparture.getTime() - dtArrival.getTime() ) / ( 1000 * 60 * 60 * 24 ) );

		if ( intDayDiff < objTravel.minBookTime  && objTravel.travelDateType == 'date-range') {
			if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
				arrErrors.push( this.objData.Prop.errors.strStayTooShort.replace( /\[N\]/gi, objTravel.minBookTime ) );
			} else {
				return this.displaySubmitError( strElement, this.objData.Prop.errors.strStayTooShort.replace( /\[N\]/gi, objTravel.minBookTime ) );
			}
		} else if ( intDayDiff > objTravel.maxBookTime ) {
			if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
				arrErrors.push( this.objData.Prop.errors.strStayTooLong.replace( /\[N\]/gi, objTravel.maxBookTime ) );
			} else {
				return this.displaySubmitError( strElement, this.objData.Prop.errors.strStayTooLong.replace( /\[N\]/gi, objTravel.maxBookTime ) );
			}
		}
		
		var dtMinMax = new Date();
		dtMinMax.setToCalendarDate();

		if ( objTravel.travelStartYear > 0 && objTravel.travelStartMonth > 0 && objTravel.travelStartDate > 0 ) {
			var dtTravel = new Date( dtMinMax );
			dtTravel.setFullYear( objTravel.travelStartYear, ( objTravel.travelStartMonth - 1 ), objTravel.travelStartDate );

			if ( dtMinMax.compare( dtTravel ) == -1 ) {
				dtMinMax = new Date( dtTravel );
			} else { 
				dtMinMax.setDate( ( dtMinMax.getDate() * 1 ) + 1 );
			}
			
			dtTravel = undefined;
		} else { 
			dtMinMax.setDate( ( dtMinMax.getDate() * 1 ) + 1 );
		}

		if ( dtArrival < dtMinMax && objTravel.travelDateType == 'date-range') {
			if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
				arrErrors.push( this.objData.Prop.errors.strArriveIsBeforeAllowable );
			} else {
				return this.displaySubmitError( strElement, this.objData.Prop.errors.strArriveIsBeforeAllowable );
			}
		}
		
		strOutOfDateRangeError = this.objData.Prop.errors.strArriveIsAfterMaxDate;

		if(((objTravel.travelEndYear * 1) == 0) && ((objTravel.travelEndMonth * 1) == 0) && ((objTravel.travelEndDate * 1) > 0))
		{

			dtMinMax.setDate(dtMinMax.getDate()+(objTravel.travelEndDate * 1));
			strOutOfDateRangeError = this.objData.Prop.errors.strArrivalAfterXDays;
		}

		else{

			dtMinMax.setFullYear( objTravel.travelEndYear, ( objTravel.travelEndMonth - 1 ), objTravel.travelEndDate );
		}
		
		
		if ( dtDeparture > dtMinMax ) {
			if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
				arrErrors.push( this.objData.Prop.errors.strArriveIsAfterMaxDate );
			} else {
				return this.displaySubmitError( strElement, strOutOfDateRangeError );
			}
		}
	}

	if ( typeof( objPO.SQQTextBox ) != 'undefined' ) {
		intMax = objPO.SQQTextBox.length;
		intCount = 0;
		
		do {
			
			nodeElement = document.getElementById(strElement + '_' + objPO.SQQTextBox[ intCount ].name + '_Text');

			if(nodeElement){
				autoMatch = nodeElement.getAttribute('autoMatch');
				if(autoMatch && autoMatch == 'false'){
					if ( typeof( objPO.SQQTextBox[ intCount ].requiredError ) != 'undefined' ) {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( objPO.SQQTextBox[ intCount ].requiredError );
						} else {
							return this.displaySubmitError( strElement, objPO.SQQTextBox[ intCount ].requiredError );
						}
					} else {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( 'Please select a valid restaurant from the dropdown.' );
						} else {
							return this.displaySubmitError( strElement, this.objData.Prop.errors.strInvalidRestaurantName );
						}
					}
				}
			}
			
			if ( typeof( objPO.SQQTextBox[ intCount ].isRequired ) != 'undefined' && objPO.SQQTextBox[ intCount ].isRequired === true ) {	
				if ( nodeElement && ( typeof( nodeElement.value ) == 'undefined' || ( typeof( nodeElement.value ) != 'undefined' && nodeElement.value.length < 1 ) ) ) {
					if ( typeof( objPO.SQQTextBox[ intCount ].requiredError ) != 'undefined' ) {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( objPO.SQQTextBox[ intCount ].requiredError );
						} else {
							return this.displaySubmitError( strElement, objPO.SQQTextBox[ intCount ].requiredError );
						}
					} else {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( 'A required field was left blank.' );
						} else {
							return this.displaySubmitError( strElement, 'A required field was left blank.' );
						}
					}
				}
			}
			
			++intCount;
		} while ( intCount < intMax );
	}

	if ( typeof( objPO.SQQDropDown ) != 'undefined' ) {
		intMax = objPO.SQQDropDown.length;
		intCount = 0;
		
		do {
			if ( typeof( objPO.SQQDropDown[ intCount ].isRequired ) != 'undefined' && objPO.SQQDropDown[ intCount ].isRequired === true ) {
				nodeElement = document.getElementById( strElement + '_' + objPO.SQQDropDown[ intCount ].xmlPointer );
	
				if ( nodeElement && ( typeof( nodeElement.value ) == 'undefined' || ( typeof( nodeElement.value ) != 'undefined' && nodeElement.value.length < 1 ) ) ) {
					if ( typeof( objPO.SQQDropDown[ intCount ].requiredError ) != 'undefined' ) {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( objPO.SQQDropDown[ intCount ].requiredError );
						} else {
							return this.displaySubmitError( strElement, objPO.SQQDropDown[ intCount ].requiredError );
						}
					} else {
						if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
							arrErrors.push( 'A required field was left blank.' );
						} else {
							return this.displaySubmitError( strElement, 'A required field was left blank.' );
						}
					}
				}
			}
			
			++intCount;
		} while ( intCount < intMax );
	}

	if ( typeof( objPO.SQQPartyMix ) != 'undefined' ) {
		if ( typeof( objPO.SQQPartyMix.maxGuests ) != 'undefined' && objPO.SQQPartyMix.maxGuests > 0 ) {
			var intGuests = 0;
			
			nodeElement = document.getElementById( strElement + '_' + objPO.SQQPartyMix.name + '_numAdults' );
			if ( nodeElement && nodeElement.value ) {
				intGuests += ( nodeElement.value * 1 );
			}
			
			nodeElement = document.getElementById( strElement + '_' + objPO.SQQPartyMix.name + '_numChildren' );
			if ( nodeElement && nodeElement.value ) {
				intGuests += ( nodeElement.value * 1 );
			}
			
			if ( intGuests > objPO.SQQPartyMix.maxGuests ) {
				if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
					arrErrors.push( this.objData.Prop.errors.strTooManyGuests.replace( /\[N\]/gi, objPO.SQQPartyMix.maxGuests ) );
				} else {
					return this.displaySubmitError( strElement, this.objData.Prop.errors.strTooManyGuests.replace( /\[N\]/gi, objPO.SQQPartyMix.maxGuests ) );
				}
			}
		}
	}
	
	if ( typeof( this.objData.Prop.listAllErrors ) != 'undefined' && this.objData.Prop.listAllErrors ) {
		if ( arrErrors && arrErrors.length > 0 ) {
			return this.displaySubmitError( strElement, arrErrors.join( '<br />' ) );
		}
	}

	if ( typeof( objPO.trackingLinkId ) != 'undefined' && objPO.trackingLinkId !== null ) {
		if ( typeof( s_wdpro ) != 'undefined' && typeof( s_wdpro.trackLink) != 'undefined' ) {
			s_wdpro.trackLink( document.getElementById( strElement + '_Submit' ), objPO.trackingLinkId );
		}
	}

	
	
	document.getElementById( strElement + '_Form' ).submit();
	return true;
};

DisneyQuickQuote.prototype.updateNumChildren = function( strParentName, strName, strEvent, intOverrideBU, intOverridePO ) {
	var intBU = ( ( typeof( intOverrideBU ) == 'undefined' ) ? this.objData.Prop.currentBU : intOverrideBU );
	var intPO = ( ( typeof( intOverridePO ) == 'undefined' ) ? this.objData.Prop.BU[ this.objData.Prop.currentBU ].currentPO : intOverridePO );
	var nodeChildren = document.getElementById( strParentName + '_' + strName + '_numChildren' );
	var intChildren = nodeChildren.options[ nodeChildren.selectedIndex ].value;

	if ( this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQPartyMix.currentChildren == intChildren ) {
		return false;
	}

	this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQPartyMix.currentChildren = intChildren;
	var nodeContainer = document.getElementById( strParentName + '_' + strName + '_childContainer' );

	if ( intChildren > 0 ) {

		var intCount = nodeChildren.options[ ( nodeChildren.options.length - 1 ) ].value;

		do {
			if ( typeof( document.getElementById( strParentName + '_' + strName + '_ageContainer' + intCount ) ) != 'undefined' ) {
				document.getElementById( strParentName + '_' + strName + '_ageContainer' + intCount ).className = ( ( intCount > intChildren ) ? 'SQQPartyMixChildAgeCount SQQPartyMixChildAgeCountHide' : 'SQQPartyMixChildAgeCount SQQPartyMixChildAgeCountDisplay' );
			}
		} while ( --intCount );
		
		nodeContainer.className = 'SQQPartyMixChildAgeContainer';
	} else {
		nodeContainer.className = 'SQQPartyMixChildAgeContainer hidden';
	}
	
	return true;
};

DisneyQuickQuote.prototype.displayChildAgeDisclaimer = function ( strName, strEvent ) {

	this.displayMessage( document.getElementById( strName + 'Body' ).innerHTML, document.getElementById( strName + 'Head' ).innerHTML, this.objData.Prop.errors.strCloseLabel );
	
	return true;
};

DisneyQuickQuote.prototype.hidePopup = function ( strName, strEvent ) {
	
	if ( typeof( document.body.style.maxHeight ) == 'undefined' ) {
		this.loopElementsWithCallback( document.getElementById( this.arrAttributes.qqElement ).getElementsByTagName( 'select' ), function( node ) {
			node.style.visibility = '';
		} );
	}
	
	if (document.getElementById( strName )) {
		document.getElementById( strName ).style.display = 'none';
	}
		
	return true;
};

DisneyQuickQuote.prototype.stdTimezoneOffset = function() {
       var thisDate = new Date();
       var dtFullYear = thisDate.getFullYear();
       
       var jan = new Date(dtFullYear, 0, 1);
       var jul = new Date(dtFullYear, 6, 1);
       return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}

DisneyQuickQuote.prototype.setDefaultTime = function( nodeElement, currTime, riskFactorMinutes, startTime, endTime ) {

	var addHours = Math.floor(riskFactorMinutes / 60);
	var addMin = riskFactorMinutes % 60;
	var riskFactorMin = 0;	// This value will be changed if hour is after ending time - book tomorrow
	
	var dtEndTime = new Date (currTime.toDateString() + ' ' + endTime);

	
         
        var intCurrTimeZoneOffset = 480;

	var intDSTSavings       = 3600000;				

	var curr_hour = currTime.getUTCHours() + (-8);
	
	if (intDSTSavings > 0) {

		if (intCurrTimeZoneOffset < this.stdTimezoneOffset() ){	
                       curr_hour -=1;
		} 
	}        
			
	var curr_date = currTime.getUTCDate();
	var curr_min = currTime.getUTCMinutes();

	if(curr_hour < 0){
		curr_hour += 24;
	}

	currTime.setHours(curr_hour);
	currTime.setMinutes(curr_min);

	if(dtEndTime.compare(currTime) == -1 || currTime.getDate() > dtEndTime.getDate()) {
		currTimeStr = startTime;
		riskFactorMin = 1;
	}
	
	curr_hour += addHours;	
	curr_min += addMin;

	currTime.setHours(curr_hour);
	currTime.setMinutes(curr_min);

	currTime.setHours(curr_hour);
	
	currTime = this.setNewTimeMinutes(currTime, nodeElement);
		
	if(dtEndTime.compare(currTime) == -1) {
		currTimeStr = startTime;
		riskFactorMin = 1;
	}		
		
	curr_hour = currTime.getHours();
	curr_min = currTime.getMinutes();

	if(curr_min == '0') {
	 	curr_min = '00';
	}

	a_p = this.setAMPM(curr_hour);

	curr_hour = this.setAMPMCurrentHour(curr_hour);

	if(curr_hour.toString().length == 1) {
		 	curr_hour = '0' + curr_hour;
	}	

	if(riskFactorMin == 0) {
		currTimeStr = curr_hour + ":" + curr_min +" "+ a_p;
	}	
	
	this.disableTimeDropdown(nodeElement, currTimeStr);
	
	return riskFactorMin;
};

DisneyQuickQuote.prototype.loadDropDown = function( nodeElement, arrData ) {

	if ( nodeElement.length > 0 ) {
		do {
			nodeElement.remove( 0 );
		} while ( nodeElement.length );
	}

	if ( arrData && arrData.length > 0 ) {

		var nodeOption;
		var intCount = 0;
		var intTotal = arrData.length;

		do {

			nodeOption = document.createElement( 'option' );
			nodeOption.text = arrData[ intCount ].l.replace( /&amp;/gi, '&' );
			nodeOption.value = ( ( typeof( arrData[ intCount ].d ) != 'undefined' ) ? arrData[ intCount ].d : '' );

			try {
				nodeElement.add( nodeOption, null );
			} catch ( e ) {
				nodeElement.add( nodeOption );
			}
			
			++intCount;
		} while ( intCount < intTotal );
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateDropDownMultiSelection = function ( intNode, strElement1, strElement2, strEvent, intOverrideBU, intOverridePO ) {
	var nodeElement1 = document.getElementById( strElement1 );
	var intBU = ( ( typeof( intOverrideBU ) == 'undefined' ) ? this.objData.Prop.currentBU : intOverrideBU );
	var intPO = ( ( typeof( intOverridePO ) == 'undefined' ) ? this.objData.Prop.BU[ this.objData.Prop.currentBU ].currentPO : intOverridePO );

	var intLoc = nodeElement1.options[ nodeElement1.selectedIndex ].value.indexOf( '|' );

	if ( intLoc == -1 ) {
		return false;
	}
	
	var strNewValues = nodeElement1.options[ nodeElement1.selectedIndex ].value.substr( ( intLoc + 1 ) );
	var nodeElement2 = document.getElementById( strElement2 );

	if ( strNewValues || typeof( this.objData.Groups[ strNewValues ] ) != 'undefined' ) {

		if ( strNewValues == this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intNode ].xmlPointer2 ) {
			nodeElement2.parentNode.style.display = 'block';
			return true;
		}
 
		this.objData.Prop.BU[ intBU ].PO[ intPO ].SQQDropDownMulti[ intNode ].xmlPointer2 = strNewValues;

		this.loadDropDown( nodeElement2, this.objData.Groups[ strNewValues ] );

		nodeElement2.parentNode.style.display = 'block';
	} else {
 
		nodeElement2.parentNode.style.display = 'none';
	}
};

DisneyQuickQuote.prototype.updateTravelDates = function ( strName, bSingle, intMonth, intDay, intYear ) {
	if ( bSingle ) {
		document.getElementById( strName + 'Date' ).value = intMonth + '/' + intDay + '/' + intYear;
	} else {
		var nodeMonth = document.getElementById( strName + 'Month' );
		var nodeDay = document.getElementById( strName + 'Day' );
		var nodeYear = document.getElementById( strName + 'Year' );
		
		nodeMonth.value = intMonth;
		nodeYear.value = intYear;
		this.updateDaysInMonth( nodeMonth, nodeDay, nodeYear );
		nodeDay.value = intDay;
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateTextBoxOverlay = function ( strName, strParentName, bIsFocus, bSetFocus, strEvent ) {
	var nodeElement = document.getElementById( strParentName + '_' + strName + '_Text' );
	var nodeOverlay = document.getElementById( strParentName + '_' + strName + '_Overlay' );
	
	if ( bSetFocus ) {
		nodeElement.focus();
	}

	if ( bIsFocus ) {
		nodeOverlay.className = 'SQQTextBoxOverlayLabelHide';
	} else {
		if ( typeof( nodeElement.value ) != 'undefined'  ) {
			if ( nodeElement.value && nodeElement.value.length > 0 ) {
				nodeOverlay.className = 'SQQTextBoxOverlayLabelHide';
			} else {
				nodeOverlay.className = 'SQQTextBoxOverlayLabel';
			}
		} else {
			nodeOverlay.className = 'SQQTextBoxOverlayLabel';
		}
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateDropDownSelection = function ( strName, strParentName, intNode, strEvent, intOverwriteBU, intOverwritePO ) {
	var nodeElement = document.getElementById( strParentName + '_' + strName );
	var intBU = ( ( typeof( intOverwriteBU ) == 'undefined' ) ? this.objData.Prop.currentBU : intOverwriteBU );
	var intPO = ( ( typeof( intOverwritePO ) == 'undefined' ) ? this.objData.Prop.BU[ this.objData.Prop.currentBU ].currentPO : intOverwritePO );
	
	var objPO = this.objData.Prop.BU[ intBU ].PO[ intPO ];
	var nodeSelect = document.getElementById( strParentName + '_' + objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].xmlPointer );
	var strDataName = strName;
	var objData;
	
	if ( typeof( objPO.SQQDropDown[ intNode ].targetData ) != 'undefined' && objPO.SQQDropDown[ intNode ].targetData ) {
		strDataName = objPO.SQQDropDown[ intNode ].targetData ;
	}

	if ( !nodeElement.value ) {

		if ( !this.objData.Groups[ objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].xmlPointer ] ) {
			return false;
		} else {
			objData = this.objData.Groups[ objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].xmlPointer ];
			objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].targetData = null;
		}
	} else {

		var objGroup = this.objData.Groups[ strDataName ][ nodeElement.selectedIndex ];
		
		if ( !objGroup || objGroup.length < 1 || ( typeof( objGroup.a ) != 'undefined' && objGroup.a.length < 1 ) ) {
			nodeSelect.className = 'SQQDropDownSelect SQQDropDownSelectHidden';
			
			return false;
		}

		if ( strDataName == 'DCLCruises' ) {
			objData = objGroup.a;
		} else if ( typeof( objGroup.t ) == 'undefined') { 
			if ( !this.objData.Groups[ objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].xmlPointer ] ) {
				return false;
			} else {
				objData = this.objData.Groups[ objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].xmlPointer ];
				objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].targetData = null;
			}
		} else {
			if ( !this.objData.Groups[ objGroup.t ] && !this.objData.OptInfo[ objGroup.t ] ) {
				return false;
			}

			if ( objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].targetData == objGroup.t ) {
				return false;
			}
			
			objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].targetData = objGroup.t; // moved here to save data
			
			if ( this.objData.Groups[ objGroup.t ] ) {
				objData = this.objData.Groups[ objGroup.t ];
			} else {

				var objOptInfo = this.objData.OptInfo[ objGroup.t ];
				objData = objOptInfo.d;

				if ( typeof( objPO.SQQTravelDates ) != 'undefined' ) {

					this.checkCalendar( this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.arrival ], true );
					this.checkCalendar( this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.departure ], true );
					
					var dtStart = new Date();
					dtStart.setToCalendarDate();
					var dtEnd = new Date( dtStart );

					if ( ( typeof( objOptInfo.travelStartDate ) != 'undefined' && objOptInfo.travelStartDate !== null ) || ( typeof( objOptInfo.travelStartDate ) == 'undefined' && objOptInfo.travelStartMonth != ( dtStart.getMonth() + 1 ) ) ) {

						dtStart.setFullYear( objOptInfo.travelStartYear, ( ( objOptInfo.travelStartMonth * 1 ) - 1 ), 1 );
						
						if ( typeof( objOptInfo.travelStartDate ) != 'undefined' && objOptInfo.travelStartDate !== null ) {
							dtStart.setDate( objOptInfo.travelStartDate );
						}
					}

					if ( ( typeof( objOptInfo.travelEndDate ) != 'undefined' && objOptInfo.travelEndDate !== null ) || ( typeof( objOptInfo.travelEndDate ) == 'undefined' && objOptInfo.travelEndMonth != ( dtEnd.getMonth() + 1 ) ) ) {

						dtEnd.setFullYear( objOptInfo.travelEndYear, ( ( objOptInfo.travelEndMonth * 1 ) - 1 ), 1 );
						
						if ( typeof( objOptInfo.travelEndDate ) != 'undefined' && objOptInfo.travelEndDate !== null ) {
							dtEnd.setDate( objOptInfo.travelEndDate );
						}
					}

					dtEnd.setDate( dtEnd.getDate() - objOptInfo.minBookTime );

					this.updateTravelDates( strParentName + '_' + objPO.SQQTravelDates.name + '_arrival', objPO.SQQTravelDates.singleTextField, ( dtStart.getMonth() + 1 ), dtStart.getDate(), dtStart.getFullYear() );
					this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.arrival ].calendar.setDateFromInputs();
					this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.arrival ].calendar.setDateRange( dtStart, dtEnd );
					this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.arrival ].minBookTime = objOptInfo.minBookTime;

					var dtDisplay = new Date( dtStart );
					
					if (objPO.SQQTravelDates.displayDateRange >= objOptInfo.minBookTime) {
						dtDisplay.setDate( dtDisplay.getDate() + objPO.SQQTravelDates.displayDateRange );
					} else {
						dtDisplay.setDate( dtDisplay.getDate() + objOptInfo.minBookTime );
					}
					
					dtStart.setDate( dtStart.getDate() + objOptInfo.minBookTime );
					dtEnd.setDate( dtEnd.getDate() + objOptInfo.minBookTime );
					
					this.updateTravelDates( strParentName + '_' + objPO.SQQTravelDates.name + '_departure', objPO.SQQTravelDates.singleTextField, ( dtDisplay.getMonth() + 1 ), dtDisplay.getDate(), dtDisplay.getFullYear() );
					this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.departure ].calendar.setDateFromInputs();
					this.arrAttributes.qqCalendars[ objPO.SQQTravelDates.departure ].calendar.setDateRange( dtStart, dtEnd );
				}
			}
		}
	}

	nodeSelect.className = 'SQQDropDownSelect';
	this.loadDropDown( nodeSelect, objData );

	if ( typeof( objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].child ) != 'undefined' && objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].child ) {
		return this.updateDropDownSelection( objPO.SQQDropDown[ objPO.SQQDropDown[ intNode ].child ].xmlPointer, strParentName, objPO.SQQDropDown[ intNode ].child, 'inherit', intBU, intPO );
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateFilteredSelection = function (evt, strParentName, objFilter, strEvent) {
    var i, ii, arrValues = [], arrFields = [], objCatalog, bReset = false, objEvent, objTarget, strDelimiter = '^';

    function getValueIndex(objCatalog, nodeField) {
        var i, arrData;

        if (nodeField && nodeField.value && nodeField.name) {
            if (objCatalog && objCatalog.values && objCatalog.values[nodeField.name]) {
                arrData = objCatalog.values[nodeField.name];
            }

            if (arrData) {
                for (i = arrData.length; --i >= 0;) {
                    if (arrData[i] == nodeField.value) return i;
                }
            }
        }

        return undefined;
    }

    function getFilterString(arrData, arrIndex) {
        var i, strFilter = '';

        for (i = arrIndex.length; --i >= 0;) {
            strFilter = arrData[arrIndex[i]] + strDelimiter + strFilter;
        }

        return strDelimiter + strFilter;
    }

    function getFilteredCatalog(objCatalog, arrSelection) {
        var i, f, arrData, arrIndex = [], objResult = {}, strField, strValue;

        for (i = arrSelection.length; --i >= 0;) {
            if (arrSelection[i] != undefined) arrIndex[arrIndex.length] = i;
        }

        for (i = objCatalog.fields.length; --i >= 0;) {
            objResult[objCatalog.fields[i]] = '';
        }

        strMatch = getFilterString(arrSelection, arrIndex);
        if (strMatch != strDelimiter) {
            for (i = objCatalog.catalog.length; --i >= 0;) {
                arrData = objCatalog.catalog[i];

                if (strMatch == getFilterString(arrData, arrIndex)) {
                    for (f = objCatalog.fields.length; --f >= 0;) {
                        strField = objCatalog.fields[f];
                        strValue = strDelimiter + objCatalog.values[strField][arrData[f]] + strDelimiter;

                        if (objResult[strField].indexOf(strValue) < 0) {
                            objResult[strField] = strValue + objResult[strField];
                        }
                    }
                }
            }
        }

        return objResult;
    }

    objEvent = evt || window.event;
    objTarget = objEvent.target || objEvent.srcElement;
    if (objTarget && objTarget.selectedIndex && objTarget.options) {
        if (objTarget.options[objTarget.selectedIndex].className.match(/\bunavailable\b/) != null) {
            bReset = true;
        }
    }

    for (i = objFilter.ids.length; --i >= 0;) {
        arrFields[i] = document.getElementById(strParentName + '_' + objFilter.ids[i]);

        if (bReset && arrFields[i] != objTarget && arrFields[i] && arrFields[i].selectedIndex) {
            arrFields[i].selectedIndex = 0;
        }

        arrValues[i] = getValueIndex(objFilter, arrFields[i]);
    }

    objCatalog = getFilteredCatalog(objFilter, arrValues);

    for (i = arrFields.length; --i >= 0;) {
        objField = arrFields[i];

        if (objField && objField.options) {
            for (ii = objField.options.length; --ii >= 0;) {
                objOption = objField.options[ii];
                objOption.className = objOption.className.replace(/\s?\bunavailable\b/, '');

                if (objOption.value && objField.name && objCatalog[objField.name]) {
                    if (objCatalog[objField.name].indexOf(strDelimiter + objOption.value + strDelimiter) < 0) {
                        objOption.className += 'unavailable';
                    }
                }
            }

            objField.parentNode.replaceChild(objField, objField);
        }
    }

    return;
}

DisneyQuickQuote.prototype.checkCalendar = function( objEntry, bPreventAutoCheck ) {
	if ( typeof( objEntry.calendar ) == 'undefined' ) {

		if ( !objEntry.isArrival && !bPreventAutoCheck ) {
			this.checkCalendar( this.arrAttributes.qqCalendars[ objEntry.arrival ], true );
		}

		if ( objEntry.singleTextField ) {
			objEntry.calendar = new Calendar( objEntry.name + 'Date', objEntry.config );
		} else {
			objEntry.calendar = new Calendar( objEntry.name + 'Month', objEntry.name + 'Day', objEntry.name + 'Year', objEntry.config );
		}
		
		objEntry.calendar.draw(); 
		objEntry.calendar.hide(); 
		objEntry.config = undefined;

		objEntry.calendar._fChange = objEntry._fChange;

		if ( objEntry.isArrival && !bPreventAutoCheck ) {
			if( typeof(this.arrAttributes.qqCalendars[ objEntry.departure ]) != 'undefined'){
				this.checkCalendar( this.arrAttributes.qqCalendars[ objEntry.departure ], true );
			}
			
		}
		
		return true;
	} else {
		return false;
	}
};

DisneyQuickQuote.prototype.displayCalendar = function ( objEntry, intCal, strEvent ) {

	if ( this.arrAttributes.curOpenCalendar >= 0 ) {

		if ( this.arrAttributes.qqCalendars[ this.arrAttributes.curOpenCalendar ].name == objEntry.name ) {
			this.hideCal( objEntry );
			return true;
		}
		
		this.hideCal( this.arrAttributes.qqCalendars[ this.arrAttributes.curOpenCalendar ] );
	}

	this.checkCalendar( objEntry );

	if ( typeof( document.body.style.maxHeight ) == 'undefined' ) {
		if ( document.getElementById( 'SQQMultiBU' ) ) {
			document.getElementById( 'SQQMultiBU' ).style.visibility = 'hidden';
		}
		
		this.displayMessage( '', '', '', true );
		this.loopElementsWithCallback( document.getElementById( objEntry.parentName + '_Container' ).getElementsByTagName( 'select' ), function( node ) {
			if ( node.id != objEntry.name + 'Month' && node.id != objEntry.name + 'Day' && node.id != objEntry.name + 'Year' ) {
				node.style.visibility = 'hidden';
			} else {
				node.style.visibility = 'visible';
			}
		} );
	}

	var nodeElement = document.getElementById( objEntry.name + 'CalendarBtn' );
	nodeElement.className = 'SQQTravelDatesCalendar SQQTravelDatesCalendarOpen';
	
	var objCoords = this.getCoords( nodeElement );
	
	this.arrAttributes.curOpenCalendar = intCal;
	objEntry.calendar._nodeCalendar.style.left = objCoords.right + 'px'; 
	objEntry.calendar._nodeCalendar.style.top = objCoords.top + 'px';
	objEntry.calendar.show();
	
	return true;
};

DisneyQuickQuote.prototype.hideCal = function( objEntry ) {

	if ( this.arrAttributes.curOpenCalendar < 0 ) {
		return false;
	}

	document.getElementById( objEntry.name + 'CalendarBtn' ).className = 'SQQTravelDatesCalendar';
	objEntry.calendar.hide();
	this.arrAttributes.curOpenCalendar = -1;
};

DisneyQuickQuote.prototype.getCoords = function( nodeElement ) {
	var objCoords = {
		top: 0,
		right: 0,
		bottom: 0,
		left: 0
	};
	
	objCoords.right = nodeElement.offsetWidth;
	objCoords.bottom = nodeElement.offsetHeight;

	while ( nodeElement !== null ) {
		objCoords.top += nodeElement.offsetTop;
		objCoords.left += nodeElement.offsetLeft;
		nodeElement = nodeElement.offsetParent;
	}

	objCoords.bottom += objCoords.top;
	objCoords.right += objCoords.left;
	
	return objCoords;
};

DisneyQuickQuote.prototype.checkOpenCalendar = function( e, that ) {

	if ( that.arrAttributes.curOpenCalendar < 0 ) {
		return false;
	}

	if ( typeof( that.arrAttributes.qqCalendars[ that.arrAttributes.curOpenCalendar ] ) == 'undefined' ) {
		that.arrAttributes.curOpenCalendar = -1;
		return false;
	}
	
	var objEntry = that.arrAttributes.qqCalendars[ that.arrAttributes.curOpenCalendar ];

	if ( !e ) {
		e = window.event;
	}


	var objCoords = that.getCoords( objEntry.calendar._nodeCalendar );
	
	var intPosX = 0;
	var intPosY = 0;

	objCoords.bottom += ( that.arrAttributes.qqCalendarPadding );
	objCoords.right += ( that.arrAttributes.qqCalendarPadding );
	objCoords.top -= ( that.arrAttributes.qqCalendarPadding );
	objCoords.left -= ( that.arrAttributes.qqCalendarPadding );

	if ( typeof( e.pageX ) != 'undefined' && typeof( e.pageY ) != 'undefined' ) {
		intPosX = e.pageX;
		intPosY = e.pageY;
	} else if ( typeof( e.clientX ) != 'undefined' && typeof( e.clientY ) != 'undefined' ) {
		intPosX = ( e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft );
		intPosY = ( e.clientY + document.body.scrollTop + document.documentElement.scrollTop );
	}

	if ( !( intPosX > objCoords.left && intPosX < objCoords.right && intPosY > objCoords.top && intPosY < objCoords.bottom ) ) {

		var nodeBtn = document.getElementById( objEntry.name + 'CalendarBtn' );
		if ( nodeBtn ) {
			objCoords = that.getCoords( nodeBtn );

			if ( intPosX > objCoords.left && intPosX < objCoords.right && intPosY > objCoords.top && intPosY < objCoords.bottom ) {
				return false;
			}
		}

		var nodeDate = document.getElementById( objEntry.name + 'Date' );
		if ( nodeDate ) {
			objCoords = that.getCoords( nodeDate );

			if ( intPosX > objCoords.left && intPosX < objCoords.right && intPosY > objCoords.top && intPosY < objCoords.bottom ) {
				return false;
			}
		}

		if ( typeof( document.body.style.maxHeight ) == 'undefined' ) {
			this.hidePopup( 'qqWarning', 'auto' );
			this.loopElementsWithCallback( document.getElementById( objEntry.parentName + '_Container' ).getElementsByTagName( 'select' ), function( node ) {
				node.style.visibility = 'visible';
			} );
		}
		
		this.hideCal( objEntry );
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateSingleTravelDate = function( objEntry, bFromCal, strEvent ) {

	if ( bFromCal ) {

		if ( typeof( document.body.style.maxHeight ) == 'undefined' ) {
			this.hidePopup( 'qqWarning', 'click' );
			this.loopElementsWithCallback( document.getElementById( objEntry.parentName + '_Container' ).getElementsByTagName( 'select' ), function( node ) {
				node.style.visibility = 'visible';
			} );
		}
		
		this.hideCal( objEntry );
	} else {
		bCreated = this.checkCalendar( objEntry );
	}

	if ( objEntry.isArrival ) {
		var bUpdateDeparture = false;
		var dtDepart = new Date();
		dtDepart.setToCalendarDate();
		var dtLowest = new Date( dtDepart );
		var intSavedMonth = objEntry.calendar._dtSelected.getMonth();
		var intSavedDate = objEntry.calendar._dtSelected.getDate();
		var intSavedYear = objEntry.calendar._dtSelected.getFullYear();
		var riskFactorDays = 0;
		var nodeDepartureDate = null;
		var nodeArrivalDate = document.getElementById( objEntry.name + 'Date' ); // Get date value from the input 

		if (objEntry.departure) {
			nodeDepartureDate = document.getElementById( this.arrAttributes.qqCalendars[ objEntry.departure ].name + 'Date' );
		}

		if (!nodeDepartureDate) {
		
			var newDate = new Date(Date.parse( nodeArrivalDate.value ) );

			var nodeTimeDropdown = objEntry.timeDropDown;

			if (bFromCal) {
				newDate = new Date((intSavedMonth+1) +'/'+ intSavedDate +'/'+ intSavedYear);
			} 

			if (dtDepart.compare(newDate) == -1) {
				this.enableTimeDropdown(nodeTimeDropdown, objEntry.operationalStartTime);
			} else {
				newDate = new Date();
				newDate.setMonth(intSavedMonth+1);
				newDate.setDate(intSavedDate);
				newDate.setFullYear(intSavedYear);
				riskFactorDays = this.setDefaultTime(nodeTimeDropdown, newDate, objEntry.riskFactorMinutes, objEntry.operationalStartTime, objEntry.operationalEndTime);
				dtDepart.setDate(intSavedDate + riskFactorDays);
			}
			
		}

		if ( bFromCal ) {
			dtDepart.setFullYear( intSavedYear, intSavedMonth, (intSavedDate + riskFactorDays));
			if ( objEntry.displayDateRange ) {
				dtDepart.setDate( dtDepart.getDate() + objEntry.displayDateRange );
			} else {
				dtDepart.setDate( dtDepart.getDate() );
			}
			
			bUpdateDeparture = true;
		} else {
			var dtNew = new Date( dtDepart );

			if ( dtNew.validate( nodeArrivalDate.value ) ) {
				dtNew.setTime( Date.parse( nodeArrivalDate.value ) );
				
				if ( dtNew < objEntry.calendar._dtRangeStart ) {
					dtNew.setTime( objEntry.calendar._dtRangeStart.getTime() );
					nodeArrivalDate.value = ( dtNew.getMonth() + 1 ) + '/' + dtNew.getDate() + '/' + dtNew.getFullYear();
				}
				
				dtLowest.setTime( dtNew.getTime() );
			}
			
			if ( nodeDepartureDate && dtDepart.validate( nodeDepartureDate.value ) ) {
				dtDepart.setTime( Date.parse( nodeDepartureDate.value ) );
			}
			
			if ( dtNew > dtDepart ) {
				dtDepart.setTime( dtNew.getTime() );
				bUpdateDeparture = true;
			}
			
			dtLowest.setDate( dtLowest.getDate() + objEntry.minBookTime );
			if ( dtLowest > dtDepart ) {
				dtDepart.setTime( dtLowest.getTime() );
				bUpdateDeparture = true;
			} else {

				if ( dtNew.getMonth() != intSavedMonth ) {
					dtDepart.setMonth( dtNew.getMonth() );
					dtDepart.setDate( dtNew.getDate() );
					bUpdateDeparture = true;
				} else if ( dtNew.getMonth() == dtDepart.getMonth() && dtNew.getDate() != intSavedDate && dtNew.getDate() >= dtDepart.getDate() ) {

					dtDepart.setMonth( dtNew.getMonth() );
					dtDepart.setDate( dtNew.getDate() );
					bUpdateDeparture = true;
				} else if ( dtNew.getFullYear() != intSavedYear ) {

					dtDepart.setFullYear( dtNew.getFullYear() );
					bUpdateDeparture = true;
				}
				
				if ( bUpdateDeparture ) {
					dtDepart.setDate( dtDepart.getDate() + objEntry.displayDateRange );
				}
			}

			objEntry.calendar.setDateFromInputs();
		}

		if ( bUpdateDeparture && nodeDepartureDate ) {
			nodeDepartureDate.value = ( dtDepart.getMonth() + 1 ) + '/' + dtDepart.getDate() + '/' + dtDepart.getFullYear();
			this.arrAttributes.qqCalendars[ objEntry.departure ].calendar.setDateFromInputs();
		}

		if (objEntry.departure) {
			this.arrAttributes.qqCalendars[ objEntry.departure ].calendar.setDateRange( dtLowest, this.arrAttributes.qqCalendars[ objEntry.departure ].calendar._dtRangeEnd );
		}
	} else if ( !bFromCal ) { 
		objEntry.calendar.setDateFromInputs();
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateTravelDate = function( objEntry, bFromCal, strEvent ) {
	var bCreated = false;

	if ( bFromCal ) {

		if ( typeof( document.body.style.maxHeight ) == 'undefined' ) {
			this.hidePopup( 'qqWarning', 'click' );
			this.loopElementsWithCallback( document.getElementById( objEntry.parentName + '_Container' ).getElementsByTagName( 'select' ), function( node ) {
				node.style.visibility = 'visible';
			} );
		}
		
		this.hideCal( objEntry );
	} else {
		bCreated = this.checkCalendar( objEntry );
	}

	if ( objEntry.isArrival ) {
		var nodeArrivalMonth = document.getElementById( objEntry.name + 'Month' );
		var nodeArrivalDay = document.getElementById( objEntry.name + 'Day' );
		var nodeArrivalYear = document.getElementById( objEntry.name + 'Year' );
		var nodeDepartureMonth = document.getElementById( this.arrAttributes.qqCalendars[ objEntry.departure ].name + 'Month' );
		var nodeDepartureDay = document.getElementById( this.arrAttributes.qqCalendars[ objEntry.departure ].name + 'Day' );
		var nodeDepartureYear = document.getElementById( this.arrAttributes.qqCalendars[ objEntry.departure ].name + 'Year' );
		
		var intSavedMonth = ( objEntry.calendar._dtSelected.getMonth() + 1 );
		var intSavedDate = objEntry.calendar._dtSelected.getDate();
		var intSavedYear = objEntry.calendar._dtSelected.getFullYear();
    
		var dtNew = new Date();
		dtNew.setToCalendarDate();

		var bUpdateDeparture = true;

		if ( bFromCal ) {
			this.updateDaysInMonth( nodeArrivalMonth, nodeArrivalDay, nodeArrivalYear );
			nodeArrivalDay.value = objEntry.calendar._dtSelected.getDate();
			
			dtNew.setFullYear( intSavedYear, ( intSavedMonth - 1 ), intSavedDate );
			dtNew.setDate( dtNew.getDate() + objEntry.displayDateRange );
			
			nodeDepartureMonth.value = ( dtNew.getMonth() + 1 );
			nodeDepartureYear.value = dtNew.getFullYear();
			this.updateDaysInMonth( nodeDepartureMonth, nodeDepartureDay, nodeDepartureYear );
			nodeDepartureDay.value = dtNew.getDate();
			
			bUpdateDeparture = true;
		} else  {

			dtNew.setFullYear( nodeArrivalYear.value, ( ( nodeArrivalMonth.value * 1 ) - 1 ), nodeArrivalDay.value );
			
			if ( dtNew.compare(objEntry.calendar._dtRangeEnd) == 1 ) { 
				dtNew.setTime( objEntry.calendar._dtRangeEnd.getTime() );
				
				nodeArrivalYear.value = dtNew.getFullYear();
				nodeArrivalMonth.value = ( dtNew.getMonth() + 1 );
				this.updateDaysInMonth( nodeArrivalMonth, nodeArrivalDay, nodeArrivalYear );
				nodeArrivalDay.value = dtNew.getDate();
			}
			
			var intNewDay = -1;

			var dtDisplay = new Date( dtNew );
			dtDisplay.setDate( dtDisplay.getDate() + objEntry.displayDateRange ); 
			dtNew.setDate( dtNew.getDate() + objEntry.minBookTime );
			
			if ( bCreated ) {
				intSavedMonth = -1;
			}

			if ( ( nodeArrivalMonth.value != intSavedMonth ) || ( nodeArrivalMonth.value == nodeDepartureMonth.value && ( nodeArrivalDay.value * 1 ) != intSavedDate && ( nodeArrivalDay.value * 1 ) >= ( nodeDepartureDay.value * 1 ) ) ) {

				nodeDepartureMonth.value = ( dtDisplay.getMonth() + 1 );
				intNewDay = dtDisplay.getDate();
				bUpdateDeparture = true;
			} else if ( nodeArrivalYear.value != intSavedYear ) {

				nodeDepartureYear.value = dtNew.getFullYear(); 
				bUpdateDeparture = true;
			} 

			if ( nodeArrivalMonth.value != intSavedMonth || nodeArrivalYear.value != intSavedYear ) {
				this.updateDaysInMonth( nodeArrivalMonth, nodeArrivalDay, nodeArrivalYear );
			}

			if ( bUpdateDeparture ) {
				this.updateDaysInMonth( nodeDepartureMonth, nodeDepartureDay, nodeDepartureYear );

				if ( nodeDepartureMonth.value != nodeArrivalMonth.value && nodeArrivalDay.value == 1 ) {
					nodeDepartureMonth.value = nodeArrivalMonth.value;
					this.updateDaysInMonth( nodeDepartureMonth, nodeDepartureDay, nodeDepartureYear );
					dtNew.setMonth( nodeArrivalMonth.value - 1 ); // this is on purpose, we want the previous month (0-11)
				}

				if ( intNewDay < 0) {
                    intNewDay = dtDisplay.getDate();				
				}
				 
				if ( intNewDay > 0 ) {
					nodeDepartureDay.value = intNewDay;

				}
			}

			objEntry.calendar.setDateFromInputs();
		}

		if ( bUpdateDeparture ) {
			this.arrAttributes.qqCalendars[ objEntry.departure ].calendar.setDateFromInputs();
		}

		this.arrAttributes.qqCalendars[ objEntry.departure ].calendar.setDateRange( dtNew, this.arrAttributes.qqCalendars[ objEntry.departure ].calendar._dtRangeEnd );
	} else {
		nodeDepartureMonth = document.getElementById( objEntry.name + 'Month' );
		nodeDepartureDay = document.getElementById( objEntry.name + 'Day' );
		nodeDepartureYear = document.getElementById( objEntry.name + 'Year' );
		
		if ( bFromCal ) {
			this.updateDaysInMonth( nodeDepartureMonth, nodeDepartureDay, nodeDepartureYear );
			nodeDepartureDay.value = objEntry.calendar._dtSelected.getDate();
		} else {
			dtNew = new Date();
			dtNew.setToCalendarDate();
			dtNew.setFullYear( nodeDepartureYear.value, ( ( nodeDepartureMonth.value * 1 ) - 1 ), nodeDepartureDay.value );
			
			if ( dtNew.compare(objEntry.calendar._dtRangeEnd) == 1 ) { 
				nodeDepartureYear.value = objEntry.calendar._dtRangeEnd.getFullYear();
				nodeDepartureMonth.value = objEntry.calendar._dtRangeEnd.getMonth();
				this.updateDaysInMonth( nodeArrivalMonth, nodeArrivalDay, nodeArrivalYear );
				nodeDepartureDay.value = objEntry.calendar._dtRangeEnd.getDate();
			}

			if ( nodeDepartureMonth.value != ( objEntry.calendar._dtSelected.getMonth() + 1 ) || nodeDepartureYear.value != objEntry.calendar._dtSelected.getFullYear() ) {
				this.updateDaysInMonth( nodeDepartureMonth, nodeDepartureDay, nodeDepartureYear );
			}

			objEntry.calendar.setDateFromInputs();
		}
	}
	
	return true;
};

DisneyQuickQuote.prototype.updateDaysInMonth = function( nodeMonth, nodeDay, nodeYear ) {
	if ( nodeMonth.value === null || !( nodeMonth.value >= 1 && nodeMonth.value <= 12 ) ) {
		return false;
	}

	var arrDaysInMonth = Array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
	var intDaysInMonth = arrDaysInMonth[ ( nodeMonth.value - 1 ) ];
	var intDays = ( nodeDay.options[ ( nodeDay.length - 1 ) ].value * 1 );
	
	if ( nodeMonth.value == 2 ) { 
		if ( ( ( ( nodeYear.value ) % 4 ) === 0 && ( ( nodeYear.value ) % 100 ) !== 0 ) || ( ( nodeYear.value ) % 400 ) === 0 ) {
			intDaysInMonth = 29;
		}
	}

	if ( intDays == intDaysInMonth ) {
		return true;
	} else if ( intDays < intDaysInMonth ) { 
		var nodeOption = null;
		++intDays; 

		do {
			nodeOption = document.createElement( 'option' );
			nodeOption.value = intDays;
			nodeOption.text = intDays;

			try {
				nodeDay.add( nodeOption, null );
			} catch ( e ) {
				nodeDay.add( nodeOption );
			}
			
			++intDays;
		} while ( intDays <= intDaysInMonth );
	} else if ( intDays > intDaysInMonth ) { 
		intDays = ( intDays - intDaysInMonth );
		
		do {
			nodeDay.remove( intDaysInMonth );
		} while ( --intDays );
	}
	
	return true;
};

DisneyQuickQuote.prototype.addEvent = function( nodeElement, strEvent, funcFunction, bCapture ) {
	if ( nodeElement.addEventListener ) {
		nodeElement.addEventListener( strEvent, funcFunction, bCapture );
		return true;
	} else if ( nodeElement.attachEvent ) {
		var bReturn = nodeElement.attachEvent( 'on' + strEvent, funcFunction );
		return bReturn;
	} else {
		nodeElement[ 'on' + strEvent ] = funcFunction;
	}
};

qqModule = new DisneyQuickQuote();

if ( typeof( WDPRO_LOADER ) != 'undefined' ) {
	WDPRO_LOADER.addCallback( function(){
		qqModule.startOnload();
	} );
} else {
	qqModule.addEvent( window, 'load', function() { qqModule.startOnload(); }, false );
}

DisneyQuickQuote.prototype.enableTimeDropdown = function(nodeElement, strStartTime) {
	for ( var i = 0; i < nodeElement.length; i++ ) {
		if (nodeElement.options[i].text.indexOf(":") != -1) {
			nodeElement.options[i].value = nodeElement.options[i].text;
			nodeElement.options[i].disabled = false;
			nodeElement.options[i].className = 'SQQDropDownEnabledOption';
			nodeElement.options[i].style.color='black'; 
		}
	}
};

DisneyQuickQuote.prototype.disableTimeDropdown = function(nodeElement, currTimeStr ) {
	for( var i=0; i < nodeElement.length; i++){
		if( nodeElement.options[i].text.toLowerCase() == currTimeStr.toLowerCase() ) {
			nodeElement.options[i].selected = true;
			return;
		}

		if( nodeElement.options[i].text.indexOf(":") != -1 ) {
			nodeElement.options[i].disabled = true;
			nodeElement.options[i].value = ""; 
			nodeElement.options[i].className = "SQQDropDownDisabledOption";
			nodeElement.options[i].style.color='lightgrey';  
		}		

		if( nodeElement.options[i].value.toLowerCase() == 'divider' ) {
			nodeElement.options[i].disabled = true;
			nodeElement.options[i].value = "";
			nodeElement.options[i].className = "SQQDropDownDisabledOption";
		}
	}
	return true;	
};

DisneyQuickQuote.prototype.parseTime = function(timeString) {	
	
	var regExTime = /(\d+)(?::(\d\d))?\s*([Pp]?)/;	
	
	var dt = new Date();	  	
	if(regExTime.test(timeString)){						        
		var time = timeString.match(regExTime);														
		dt.setHours( Number(time[1]) + (time[3] && Number(time[1]) != 12 ? 12 : 0) );	        						
		dt.setMinutes( Number(time[2]) || 0 );
	}
	return dt;
}
 
DisneyQuickQuote.prototype.setNewTimeMinutes = function(currDate, nodeElement) {	

	var currMin = currDate.getMinutes();
	var currHour = currDate.getHours();
	var optionTime = new Date();	
	
	for( var i=0; i < nodeElement.length; i++){
		if( nodeElement.options[i].text.indexOf(":") != -1 ) {
			optionTime = this.parseTime(nodeElement.options[i].value);			
			if (optionTime > currDate){			   			                                
				return optionTime;
			}		
		}		
	}
	return currDate;
};

DisneyQuickQuote.prototype.setAMPM = function(currHour) {	
	if (currHour < 12) {
	   	a_p = "am";
	} else {
	   a_p = "pm";
	}
	
	return a_p;
};

DisneyQuickQuote.prototype.setAMPMCurrentHour = function(currHour) {	

	if (currHour == 0) {
	      currHour = 12;
	}else if (currHour > 12) {
	      currHour -= 12;
	}
	
	return currHour;
	
};

function toElement( nodeElement ) {
	if ( typeof( nodeElement ) != 'object' ) {
		nodeElement = document.getElementById( nodeElement );
	}
	
	return nodeElement;
}

Date.prototype.setToNextMonth = function() {
	this.setDate( 1 );
	this.setMonth( this.getMonth() + 1 );
};

Date.prototype.setToPreviousMonth = function() {
	this.setDate( 1 );
	this.setMonth( this.getMonth() - 1 );
};

Date.prototype.getDaysInMonth = function() {

	var that = this;
	that.setDate( 1 );
	that.setMonth( that.getMonth() + 1 );
	that.setDate( that.getDate() - 1 );
	return that.getDate();
};

Date.prototype.getFirstDayOfMonth = function() {
	var that = this;
	that.setDate( 1 );
	return that.getDay();
};

Date.prototype.setToCalendarDate = function() {
	this.setHours( 0 );
	this.setSeconds( 0 );
	this.setMinutes( 0 );
	this.setMilliseconds( 0 );
};

Date.prototype.getCalendarDate = function() {
	var t = new Date( this );
	t.setToCalendarDate();
	return t;
};

Date.prototype.validate = function( strInput ) {
	var bSet = false;
	
	try {
		bSet = ( typeof( strInput ) == 'string' && strInput.match(/^(0?[1-9]|1[012])[\.\-\/](0?[1-9]|[12]?[0-9]|3[01])[\.\-\/](\d\d)?\d\d$/) !== null );
	} catch( e ) {
		bSet = false;
	}
	
	return bSet;
};

Date.prototype.compare = function( dtCompare ) {
	var intReturn = null;
    var intCompareTime = dtCompare.getTime();
	var intThisTime = this.getTime();
	
    if ( intThisTime > intCompareTime ) {
		intReturn = 1;
	} else if ( intThisTime == intCompareTime ) {
		intReturn = 0;
	} else {
		intReturn = -1;
	}
	
	return intReturn;
};

function Calendar( varA, varB, varC, varD ) {
	// init private vars
	this._arrDayLabels = ['S','M','T','W','T','F','S'];
	this._arrMonthLabels = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
	this._arrCalendarDays = [];		
	this._dtNow = new Date();					
	this._dtNow.setToCalendarDate();			
	this._dtCurrentMonth = new Date(this._dtNow);	 
	this._dtCurrentMonth.setDate(1);
	this._dtRangeStart = null;					 
	this._dtRangeEnd = null;					 
	this._dtSelected = new Date(this._dtNow);	 
	this._fChange = null;						 
	this._nodeCalendar = null;					 
	this._nodeTarget = null;
	this._nodeMonthYear = null;  				 
	this._nodeSelectedDateCell = null;			 
	this._nodeSelectInputDay = null;
	this._nodeSelectInputMonth = null;
	this._nodeSelectInputYear = null;
	this._nodeShow = false;						 
	this._nodeTextInput = null;
	this._strID = null;
 
	var that = this;
	if ( arguments.length >= 3 ) {
		this._nodeSelectInputMonth = toElement( varA );
		this._nodeSelectInputDay = toElement( varB );
		this._nodeSelectInputYear = toElement( varC );
 
		if ( arguments.length == 4 ) {
			this.setConfig(varD);
		}
	} else if ( arguments.length >= 1 ) { // 1+ param, only 1 input
		this._nodeTextInput = toElement( varA );
 
		if ( arguments.length == 2) {
			this.setConfig(varB);
		}
		
		if ( this._dtSelected.validate( this._nodeTextInput.value ) ) {
			this._dtSelected.setTime( Date.parse( this._nodeTextInput.value ) );
			this._dtCurrentMonth = this._dtSelected;
			this._dtCurrentMonth.setDate(1);
		} else {

			this._setValue();
		}
	}
}
Calendar.prototype.addEvent = function( nodeElement, strEvent, funcFunction, bCapture ) {
	if ( nodeElement.addEventListener ) {
		nodeElement.addEventListener( strEvent, funcFunction, bCapture );
		return true;
	} else if ( nodeElement.attachEvent ) {
		var bReturn = nodeElement.attachEvent( 'on' + strEvent, funcFunction );
		return bReturn;
	} else {
		nodeElement[ 'on' + strEvent ] = funcFunction;
	}
};

Calendar.prototype.setConfig = function(objConfig) {

	if ( this._nodeSelectInputYear !== null ) {
		this._dtRangeStart = new Date('January 01, ' + this._nodeSelectInputYear.options[0].value); 
		this._dtRangeEnd = new Date('December 31, ' + this._nodeSelectInputYear.options[this._nodeSelectInputYear.options.length - 1].value);
	}

	if ( objConfig.id !== null ) {
		this._strID = objConfig.id;	
	}

	if ( objConfig.target !== null ) {
		this._nodeTarget = toElement( objConfig.target );
	}

	if ( objConfig.dateRangeStart !== null ) {
		this._dtRangeStart = new Date( objConfig.dateRangeStart );
		this._dtRangeStart.setToCalendarDate();
	}

	if ( objConfig.dateRangeEnd !== null ) {
		this._dtRangeEnd = new Date( objConfig.dateRangeEnd );
		this._dtRangeEnd.setToCalendarDate();
	}

	if ( objConfig.onChangeDate !== null ) {
		this._fChange = objConfig.onChangeDate;
	}

	if ( objConfig.showInput !== null ) {
		this._nodeShow = objConfig.showInput;
	}

	if ( objConfig.dayLabels !== undefined ) {
		this._arrDayLabels = objConfig.dayLabels.split( ',' );
	}

	if ( objConfig.monthLabels !== null ) {
		this._arrMonthLabels = objConfig.monthLabels.split( ',' );
	}
};

Calendar.prototype.setDateFromInputs = function() {
	if ( this._nodeTextInput !== null ) {
		if ( this._dtSelected.validate( this._nodeTextInput.value ) ) {
			this._dtSelected = new Date( this._nodeTextInput.value );
		}
	} else {
		this._dtSelected = new Date( this._nodeSelectInputMonth.value + '/' + this._nodeSelectInputDay.value + '/' + this._nodeSelectInputYear.value );
	}
	
	this._dtSelected.setToCalendarDate();
	this._dtCurrentMonth = new Date( this._dtSelected );
	this._dtCurrentMonth.setDate( 1 );
	this._populateMonth();
};

Calendar.prototype.getDateSelected = function(){
	return new Date( this._dtSelected );
};

Calendar.prototype.draw = function() {
	if ( this._nodeCalendar === null ) {

		var nodeContainer = document.createElement('div');
		nodeContainer.className = 'DisneyCal';
		
		if ( this._strID !== null ) {
			nodeContainer.id = this._strID;
		}

		var that = this;

		var nodeHead = nodeContainer.appendChild(document.createElement('div'));
		nodeHead.className = 'DisneyCalHead';
		
		var nodeChild = nodeHead.appendChild(document.createElement('div'));
		nodeChild.className = 'DisneyCalTLNav';
		
		var nodeData = nodeChild.appendChild(document.createElement('a'));
		nodeData.innerHTML = '&lt;';
		nodeData.href = 'javascript:void(0);';
		this.addEvent( nodeData, 'click', function() { that.setToPreviousMonth(); }, false );
		
		nodeChild = nodeHead.appendChild(document.createElement('span'));
		nodeChild.className = 'DisneyCalMonth';
		this._nodeMonthYear = nodeChild;
		
		nodeChild = nodeHead.appendChild(document.createElement('div'));
		nodeChild.className = 'DisneyCalTRNav';
		
		nodeData = nodeChild.appendChild(document.createElement('a'));
		nodeData.href = 'javascript:void(0);';
		nodeData.innerHTML = '&gt;';
		
		this.addEvent( nodeData, 'click', function() { that.setToNextMonth(); }, false );
 
		nodeHead = nodeContainer.appendChild(document.createElement('table'));
		nodeHead.className = 'DisneyCalTable';

		nodeChild = nodeHead.appendChild(document.createElement('thead'));
		nodeChild = nodeChild.appendChild(document.createElement('tr'));

		var intDaysInWeek = 7;
		var i = 0;
		do{
			nodeData = nodeChild.appendChild(document.createElement('th'));
			nodeData.innerHTML = this._arrDayLabels[i];
			i++;
		} while (--intDaysInWeek);

		nodeHead = nodeHead.appendChild(document.createElement('tbody'));
		var intWeeksInMonth = 6;
		do {
			intDaysInWeek = 7;
			nodeChild = nodeHead.appendChild(document.createElement('tr'));
			
			do {
				nodeData = nodeChild.appendChild(document.createElement('td'));
				this._addHandleClick(nodeData);
				this._arrCalendarDays.push(nodeData);
			} while (--intDaysInWeek);
		} while (--intWeeksInMonth);

		if ( this._nodeTarget ) {
			if ( this._nodeTarget.childNodes.length > 0 ) {
				this._nodeCalendar = this._nodeTarget.insertBefore( nodeContainer, this._nodeTarget.childNodes[0] );
			} else {
				this._nodeCalendar = this._nodeTarget.appendChild( nodeContainer );
			}
		} else {
			if ( this._nodeTextInput !== null ) {
				this._nodeCalendar = this._nodeTextInput.parentNode.insertBefore(nodeContainer, this._nodeTextInput);
			} else {
				this._nodeCalendar = this._nodeSelectInputMonth.parentNode.insertBefore(nodeContainer, this._nodeSelectInputMonth);
			}
		}

		this.setDateFromInputs();
		
		if ( ! this._nodeShow ) {
			if ( this._nodeTextInput !== null ) {
				this._nodeTextInput.style.display = 'none';
			} else if ( this._nodeSelectInputMonth !== null && this._nodeSelectInputDay !== null && this._nodeSelectInputYear !== null) {
				this._nodeSelectInputMonth.style.display = 'none';
				this._nodeSelectInputDay.style.display = 'none';
				this._nodeSelectInputYear.style.display = 'none';
			}
		}
		
		this._nodeCalendar.style.display = 'block';
	}
};

Calendar.prototype._addHandleClick = function( nodeData ) {
	var that = this;
	this.addEvent( nodeData, 'click', function() { that._handleClick( nodeData ); }, false );
};

Calendar.prototype.setDateRange = function(dtStart, dtEnd, bStopReset) {
	this._dtRangeStart = new Date(dtStart);
	this._dtRangeEnd = new Date(dtEnd);
	this._dtRangeStart.setToCalendarDate();
	this._dtRangeEnd.setToCalendarDate();
	
	if (this._dtRangeStart.compare(this._dtRangeEnd) == 1) {
		var e = new Error('setDateRange: second Date may not occur before first Date:' + this._dtRangeStart + ' - ' + this._dtRangeEnd);
		throw(e);	
	}

	if (this._dtSelected.compare(this._dtRangeStart) == -1 || this._dtSelected.compare(this._dtRangeEnd) == 1) {
		this._dtSelected = new Date(this._dtRangeEnd);
		this._dtSelected.setToCalendarDate();
		this._setValue();
	}
	
	this._dtCurrentMonth = new Date(this._dtSelected);
	this._dtCurrentMonth.setDate(1);
	this._dtCurrentMonth.setToCalendarDate();
	this._populateMonth();
};

Calendar.prototype.show = function() {
	this._nodeCalendar.style.display = 'block';
	
};

Calendar.prototype.hide = function() {
	this._nodeCalendar.style.display = 'none';	
};

Calendar.prototype.toggleVisibility = function() {
	if (this._nodeCalendar.style.display != 'block') {
		this._nodeCalendar.style.display ='block';
	} else {
		this._nodeCalendar.style.display = 'none';
	}
};

Calendar.prototype.setToNextMonth = function() {
	this._dtCurrentMonth.setToNextMonth();
	this._populateMonth();
};

Calendar.prototype.setToPreviousMonth = function() {
	this._dtCurrentMonth.setToPreviousMonth();
	this._populateMonth();
};

Calendar.prototype._handleClick = function( nodeData ) {
	if ( nodeData.className.indexOf( 'DisneyCalDateEnabled' ) > -1 || nodeData.className.indexOf( 'DisneyCalDateSelected' ) > -1 ) {
		this._selectDate( nodeData );
		this._setValue();
	}
};

Calendar.prototype._populateMonth = function() {

	var that = this;
	var strClassName = '';
	var bOutOfBounds = false;

	var dtCurrent = new Date(this._dtCurrentMonth);
	dtCurrent.setToCalendarDate();
	dtCurrent.setDate(1);

	var intFirstDay = dtCurrent.getFirstDayOfMonth();

	dtCurrent.setDate( dtCurrent.getDate() - intFirstDay );
	this._nodeMonthYear.innerHTML = this._arrMonthLabels[this._dtCurrentMonth.getMonth()] + ' ' + this._dtCurrentMonth.getFullYear();

	var i = 0;
	var arrCalDayLength = this._arrCalendarDays.length;
	this._dtSelected.setToCalendarDate();
	
	while (i < arrCalDayLength) {
		bOutOfBounds = false;
		strClassName = '';

		this._arrCalendarDays[i].innerHTML = dtCurrent.getDate();
		
		if (dtCurrent.getMonth() == this._dtCurrentMonth.getMonth() && dtCurrent.getFullYear() == this._dtCurrentMonth.getFullYear()) {

			if (dtCurrent.compare(this._dtNow) == -1) {

				strClassName += ' DisneyCalDatePast';
			} else if (dtCurrent.compare(this._dtNow) === 0) {

				strClassName += ' DisneyCalDateToday';
			}

			if (this._dtRangeStart !== null && dtCurrent.compare(this._dtRangeStart) == -1) {

				strClassName += ' DisneyCalDateOutOfBounds';
				bOutOfBounds = true;
			}

			if (this._dtRangeEnd !== null && dtCurrent.compare(this._dtRangeEnd) == 1) {

				strClassName += ' DisneyCalDateOutOfBounds';
				bOutOfBounds = true;
			}
			
			if (!bOutOfBounds) {

				if (dtCurrent.compare(this._dtSelected) === 0) {

					strClassName += ' DisneyCalDateSelected ';
					this._nodeSelectedDateCell = this._arrCalendarDays[i];
				} else {

					strClassName += ' DisneyCalDateEnabled ';
				}
			}
		} else {

			strClassName = 'DisneyCalDateDisabled';
		}
		
		this._arrCalendarDays[i].className = strClassName;
		dtCurrent.setDate(dtCurrent.getDate() + 1);
		i++;
	}
};

Calendar.prototype._setValue = function() {
	if ( this._nodeTextInput !== null ) {
		this._nodeTextInput.value = this._dtSelected.getMonth() + 1 + '/' + this._dtSelected.getDate() + '/'  + this._dtSelected.getFullYear();
	} else {
		this._resetSelect(this._nodeSelectInputMonth);
		this._resetSelect(this._nodeSelectInputDay);
		this._resetSelect(this._nodeSelectInputYear);
		this._nodeSelectInputMonth.options[this._dtSelected.getMonth()].selected = true;
		
		if ( typeof( this._nodeSelectInputDay.options[this._dtSelected.getDate() - 1] ) != 'undefined' ) {
			this._nodeSelectInputDay.options[this._dtSelected.getDate() - 1].selected = true;
		}
		
		var strYear = this._dtSelected.getFullYear();
		for ( var i = 0; ( nodeChild = this._nodeSelectInputYear.options[i] ); ++i ) {
			if (nodeChild.value == strYear) {
				nodeChild.selected = true;
				break;	
			}
		}
	}

	if ( typeof( this._fChange ) == 'function' ) {
		this._fChange();
	}
};

Calendar.prototype._resetSelect = function(nodeElement) {
	for ( var i = 0; ( nodeChild = nodeElement.options[i]); ++i ) {
		nodeChild.selected = false;
	}
};

Calendar.prototype._selectDate = function(nodeElement) {
	this._dtSelected = new Date(this._dtCurrentMonth);
	this._dtSelected.setDate(nodeElement.innerHTML);
	this._populateMonth();
};



