/* <![CDATA[ */

function linkTo_UnCryptMailto(s) {
	var alt=s;
	var neu = alt.replace(/°ed°/, "@");
	var r = "mailto:" + neu ;
	location.href=r;
} 

var openAdmin = function(url) {
	fenster = window.open(url, "fenster1", "width=900,height=550,status=yes,scrollbars=yes,resizable=yes");
	fenster.focus();
}
var openArchiv = function(url) {
	fenster2 = window.open(url, "fenster2", "width=220,height=500,status=yes,scrollbars=yes,resizable=yes");
	fenster2.focus();
}

var loadShoutbox = function(action,what) {
	new Request.HTML({
		url:'control.php',
		method: 'post',
		data: 'ajaxaction='+action,
		update:$(what),
		evalScripts:true,
		onRequest:function(){
			$(what).set('html','<div id="shoutbox_loading"><img height="16" width="16" alt="loading..." title="loading..." src="images/loading.gif" /><br />loading...</div>');
		},
		onComplete:function(){
			if($$('.tool').length > 0) {
				var Tips4 = new Tips($$('.tool'), {
					className: 'tool',
					offsets: {'x': 5, 'y': 5}
				});
			}
		}
	}).send();
}

var loadShoutboxForm = function(what) {
	new Request.HTML({
		url:'control.php',
		method: 'post',
		data: 'ajaxaction=3',
		update: $(what),
		evalScripts:true,
		onRequest:function(){},
		onComplete:function(){
		}
	}).send();
}

var sendMessage = function() {
	new Request.HTML({
		url:'control.php',
		method: 'post',
		data: 'ajaxaction=2&autor='+$('sb_autor').get('value')+'&message='+$('sb_message').get('value'),
		update:$('shoutbox_content'),
		evalScripts:true,
		onRequest:function(){},
		onComplete:function(){
			loadShoutbox('1','shoutbox_content'); 
			loadShoutboxForm('input');
		}
	}).send();
}
var sendMessage2 = function() {
	new Request.HTML({
		url:'control.php',
		method: 'post',
		data: 'ajaxaction=2&autor='+$('sb_autor').get('value')+'&mail='+$('sb_mail').get('value')+'&message='+$('sb_message').get('value'),
		update:$('shoutbox_content'),
		evalScripts:true,
		onRequest:function(){},
		onComplete:function(){
			loadShoutbox('1','shoutbox_content'); 
			loadShoutboxForm('input');
		}
	}).send();
}
setInterval("loadShoutbox('1','shoutbox_content')",60000);

window.addEvent('domready', function(){
	if($('shoutbox_content')!=null) {
		loadShoutbox('1','shoutbox_content');
		loadShoutboxForm('input');
	}
	if($$('.aTool').length > 0) {
		var Tips4 = new Tips($$('.aTool'), {
			className: 'aTool',
			offsets: {'x': 5, 'y': 5}
		});
	}
	if($$('.cpTool').length > 0) {
		var pages = new OwnTips($$('.cpTool'), {
			fxDuration: 1000,
			maxTitleChars: 50,
			maxOpacity: 0.9,
			clickable: true,
			stayalive:true,
			takeajax:true,
			offsets: {'x': -90, 'y': 16},
			ajaxfile:'control.php',
			ajaxoption:'ajaxaction=20&cPage',
			className: 'tooltipEvent'
		});
	}
	if($$('.archiv_Tool').length > 0) {
		var Tips6 = new Tips($$('.archiv_Tool'), {
			className: 'archiv_Tool',
			offsets: {'x': 5, 'y': 5}
		});
	}
});

//ENDE DOMONLOAD
/* ]]> */

