
FBF=window.FBF||{};FBF.Header=FBF.Header||{};FBF.Recipient=FBF.Recipient||{};FBF.Recipient.ProductDetails=FBF.Recipient.ProductDetails||{};FBF.Recipient.Bouquet=FBF.Recipient.Bouquet||{};FBF.Recipient.DeliveryDate=FBF.Recipient.DeliveryDate||{};FBF.Recipient.DeliveryAddress=FBF.Recipient.DeliveryAddress||{};FBF.Recipient.AccompanyingCard=FBF.Recipient.AccompanyingCard||{};FBF.Recipient.ProductPriceTotal=FBF.Recipient.ProductPriceTotal||{};FBF.Payment=FBF.Payment||{};FBF.Payment.Sender=FBF.Payment.Sender||{};FBF.AddressBookEntry=FBF.AddressBookEntry||{};FBF.DetectFlash=function()
{var bdetect=new Is();insns=false;ins4=false;ins5=false;ins6=false;ins7=false;if((!bdetect.ie4)||(bdetect.op3)){MM_PluginVersion=0;if(navigator.plugins["Shockwave Flash"]!=null){var words=navigator.plugins["Shockwave Flash"].description.split(" ");MM_PluginVersion=parseInt(words[2]);}
if(MM_PluginVersion>=4){insns=true;}else{insns=false;}}else if(bdetect.ie4&&bdetect.win){document.write('<SCR'+'IPT LANGUAGE=VBScript\> \n');document.write('on error resume next \n');document.write('ins4 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 4)))\n');document.write('ins5 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 5)))\n');document.write('ins6 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 6)))\n');document.write('ins7 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 7)))\n');document.write('</SCR'+'IPT\> \n');}
return ins4||ins5||ins6||ins7||insns;}
FBF.hideOrShowElement=function(id)
{if(id)
{var element=document.getElementById(id);if(element)
{if(element.style.display==="block")
element.style.display="none"
else
element.style.display="block"}}}
FBF.attachEvent=function(element,eventName,handler,elementContainer)
{if(!element||!eventName||!eventName.length||eventName.length<3||!handler)
return;if(element.addEventListener)
element.addEventListener(eventName.substr(2),function(eventObject){handler.call(elementContainer,eventObject)},false)
else if(element.attachEvent)
element.attachEvent(eventName,function(){handler.call(elementContainer,event)});}
FBF.openPopupWindow=function(url,width,height,menubar,top,left,status,location,toolbar,scrollbars,resizable)
{return window.open(url,"wndPopUpHandle","width="+width
+", height="+height
+", menubar="+(menubar||"no")
+", top="+(top||"0")
+", left="+(left||"0")
+", status="+(status||"no")
+", location="+(location||"no")
+", toolbar="+(toolbar||"no")
+", scrollbars="+(scrollbars||"yes")
+", resizable="+(resizable||"no")
+"\"");}
FBF.addOption=function(dropDownList,name,value)
{var option=document.createElement('option');option.text=name;option.value=value;try
{dropDownList.add(option,null);}
catch(ex)
{dropDownList.add(option);}}
FBF.Header.bookmarkSite=function()
{var url=location.href;var title=document.title;if(window.sidebar)
{window.sidebar.addPanel(title,url,"");}
else if(window.external)
{window.external.AddFavorite(url,title);}
else
{alert('Unfortunately, this browser does not support the requested action,'
+' please bookmark this page manually. Press CTRL-D to bookmark.');}}
FBF.Header.handleBookmarkSiteClick=function(event)
{if(event.preventDefault)
{event.preventDefault();}
event.cancelBubble=true;this.bookmarkSite();event.returnValue=false;}
FBF.Header.initialize=function()
{FBF.attachEvent(this.linkBookmarkSite,'onclick',this.handleBookmarkSiteClick,this);}
FBF.Recipient.ProductDetails.updateProductImage=function(imageSource)
{if(this.productImage)
this.productImage.src=imageSource;}
FBF.Recipient.ProductDetails.updatePrices=function()
{if(this.helperButton)
this.helperButton.click();}
FBF.Recipient.DeliveryDate.dateChanged=function()
{FBF.DatePicker.dateText.value=this.ddlDeliveryDay.value
+'.'+this.ddlDeliveryMonth.value
+'.'+this.ddlDeliveryYear.value;this.hideChangeOrPeakPriceMessage();FBF.Recipient.ProductDetails.updatePrices()
var deliveryDate=document.getElementById("deliveryDate");if(deliveryDate){var dayIndex=this.ddlDeliveryDay.selectedIndex;var monthIndex=this.ddlDeliveryMonth.selectedIndex;var yearIndex=this.ddlDeliveryYear.selectedIndex;var day=this.ddlDeliveryDay.options[dayIndex].text;var month=this.ddlDeliveryMonth.options[monthIndex].text;var year=this.ddlDeliveryYear.options[yearIndex].text;deliveryDate.innerHTML=day+" "+month+" "+year;};}
FBF.Recipient.DeliveryDate.monthChanged=function()
{var selectedDay=this.ddlDeliveryDay.value;var ddLength=this.ddlDeliveryDay.options.length
for(i=0;i<ddLength;i++)
this.ddlDeliveryDay.remove(0)
var daysNumber=this.daysInMonth(this.ddlDeliveryYear.value,this.ddlDeliveryMonth.value-1);for(i=1;i<=daysNumber;i++)
FBF.addOption(this.ddlDeliveryDay,i,i);if(selectedDay<=this.ddlDeliveryDay.options.length)
this.ddlDeliveryDay.selectedIndex=selectedDay-1;this.dateChanged();}
FBF.Recipient.DeliveryDate.daysInMonth=function(year,month)
{return 32-new Date(year,month,32).getDate();}
FBF.Recipient.DeliveryDate.hideChangeOrPeakPriceMessage=function()
{if(this.phChangeOrPeakPriceMessage)
this.phChangeOrPeakPriceMessage.style.display='none';}
FBF.Recipient.DeliveryDate.setupDatePicker=function()
{if(DatePickers&&DatePickers[0])
{var oldOnSelectedHandler=DatePickers[0].onSelected;var oldOnCloseHandler=DatePickers[0].onClose;DatePickers[0].onSelected=onDatePickerSelected;DatePickers[0].onClose=onDatePickerClose;}
FBF.Recipient.DeliveryDate.dateChanged();function onDatePickerSelected(datePicker,date)
{oldOnSelectedHandler(datePicker,date);FBF.Recipient.DeliveryDate.ddlDeliveryDay.selectedIndex=parseInt(parseFloat(date.substr(0,2)))-1;FBF.Recipient.DeliveryDate.ddlDeliveryMonth.selectedIndex=parseInt(parseFloat(date.substr(3,2)))-1;FBF.Recipient.DeliveryDate.ddlDeliveryYear.selectedIndex=parseInt(parseFloat(date.substr(6,4)))-new Date().getFullYear();}
function onDatePickerClose(datePicker,date)
{oldOnCloseHandler(datePicker,date);FBF.Recipient.DeliveryDate.dateChanged();}}
FBF.Recipient.DeliveryDate.setDeliveryDate=function(day,month,year)
{this.ddlDeliveryDay&&day&&(this.ddlDeliveryDay.value=day);this.ddlDeliveryMonth&&month&&(this.ddlDeliveryMonth.value=month);this.ddlDeliveryYear&&year&&(this.ddlDeliveryYear.value=year);FBF.Recipient.btnSend&&FBF.Recipient.btnSend.click();}
FBF.Recipient.DeliveryAddress.openAddressbookListPopup=function()
{FBF.openPopupWindow('Popups/AddressbookListPopup.aspx?country='+this.deliveryProductCountry
+'&clid='+this.clientID+'&mode='+this.cityCodeSeparated?1:0,600,400)}
FBF.Recipient.DeliveryAddress.showOtherGender=function()
{if(this.ddlGender&&this.ddlGender.selectedIndex==this.ddlGender.options.length-1)
{this.tblGenderOther&&(this.tblGenderOther.style.visibility="visible");this.tbGenderOther&&this.tbGenderOther.focus();}
else{this.tblGenderOther&&(this.tblGenderOther.style.visibility="hidden");};}
FBF.Recipient.DeliveryAddress.showAddressTypeDescription=function()
{if(this.ddlLocationTypes&&this.ddlLocationTypes.options.length>0&&this.ddlLocationTypes.options[this.ddlLocationTypes.selectedIndex]&&this.ddlLocationTypes.options[this.ddlLocationTypes.selectedIndex].attributes["description"])
{this.tdAddressTypeDescription&&(this.tdAddressTypeDescription.innerHTML=this.ddlLocationTypes.options[this.ddlLocationTypes.selectedIndex].attributes["description"].value);}
else
this.tdAddressTypeDescription&&(this.tdAddressTypeDescription.innerHTML="");}
FBF.Recipient.DeliveryAddress.clearContact=function()
{if(this.ddlGender&&this.ddlGender.options.length>0)
{this.ddlGender.options[0].selected=true;this.ddlGender.onchange()}
this.tbFirstName&&(this.tbFirstName.value="");this.tbCompany&&(this.tbCompany.value="");this.tbStreet&&(this.tbStreet.value="");this.tbEmail&&(this.tbEmail.value="");this.tbPhone&&(this.tbPhone.value="");this.tbPhoneAlternate&&(this.tbPhoneAlternate.value="");this.tbZip&&(this.tbZip.value="");this.tbCity&&(this.tbCity.value="");}
FBF.Recipient.Bouquet.initialize=function()
{this.rbLowPrice&&this.lLowPrice&&(this.rbLowPrice.price=this.lLowPrice.innerHTML);this.rbLowPrice&&(this.rbLowPrice.parentRow=this.trLowPrice);this.rbMidPrice&&this.lMidPrice&&(this.rbMidPrice.price=this.lMidPrice.innerHTML);this.rbMidPrice&&(this.rbMidPrice.parentRow=this.trMidPrice);this.rbHighPrice&&this.lHighPrice&&(this.rbHighPrice.price=this.lHighPrice.innerHTML);this.rbHighPrice&&(this.rbHighPrice.parentRow=this.trHighPrice);this.rbLuxuryPrice&&this.lLuxuryPrice&&(this.rbLuxuryPrice.price=this.lLuxuryPrice.innerHTML);this.rbLuxuryPrice&&(this.rbLuxuryPrice.parentRow=this.trLuxuryPrice);this.rbCustomPrice&&(this.rbCustomPrice.parentRow=this.trCustomPrice);FBF.Recipient.ProductPriceTotal.addGetProductPriceCallback(this.getProductPrice,FBF.Recipient.Bouquet);if(this.tbCustomPrice)
{FBF.attachDecimalFieldValidator(this.tbCustomPrice,FBF.decimalSeparator,(this.ihMinCustomPrice?this.ihMinCustomPrice.value:null));this.tbCustomPrice.validator.addCheckingStartedCallback(FBF.Recipient.Bouquet.selectCustomPrice,FBF.Recipient.Bouquet);this.tbCustomPrice.validator.addCheckingFinishedCallback(FBF.Recipient.ProductPriceTotal.updateProductPrice,FBF.Recipient.ProductPriceTotal);this.tbCustomPrice.validator.addCheckingFinishedCallback(FBF.Recipient.Bouquet.SetCustomPriceChange,FBF.Recipient.Bouquet);}
this.SetFromPrice(this.tbCustomPrice);}
FBF.Recipient.Bouquet.SetCustomPriceChange=function(){FBF.Recipient.Bouquet.ihInitialCustomPrice.value=FBF.Recipient.Bouquet.tbCustomPrice.value;};FBF.Recipient.Bouquet.getMinimumProductPrice=function()
{var price="";if(this.rbLowPrice)
price=this.rbLowPrice.price;else if(this.rbMidPrice)
price=this.rbMidPrice.price;else if(this.rbHighPrice)
price=this.rbHighPrice.price;else if(this.rbLuxuryPrice)
price=this.rbLuxuryPrice.price;else if(this.rbCustomPrice&&this.tbCustomPrice)
price=this.tbCustomPrice.value;return parseFloat(price.replace(/,/,'.'));}
FBF.Recipient.Bouquet.getProductPrice=function()
{var price="";if(this.rbLowPrice&&this.rbLowPrice.checked)
price=this.rbLowPrice.price;else if(this.rbMidPrice&&this.rbMidPrice.checked)
price=this.rbMidPrice.price;else if(this.rbHighPrice&&this.rbHighPrice.checked)
price=this.rbHighPrice.price;else if(this.rbLuxuryPrice&&this.rbLuxuryPrice.checked)
price=this.rbLuxuryPrice.price;else if(this.rbCustomPrice&&this.rbCustomPrice.checked&&this.tbCustomPrice)
price=this.tbCustomPrice.value;return parseFloat(price.replace(/,/,'.'));}
FBF.Recipient.Bouquet.selectCustomPrice=function()
{if(this.rbCustomPrice&&!this.rbCustomPrice.checked)
{this.rbCustomPrice.checked=true;this.rbCustomPrice.onclick();}
this.tbCustomPrice.focus();}
FBF.Recipient.Bouquet.handleChangedPrice=function(radioButton)
{if(radioButton)
{this.trLowPrice&&(this.trLowPrice.className='Offprice');this.trMidPrice&&(this.trMidPrice.className='Offprice');this.trHighPrice&&(this.trHighPrice.className='Offprice');this.trLuxuryPrice&&(this.trLuxuryPrice.className='Offprice');this.trCustomPrice&&(this.trCustomPrice.className='Offprice');radioButton.parentRow&&(radioButton.parentRow.className='Onprice');if(radioButton!=this.rbCustomPrice){FBF.Recipient.ProductPriceTotal.updateProductPrice(radioButton.price);}
else{this.selectCustomPrice();}}}
FBF.Recipient.Bouquet.SetFromPrice=function(isCustomPrice){var fromPrice=document.getElementById("fromPrice");if(fromPrice){if(isCustomPrice){fromPrice.innerHTML=this.ihMinCustomPrice.value;}
else{fromPrice.innerHTML=this.getMinimumProductPrice();};};};FBF.Recipient.AccompanyingCard.initialize=function()
{if(this.rbShowMessage&&this.rbShowMessage.addEventListener){this.rbShowMessage.addEventListener('click',function(eventObject){FBF.Recipient.AccompanyingCard.showCardMessage.call(FBF.Recipient.AccompanyingCard,eventObject)},false);}
else if(this.rbShowMessage&&this.rbShowMessage.attachEvent){this.rbShowMessage.attachEvent('onclick',function(){FBF.Recipient.AccompanyingCard.showCardMessage.call(FBF.Recipient.AccompanyingCard,event)});};if(this.rbHideMessage&&this.rbHideMessage.addEventListener){this.rbHideMessage.addEventListener('click',function(eventObject){FBF.Recipient.AccompanyingCard.hideCardMessage.call(FBF.Recipient.AccompanyingCard,eventObject)},false);}
else if(this.rbHideMessage&&this.rbHideMessage.attachEvent){this.rbHideMessage.attachEvent('onclick',function(){FBF.Recipient.AccompanyingCard.hideCardMessage.call(FBF.Recipient.AccompanyingCard,event)});};if(this.lSelectCardMessage&&this.lSelectCardMessage.addEventListener){this.lSelectCardMessage.addEventListener('click',function(eventObject){FBF.Recipient.AccompanyingCard.openCardMessagePopup.call(FBF.Recipient.AccompanyingCard,eventObject)},false);}
else if(this.lSelectCardMessage&&this.lSelectCardMessage.attachEvent){this.lSelectCardMessage.attachEvent('onclick',function(){FBF.Recipient.AccompanyingCard.openCardMessagePopup.call(FBF.Recipient.AccompanyingCard,event)});};}
FBF.Recipient.AccompanyingCard.showCardMessage=function()
{this.tableCardText&&(this.tableCardText.style.display="block");}
FBF.Recipient.AccompanyingCard.hideCardMessage=function()
{this.tableCardText&&(this.tableCardText.style.display="none");}
FBF.Recipient.AccompanyingCard.openCardMessagePopup=function()
{FBF.openPopupWindow(FBF.Recipient.AccompanyingCard.baseDir+'AccompanyingCardPopup.aspx',500,540);}
FBF.Recipient.AccompanyingCard.updateCardMessage=function(cardText)
{this.tbCardText&&(this.tbCardText.value=cardText);}
FBF.Recipient.ProductPriceTotal.initialize=function()
{if(this.tbPriceQuantity)
{FBF.attachNumberFieldValidator(this.tbPriceQuantity,1,((this.maxProductQuantity&&this.maxProductQuantity>0)?this.maxProductQuantity:null));this.tbPriceQuantity.validator.addCheckingFinishedCallback(FBF.Recipient.ProductPriceTotal.updateProductPrice,FBF.Recipient.ProductPriceTotal);}
this.updateProductPrice();}
FBF.Recipient.ProductPriceTotal.addGetProductPriceCallback=function(callback,container)
{this.getProductPrice=function()
{var price=0;if(callback)
price=callback.call(container);if(!price)
price=0;return price;}}
FBF.Recipient.ProductPriceTotal.getProductQuantity=function()
{var quantity=1;if(this.tbPriceQuantity)
quantity=parseInt(this.tbPriceQuantity.value);if(!quantity)
quantity=1;return quantity;}
FBF.Recipient.ProductPriceTotal.updateProductPrice=function()
{var total=this.getProductPrice()*this.getProductQuantity();if(this.spanProductPrice)
this.spanProductPrice.innerHTML=total.toFixed(2).replace(/\./,FBF.decimalSeparator);if(this.tdServiceChargeTotal)
total+=parseFloat(this.tdServiceChargeTotal.innerHTML.replace(/,/,'.'));if(this.tdSpecialCardTotal!=null)
total+=parseFloat(this.tdSpecialCardTotal.innerHTML.replace(/,/,'.'));if(this.spanTotal)
this.spanTotal.innerHTML=total.toFixed(2).replace(/\./,FBF.decimalSeparator);}
FBF.Payment.Sender.initialize=function()
{this.ddlGender&&(this.ddlGender.onchange=null);FBF.attachEvent(this.ddlGender,'onchange',this.showOtherGender,this);}
FBF.Payment.Sender.showOtherGender=function()
{if(this.ddlGender&&this.ddlGender.selectedIndex==this.ddlGender.options.length-1)
{this.tblGenderOther&&(this.tblGenderOther.style.visibility="visible");this.tbGenderOther&&this.tbGenderOther.focus();}
else
this.tblGenderOther&&(this.tblGenderOther.style.visibility="hidden");}
FBF.attachTextFieldValidator=function(textField,maxLength,allowedChars,maxLengthErrorMessage,allowedCharsErrorMessage,counter)
{if(!textField||textField.validator)
return;var validator=new FBF.TextFieldValidator(textField,maxLength,allowedChars,maxLengthErrorMessage,allowedCharsErrorMessage,counter);FBF.attachValidator(textField,validator);}
FBF.attachNumberFieldValidator=function(textField,minValue,maxValue,minValueCallback,maxValueCallback)
{if(!textField||textField.validator)
return;var validator=new FBF.NumberFieldValidator(textField,minValue,maxValue,minValueCallback,maxValueCallback);FBF.attachValidator(textField,validator);}
FBF.attachDecimalFieldValidator=function(textField,decimalSeparator,minValue,maxValue,minValueCallback,maxValueCallback)
{if(!textField||textField.validator)
return;var validator=new FBF.DecimalFieldValidator(textField,decimalSeparator,minValue,maxValue,minValueCallback,maxValueCallback);FBF.attachValidator(textField,validator);}
FBF.attachValidator=function(textField,validator)
{if(!textField||!validator||textField.validator)
return;textField.validator=validator;if(textField.addEventListener)
{textField.addEventListener('focus',function(eventObject){textField.validator.startMonitoring.call(textField.validator,eventObject)},false);textField.addEventListener('blur',function(eventObject){textField.validator.stopMonitoring.call(textField.validator,eventObject)},false);textField.addEventListener('keypress',function(eventObject){return textField.validator.isInputAllowed.call(textField.validator,eventObject)},false);}
else if(textField.attachEvent)
{textField.attachEvent('onfocus',function(){textField.validator.startMonitoring.call(textField.validator,event)});textField.attachEvent('onblur',function(){textField.validator.stopMonitoring.call(textField.validator,event)});textField.attachEvent('onkeypress',function(){return textField.validator.isInputAllowed.call(textField.validator,event)});}}
FBF.TextFieldValidator=function(textField,maxLength,allowedChars,maxLengthErrorMessage,allowedCharsErrorMessage,counter)
{var _textField=textField;var _maxLength=maxLength;var _allowedCharRanges=new Array();var _maxLengthErrorMessage=maxLengthErrorMessage;var _allowedCharsErrorMessage=allowedCharsErrorMessage;var _counter=counter;var _checkingFinishedCallbacks=new Array();var _checkingStartedCallbacks=new Array();var _interval;if(_counter)
_counter.value=_maxLength;function isAllowedChar(charCode)
{if(!_allowedCharRanges)
return false;for(var i=0;i<_allowedCharRanges.length;++i)
{if(charCode>=_allowedCharRanges[i].start&&charCode<=_allowedCharRanges[i].end)
return true;}
return false;}
this.getTextField=function()
{return _textField;}
this.addAllowedCharRange=function(allowedCharRange)
{var range=String(allowedCharRange).split("-");var start=range[0];var end=range[1]||start;_allowedCharRanges.push({start:start,end:end});}
this.checkField=function()
{var text=(_textField&&_textField.value)||"";var alerted=false;for(var i=0;i<text.length;i++)
{if(!isAllowedChar(text.charCodeAt(i)))
{if(!alerted)
{_allowedCharsErrorMessage&&alert(_allowedCharsErrorMessage)
alerted=true}
text=text.substring(0,i)+text.substring(i+1,text.length)
--i;}}
if(_maxLength&&text.length>_maxLength)
{text=text.substring(0,maxLength);_maxLengthErrorMessage&&alert(_maxLengthErrorMessage);}
if(_textField&&_textField.value.length!=text.length)
_textField.value=text;if(_counter)
_counter.value=_maxLength-text.length;}
this.isInputAllowed=function(eventObject)
{var keyCode=eventObject.which;if(keyCode===undefined)
keyCode=eventObject.keyCode;var result=true;if(keyCode!=0&&keyCode!=9&&keyCode!=8&&keyCode!=27&&keyCode!=35&&keyCode!=36&&keyCode!=37&&keyCode!=38&&keyCode!=39&&keyCode!=40&&!eventObject.altKey&&!eventObject.ctrlKey&&!eventObject.shiftKey&&!eventObject.metaKey)
{if(_maxLength&&_textField&&_textField.value.length>=_maxLength)
{if(_maxLengthErrorMessage)
{_textField&&_textField.blur();alert(_maxLengthErrorMessage);_textField&&_textField.focus();}
result=false;}
if(result)
{if(!isAllowedChar(keyCode))
{if(_allowedCharsErrorMessage)
{_textField&&_textField.blur();alert(_allowedCharsErrorMessage);_textField&&_textField.focus();}
result=false;}}}
if(!result)
{eventObject.cancelBubble=true;eventObject.stopPropagation&&eventObject.stopPropagation();eventObject.preventDefault&&eventObject.preventDefault();}
return result;}
this.startMonitoring=function()
{if(!_interval)
_interval=setInterval(this.checkField,20);dispatchCallbacks(_checkingStartedCallbacks);}
this.stopMonitoring=function()
{clearInterval(_interval);_interval=undefined;dispatchCallbacks(_checkingFinishedCallbacks,_textField.value);}
this.addCheckingFinishedCallback=function(callback,container)
{addCallback(_checkingFinishedCallbacks,callback,container);}
this.addCheckingStartedCallback=function(callback,container)
{addCallback(_checkingStartedCallbacks,callback,container);}
function addCallback(callbacks,callback,container)
{if(callbacks&&callback)
callbacks[callbacks.length]={callback:callback,container:container};}
function dispatchCallbacks(callbacks,parameter)
{if(callbacks&&callbacks.length&&callbacks.length>0)
{for(var i=0;i<callbacks.length;++i)
callbacks[i].callback&&callbacks[i].callback.call(callbacks[i].container,parameter);}}
var ranges=(allowedChars&&allowedChars.split(","))||new Array();for(var k=0;k<ranges.length;++k)
this.addAllowedCharRange(ranges[k]);}
FBF.NumberFieldValidator=function(numberField,minValue,maxValue,minValueCallback,maxValueCallback)
{var _minValue=Number(minValue);var _maxValue=Number(maxValue);var _minValueCallback=minValueCallback;var _maxValueCallback=maxValueCallback;var base=new FBF.TextFieldValidator(numberField);var baseStopMonitoring=base.stopMonitoring;base.addAllowedCharRange("48-57");base.getMinValue=function()
{if(minValueCallback)
return minValueCallback();return _minValue;}
base.getMaxValue=function()
{if(maxValueCallback)
return maxValueCallback();return _maxValue;}
base.stopMonitoring=function()
{base.checkFieldLimits();baseStopMonitoring();}
base.checkFieldLimits=function()
{base.checkField();var minValue=base.getMinValue();var maxValue=base.getMaxValue();var text=(base.getTextField()&&base.getTextField().value)||"";var value=parseInt(text);if(minValue&&(isNaN(value)||value<minValue))
value=minValue;if(maxValue&&(isNaN(value)||value>maxValue))
value=maxValue;if(!value)
value=0;base.getTextField().value=value.toString();}
return base;}
FBF.DecimalFieldValidator=function(decimalField,decimalSeparator,minValue,maxValue,minValueCallback,maxValueCallback)
{var _decimalSeparator=decimalSeparator||".";var base=new FBF.NumberFieldValidator(decimalField,minValue,maxValue,minValueCallback,maxValueCallback);var baseCheckField=base.checkField;var baseIsInputAllowed=base.isInputAllowed;base.addAllowedCharRange(_decimalSeparator.charCodeAt(0));base.checkField=function()
{baseCheckField();var text=(base.getTextField()&&base.getTextField().value)||"";while(text.lastIndexOf(_decimalSeparator)!=text.indexOf(_decimalSeparator))
text=text.substr(0,text.lastIndexOf(_decimalSeparator))+text.substr(text.lastIndexOf(_decimalSeparator)+1);while(text.length>0&&isNaN(parseFloat(text.replace(_decimalSeparator,"."))))
text=text.substr(0,text.length-1);if(base.getTextField()&&(base.getTextField().value.length!=text.length))
base.getTextField().value=text;}
base.checkFieldLimits=function()
{base.checkField();var minValue=base.getMinValue();var maxValue=base.getMaxValue();var text=(base.getTextField()&&base.getTextField().value)||"";var value=parseFloat(text.replace(_decimalSeparator,"."));if(minValue&&(isNaN(value)||value<minValue))
value=minValue;if(maxValue&&(isNaN(value)||value>maxValue))
value=maxValue;if(!value)
value=0;base.getTextField().value=value.toFixed(2).toString().replace(".",_decimalSeparator);}
base.isInputAllowed=function(eventObject)
{var result=false;if(baseIsInputAllowed(eventObject))
{var keyCode=eventObject.which||eventObject.keyCode;var text=(base.getTextField()&&base.getTextField().value)||"";if((text.lastIndexOf(_decimalSeparator)<0||(keyCode!=_decimalSeparator.charCodeAt(0)))&&!isNaN(parseFloat(text.replace(_decimalSeparator,".")+String.fromCharCode(keyCode))))
result=true;}
if(!result)
{eventObject.cancelBubble=true;eventObject.stopPropagation&&eventObject.stopPropagation();eventObject.preventDefault&&eventObject.preventDefault();}
return result;}
return base;}
FBF.AddressBookEntry.showOtherGender=function()
{if(this.ddlGender&&this.ddlGender.selectedIndex==this.ddlGender.options.length-1)
{this.tbGenderOther&&this.tbGenderOther.focus();this.tbGenderOther&&(this.tbGenderOther.disabled=false);}
else{this.tbGenderOther&&(this.tbGenderOther.disabled=true);};}
function CheckAndPostZipCode(object){if(object.value=="")
{window.alert('<%=VStrings.get(false,"Text_ZipCodeWarning").Replace("\"", "\'").Replace("\n"," ").Trim()%>');return false;}
return true;}
function cbCardMessageRequired_onClick()
{}
function cbCardMessageRequired_CheckedChanged()
{if(cbCardMessageRequired==undefined||tbCardText==undefined||cbCardMessageRequired==null||tbCardText==null)
return;tbCardText.value=tbCardText.value.replace(/^\s+/,'').replace(/\s+$/,'');if(cbCardMessageRequired.checked)
{tbCardTextContent=tbCardText.value;tbCardText.value="";tbCardText.disabled=true;}
else
{tbCardText.value=tbCardTextContent;tbCardText.disabled=false;}}
function CheckCardMessage()
{if(cbCardMessageRequired==undefined||tbCardText==undefined||cbCardMessageRequired==null||tbCardText==null)
return;tbCardText.value=tbCardText.value.replace(/^\s+/,'').replace(/\s+$/,'');if((cbCardMessageRequired.checked==false)&&(tbCardText.value.length==0))
{alert("A card message or no card must be indicated before continuing");return false;}
return true;}
function CheckLeaveSite()
{if(window.confirm(question))
{return true;}
else
{window.location="deliveryregions.aspx";return false;}}
function GetMajor(bname,agent){bpos=agent.indexOf(bname)+bname.length+1;return parseInt(agent.substr(bpos));}
function GetMinor(bname,agent){bpos=agent.indexOf(bname)+bname.length+1;return parseFloat(agent.substr(bpos));}
function CheckAgent(bname,agent){return agent.indexOf(bname)>-1;}
function Is()
{var agent=navigator.userAgent.toLowerCase();this.ie=CheckAgent("msie",agent);this.ns=CheckAgent("mozilla",agent);this.op3=CheckAgent("opera",agent);this.major=GetMajor("msie",agent);this.minor=GetMinor("msie",agent);this.nmajor=GetMajor("mozilla",agent);this.nminor=GetMinor("mozilla",agent);this.omajor=GetMajor("opera",agent);this.ominor=GetMinor("opera",agent);this.ns2=(this.ns&&(this.nmajor==2));this.ns3=(this.ns&&(this.nmajor==3));this.ns4b=(this.ns&&(this.nminor<4.04));this.ns4=(this.ns&&(this.nmajor>=4));this.ie3=(this.ie&&(this.major==2));this.ie4=(this.ie&&(this.major>=4));this.ie5=(this.ie&&(this.major>=5));this.ie6=(this.ie&&(this.major>=6));this.win=CheckAgent("win",agent);this.mac=CheckAgent("mac",agent);this.unix=CheckAgent("x11",agent);}
function SetCookie(cookieName,cookieValue,nDays){var today=new Date();var expire=new Date();if(nDays==null||nDays==0)nDays=1;expire.setTime(today.getTime()+3600000*24*nDays);document.cookie=cookieName+"="+escape(cookieValue)
+";expires="+expire.toGMTString();}
function DetectFlash(){var bdetect=new Is();insns=false;ins4=false;ins5=false;ins6=false;ins7=false;if((!bdetect.ie4)||(bdetect.op3)){MM_PluginVersion=0;if(navigator.plugins["Shockwave Flash"]!=null){var words=navigator.plugins["Shockwave Flash"].description.split(" ");MM_PluginVersion=parseInt(words[2]);}
if(MM_PluginVersion>=4){insns=true;}else{insns=false;}}else if(bdetect.ie4&&bdetect.win){document.write('<SCR'+'IPT LANGUAGE=VBScript\> \n');document.write('on error resume next \n');document.write('ins4 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 4)))\n');document.write('ins5 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 5)))\n');document.write('ins6 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 6)))\n');document.write('ins7 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 7)))\n');document.write('</SCR'+'IPT\> \n');}
return ins4||ins5||ins6||ins7||insns;}
function SetInputFocus(vObject)
{var is=new Is();if(is.ie4)
vObject.focus();delete is;}
function ChangeAnchor(strAnchorID,strUrl,x,y,width,height)
{var theAnchor=(document.layers)||!(document.getElementById)?"['"+strAnchorID+"']":"('"+strAnchorID+"')";var strFunction=(document.getElementById)?"document.getElementById":"document.anchors";var obj=eval(strFunction+theAnchor);if(obj)
{obj.href="javascript:void(0);";obj.target="";obj.onclick=new Function("changelink( '"+strUrl+"', "+x+", "+y+", "+width+", "+height+")");}}
function changelink(strUrl,x,y,width,height)
{window.open(strUrl,"popup_msg","scrollbars=no,resizable=no,screenX="+x+",screenY="+y+",width="+width+",height="+height+"");}
function IsNetscapeOnMac()
{var agent=window.navigator.userAgent;if((agent.indexOf('Mozilla')!=-1)&&(agent.indexOf('compatible')==-1))
{if(agent.indexOf('Macintosh')!=-1)
{return true;}else{return false;}}else{return false;}}
function IsExplorerOnMac()
{var agent=window.navigator.userAgent;if((agent.indexOf('Mozilla')!=-1)&&(agent.indexOf('compatible')!=-1)&&(agent.indexOf('MSIE')!=-1))
{if(agent.indexOf('Mac_PowerPC')!=-1)
{return true;}else{return false;}}else{return false;}}
function IsNetscape6(){return(navigator.appName=="Netscape"&&navigator.appVersion.charAt(0)=="5");}
function IsAOL6O(agent)
{if((agent.indexOf('Mozilla')!=-1)&&(agent.indexOf('compatible')!=-1)&&(agent.indexOf('MSIE')!=-1)&&(agent.indexOf('AOL ')!=-1))
{return true;}else{return false;}}
function launchCenter(agent,url,name,height,width,extraspec)
{var str="height="+height;str+=",width="+width;if(window.screen)
{var xc=100;var yc=100;str+=",screenX="+xc;str+=",screenY="+yc;if(!IsAOL6O(agent))
{str+=",top="+yc;str+=",left="+xc;}
str+=","+extraspec;}
return window.open(url,name,str);}
function On3DSecureLoadEvent(agent,strFormName,strAction)
{var ThreeDSecureChildwin;var ThreeDSecurePopupName;window.name='FIPaymentPage';ThreeDSecurePopupName=window.name+"Popup";ThreeDSecureChildwin=launchCenter(agent,'about:blank',ThreeDSecurePopupName,400,390,'status=yes,dependent=no,scrollbars=yes,resizable=no');ThreeDSecureChildwin.focus();var objForm=getFormObject(strFormName);objForm.target=ThreeDSecurePopupName;objForm.action=strAction;objForm.submit();}
function On3DSecureCloseLoad(strFormName,intPageMode)
{window.opener.focus();var objForm=getFormObject(strFormName);objForm.action='Payment.aspx?mode='+intPageMode;objForm.target='FIPaymentPage';objForm.elements[0].name="VS";objForm.elements[0].id="VS";objForm.submit();if(IsNetscape6()||IsNetscapeOnMac()||IsExplorerOnMac())
{setTimeout('self.close()',1000);}else{self.close();}}
function On3DSecurePopupClosedLoad(strFormName)
{var objForm=getFormObject(strFormName);objForm.action='Payment.aspx?mode=2';objForm.submit();}
function getFormObject(strFormName)
{var strForm=(document.layers)||!(document.getElementsByName)?"['"+strFormName+"']":"('"+strFormName+"')[0]";var funcName=(document.getElementsByName)?"document.getElementsByName":((document.layers)?"document.forms":"document.all");return eval(funcName+strForm);}
function TieButton(buttonName)
{if((event.which&&event.which==13)||(event.keyCode&&event.keyCode==13))
{document.getElementsByName(buttonName)[0].click();return false;}
else
return true;}
function checkInstructionsField(object)
{if(!object)
return;if(object.value.length>200)
object.value=object.value.substring(0,200);for(var j=0;j<object.value.length;j++)
{if(object.value.charCodeAt(j)>128)
{object.value=object.value.substring(0,j)+object.value.substring(j+1,object.value.length);j--;}}}
function UpdateCounter(field,objectID,objectWarning,allow,cntrID)
{if(!allow)
checkChars(objectID,objectWarning)
var count=document.forms[0][objectID].value.length;document.forms[0][cntrID].value=248-count;if(count>248){field.value=field.value.substring(0,field.value.length-1);UpdateCounter(field,objectID,objectWarning,allow,cntrID);}}
function checkChars(objectID,strWarning)
{var blnAlerted=false
var flds=new Array()
flds[0]=document.forms[0][objectID]
for(var i=0;i<flds.length;i++)
{for(var j=0;j<flds[i].value.length;j++)
{if(flds[i].value.charCodeAt(j)>255)
{if(!blnAlerted)
alert(strWarning)
blnAlerted=true
flds[i].value=flds[i].value.substring(0,j)+flds[i].value.substring(j+1,flds[i].value.length)
j--;}}}}
function otherGenderChange(objectID,objectOtherID){if(document.forms[0][objectOtherID].value.length>0)
document.forms[0][objectID].selectedIndex=document.forms[0][objectID].length-1
return true}
function GenderChange(objectID,objectOtherID,objectNameID)
{if(document.forms[0][objectID].selectedIndex!=document.forms[0][objectID].length-1)
{document.forms[0][objectOtherID].value=''
SetInputFocus(document.forms[0][objectNameID])}
else
SetInputFocus(document.forms[0][objectOtherID])
return true}
function selText(keyval,ca_mode,objectID,strWarning,allow,cntrID)
{if(ca_mode)
{var strText;eval("strText = text_"+keyval+";");if(strText.length>248)
strText=strText.substr(0,230)+" [...more text]";document.forms[0][objectID].value=strText;}
else
{eval("document.forms[0][objectID].value = text_"+keyval+";");}
UpdateCounter(this,objectID,strWarning,allow,cntrID);}
var xPos,yPos;xPos=0;yPos=0;var isNS=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)>=4);function pos()
{imgElem=document.images["_ctl0_Content__ctl0_imProduct"];if(imgElem==null)
return;if(isNS)
{xPos=eval(imgElem).x;yPos=eval(imgElem).y;}
else
{xPos=eval(imgElem).offsetLeft;tempEl=eval(imgElem).offsetParent;while(tempEl!=null)
{xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent;}
yPos=eval(imgElem).offsetTop;tempEl=eval(imgElem).offsetParent;while(tempEl!=null)
{yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent;}
xPos=xPos+160;}}
function showEnlargeImage(object){var lft,tp;w1=document.images["_ctl0_Content__ctl0_imProduct"].width;w2=345;lft=xPos-(w2-w1);tp=yPos;document.images["bigimage"].src=document.images["_ctl0_Content__ctl0_imProduct"].src;object.style.left=lft;object.style.top=tp;object.style.borderColor="Green";object.style.visibility="VISIBLE";}
function hideEnlargeImage(object){object.style.visibility="HIDDEN";}
function IsImagePreView(strimg){var centerimg=document.images["ctl00_Content_ctl00_ProductDescription_ctl00_imProduct"];if(centerimg==null)
{return;}
preimage=document.images["ctl00_RightSide_ctl00_"+strimg];if(preimage==null)
{return;}
centerimg.src=preimage.src.replace("pre","big");}