
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - shoutbox.js - */
// http://nature-ride.at/portal_javascripts/shoutbox.js?original=1
var ns=(navigator.appName.indexOf("Netscape")!=-1);var ie=(navigator.appName.indexOf("Microsoft Internet Explorer")!=-1);var xhttp_put=false;var xhttp_get=false;var debug=false;
function overrideThisShoutboxForm(){if(!W3CDOM){return false}
if(typeof(shoutbox_id)!='undefined'){sb_form=document.getElementById(shoutbox_id+'-form');sb_form.onsubmit=function(){handleShoutBoxSubmit();return false}}}
function handleShoutBoxSubmit(){sb_nick=document.getElementById(shoutbox_id+'-nick');sb_comment=document.getElementById(shoutbox_id+'-comment');sb_referer=document.getElementById(shoutbox_id+'-referer');sb_button=document.getElementById(shoutbox_id+'-button');document.getElementById(shoutbox_id+'-spinner').style.display='inline';xhttp_put=new XMLHttpRequest();if(sb_comment.value!=''){if(xhttp_put.readyState==0){sb_comment.disabled=true;sb_button.disabled=true;parameters='comment='+encodeURIComponent(sb_comment.value);parameters+='&last_referer='+encodeURIComponent(sb_referer.value);if(sb_nick){sb_nick.disabled=true;parameters+='&nickname='+encodeURIComponent(sb_nick.value)}
xhttp_put.open("POST",sb_form.action,true);xhttp_put.setRequestHeader('Content-Type','application/x-www-form-urlencoded');var id=shoutbox_id
xhttp_put.onreadystatechange=handlePutShoutBox;xhttp_put.send(parameters)}}}
function handlePutShoutBox(){xhttp_get=new XMLHttpRequest();if(xhttp_put.readyState==4){sb_comment.value='';if(sb_nick) sb_nick.value=''}
if(xhttp_get.readyState==0){sb_form=document.getElementById(shoutbox_id+'-form');url_parts=sb_form.action.split('/');url_parts[url_parts.length-1]=shoutbox_ajax_response_template;shoutbox_url=url_parts.join('/');xhttp_get.open("GET",shoutbox_url+'?base_id='+shoutbox_id+'&rand='+Date.parse(Date())+Math.floor(Math.random() * 1000000),true);xhttp_get.onreadystatechange=handleReceiveShoutBox;xhttp_get.send(null)}}
function handleReceiveShoutBox(){if(xhttp_get.readyState==4){response=xhttp_get.responseText
document.getElementById(shoutbox_id).innerHTML=response;document.getElementById(shoutbox_id+'-spinner').style.display='none';sb_form=document.getElementById(shoutbox_id+'-form');sb_form.onsubmit=function(){handleShoutBoxSubmit();return false}}}


/* - ie6fixes.js - */
// http://nature-ride.at/portal_javascripts/ie6fixes.js?original=1
function IE6HoverFixer(){var navVersion=navigator.appVersion.split("MSIE")
var ie_version=parseFloat(navVersion[1])
if(ie_version<7){elements=cssQuery("#portal-globalnav li")
for(var i=0;i<elements.length;i++){elements[i].onmouseover=ahcn;elements[i].onmouseout=rhcn}}}
function ahcn(){addClassName(this,'hover')}
function rhcn(){removeClassName(this,'hover')}
registerPloneFunction(IE6HoverFixer);

