function XdomAjaxPurchaseWidget(f,e,a,c,b,d){this.id=f;this.formID=e;this.requestURL=a;this.extension=c;this.callback=b;this.varName=d;this.cartSlotID="";Utilities.onload(this)}XdomAjaxPurchaseWidget.prototype={onPageLoad:function(){var a=this,b,d;a.container=xdom_getElementById(a.id);a.form=xdom_getElementById(a.formID);a.busy=new BusyIndicator();if(a.cartSlotID){if(a.cartSlot=xdom_getElementById(a.cartSlotID)){d=new CookieUtil(document,"SitePurchaseData");if(d.read()){a.sendRequest("cart_check",a.varName)}}}a.checkingPurchase=false},cartButton:function(a){this.cartSlotID=a},sendRequest:function(e,d,c){var b,a="callback="+this.callback+"&controlID="+e+"&controlValue="+encodeURIComponent(d)+"&parameter="+this.varName;if(c){a+="&"+xdom.formPost(c)}b=new XdomAjax(null,"VerifiedControl",this.requestURL);b.requestor=this;b.xdomExtension=this.extension;b.sendRequest(null,a);return b},serverResponse:function(b,a){var k=this,g,d,i=b.err=="0",l=b.errmsg,j,h;k.busy.hide();if(g=xdom_GetFirstElementWithTagName(a,"replace_content")){k.container.innerHTML=decodeURIComponent(decodeURIComponent(xdom_GetData(g)))}if(!i){if(typeof console!="undefined"){console.error("Server Response Error: "+l)}alert(l);return false}if(g=xdom_GetFirstElementWithTagName(a,"payment_status")){j=g.getAttribute("value");if(j=="pending"){k.checkingPurchase=false;return true}k.popupFormClose();d=xdom_getElementById(k.formID);k.sendRequest("summary_pay",j,d)}if(g=xdom_GetFirstElementWithTagName(a,"cart_button")){if(k.cartSlot){k.cartSlot.innerHTML=decodeURIComponent(decodeURIComponent(xdom_GetData(g)))}}return true},Send:function(f,d,a){var b=this,c=f.form;b.busy.show();b.sendRequest(d,a,c)},popupFormClose:function(){var b=this;window.clearInterval(b.popupCheckInterval);window.clearInterval(b.checkPurchaseInterval);window.clearInterval(b.timoutInterval);b.checkingPurchase=false;b.timersActive=false;try{if(b.popup){b.popup.close()}}catch(a){return}},popupFormSend:function(a,b){return b},checkPurchase:function(b){var a=this;if(a.checkingPurchase){return}xdomAjax=a.sendRequest("payment_status",b);a.checkingPurchase=true},popupFormCheck:function(){var a=this,b;if(!a.popup.closed){return}a.popupFormClose();b=xdom_getElementById(a.formID);a.sendRequest("summary_pay","abort",b)},timeoutPurchase:function(){var a=this,b;if(a.popup.closed){return}a.popupFormClose();b=xdom_getElementById(a.formID);a.sendRequest("summary_pay","timeout",b)},onSubmitPopup:function(c,b,e){var a=this,d,g;if(!b){b="500"}if(!e){e="400"}this.popup=window.open("","xdom_purchase_popup","resizable,scrollbars,width="+b+",height="+e);c.target="xdom_purchase_popup";d=xdom_getElementById(a.formID);g=d.o.value;a.timersActive=true;a.popupCheckInterval=window.setInterval(function(){if(a.timersActive){a.popupFormCheck()}},200);a.checkPurchaseInterval=window.setInterval(function(){if(a.timersActive){a.checkPurchase(g)}},2000);a.timoutInterval=window.setInterval(function(){if(a.timersActive){a.timeoutPurchase()}},1200000);return true}};function BusyIndicator(){var a,b=this;b.hidden=true;b.image=a=document.createElement("img");a.setAttribute("src","/images/busy.gif");a.style.position="absolute";a.style.top="-200px";a.style.left="-200px";a.style.zIndex="50000";document.body.appendChild(a);b.othermousemove=document.onmousemove;document.onmousemove=function(c){return b.mouse(c)}}BusyIndicator.prototype={show:function(){var a=this;a.hidden=false;a.image.style.top=(a.y-15)+"px";a.image.style.left=(a.x-15)+"px"},hide:function(){var a=this;a.hidden=true;a.image.style.top="-200px";a.image.style.left="-200px"},mouse:function(b){var a=this;if(a.othermousemove){a.othermousemove(b)}if(document.all){a.x=window.event.clientX+((document.documentElement&&document.documentElement.scrollLeft)?document.documentElement.scrollLeft:document.body.scrollLeft);a.y=window.event.clientY+((document.documentElement&&document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop)}else{a.x=b.pageX;a.y=b.pageY}if(a.hidden){return}this.image.style.top=(a.y-15)+"px";this.image.style.left=(a.x-15)+"px"}};function SecureLogin(c,b,a){this.formID=c;this.requestURL=b;this.md5URL=a;this.md5Loaded=false;this.form=null;this.popupForm=null;Utilities.onload(this)}SecureLogin.prototype={onPageLoad:function(){var b,a=this;b=xdom_getElementById(a.formID);if(/^input$/i.test(b.tagName)){a.form=b.form;a.ajax=true}else{a.form=b;a.ajax=false;a.busy=new BusyIndicator()}a.form.SecureLogin=a},submit:function(){var a=this;if(a.busy){a.busy.show()}if(typeof hex_md5!="function"){Utilities.loadJavascript(null,a.md5URL);a.loadTimer=setInterval(function(){if(typeof hex_md5!="function"||a.md5Loaded){return}a.md5Loaded=true;clearInterval(a.loadTimer);a.sendRequest()},200);return false}a.sendRequest();return false},AjaxFormSend:function(b,c,a){var d=this;d.popupForm=b;d.popupVarname=c;d.popupAction=a;d.submit()},sendRequest:function(){var b,a="callback=MemberAjaxLoginCallback";b=new XdomAjax(null,"SecureLogin",this.requestURL);b.requestor=this;b.sendRequest(null,a);return b},serverResponse:function(d,a){var p=this,h=p.form,j=h.elements,m=d.err=="0",n=d.errmsg,o,l,g,k,b;if(p.busy){p.busy.hide()}if(m){for(b=0;b<j.length;b++){k=j[b];if(k.type=="password"){break}}l=hex_md5(o=k.value);g=hex_hmac_md5(n,l);k.value=g;h.password_key.value="1";if(p.popupForm){p.popupForm.DoSend(p.popupVarname,p.popupAction)}else{h.submit();if(Utilities.Chrome||Utilities.Opera){h.password.value=o}}}return true}};function xdom_engine(){}xdom_engine.prototype={alert:function(a){alert("Oops.  We have encountered a javascript problem.  "+a+"  If this problem persists please contact Fred's Used Websites.");return false},formPost:function(d,a,g){var s="",q,b,h,n,f,k,t="",m=d.elements,p,j=Array(),l;if(!m){return""}for(h=0;h<m.length;h++){n=m[h];if(!n.type){continue}b=n.name;if(n.type!="select-multiple"&&(p=b.indexOf("[]"))!=-1){b=b.substr(0,p);l=j[b]=(typeof(j[b])=="number")?j[b]+1:0;b+="["+l+"]"}switch(n.type){case"text":case"textarea":q=n.value;break;case"checkbox":case"radio":if(!n.checked){continue}q=n.value;break;case"select-multiple":for(f=0;f<n.options.length;f++){k=n.options[f];if(k.selected){s+=t+b+"="+encodeURIComponent(k.value)}t="&"}continue;default:q=n.value}s+=t+b+"="+encodeURIComponent(q);t="&"}if(a){s+=t+a+"="+encodeURIComponent(g)}return s}};xdom=new xdom_engine();var xdom_otherOnLoad,xdom_otherOnUnload;var xdom_onloadRegistry;if(!xdom_onloadRegistry){xdom_onloadRegistry=new Object();xdom_onloadRegistry.controlMatches=new Array();xdom_onloadRegistry.controlDependencies=new Array();xdom_onloadRegistry.requiredControls=new Array();xdom_onloadRegistry.validatedControls=new Array();xdom_onloadRegistry.validatedMinMaxControls=new Array();xdom_onloadRegistry.listSelectors=new Array();xdom_onloadRegistry.autoSubmits=new Array();xdom_onloadRegistry.dynamicControls=new Array();var xdom_labelElements;if(window.onload){xdom_otherOnLoad=window.onload}else{xdom_otherOnLoad=false}window.onload=xdom_onLoad;if(window.onunload){xdom_otherOnUnload=window.onunload}else{xdom_otherOnUnload=false}window.onunload=xdom_onUnload}function xdom_getElementById(b){var a;if((typeof jQuery!="undefined")&&(a=$("#"+b).get(0))){return a}return document.getElementById(b)}function xdom_onUnload(){if(xdom_otherOnUnload&&xdom_otherOnUnload!=xdom_onUnload){xdom_otherOnUnload()}}function xdom_onLoad(){ajaxDebugElement=xdom_getElementById("ajaxDebugOutputDIV");xdom_labelElements=document.getElementsByTagName("LABEL");ajaxDebug("AJAX DEBUG OUTPUT:");xdom_ConfigureDependentControls();xdom_ConfigureRequiredControls();xdom_ConfigureMatchingControl();xdom_ConfigureValidatedControls();xdom_ConfigureDynamicControls();xdom_ConfigureValidatedMinMaxControls();xdom_ListSelectorInitialize();xdom_ConfigureAutoSubmits();if(xdom_otherOnLoad&&xdom_otherOnLoad!=xdom_onLoad){try{xdom_otherOnLoad()}catch(a){}}}var ajaxDebugElement;function ajaxDebug(a){if(!ajaxDebugElement){}else{a=a.replace(/\n/,"<br/>");ajaxDebugElement.innerHTML+=a+"<br/>";ajaxDebugElement.scrollTop=ajaxDebugElement.scrollHeight}}function xdom_RegisterAutoSubmit(a){var b=new Object();b.controlID=a;xdom_onloadRegistry.autoSubmits.push(b)}function xdom_RegisterDependentControl(b,c,a){var d=new Object();d.controlID=b;d.masterID=c;d.ctlFunction=a;xdom_onloadRegistry.controlDependencies.push(d)}function xdom_RegisterRequiredControl(a,c){var b=new Object();b.controlID=a;b.checkControlID=c;xdom_onloadRegistry.requiredControls.push(b)}function xdom_RegisterMatchingControl(a,b){var c=new Object();c.controlID=a;c.masterID=b;xdom_onloadRegistry.controlMatches.push(c)}function xdom_RegisterValidatedControl(e,c,a,i,d,f,g,b){var h=new Object();h.controlID=e;h.requestURL=a;h.callbackClass=c;h.parameter=i;h.parameterIsOtherControl=d;h.allowEmpty=f;h.callbackObject=g;h.xdomExtension=b;xdom_onloadRegistry.validatedControls.push(h)}function xdom_RegisterDynamicControl(a,b,d,e){var c=new Object();c.controlID=a;c.requestURL=d;c.callbackClass=b;c.parameter=e;xdom_onloadRegistry.dynamicControls.push(c)}function xdom_RegisterValidatedMinMaxControl(b,a,f,c,e){var d=new Object();d.controlID=b;d.minValue=a;d.maxValue=f;d.decimalPlaces=c;d.checkControlID=e;xdom_onloadRegistry.validatedMinMaxControls.push(d)}function xdom_RegisterListSelector(a,f,e,c,g,b){var d=new Object();d.controlID=a;d.listID=f;d.requestURL=e;d.callbackClass=c;d.callbackObject=g;d.xdomExtension=b;xdom_onloadRegistry.listSelectors.push(d)}function xdom_ConfigureAutoSubmits(){var a,d=xdom_onloadRegistry.autoSubmits;while(d.length&&(a=d.shift())){var b=xdom_getElementById(a.controlID);if(!b){continue}b.submit()}}function xdom_ConfigureDependentControls(){var b,g=xdom_onloadRegistry.controlDependencies;while(g.length&&(b=g.shift())){var f=new Object();var e=xdom_getElementById(b.controlID);f.element=e;f.ctlFunction=b.ctlFunction;var a=new Object();var d=xdom_getElementById(b.masterID);if(!e||!d){continue}a.element=d;a.ctlFunction=b.ctlFunction;if(!d||!e){return false}if(!d.xdom_DependentControls){d.xdom_DependentControls=new Array()}d.xdom_DependentControls.push(f);e.xdom_MasterControl=a}}function xdom_ConfigureRequiredControls(){var b,f=xdom_onloadRegistry.requiredControls;while(f.length&&(b=f.shift())){var a=b.controlID;var e=xdom_getElementById(a);if(!e){continue}if(e.form){if(!e.form.requiredControls){e.form.requiredControls=new Array()}e.form.requiredControls.push(e)}xdom_setCheckControl(e,b.checkControlID);var d=function(){var c=this.checkControl;if(c&&!c.checked){return true}var j=false,h;var h="";switch(this.type){case"text":case"textarea":case"password":j=!isEmpty(this.value);h="This field cannot be empty";break;case"select-one":j=(this.value!=""&&this.value!="0");h="Please make a selection";break;case"checkbox":case"radio":j=this.checked;h="You must check this before continuing";break;case"select":case"select-multiple":for(var g=0;g<this.options.length;g++){if(this.options[g].selected){j=true}}if(!j){h="You must select at least one option."}break;case"file":j=!isEmpty(this.value);h="You must select a file for uploading.";break;default:j=false;h="Control type "+this.type+" not supported."}xdom_setElementFailState(this,j,h);return j};xdom_setOnblurEvent(e,d);xdom_setOnsubmitEvent(e,d);xdom_setFormsubmitHandler(e)}}function xdom_ConfigureMatchingControl(){var b,f=xdom_onloadRegistry.controlMatches;while(f.length&&(b=f.shift())){var e=xdom_getElementById(b.controlID);var d=xdom_getElementById(b.masterID);if(!e||!d){continue}e.xdomMatchingControl=d;xdom_findAssociatedLabel(e,false);var a=xdom_findAssociatedLabel(d,false);e.xdomMatchingControlName=a?a.textContent:d.name;e.savedClassName=e.className;func=function(){var c=(this.value==this.xdomMatchingControl.value);xdom_setElementFailState(this,c,"The contents of this field must match the "+this.xdomMatchingControlName+" field.");return c};xdom_setOnblurEvent(e,func);xdom_setOnsubmitEvent(e,func);xdom_setFormsubmitHandler(e)}}function xdom_ConfigureValidatedMinMaxControls(){var d,i=xdom_onloadRegistry.validatedMinMaxControls;while(i.length&&(d=i.shift())){var b=d.controlID;var a=d.minValue;var f=d.maxValue;var e=d.decimalPlaces;var g=xdom_getElementById(b);if(!g){continue}if(g.form){if(!g.form.requiredControls){g.form.requiredControls=new Array()}g.form.requiredControls.push(g)}xdom_setCheckControl(g,d.checkControlID);var h=function(){var c=this.checkControl;if(c&&!c.checked){return true}var l=false;var k="";if(this.disabled){xdom_setElementFailState(this,true,"");return true}if(this.type=="text"){var j=Number(this.value);if(isNaN(j)){k="You must enter a numeric value"}else{if(j<a||j>f){k="Value is out of range (minimum value:"+a+"; maximum value: "+f+")"}else{this.value=j.toFixed(e);l=true}}}else{k="Validation on wrong type of control"}xdom_setElementFailState(this,l,k);return l};xdom_setOnblurEvent(g,h);xdom_setOnsubmitEvent(g,h);xdom_setFormsubmitHandler(g)}}var xdom_SessionKeepAliveAjax;function xdom_StartSessionKeepAlive(c,d,b,a){xdom_SessionKeepAliveAjax=new XdomAjax(null,"KeepAlive",d);xdom_SessionKeepAliveAjax.controlHandler=function(f){var e=this.err=="0";if(!e){var g="";g+="The browser has detected a problem with the web server.\n";g+="If you have entered data on this form, there is a potential\n";g+="that this data will be lost.  Do not submit the form until you\n";g+="can access the website and are logged in.  When you click OK\n";g+="a new window should popup.  Use that window to ensure that you\n";g+="are logged in, then return to this window and click submit to\n";g+="save your data";window.clearInterval(xdom_SessionKeepAliveAjax.timerID);alert(g);xdom_openLinkInNewWindow(xdom_SessionKeepAliveAjax.failURL);xdom_SessionKeepAliveAjax.timerID=window.setInterval("xdom_SessionKeepAlive()",xdom_SessionKeepAliveAjax.invervalMsec)}};xdom_SessionKeepAliveAjax.timerID=window.setInterval("xdom_SessionKeepAlive()",c);xdom_SessionKeepAliveAjax.invervalMsec=c;xdom_SessionKeepAliveAjax.failURL=b;xdom_SessionKeepAliveAjax.callbackClass=a}function xdom_SessionKeepAlive(){xdom_SessionKeepAliveAjax.sendRequest("callback="+xdom_SessionKeepAliveAjax.callbackClass);xdom_SessionKeepAliveAjax.count=1}function xdom_ConfigureValidatedControls(){var a,n=xdom_onloadRegistry.validatedControls;while(n.length&&(a=n.shift())){var i=a.controlID;var d=a.requestURL;var g=a.callbackClass;var o=a.parameter;var h=a.parameterIsOtherControl;var l=a.allowEmpty;var p=xdom_getElementById(i);if(!p){continue}p.allowEmpty=l;var k=new XdomAjax(p,"VerifiedControl",d);p.xdomAjax=k;k.callbackClass=g;k.controlID=i;k.controlElement=p;k.parameter=o;k.parameterIsOtherControl=h;k.xdomExtension=a.xdomExtension;var e=k.callbackObject=a.callbackObject;if(e&&e.initialize){e.initialize(k)}if(h){var f;f=k.otherControlElement=xdom_getElementById(o);if(f){var j=new Object();j.element=p;j.ctlFunction=function(c,q){if(c.onblur){c.onblur()}};if(!f.xdom_DependentControls){f.xdom_DependentControls=new Array()}f.xdom_DependentControls.push(j);xdom_setOnblurEvent(f,function(){xdom_OnClick(this)})}else{k.parameterIsOtherControl=false;k.parameter=""}}if(p.form){if(!p.form.requiredControls){p.form.requiredControls=new Array()}p.form.requiredControls.push(p)}xdom_findAssociatedLabel(p,!l);var m=function(){var s=this.xdomAjax;var t,u,c;t=xdom_get_element_value(this);u=(s.parameterIsOtherControl)?xdom_get_element_value(s.otherControlElement):s.parameter;this.xdomWaitingForServer=true;var q="callback="+s.callbackClass+"&controlID="+s.controlID+"&controlValue="+t+"&parameter="+u;if((c=s.callbackObject)&&c.sendRequest){q+=c.sendRequest(q)}s.sendRequest(null,q)};k.controlHandler=function(q){var s=this.controlElement;var c=this.err=="0";s.xdomWaitingForServer=false;s.xdomControlIsValid=c;if(!s.xdomInitialValidation){xdom_setElementFailState(s,c,this.errmsg)}if(c&&this.errmsg){s.value=this.errmsg}s.xdomInitialValidation=false;s.xdomServerMessage=this.errmsg};var b=function(){if(this.allowEmpty&&this.value==""){return true}if(this.xdomWaitingForServer){return false}if(this.xdomControlIsValid){return true}xdom_setElementFailState(this,false,this.xdomServerMessage);return false};p.xdomInitialValidation=true;p.xdomControlIsValid=false;xdom_setOnblurEvent(p,m);xdom_setOnchangeEvent(p,m);xdom_setOnsubmitEvent(p,b);p.onblur();xdom_setFormsubmitHandler(p)}}function xdom_ConfigureDynamicControls(){var a,h=xdom_onloadRegistry.dynamicControls;while(h.length&&(a=h.shift())){var e=a.controlID;var b=a.requestURL;var d=a.callbackClass;var i=a.parameter;var j=xdom_getElementById(e);if(!j){continue}var g=new XdomAjax(j,"DynamicControl",b);j.xdomAjax=g;g.callbackClass=d;g.controlID=e;g.parameter=i;xdom_findAssociatedLabel(j,true,"xdomDynamicControl");var f=function(){var k=this.xdomAjax;var l=xdom_get_element_value(this);this.xdomWaitingForServer=true;var c="callback="+k.callbackClass+"&controlID="+k.controlID+"&controlValue="+l+"&parameter="+k.parameter;k.sendRequest(c)};g.controlHandler=function(k){var l=this.controlElement;var c=this.err=="0";l.xdomWaitingForServer=false;l.xdomControlIsValid=c;if(!l.xdomInitialValidation){xdom_setElementFailState(l,c,this.errmsg)}if(c&&this.errmsg){switch(l.type){case"text":case"textarea":l.value=this.errmsg;break;case"checkbox":l.checked=(this.errmsg=="1");break}}l.xdomInitialValidation=false;l.xdomServerMessage=this.errmsg};j.xdomInitialValidation=true;j.xdomControlIsValid=false;switch(j.type){case"text":case"textarea":xdom_setOnblurEvent(j,f);break;case"checkbox":xdom_setOnclickEvent(j,f);break}}}function xdom_ListSelectorInitialize(){var i,h=xdom_onloadRegistry.listSelectors;while(h.length&&(i=h.shift())){var f=i.controlID;var a=i.requestURL;var d=i.callbackClass;var j=i.listID;var k=xdom_getElementById(f);if(!k){continue}var g=new XdomAjax(k,"ListSelector",a);k.xdomAjax=g;g.listID=j;g.leftCell=xdom_getElementById(f+"_left");g.rightCell=xdom_getElementById(f+"_right");g.addControl=xdom_getElementById(f+"_add");g.removeControl=xdom_getElementById(f+"_remove");g.addControl.onclick=xdom_ListSelectorAct;g.removeControl.onclick=xdom_ListSelectorAct;g.addControl.xdomAjax=g;g.removeControl.xdomAjax=g;g.callbackClass=d;var b=g.callbackObject=i.callbackObject;g.controlHandler=xdom_ListSelectorRefresh;g.xdomExtension=i.xdomExtension;var e="callback="+d+"&action=getLists&listID="+j;if(b){b.initialize(g,e);e+=b.sendRequest("getLists",j,null)}g.sendRequest(e)}}function xdom_ListSelectorRefresh(a){this.controlElement.leftCellList=xdom_ListSelectorRefreshCell(this.controlElement,this.leftCell,"selected","removeSelection","xdomListSelectorSelectedList",a);this.controlElement.rightCellList=xdom_ListSelectorRefreshCell(this.controlElement,this.rightCell,"selections","addSelection","xdomListSelectorSelectionList",a)}function xdom_ListSelectorRefreshCell(q,p,o,c,a,d){var g='<table class="'+a+'"><tbody>';var h="<tr><td>(none)</td></tr>";var l=d.getElementsByTagName(o);if(l.length){var b=l[0].getElementsByTagName("entry");var j=b.length;if(j){for(var f=0;f<j;f++){var k=b[f];var n=k.firstChild?k.firstChild.data:"";g+="<tr><td>"+n+"</td></tr>"}}else{g+=h}}else{g+=h}g+="</tbody></table>";p.innerHTML=g;if(!j){return null}var u=p.getElementsByTagName("td");var m=u.length;if(j!=m){alert("We have some trouble here")}for(var f=0;f<m;f++){var k=u[f],s;k.selectionID=b[f].getAttribute("id");k.controlElement=q;if(b[f].getAttribute("disabled")=="1"){k.className="xdomListSelectorDisabledItem";k.disabled=true}else{k.onclick=xdom_ListSelectorOnclick;k.action=c}if(s=b[f].getAttribute("title")){k.setAttribute("title",s)}if(s=b[f].getAttribute("style")){k.setAttribute("style",s)}}return u}function xdom_ListSelectorAct(){var c=this.xdomAjax;var b=this.xdomAjax.callbackObject;this.disabled=true;var a="callback="+c.callbackClass+"&action="+c.action+"&listID="+c.listID+"&selectionID="+c.selectionID;if(b){a+=b.sendRequest(c.action,c.listID,c.selectionID)}c.sendRequest(a)}function xdom_ListSelectorOnclick(){var e=this.controlElement;var c=e.xdomAjax;var d=e.leftCellList;var b=e.rightCellList;if(d){for(var a=0;a<d.length;a++){if(d[a].className=="xdomListSelectorSelectedItem"){d[a].className=""}}}if(b){for(var a=0;a<b.length;a++){if(b[a].className=="xdomListSelectorSelectedItem"){b[a].className=""}}}this.className="xdomListSelectorSelectedItem";c.selectionID=this.selectionID;c.action=this.action;if(this.action=="addSelection"){c.addControl.disabled=false;c.removeControl.disabled=true}else{c.addControl.disabled=true;c.removeControl.disabled=false}}function xdom_disableDependentControl(d,a){var b=a.type;var c=(b=="checkbox"||b=="radio")?a.checked:a.value;if(c){d.disabled=false}else{d.disabled=true}}function xdom_get_element_value(b){var c;switch(b.type){case"text":case"textarea":c=b.value;break;case"checkbox":c=b.checked?"1":"0";break;case"select-one":var a=b.selectedIndex;c=b.options[a].value;break}return encodeURIComponent(c)}function xdom_OnClick(a){var b,c;if(a.xdom_DependentControls){for(c=0;c<a.xdom_DependentControls.length;c++){b=a.xdom_DependentControls[c];b.ctlFunction(b.element,a)}}}function xdom_OnBlur(a){}function xdom_onSubmit(a){}function xdom_onReset(a){}function xdom_submit(b){var a=xdom_getElementById(b);if(!a){return false}a.submit()}function xdom_submitButton(j,h,a,g){var f=j.form;if(!f){return}if(!g){g=j.value}var b=f.elements.length;for(var d=0;d<b;d++){var k=f.elements[d];if(k.type=="hidden"&&k.name==h){k.value=g}}if(!f.submit.tagName&&(a||!f.onsubmit||(f.onsubmit&&f.onsubmit()))){f.submit()}}function xdom_cancelButton(g,h){var f=g.form;if(!f){return}var b=h?h:"cancelButton";var a=f.elements.length;for(var d=0;d<a;d++){var j=f.elements[d];j.onsubmit=null;if(j.type=="hidden"&&j.name==b){j.value=g.value}}f.xdomDoingCancel=true;if(!f.submit.tagName){f.submit()}else{f.submit.name=b;f.submit.value=g.value;f.submit.click()}}var xdom_newLinkWindow;function xdom_openLinkInNewWindow(b){var a=xdom_newLinkWindow;if(!a||a.closed){a=window.open(b,window.name+"_print","menubar,resizable,scrollbars,status")}xdom_newLinkWindow=a;if(!a){alert("Window for link cannot be opened!  This is likely due to a popup blocker in your browser.")}}var xdom_newPopupWindowNumber=0;function xdom_openLinkAsPopupWindow(c,d,e){var a;var b="menubar,resizable,scrollbars";if(d){b+=",width="+d}if(e){b+=",height="+e}a=window.open(c,window.name+"_popup"+xdom_newPopupWindowNumber++,b);if(!a){alert("Window for link cannot be opened!  This is likely due to a popup blocker in your browser.")}}function xdom_executeLink(b,a,f){var e=xdom_getElementById(a);var d=e.value;if(!d){d=0}if(!f){f="selectID"}var c=b+"&"+f+"="+d;window.location=c}function xdom_switchLocale(f,b,a){var e=f.value;if(!e){return}if(e==a){return}var c=(b.indexOf("?")<0)?"?":"&";var d=b+c+"locale="+e;window.location=d}function xdom_helpPopup(a){var d=xdom_getElementById(a);var b=d.SavedTitle?d.SavedTitle:d.title;alert(b)}function xdom_FakeCancel(d){var c=d.form;var b=xdom_getElementById("xdomCancelForm");var a=xdom_getElementById("fake");a.value=d.value;a.name=d.name;a.id=d.name;b.submit();return false}function xdom_link_ok_cancel(){alert("I am here");return false}function xdom_GetFirstElementWithTagName(b,a){var c=b.getElementsByTagName(a);if(c.length<1){return null}var d=c[0];return d}function xdom_GetData(a){if(!a.firstChild){return""}var c="";for(var b=0;b<a.childNodes.length;b++){c+=a.childNodes[b].data}return c}function xdom_ResponseOK(a){var b=a.getAttribute("value");return(a.getAttribute("value")=="0")?true:false}xdom_eventHandlers=new Object();xdom_eventHandlers.onblur=new Array();xdom_eventHandlers.onclick=new Array();xdom_eventHandlers.onchange=new Array();xdom_eventHandlers.onsubmit=new Array();function xdom_setOnblurEvent(a,b){if(!a.xdomOnblur){a.xdomOnblur=new Array()}if(a.onblur&&a.onblur!=xdom_handleOnblurEvent){a.xdomOnblur.push(a.onblur)}a.onblur=xdom_handleOnblurEvent;a.xdomOnblur.push(b)}function xdom_handleOnblurEvent(){var b,c=true;for(var a=0;a<this.xdomOnblur.length;a++){this.xdomTemp=this.xdomOnblur[a];if(typeof this.xdomTemp=="function"){b=this.xdomTemp()}else{b=this.xdomTemp.onElementBlur(this)}if(!b){c=false}}return c}function xdom_setOnclickEvent(a,b){if(!a.xdomOnclick){a.xdomOnclick=new Array()}if(a.onclick&&a.onclick!=xdom_handleOnclickEvent){a.xdomOnclick.push(a.onclick)}a.onclick=xdom_handleOnclickEvent;a.xdomOnclick.push(b)}function xdom_handleOnclickEvent(){var b,c=true;for(var a=0;a<this.xdomOnclick.length;a++){this.xdomTemp=this.xdomOnclick[a];if(typeof this.xdomTemp=="function"){b=this.xdomTemp()}else{b=this.xdomTemp.onElementClick(this)}if(!b){c=false}}return c}function xdom_setOnchangeEvent(a,b){if(!a.xdomOnchange){a.xdomOnchange=new Array()}if(a.onchange&&a.onchange!=xdom_handleOnchangeEvent){a.xdomOnchange.push(a.onchange)}a.onchange=xdom_handleOnchangeEvent;a.xdomOnchange.push(b)}function xdom_handleOnchangeEvent(){var b,c=true;for(var a=0;a<this.xdomOnchange.length;a++){this.xdomTemp=this.xdomOnchange[a];if(typeof this.xdomTemp=="function"){b=this.xdomTemp()}else{b=this.xdomTemp.onElementChange(this)}if(!b){c=false}}return c}function xdom_setFocus(a){a.focus()}function xdom_setOnsubmitEvent(a,b){if(!a.xdomOnsubmit){a.xdomOnsubmit=new Array()}if(a.onsubmit&&a.onsubmit!=xdom_handleOnsubmitEvent){a.xdomOnsubmit.push(a.onsubmit)}a.onsubmit=xdom_handleOnsubmitEvent;a.xdomOnsubmit.push(b)}function xdom_handleOnsubmitEvent(){var b=true;for(var a=0;a<this.xdomOnsubmit.length;a++){this.xdomTemp=this.xdomOnsubmit[a];if(typeof this.xdomTemp=="function"){r=this.xdomTemp()}else{r=this.xdomTemp.onElementSubmit(this)}if(!r){b=false}}return b}var xdom_alertMessage;function xdom_alertOnSubmit(a){}function xdom_setElementFailState(a,b,d){var c=(a.savedClassName)?a.savedClassName+" ":"";if(b){a.className=c+"xdomRequiredControl";if(a.labelElement){a.labelElement.className="xdomRequiredControlLabel"}a.controlValidated=true}else{a.className=c+"xdomRequiredControlFail";if(a.labelElement){a.labelElement.className="xdomRequiredControlLabelFail"}if(!a.SavedTitle){a.SavedTitle=a.title}a.title=d;a.ajaxMessage=d;a.controlValidated=false}}function xdom_setFormsubmitHandler(c){var b=c.form;if(!b){return}var a=b.onsubmit;var d;if(!b.xdom_onsubmitControls){b.xdom_onsubmitControls=new Array()}b.xdom_onsubmitControls.push(c);b.onsubmit=function(){var h=true;if(b.xdomDoingCancel){return true}var g="The following fields have errors. Please correct and re-submit\n";for(var e=0;e<b.xdom_onsubmitControls.length;e++){var f=b.xdom_onsubmitControls[e];if(!f.onsubmit()){if(f.message){g+=f.message}else{g+=xdom_getLabelMessage(f)}h=false}}if(!h){alert(g)}return h}}function xdom_getLabelMessage(c){var d;if(c.labelElement){d="\n";for(var a=0;a<c.labelElement.childNodes.length;a++){var b=c.labelElement.childNodes[a];if(b.nodeType==3){d+=b.nodeValue}}if(c.ajaxMessage){d+=":   -"+c.ajaxMessage}}else{d+="\n"+c.name}return d}function xdom_findAssociatedLabel(c,b,a){if(c){return xdom_findLabel(c,c.id,b,a)}return null}function xdom_findLabel(f,g,e,d){var b;if(!f){return null}var c=f.form;f.savedClassName=f.className;for(var a=0;a<xdom_labelElements.length;a++){if((b=xdom_labelElements[a]).htmlFor==g&&b.form==c){f.labelElement=b;if(f.id==g){b.savedInnerHTML=b.innerHTML;b.savedClassName=b.className;xdom_setRequiredState(f,e,d)}break}}return b}function xdom_setRequiredState(j,c,i){var h="",d="",g="",b=j.labelElement;var f=j.savedClassName;var e=b?b.savedClassName:"";var a=i?i:"xdomRequiredControl";if(c){h="*";d=(e?" ":"")+"xdomRequiredControlLabel";g=(f?" ":"")+a}if(b){b.innerHTML=b.savedInnerHTML+h;b.className=d}j.className=f+g}function xdom_setCheckControl(d,c){var a=d.checkControl=c?xdom_getElementById(c):null;xdom_findAssociatedLabel(d,!a||a.checked);if(a){if(!a.checkControlled){a.checkControlled=new Array()}a.checkControlled.push(d);var b=function(){for(var e=0;e<this.checkControlled.length;e++){xdom_setRequiredState(this.checkControlled[e],this.checked)}};xdom_setOnchangeEvent(a,b)}}function isblank(b){for(var a=0;a<b.length;a++){var d=b.charAt(a);if((d!=" ")&&(d!="\n")&&(d!="\t")){return false}}return true}function isNumeric(a){return/[0-9]*/.test(a)}function isEmpty(a){return((a==null)||(a=="")||isblank(a))}function popup_help_window(c,b,f,d,e){var a="http://fredsusedwebsites.com/helpPopup.php?app="+c+"&topic="+b;if(f){a+="&field="+f}if(!d){d=850}if(!e){e=600}window.open(a,"HelpWindow","scrollbars=yes,resizable=yes,width="+d+",height="+e)}function xdom_checkboxSetVisibility(b,d){var a=b.checked;var c=xdom_getElementById(d);if(!c){return}if(a){c.style.display="inline"}else{c.style.display="none"}}function xdom_checkboxSetEnabled(a,c){var b=xdom_getElementById(c);if(!b){return}b.disabled=!a.checked}function xdom_getOffset(d){for(var a=d.offsetLeft,b=d.offsetTop,c=d.offsetParent;c;c=c.offsetParent){a+=c.offsetLeft;b+=c.offsetTop}return{top:b,left:a}}function XdomAjax(f,g,a){this.controlElement=f;this.url=a;this.controlName=g;try{this.xmlHttp=new XMLHttpRequest()}catch(d){var c=new Array("Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP");for(var b=0;b<c.length&&!this.xmlHttp;b++){try{this.xmlHttp=new ActiveXObject(c[b])}catch(d){}}}if(!this.xmlHttp){alert("Error creating the XMLHttpRequest object.")}}XdomAjax.prototype={sendRequest:function(b,a){var c="?xdomControl="+this.controlName;if(b){c+="&"+b}if(this.xdomExtension){c+="&xdomExtension="+this.xdomExtension}this.sendRawRequest(this.url+c,a)},sendRawRequest:function(a,b){this.requestString=a;if(this.xmlHttp){if(this.xmlHttp.readyState!=0&&this.xmlHttp.readyState!=4){return}try{var d=this;this.xmlHttp.open(b?"POST":"GET",a,true);this.xmlHttp.onreadystatechange=function(){var e=d;e.handleRequestStateChange()};if(b){this.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");this.xmlHttp.send(b)}else{this.xmlHttp.send(null)}}catch(c){alert("Can't connect to server:\n"+c.toString())}}},handleRequestStateChange:function(){if(this.xmlHttp.readyState!=4){return}if(this.xmlHttp.status!=200){ajaxDebug("xmlHttp.status = "+this.xmlHttp.status);alert("There was a problem retrieving the data:\n"+this.xmlHttp.statusText+"Request: "+this.requestString);return}try{this.handleServerResponse()}catch(a){var b="Error with the server response: "+a.toString();this.x=a;if(typeof console!="undefined"){console.error(b);console.dirxml(this.xmlHttp.responseXML)}alert(b)}},handleServerResponse:function(){var g=this.xmlHttp.responseXML,k=this.xmlHttp.responseText,j,f,m;if(!g||!g.documentElement){throw ("Invalid XML Structure:\n"+k)}var a=g.documentElement.nodeName;if(a=="parsererror"){throw ("Invalid XML Structure:\n"+k)}var i=g.documentElement;if(a!="response"||!i.firstChild){throw ("Invalid XML structure:\n"+k)}var h=xdom_GetFirstElementWithTagName(i,"error");this.err=h.getAttribute("value");this.errmsg=xdom_GetData(h);if(this.err=="2"){throw ("Server exception\n"+this.errmsg)}var b=xdom_GetFirstElementWithTagName(i,"debug");if(b){ajaxDebug("Server Debug: \n"+xdom_GetData(b))}if(this.requestor){this.requestor.serverResponse(this,i)}else{this.controlHandler(i);if(this.callbackObject){this.callbackObject.serverResponse(this,i)}}if(j=xdom_GetFirstElementWithTagName(i,"reloadpage")){var d=xdom_GetData(j);if(d=="1"){document.location.reload()}else{document.location=d}}if(j=xdom_GetFirstElementWithTagName(i,"cookie")){m=xdom_GetData(j);if(f=j.getAttribute("name")){var l=new CookieUtil(document,f,j.getAttribute("time"),j.getAttribute("path"),j.getAttribute("domain"),j.getAttribute("secure"));l.store(m)}}if(j=xdom_GetFirstElementWithTagName(i,"ajax_script")){Utilities.loadJavascript(xdom_GetData(j))}}};function XdomAjaxServerWidget(f,c,b,a,e){var d=this;d.id=f;d.url=c;d.delay=b*1000;d.interval=a*1000;d.params=e;Utilities.onload(this)}XdomAjaxServerWidget.prototype={onPageLoad:function(){var a=this;if(!(a.content=xdom_getElementById(a.id))){return}if(a.delay<=0){a.serverRequest()}else{a.timer=window.setInterval(function(){a.serverRequest()},a.delay)}},serverRequest:function(){var c=this,f=c.content,d,b="",a,g=c.params;sep="";window.clearInterval(c.timer);d=c.xdomAjax=new XdomAjax(f,"ServerWidget",c.url);d.requestor=c;for(a in g){b+=sep+a+"="+encodeURIComponent(g[a]);sep="&"}d.sendRequest(null,b)},serverResponse:function(d,c){var b=this,f,a;if(b.interval>0){b.timer=window.setInterval(function(){b.serverRequest()},b.interval)}if(d.err!="0"){alert(d.errmsg);return}f=xdom_GetFirstElementWithTagName(c,"content");a=f.getAttribute("value")=="0";if(f&&a){b.content.innerHTML=decodeURIComponent(xdom_GetData(f))}Utilities.onPageUpdate()}};function PayPalSetCmd(c,b){var a=document.getElementById(c);if(!a){return false}a.value=b;return true}function paypalEnableCheckSubmit(c){var a=document.getElementById(c);var b=function(){var d=document.getElementById(c);alert("Cmd: "+d.value)};xdom_setOnsubmitEvent(a,b)};