//TR:
function MapWillShowIE (id)
{
	if (document.getElementById(id).style.display == 'block') {
document.getElementById(id).style.display = 'none';
	}
}

///////////// MooSlider /////////////
window.addEvent('domready',function(){
				
	// Anpassung IE6
	if(window.ie6) var heightValue='100%';
	else var heightValue='';
	
	
	// Selektoren der Container für Schalter und Inhalt
	var togglerName='dt.accordion_toggler_';
	var contentName='dd.accordion_content_';
	
	
	// Selektoren setzen
	var counter=1;	
	var toggler=$$(togglerName+counter);
	var content=$$(contentName+counter);
	
	while(toggler.length>0)
	{
		// Accordion anwenden
		new Accordion(toggler, content, {
			opacity: true,
			//display: -1,
			display: pagedisp,
			alwaysHide: true,
			onComplete: function() { 
				var element=$(this.elements[this.previous]);
				if(element && element.offsetHeight>0) element.setStyle('height', heightValue);			
			},
			onActive: function(toggler, content) {
				toggler.addClass('open');
			},
			onBackground: function(toggler, content) {
				toggler.removeClass('open');
			}
		});
		
		// Selektoren für nächstes Level setzen
		counter++;
		toggler=$$(togglerName+counter);
		content=$$(contentName+counter);
	}
									
		//SAMPLE 8
		var handles8_more = $$('#handles8_more span');
		var nS8 = new noobSlide({
			box: $('box8'),
			items: $$('#box8 h3'),
			size: 358,
			//handles: $$('#handles8 span'), 
			// TR: prev & next by handles. play, stop, pause...
			//addButtons: {previous: $('prev8'), play: $('play8'), stop: $('stop8'), playback: $('playback8'), next: $('next8') },
			onWalk: function(currentItem,currentHandle){
				//style for handles
				$$(this.handles,handles8_more).removeClass('active');
				$$(currentHandle,handles8_more[this.currentIndex]).addClass('active');
				//text for "previous" and "next" default buttons
				// TR: Reads name in the H3 to change to.  also, handles8 above. 
				//$('prev8').set('html','&lt;&lt; '+this.items[this.previousIndex].innerHTML);
				//$('next8').set('html',this.items[this.nextIndex].innerHTML+' &gt;&gt;');
			}
		});
		//more "previous" and "next" buttons
		nS8.addActionButtons('previous',$$('.prev'));
		nS8.addActionButtons('next',$$('.next'));
		// TR: these for inside the box
		/*nS8.addActionButtons('previous',$$('#box8 .prev'));
		nS8.addActionButtons('next',$$('#box8 .next'));*/ 
		//more handle buttons
		//nS8.addHandleButtons(handles8_more);
		//walk to item 3 witouth fx
		//TR: .walk( # = 1 before start, 
		nS8.walk(0,false,true);
	});
		

///////////// Hover /////////////
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
function pngfade(imgName)  {
        if (document.images) {
                document[imgName].src = "images/nav/" + imgName + "_hov.png"
        }
}
function pngdie(imgName) {
        if (document.images)  {
                document[imgName].src = "images/nav/" + imgName + ".png"
        }
}
function jpgfade(imgName)  {
        if (document.images) {
                document[imgName].src = "images/nav/" + imgName + "_hov.jpg"
        }
}
function jpgdie(imgName) {
        if (document.images)  {
                document[imgName].src = "images/nav/" + imgName + ".jpg"
        }
}

	
///////////// Toggle Sliders /////////////			
//var mysliders=new Array('mhproperties','footergooglemap','sitemapshowbox','check-avail-block');

function toggleBlock(id, linkid) {
if (document.getElementById(id).style.display == 'none') {
document.getElementById(id).style.display = 'block';
document.getElementById(linkid).innerHTML = 'Show less.'
} else {
document.getElementById(id).style.display = 'none';
document.getElementById(linkid).innerHTML = 'Read more.'
}
}
function ReverseContentDisplay(d) {

if(d.length < 1) { return; }
if(document.getElementById(d).style.display == 'none') { 
	document.getElementById(d).style.display = 'block';
}
else { 
	document.getElementById(d).style.display = 'none'; 
}
}



function showSlider (e) {
	document.getElementById(e).style.display = 'block';
}
function clearAll (e) {
	var mysliders=new Array('mhproperties','footergooglemap','sitemapshowbox','check-avail-block');
	for (j=0;j<mysliders.length;j++){
		document.getElementById(mysliders[j]).style.display = 'none';
	}
	//document.getElementById('mhproperties').style.display = 'none';
	showSlider(e);
}

///////////// Swap Background Image /////////////		
function changeImage(mySrc)  
{ document.getElementById('middle_background').src=mySrc; }  


///////////// Analytics /////////////		
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-8725248-3']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