/* - contentloader.js - */
// http://nature-ride.at/portal_javascripts/contentloader.js?original=1
image=new Object()
image.Fader=function(){this.spinner_id='spinner';this.container_id='image-container';this.container=null;this.isIE=document.all&&(navigator.appName.indexOf("Microsoft")!=-1);this.isSafari=navigator.appVersion.indexOf("Safari")!=-1;this.EFFECT_STEPS=10;this.EFFECT_SPEED=40;this.ALPHA_MAX=100;this.SHOW_TIME=(typeof(show_time)!='undefined'?show_time:5) * 1000;this.response_url=typeof(response_url)!='undefined'?response_url:'getRandomXMLImageData.xml';this.container=document.getElementById(this.container_id)
if(this.container){counter=1;for(i=0;(image=this.container.getElementsByTagName('img')[i]);i++){if(image.parentNode.id!=this.spinner_id){image_id=this.container_id+'-'+counter;image.setAttribute('id',image_id);image.id=image_id
if(counter>1){addClassName(image,'hiddenStructure')}
counter+=1}}
if(!this.container){alert("Your image container (id='"+this.container_id+"') was not found!");return false}
var tmp=this;setTimeout(function(){tmp.change()},this.SHOW_TIME)}}
image.Fader.prototype={change:function(){var xmlhttp=new XMLHttpRequest();var tmp=this;d=new Date()
anticache=d.getTime()+d.getMilliseconds();src=0;xmlhttp.open('GET',this.response_url+'?anticache='+anticache+'&current='+src,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){data=xmlhttp.responseXML;src=data.getElementsByTagName('address')[0].firstChild;title=data.getElementsByTagName('title')[0].firstChild;img1=document.getElementById(tmp.container_id+'-1')
img2=document.getElementById(tmp.container_id+'-2');if(img2){if(img1) tmp.container.removeChild(img1);img2.setAttribute('id',tmp.container_id+'-1');img2.id=tmp.container_id+'-1'}
img=document.createElement('img');img.setAttribute('id',tmp.container_id+'-2');img.setAttribute('src',src.data);img.setAttribute('alt',title?title.data:'');img.src=src.data;img.alt=title?title.data:'';img.id=tmp.container_id+'-2';addClassName(img,'hiddenStructure');tmp.container.appendChild(img);tmp.setOpacity(img.id,0);removeClassName(img,'hiddenStructure');tmp.debug('+ starting loading: '+img.src+' (Cache: '+img.complete+')');if(document.getElementById('image-caption')){setTimeout("document.getElementById('image-caption').innerHTML = '"+(title?title.data:'')+"';",(tmp.EFFECT_SPEED *(tmp.EFFECT_STEPS * 2)))}
tmp.onloadIEHandler.call(tmp)}}
xmlhttp.send(null)
this.spinner(true)},onloadHandler:function(){this.spinner(false);this.debug('- finished loading.');img2=document.getElementById(this.container_id+'-2')
this.fade(img2.id,0);var tmp=this;setTimeout('tmp.spinner(false)',this.EFFECT_STEPS * this.EFFECT_SPEED);setTimeout(function(){tmp.change()},this.SHOW_TIME)},onloadIEHandler:function(){if(img.complete){this.onloadHandler()} else{this.debug('- loading.');tmp=this;setTimeout('tmp.onloadIEHandler()',100)}},setOpacity:function(id,alpha){this.debug(id+': opacity='+alpha+'('+this.ALPHA_MAX+'/'+this.EFFECT_STEPS+')');element=document.getElementById(id)
if(this.isIE){element.style.filter='alpha(opacity='+alpha+')'} else if(this.isSafari){element.style.opacity=alpha/100} else{element.style.MozOpacity=alpha/100}},fade:function(id,alpha){this.setOpacity(id,alpha);if(alpha>=this.ALPHA_MAX){return true} else{alpha+=parseInt(this.ALPHA_MAX/this.EFFECT_STEPS);tmp=this;setTimeout('tmp.fade("'+id+'", '+alpha+')',this.EFFECT_SPEED)}},debug:function(debug_string){d=document.getElementById('debug');if(d){if(this.isIE){d.innerHTML=d.innerHTML+'<br />'+debug_string} else{d.innerHTML=d.innerHTML+'\n'+debug_string}}},spinner:function(visible){s=document.getElementById(this.spinner_id);if(visible){removeClassName(s,'hiddenStructure')} else{addClassName(s,'hiddenStructure')}}}
function startFadeEffect(){var o=new image.Fader()}
registerPloneFunction(startFadeEffect);
