
/* - atphoto_transitions.js - */
// http://www.lengen-weine.ch/portal_javascripts/atphoto_transitions.js?original=1
var TransitionsCallbacks=new Array();
function registerTransitionCallBack(id,method){var transition=new Object;transition.id=id;transition.method=method;TransitionsCallbacks.push(transition)}
function ATPhoto_basicCallBack(){this.wrapper.style.backgroundPosition='top center';this.wrapper.style.backgroundRepeat='no-repeat';this.wrapper.style.backgroundImage='url('+searchForAttr(this.wrapper,'src')+')';while(this.wrapper.hasChildNodes()){this.wrapper.removeChild(this.wrapper.firstChild)}
this.wrapper.innerHTML='';this.wrapper.appendChild(this.newNode);this.updateHTML();this.getNavigation();this.incrPhotoCounter();this.currentNode=this.newNode;this.is_in_callback=0;this.callback_counter=0;this.wrapper.style.backgroundImage='';this.setTimer(this.large_delay)}
registerTransitionCallBack('basic','ATPhoto_basicCallBack');
function ATPhoto_switchCallBack(){this.is_in_callback=true;if(!this.callback_counter){this.callback_counter=1}
if(this.currentNode){if(this.callback_counter==2||this.callback_counter==4||this.callback_counter==6){if(this.wrapper.hasChildNodes()){this.wrapper.removeChild(this.wrapper.firstChild)}
this.wrapper.appendChild(this.currentNode)} else{if(this.wrapper.hasChildNodes()){this.wrapper.removeChild(this.wrapper.firstChild)}
this.wrapper.appendChild(this.newNode)}
this.getNavigation()} else{this.wrapper.appendChild(this.newNode);this.callback_counter=100;this.getNavigation();this.setTimer(this.large_delay)}
if(this.callback_counter>=6){this.updateHTML();this.incrPhotoCounter();this.currentNode=this.newNode;this.is_in_callback=false;this.callback_counter=null;this.setTimer(this.large_delay);return}
this.callback_counter+=1;this.setTimer(100)}
function ATPhoto_crossWipeCallBack(){this.is_in_callback=true;if(!this.callback_counter){this.callback_counter=0}
this.wrapper.style.backgroundPosition='top center';this.wrapper.style.backgroundRepeat='no-repeat';if(this.wrapper.hasChildNodes()&&this.wrapper.firstChild.id!='transitionWrapper'){this.wrapper.style.backgroundImage='url('+searchForAttr(this.wrapper,'src')+')';while(this.wrapper.hasChildNodes()){this.wrapper.removeChild(this.wrapper.firstChild)}
this.wrapper.innerHTML=''}
if(!this.wrapper.hasChildNodes()){try{var newNode=document.createElementNS('http://www.w3.org/1999/xhtml','div')}
catch(e){var newNode=document.createElement('div')}
newNode.style.backgroundPosition='top center';newNode.style.backgroundRepeat='no-repeat';newNode.id='transitionWrapper';this.wrapper.appendChild(newNode)}
var wrapper=this.wrapper.firstChild;this.wrapper.style.height=this.newNode.height+'px';wrapper.style.backgroundImage='url('+this.newNode.src+')';wrapper.style.height=this.callback_counter+'px';if(this.callback_counter>=this.newNode.height){this.updateHTML();this.getNavigation();this.incrPhotoCounter();this.wrapper.style.backgroundImage='url('+this.newNode.src+')';this.currentNode=this.newNode;this.is_in_callback=false;this.callback_counter=null;this.setTimer(this.large_delay);return}
this.callback_counter+=2;this.setTimer(20)}
registerTransitionCallBack('cross wipe','ATPhoto_crossWipeCallBack');
function ATPhoto_fadeCallBack(){this.is_in_callback=true;if(!this.callback_counter){this.callback_counter=0}
this.wrapper.style.backgroundPosition='top center';this.wrapper.style.backgroundRepeat='no-repeat';if(this.wrapper.hasChildNodes()&&this.wrapper.firstChild.id!='transitionWrapper'){this.wrapper.style.backgroundImage='url('+searchForAttr(this.wrapper,'src')+')';while(this.wrapper.hasChildNodes()){this.wrapper.removeChild(this.wrapper.firstChild)}
this.wrapper.innerHTML=''}
if(!this.wrapper.hasChildNodes()){try{var newNode=document.createElementNS('http://www.w3.org/1999/xhtml','div')}
catch(e){var newNode=document.createElement('div')}
newNode.id='transitionWrapper';newNode.style.backgroundPosition='top center';newNode.style.backgroundRepeat='no-repeat';this.wrapper.appendChild(newNode)}
var wrapper=this.wrapper.firstChild;this.wrapper.style.height=this.newNode.height+'px';wrapper.style.backgroundImage='url('+this.newNode.src+')';wrapper.style.height=this.newNode.height+'px';try{wrapper.filters.alpha.opacity=(this.callback_counter*100)} catch(e){wrapper.style.KhtmlOpacity=this.callback_counter;if(this.callback_counter>=1){wrapper.style.MozOpacity=0.9999999;wrapper.style.opacity=0.9999999} else{wrapper.style.MozOpacity=this.callback_counter;wrapper.style.opacity=this.callback_counter}}
if(this.callback_counter==0.7){this.updateHTML();this.getNavigation()}
if(this.callback_counter>=1){this.incrPhotoCounter();this.wrapper.style.backgroundImage='url('+this.newNode.src+')';this.currentNode=this.newNode;this.is_in_callback=false;this.callback_counter=null;this.setTimer(this.large_delay);return}
this.callback_counter+=.10;this.setTimer(100)}
registerTransitionCallBack('cross fade','ATPhoto_fadeCallBack');

