var CenterHelper=Class.create();CenterHelper.prototype={initialize:function(){},set_position:function(e){var d=$(e);var b=this.getPageSize();var a=this.getPageScroll();var g=(a[1]+((b[3]-35-d.clientHeight)/2)+"px");var f=(((b[0]-20-d.clientWidth)/2)+"px");d.style.left=f;d.style.top=g},getPageScroll:function(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}arrayPageScroll=new Array("",a);return arrayPageScroll},getPageSize:function(){var d,a;if(window.innerHeight&&window.scrollMaxY){d=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){d=document.body.scrollWidth;a=document.body.scrollHeight}else{d=document.body.offsetWidth;a=document.body.offsetHeight}}var b,e;if(self.innerHeight){b=self.innerWidth;e=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;e=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;e=document.body.clientHeight}}}if(a<e){pageHeight=e}else{pageHeight=a}if(d<b){pageWidth=b}else{pageWidth=d}arrayPageSize=new Array(pageWidth,pageHeight,b,e);return arrayPageSize}};var AjaxRequestHelper=Class.create();AjaxRequestHelper.prototype={container:null,indicator:null,indicator_layout:null,indicator_overlay:null,set_style:true,initialize:function(e,b,a,f,d){this.container=e;this.indicator=$(b);this.indicator_layout=$(a);this.indicator_overlay=$(f);this.set_style=d},formRequest:function(a,b){data=$(a).serialize();new Ajax.Updater({success:this.container},b,{parameters:data,asynchronous:true,evalScripts:true,onComplete:function(d){this.hideIndicator()}.bindAsEventListener(this),onLoading:function(d){this.showIndicator()}.bindAsEventListener(this),onFailure:function(d){alert("We are sorry, but something is wrong. Please contact us by phone.")}.bindAsEventListener(this),insertion:Element.update})},linkRequest_move_page_down:function(a){new Ajax.Updater({success:this.container},a,{parameters:{ajax:"true"},asynchronous:true,evalScripts:true,requestHeaders:["Accept","text/javascript"],onComplete:function(b){this.hideIndicator();window.scrollBy(0,20000)}.bindAsEventListener(this),onLoading:function(b){this.showIndicator()}.bindAsEventListener(this),insertion:Element.update})},linkRequest:function(a){new Ajax.Updater({success:this.container},a,{parameters:{ajax:"true"},asynchronous:true,evalScripts:true,requestHeaders:["Accept","text/javascript"],onComplete:function(b){this.hideIndicator()}.bindAsEventListener(this),onLoading:function(b){this.showIndicator()}.bindAsEventListener(this),insertion:Element.update})},showIndicator:function(){if(this.indicator_layout){if(this.set_style){this.indicator_layout.setStyle({height:document.body.clientHeight+"px"});this.indicator_layout.setStyle({width:document.body.clientWidth+"px"})}this.indicator_layout.show()}if(this.indicator_overlay){if(this.set_style){this.indicator_overlay.setStyle({height:document.body.clientHeight+"px"});this.indicator_overlay.setStyle({width:document.body.clientWidth+"px"})}this.indicator_overlay.show()}if(this.indicator!=null){if(this.set_style){c=new CenterHelper().set_position(this.indicator.id)}this.indicator.show()}},hideIndicator:function(){if(this.indicator!=null){if(this.indicator_layout){this.indicator_layout.hide()}if(this.indicator_overlay){this.indicator_overlay.hide()}if(this.indicator!=null){this.indicator.hide()}}}};