var req;



window.addEvent('domready', function() {
	build_tooltips();
	build_tooltips2();
	
	var path = 'http://hoerpfad.schloss-karlsberg.de/';

	req = new Request.HTML({method: 'get',url:path+'ajax.asp',
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('content_right').set('text', '');
			//Inject the new DOM elements into the results div.
			$('content_right').adopt(html);
			$('content_right').setStyle('visibility', 'visible');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('content_right').set('text', 'The request failed.');
		}
	});

	$('audio_player').setStyle('visibility', 'hidden');

	req2 = new Request.HTML({method: 'get',url:path+'player.asp',
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('audio_player').set('text', '');
			//Inject the new DOM elements into the results div.
			$('audio_player').adopt(html);
			$('audio_player').setStyle('visibility', 'visible');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('audio_player').set('text', 'The request failed.');
		}
	});

});


function build_tooltips() {
	
	customTips = $$('.tooltip');
	toolTips = new Tips(customTips, {
		className: 'custom_tip'
	});
}

function build_tooltips2() {
	
	customTips = $$('.tooltip2');
	toolTips = new Tips(customTips, {
		className: 'custom_tip2'
	});
}

function show_content(inhalt,site,audio) {
	
	req.send('id=' + inhalt + '&site=' + site + '&audio=' + audio);
	$('audio_player').setStyle('visibility', 'visible');

}

function show_audio(datei,audio) {
	
	req2.send('datei=' + datei + '&audio=' + audio);
}
