var ie=/MSIE/.test(navigator.userAgent);var moz=!ie&&navigator.product=="Gecko";if(moz){extendEventObject();emulateEventHandlers(["click","dblclick","mouseover","mouseout","mousedown","mouseup","mousemove","keydown","keypress","keyup"])}function hlPostalCode_OnClick(b,g,l,e,h){var k=window.opener;re=/:/gi;if(h=="recipient"){var c="ihShip_to_zipUID";var n="ihShip_to_companyUID";var a="ihShip_to_address1UID";var i="ihShip_to_cityUID"}var f=k.document.getElementById(k.document.getElementById(c).value.replace(re,"_"));f.value=b;var m=k.document.getElementById(k.document.getElementById(n).value.replace(re,"_"));m.value=g;var d=k.document.getElementById(k.document.getElementById(a).value.replace(re,"_"));d.value=l;var j=k.document.getElementById(k.document.getElementById(i).value.replace(re,"_"));j.value=e;window.close()}function openPopupWindow(c,b,d){var a="";a=window.open(c,"wndPopUpHandle","width="+b+", height="+d+", menubar=no, top=0, left=0, status=no, location=no, toolbar=no, scrollbars=yes, resizable=no");return a}function setStyle(b,a,c){if(b==null){return false}b.style[a]=c;return true}function getStyle(b,a){if(b==null){return null}var c=b.style[a];if(!c){if(document.defaultView){c=document.defaultView.getComputedStyle(b,"").getPropertyValue(a)}else{if(b.currentStyle){c=b.currentStyle[a]}}}return c}function CheckAndPostZipCode(b,a){if(b.value==""){window.alert(a);return false}return true}function CheckLeaveSite(){if(window.confirm(question)){return true}else{window.location="deliveryregions.aspx";return false}}function GetMajor(b,a){bpos=a.indexOf(b)+b.length+1;return parseInt(a.substr(bpos))}function GetMinor(b,a){bpos=a.indexOf(b)+b.length+1;return parseFloat(a.substr(bpos))}function CheckAgent(b,a){return a.indexOf(b)>-1}function Is(){var a=navigator.userAgent.toLowerCase();this.ie=CheckAgent("msie",a);this.ns=CheckAgent("mozilla",a);this.op3=CheckAgent("opera",a);this.major=GetMajor("msie",a);this.minor=GetMinor("msie",a);this.nmajor=GetMajor("mozilla",a);this.nminor=GetMinor("mozilla",a);this.omajor=GetMajor("opera",a);this.ominor=GetMinor("opera",a);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",a);this.mac=CheckAgent("mac",a);this.unix=CheckAgent("x11",a)}function SetCookie(f,e,d){var c=new Date();var b=new Date();var a="";if(!(typeof(d)=="undefined"||d==null||d==0)){b.setTime(c.getTime()+3600000*24*d);a=";expires="+b.toGMTString()}document.cookie=f+"="+escape(e)+a}function GetCookie(c){var d=document.cookie.indexOf(c+"=");var a=d+c.length+1;if(!d&&(c!=document.cookie.substring(0,c.length))){return null}if(d==-1){return null}var b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))}function DeleteCookie(a,c,b){if(GetCookie(a)){document.cookie=a+"="+(c?";path="+c:"")+(b?";domain="+b:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}function DetectFlash(){var a=new Is();insns=false;ins4=false;ins5=false;ins6=false;ins7=false;if((!a.ie4)||(a.op3)){MM_PluginVersion=0;if(navigator.plugins["Shockwave Flash"]!=null){var b=navigator.plugins["Shockwave Flash"].description.split(" ");MM_PluginVersion=parseInt(b[2])}if(MM_PluginVersion>=4){insns=true}else{insns=false}}else{if(a.ie4&&a.win){document.write("<SCRIPT 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("</SCRIPT> \n")}}return ins4||ins5||ins6||ins7||insns}function SetInputFocus(a){var b=new Is();if(b.ie4){a.focus()}delete b}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(d,b,e,c,a){window.open(d,"popup_msg","scrollbars=no,resizable=no,screenX="+b+",screenY="+e+",width="+c+",height="+a+"")}function IsNetscapeOnMac(){var a=window.navigator.userAgent;if((a.indexOf("Mozilla")!=-1)&&(a.indexOf("compatible")==-1)){if(a.indexOf("Macintosh")!=-1){return true}else{return false}}else{return false}}function IsExplorerOnMac(){var a=window.navigator.userAgent;if(a.indexOf("Mozilla")!=-1&&a.indexOf("compatible")!=-1&&a.indexOf("MSIE")!=-1){if(a.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(a){if(a.indexOf("Mozilla")!=-1&&a.indexOf("compatible")!=-1&&a.indexOf("MSIE")!=-1&&a.indexOf("AOL ")!=-1){return true}else{return false}}function launchCenter(d,a,b,h,c,e){var g="height="+h;g+=",width="+c;if(window.screen){var i=100;var f=100;g+=",screenX="+i;g+=",screenY="+f;if(!IsAOL6O(d)){g+=",top="+f;g+=",left="+i}g+=","+e}return window.open(a,b,g)}function On3DSecureLoadEvent(c,e,d){var b;var a;window.name="FIPaymentPage";a=window.name+"Popup";b=launchCenter(c,"about:blank",a,400,390,"status=yes,dependent=no,scrollbars=yes,resizable=no");b.focus();var f=getFormObject(e);f.target=a;f.action=d;f.submit()}function On3DSecureCloseLoad(b,a){window.opener.focus();var c=getFormObject(b);c.action="Payment.aspx?mode="+a;c.target="FIPaymentPage";c.elements[0].name="VS";c.elements[0].id="VS";c.submit();if(IsNetscape6()||IsNetscapeOnMac()||IsExplorerOnMac()){setTimeout("self.close()",1000)}else{self.close()}}function On3DSecurePopupClosedLoad(a){var b=getFormObject(a);b.action="Payment.aspx?mode=2";b.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)){var obj=document.getElementById(buttonName);if(obj!=null){if(obj.href!=undefined){document.location.href=obj.href;eval(obj.href)}else{obj.click()}return false}}return true}function checkInstructionsField(b){fld=document.forms[0][b];if(fld.value.length>200){fld.value=fld.value.substring(0,200)}for(var a=0;a<fld.value.length;a++){if(fld.value.charCodeAt(a)>128){fld.value=fld.value.substring(0,a)+fld.value.substring(a+1,fld.value.length);a--}}}function UpdateCounter(e,f,b,c,a){if(!c){checkChars(f,b)}var d=document.forms[0][f].value.length;document.forms[0][a].value=248-d;if(d>248){e.value=e.value.substring(0,e.value.length-1);UpdateCounter(e,f,b,c,a)}}function checkChars(g,d){var f=false;var c=document.getElementById(g);var a="%339%338%8217%8230%";var e="";if(c){e=c.value}for(var b=0;b<e.length;b++){if(e.charCodeAt(b)>255&&a.indexOf("%"+e.charCodeAt(b)+"%")==-1){if(!f){alert(d+e.charCodeAt(b))}f=true;e=e.substring(0,b)+e.substring(b+1,e.length)}}if(c){c.value=e}}function otherGenderChange(b,a){if(document.forms[0][a].value.length>0){document.forms[0][b].selectedIndex=document.forms[0][b].length-1}return true}function GenderChange(c,a,b){if(null!=c&&document.forms[0][c].selectedIndex!=document.forms[0][c].length-1){if(null!=a){document.forms[0][a].value=""}if(null!=b){SetInputFocus(document.forms[0][b])}}else{if(null!=a){SetInputFocus(document.forms[0][a])}}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;var isNS=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)>=4);function pos(b,a){xPos=0;yPos=0;if(b==null){return}if(b.offsetParent){while(b.offsetParent){xPos+=b.offsetLeft;yPos+=b.offsetTop;b=b.offsetParent}}else{if(b.x&&b.y){xPos+=b.x;yPos+=b.y}}}function cbCardMessageRequired_onClick(){var a=document.getElementById("cbCardMessageRequiredID");if(a!=null){if(a.checked){document.forms[0][tbShip_to_text2ID].disabled=true}else{document.forms[0][tbShip_to_text2ID].disabled=false}}}function show_props(d,c){var a="";for(var b in d){a+=c+"."+b+" = "+d[b]+"\n"}return a}function ShowLoginBlock(){if(divLoginBlock==undefined||divLoginBlock==null){return}if(rblOrder!=undefined||rblOrder!=null){if(rblOrder.checked==true){divLoginBlock.style.visibility="hidden";setStyle(divLoginBlock,"display","none")}else{divLoginBlock.style.visibility="visible";setStyle(divLoginBlock,"display","inline")}}}InputIntControl=function(a){var c=a.value;if(IsDecimalSeparatorDefined){c=c.replace(rExpFormLocale,".")}var b=c.indexOf(".");if(b!=-1){c=c.substring(0,b)}if(/\D/.test(c)){a.value=a.defaultValue}else{if(c==""){c="1"}a.defaultValue=c}return c};function emulateEventHandlers(b){for(var a=0;a<b.length;a++){document.addEventListener(b[a],function(c){window.event=c},true)}}function extendEventObject(){Event.prototype.__defineSetter__("returnValue",function(a){if(!a){this.preventDefault()}return a});Event.prototype.__defineSetter__("cancelBubble",function(a){if(a){this.stopPropagation()}return a});Event.prototype.__defineGetter__("fromElement",function(){var a;if(this.type=="mouseover"){a=this.relatedTarget}else{if(this.type=="mouseout"){a=this.target}}if(!a){return}while(a.nodeType!=1){a=a.parentNode}return a});Event.prototype.__defineGetter__("toElement",function(){var a;if(this.type=="mouseout"){a=this.relatedTarget}else{if(this.type=="mouseover"){a=this.target}}if(!a){return}while(a.nodeType!=1){a=a.parentNode}return a});Event.prototype.__defineGetter__("offsetX",function(){return this.layerX});Event.prototype.__defineGetter__("offsetY",function(){return this.layerY})}function RemoveSpecialCharacters(c){var b="";if(c.length>0){for(var a=0;a<c.length;a++){if(c.charCodeAt(a)>31||c.charCodeAt(a)==10||c.charCodeAt(a)==13){b+=String.fromCharCode(c.charCodeAt(a))}}}return b}function showPartnerInformation(c,e,b){var d=document.getElementById(b);var a=document.getElementById(c);if(d.style.visibility=="visible"){d.style.visibility="hidden";d.innerHTML="";a.innerHTML=">"}else{d.style.visibility="visible";d.innerHTML=e;a.innerHTML=""}}FLEUROP={};FLEUROP.attachTextFieldValidator=function(d,c,b,g,f,a){if(!d||d.validator){return}var e=new FLEUROP.TextFieldValidator(d,c,b,g,f,a);FLEUROP.attachValidator(d,e)};FLEUROP.attachDecimalTextFieldValidator=function(a,e,g,h,d,f,c){if(!a||a.validator){return}var b=new FLEUROP.DecimalTextFieldValidator(a,e,g,h,d,f,c);FLEUROP.attachValidator(a,b)};FLEUROP.attachValidator=function(a,b){if(!a||!b||a.validator){return}a.validator=b;if(a.addEventListener){a.addEventListener("focus",function(){a.validator.startMonitoring.call(a.validator,event)},false);a.addEventListener("blur",function(){a.validator.stopMonitoring.call(a.validator,event)},false);a.addEventListener("keypress",function(){return a.validator.isInputAllowed.call(a.validator,event)},false)}else{if(a.attachEvent){a.attachEvent("onfocus",function(){a.validator.startMonitoring.call(a.validator,event)});a.attachEvent("onblur",function(){a.validator.stopMonitoring.call(a.validator,event)});a.attachEvent("onkeypress",function(){return a.validator.isInputAllowed.call(a.validator,event)})}}};FLEUROP.TextFieldValidator=function(o,i,m,c,a,l){var u=o;var p=i;var s=new Array();var q=c;var j=a;var t=l;var b;if(t){t.value=p-f(u.value).length}var d=(m&&m.split(","))||new Array();for(var r=0;r<d.length;++r){var n=d[r].split("-");var h=n[0];var e=n[1]||h;s.push({start:h,end:e})}function g(k){if(!s){return false}for(var v=0;v<s.length;++v){if(k>=s[v].start&&k<=s[v].end){return true}}return false}function f(k){if(k.indexOf("\r\n")!=-1){}else{if(k.indexOf("\r")!=-1){k=k.replace(/\r/g,"\r\n")}else{if(k.indexOf("\n")!=-1){k=k.replace(/\n/g,"\r\n")}}}return k}this.getTextField=function(){return u};this.checkField=function(){var x=(u&&u.value)||"";var k=f(x);var v=false;for(var w=0;w<x.length;w++){if(!g(x.charCodeAt(w))){if(!v){j&&alert(j);v=true}x=x.substring(0,w)+x.substring(w+1,x.length);--w}}if(p&&k.length>p){x=k.substring(0,i);q&&alert(q)}if(u&&u.value.length!=x.length){u.value=x;u.scrollTop=u.scrollHeight}if(t){t.value=p-k.length}};this.isInputAllowed=function(w){var y=(u&&u.value)||"";var v=f(y);var x=w.which;if(x===undefined){x=w.keyCode}var k=true;if(!(w.altKey||w.ctrlKey||w.shiftKey||w.metaKey)&&x!=0&&x!=9&&x!=8&&x!=27&&x!=35&&x!=36&&x!=37&&x!=38&&x!=39&&x!=40){if(p&&u&&v.length>=p){if(q){u&&u.blur();alert(q);u&&u.focus()}k=false}if(k){if(!g(x)){if(j){u&&u.blur();alert(j);u&&u.focus()}k=false}}}if(!k){w.cancelBubble=true;w.stopPropagation&&w.stopPropagation();w.preventDefault&&w.preventDefault()}return k};this.startMonitoring=function(){if(!b){b=setInterval(this.checkField,20)}};this.stopMonitoring=function(){clearInterval(b);b=undefined}};FLEUROP.DecimalTextFieldValidator=function(l,q,n,g,e,m,j){var f=q||".";var o=n;var i=g;var p=e;var b=m;var k=j;var a=new FLEUROP.TextFieldValidator(l,null,"48-57, "+f.charCodeAt(0));var d=a.checkField;var c=a.stopMonitoring;var h=a.isInputAllowed;a.getMinValue=function(){if(e){return e()}return o};a.getMaxValue=function(){if(m){return m()}return i};a.checkField=function(){d();var r=(a.getTextField()&&a.getTextField().value)||"";while(r.lastIndexOf(f)!=r.indexOf(f)){r=r.substr(0,r.lastIndexOf(f))+r.substr(r.lastIndexOf(f)+1)}while(r.length>0&&isNaN(parseFloat(r.replace(f,".")))){r=r.substr(0,r.length-1)}if(a.getTextField()&&(a.getTextField().value.length!=r.length)){a.getTextField().value=r}};a.stopMonitoring=function(){setTimeout(function(){c();a.checkFieldForMaxAndMinValue();if(k){k(a.getTextField())}},300)};a.checkFieldForMaxAndMinValue=function(){a.checkField();var t=a.getMinValue();var u=a.getMaxValue();var v=(a.getTextField()&&a.getTextField().value)||"";var s=t;var r=parseFloat(v.replace(f,"."));if(!isNaN(r)){s=r}if(t&&s<t){s=t}if(u&&s>u){s=u}if(!s){s=0}a.getTextField().value=s.toFixed(2).toString().replace(".",f)};a.isInputAllowed=function(s){var r=false;if(h(s)){if(s.charCode==0&&s.keyCode>0){r=true}else{var t=s.which||s.keyCode;var u=(a.getTextField()&&a.getTextField().value)||"";if((u.lastIndexOf(f)<0||(t!=f.charCodeAt(0)))&&!isNaN(parseFloat(u.replace(f,".")+String.fromCharCode(t)))){r=true}}}if(!r){s.cancelBubble=true;s.stopPropagation&&s.stopPropagation();s.preventDefault&&s.preventDefault()}return r};return a};function getElementsByTagNameAndAttribute(d,b){var e=document.getElementsByTagName(d);var a=new Array();for(var c=0;c<e.length;++c){if(e[c].attributes[b]){a.push(e[c])}}return a}function ShowFlashPlayer(e,c,a){widthW=c+20;heightW=a+20;var b=window.open("","","height= "+heightW+",width="+widthW+",menubar=no, top=150, left=150, status=no, location=no, toolbar=no, scrollbars=no, resizable=no");var d='<html><head><title></title></head><body><div style= style="margin:0px;padding:0px">';d+="<object width='"+c+"' height='"+a+"' id='Object2'>";d+="<param name='movie' value='"+e+"'/>";d+="<embed src='"+e+"' width='"+c+"' height='"+a+"' type='application/x-shockwave-flash'>";d+="</object></div></body></html>";b.document.write(d)};
