ajax_get_obj=function(){
var _1=null;
try{
_1=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_1=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
_1=new XMLHttpRequest();
}
}
return _1;
};
ajax_is_available=function(){
return ajax_get_obj()!=null;
};
ajax_get=function(_2,_3){
var _4=ajax_get_obj();
if(!_4){
return false;
}
_4.onreadystatechange=function(){
if(_4.readyState==4){
_3.update_by_xml(_4.responseXML);
}
};
_4.open("GET",_2,true);
_4.send(null);
return true;
};
var oi_objs;
function setObjectInterval(_5,_6){
if(!oi_objs){
oi_objs=new Array();
}
var _7=oi_objs.length;
oi_objs[_7]=_5;
var _8=setInterval("runObjectInterval("+_7+")",_6);
if(_8>0){
_5._interval_id=_8;
}
return _8;
}
function runObjectInterval(_9,_a){
if(oi_objs[_9]){
oi_objs[_9].runInterval();
}
}
function clearObjectInterval(_b){
for(var i=0;i<oi_objs.length;i++){
if(oi_objs[i]==_b){
clearInterval(_b._interval_id);
oi_objs[i]=null;
return true;
}
}
return false;
}
var APUScroller=function(_d,_e,_f,_10,_11){
this.dest_x=_d;
this.dest_y=_e;
this.duration=_f;
this.no_steps=_10;
if(this.no_steps==0){
this.no_steps=10*_f;
}
this.event_obj=_11;
this.finished=true;
};
APUScroller.prototype.start=function(){
this.finished=false;
if(this.no_steps>0&&this.duration>0){
this.step_count=this.no_steps;
setObjectInterval(this,Math.round(this.duration/this.no_steps));
}else{
this.stop();
}
};
APUScroller.prototype.runInterval=function(){
var _12=document.body.scrollLeft;
var _13=document.body.scrollTop;
var _14=Math.round((this.dest_x-_12)/this.step_count);
var _15=Math.round((this.dest_y-_13)/this.step_count);
this.step_count--;
if(this.step_count==0||(_12==this.dest_x&&_13==this.dest_y)){
this.stop();
}else{
window.scrollBy(_14,_15);
if(this.event_obj){
this.event_obj.onscroll(this);
}
}
};
APUScroller.prototype.stop=function(){
if(this.finished){
return;
}
this.finished=true;
clearObjectInterval(this);
window.scrollTo(this.dest_x,this.dest_y);
};
var global_last_used_effect_id=-1;
var APUTransition=function(_16,_17,_18,_19,_1a){
this.elements=_16;
this.filter_ids=_17;
this.duration=_18;
this.new_visibility=_19;
this.event_obj=_1a;
this.finished=true;
};
APUTransition.prototype.get_filter_style=function(_1b){
if(_1b==1){
return "blendTrans(duration:"+this.duration+");";
}else{
if(_1b>=256){
return "revealTrans(duration:"+this.duration+"; transition:"+(_1b-256)+");";
}else{
return "";
}
}
};
APUTransition.prototype.start=function(){
var i;
var _1d;
this.finished=false;
var _1e=true;
for(i=0;i<this.elements.length;i++){
_1e=_1e&(this.elements[i].style.visibility==this.new_visibility);
}
if(_1e){
this.stop();
}
var ids=this.filter_ids.split(",");
var _20=parseInt(ids[0]);
var _21;
if(ids.length>1){
do{
_21=parseInt(ids[Math.round(Math.random()*(ids.length-1))]);
}while(_21==global_last_used_effect_id);
global_last_used_effect_id=_21;
}else{
_21=parseInt(this.filter_ids);
}
_1d=this.get_filter_style(_21);
if(_1d==""){
if(apu_show_errors){
alert("wrong filter_id entered!");
}
stop();
}
for(i=0;i<this.elements.length;i++){
this.elements[i].style.filter=_1d;
}
this._running=true;
for(i=0;i<this.elements.length;i++){
this._running=this._running&&this.elements[i].style.filter&&this.elements[i].filters&&this.elements[i].filters[0];
}
if(this._running){
for(i=0;i<this.elements.length;i++){
this.elements[i].filters[0].apply();
}
}
for(i=0;i<this.elements.length;i++){
this.elements[i].style.visibility=this.new_visibility;
}
if(this._running){
for(i=0;i<this.elements.length;i++){
this.elements[i].filters[0].play();
}
setObjectInterval(this,100);
}else{
this.stop();
}
};
APUTransition.prototype.runInterval=function(){
if(!this._running){
this.stop();
}
var _22=true;
for(var i=0;i<this.elements.length;i++){
_22=_22&&(this.elements[i].filters[0].status!=2);
}
if(_22){
this.stop();
}
};
APUTransition.prototype.stop=function(){
if(this._running){
clearObjectInterval(this);
for(var i=0;i<this.elements.length;i++){
this.elements[i].filters[0].stop();
}
}
for(var i=0;i<this.elements.length;i++){
this.elements[i].style.visibility=this.new_visibility;
}
this.finished=true;
if(this.event_obj){
this.event_obj.ontransitionstopped(this);
}
};
var APUPagechanger=function(_25){
this.href=_25;
this.finished=true;
this.el_loader=document.getElementById(apu_loader_element_id);
this.el_transition=document.getElementById(apu_transition_element_id);
var el;
var j=0;
this.elements=new Array(0);
for(var i=0;i<apu_element_ids.length;i++){
el=document.getElementById(apu_element_ids[i]);
if(el&&typeof el=="object"){
this.elements[j]=document.getElementById(apu_element_ids[i]);
j++;
}
}
};
function find_childnode(_29,_2a){
childNodes=_29.childNodes;
if(!childNodes){
return null;
}
for(var i=0;i<childNodes.length;i++){
if(childNodes[i].nodeName==_2a){
return childNodes[i];
}
}
return null;
}
APUPagechanger.prototype.update_by_xml=function(_2c){
var i;
if(!_2c||typeof _2c!="object"){
if(apu_show_errors){
alert("Incorrect xml parameter received.");
}
this.href_change();
return;
}
if(!_2c.documentElement||typeof (_2c.documentElement)!="object"){
if(apu_show_errors){
alert("Unable to retreive document element from page xml.");
}
this.href_change();
return;
}
var _2e=find_childnode(_2c.documentElement,"error");
if(_2e){
if(apu_show_errors){
alert(_2e.firstChild.nodeValue);
}
this.href_change();
return;
}
var _2f=find_childnode(_2c.documentElement,"redirect");
if(_2f){
var _30,apu_available;
_30="";
apu_available="false";
for(i=0;i<_2f.attributes.length;i++){
if(_2f.attributes[i].name=="href"){
_30=_2f.attributes[i].value;
}else{
if(_2f.attributes[i].name=="apu_available"){
apu_available=_2f.attributes[i].value;
}
}
}
if(apu_show_errors){
alert("Got redirect to: "+_30);
}
if(apu_available=="true"){
this.href=_30;
this.do_ajax_change();
}else{
change_href(_30);
}
return;
}
var _31=find_childnode(_2c.documentElement,"page");
if(!_31||typeof _31!="object"){
if(apu_show_errors){
alert("Unable to retreive page node from page xml.");
}
this.href_change();
return;
}
if(this.hide_transition&&!this.hide_transition.finished){
this._stored_page_xml=_2c;
return;
}
var _32,content;
for(i=0;i<this.elements.length;i++){
_32=find_childnode(_31,this.elements[i].id);
if(!_32||typeof _32!="object"||!_32.firstChild||typeof _32.firstChild!="object"){
if(apu_show_errors){
alert("Incomplete data, missing data for: "+this.elements[i].id);
}
this.href_change();
return;
}
content=_32.firstChild.nodeValue;
var _33=new Array(0);
if(apu_exec_inline_script){
var _34,_33;
var _35=0;
var _36=/<script +(type="(text\/|)javascript([0-9.]+|)"|language="javascript([0-9.]+|)")>/i;
while((sbpos=content.substr(_35,content.length-_35).search(_36))!=-1){
sbpos+=_35;
_34=content.indexOf(">",sbpos);
if(_34==-1){
break;
}
_34++;
_35=content.substr(_34,content.length-_35).search(/<\/script>/i);
if(_35==-1){
break;
}
_35+=_34;
if(_34!=_35){
_33[_33.length]=content.substring(_34,_35);
_35+=9;
content=content.substr(0,sbpos)+content.substr(_35);
_35-=_35-sbpos+9;
}else{
_35+=9;
}
}
}
this.elements[i].innerHTML=content;
if(_33.length>0){
for(i=0;i<_33.length;i++){
eval(_33[i]);
}
}
}
this.hide_loader();
this.show();
};
APUPagechanger.prototype.get_transition_elements=function(){
if(this.el_transition){
return new Array(this.el_transition);
}else{
return this.elements;
}
};
APUPagechanger.prototype.begin_hide=function(){
if(apu_hide_transition_ids!="0"&&apu_hide_transition_duration>0){
this.hide_transition=new APUTransition(this.get_transition_elements(),apu_hide_transition_ids,apu_hide_transition_duration,"hidden",this);
this.hide_transition.start();
}else{
for(var i=0;i<this.elements.length;i++){
this.elements[i].style.visibility="hidden";
}
this.end_hide();
}
};
APUPagechanger.prototype.ontransitionstopped=function(_38){
if(_38==this.hide_transition){
this.end_hide();
}else{
this.end_show();
}
};
APUPagechanger.prototype.end_show=function(){
if(this.scroller){
this.scroller=null;
}
this.finished=true;
};
APUPagechanger.prototype.end_hide=function(){
if(this._stored_page_xml){
var xml=this._stored_page_xml;
this._stored_page_xml=null;
this.update_by_xml(xml);
}else{
this.show_loader();
}
};
APUPagechanger.prototype.show_loader=function(){
if(apu_show_loader_animation!=""&&!this.loader_anim){
var _3a="this.loader_anim = new LA"+apu_show_loader_animation+"(\""+apu_loader_animation_text+"\", \""+apu_loader_animation_extra_params+"\");";
eval(_3a);
if(this.loader_anim){
this.loader_anim.show(this.href,"",this.el_page);
setObjectInterval(this,Math.max(50,apu_loader_animation_speed));
}
}
if(this.el_loader!=null){
this.el_loader.style.visibility="visible";
}
};
APUPagechanger.prototype.runInterval=function(){
if(this.loader_anim){
this.loader_anim.update(1);
}
};
APUPagechanger.prototype.hide_loader=function(){
if(this.loader_anim){
clearObjectInterval(this);
this.loader_anim.hide();
this.loader_anim=null;
}
if(this.el_loader!=null){
this.el_loader.style.visibility="hidden";
}
};
APUPagechanger.prototype.show=function(){
if(apu_show_transition_ids!="0"&&apu_show_transition_duration>0){
this.show_transition=new APUTransition(this.get_transition_elements(),apu_show_transition_ids,apu_show_transition_duration,"visible",this);
this.show_transition.start();
}else{
for(var i=0;i<this.elements.length;i++){
this.elements[i].style.visibility="visible";
}
this.end_show();
}
};
APUPagechanger.prototype.create_url_get=function(){
var rtn="req_page="+escape(this.href);
rtn+="&elements=";
for(var i=0;i<this.elements.length;i++){
rtn+=escape(this.elements[i].id);
if(i+1<this.elements.length){
rtn+="%2C";
}
}
rtn+="&template_id="+escape(apu_cur_template_id);
rtn+="&cur_page="+escape(location.href);
return rtn;
};
APUPagechanger.prototype.do_ajax_change=function(){
var url=apu_root_url+"/modules/AjaxPageUpdate/getpage.php?"+this.create_url_get();
if(!ajax_get(url,this)){
if(apu_show_errors){
alert("ajax_get returned false");
}
this.href_change();
}
};
APUPagechanger.prototype.onscroll=function(){
if(this.loader_anim){
this.loader_anim.setrect(NaN,NaN,NaN,NaN);
}
};
APUPagechanger.prototype.ajax_change=function(){
this.begin_hide();
if(apu_scroll_up){
this.scroller=new APUScroller(0,0,apu_scroll_up_duration,apu_scroll_up_steps,this);
this.scroller.start();
}
this.do_ajax_change();
};
APUPagechanger.prototype.href_change=function(){
change_href(this.href);
};
APUPagechanger.prototype.change=function(){
this.finished=false;
if(this.elements.length>0&&ajax_is_available()){
this.ajax_change();
}else{
if(apu_show_errors&&this.elements.length>0){
alert("Ajax not available");
}else{
if(apu_show_errors){
alert("No content elements specified or found.");
}
}
this.href_change();
}
};
function change_href(_3f){
location.href=_3f;
}
var gPagechanger;
function change_page(_40){
if(gPagechanger&&!gPagechanger.finished){
if(apu_show_errors){
alert("only one pagechanger object is allowed at the time.");
}
return;
}
try{
changing_page=true;
gPagechanger=new APUPagechanger(_40);
if(!gPagechanger){
if(apu_show_errors){
alert("error creating pagechanger object");
}
change_href(_40);
}else{
gPagechanger.change();
}
}
catch(e){
if(apu_show_errors){
alert(e.message);
}
change_href(_40);
}
}

