/*
         ___                         _____       __
        /  /\        ________       /    /\     / /\
(-----//  /  \//----/_____/__\\--) /____/  \___/_/ //--------------------------)
      /  /   /      \     | //     \    \  /    /\/    this code was created by
     /__/   /        \    |///-----\\____\/____/  \                       sigea
(---\\  \  /   (-----\\___|/        /    /\    \  /       
      \__\/                        /____/ /\____\/            __       sigea.ch
                                   \____\/  \  /             /\_\--------------)
                                         \___\//-------------\/_/  

*/
var rooms;
function Rooms(){
	var additionalID='additionalContent';
	var additionalDisplayID='displayAdditionalContent';
	var additionalHideID='hideAdditionalContent';
	this.show=function(element){
		removeClass(document.getElementById(additionalID),'hidden');
		addClass(element,'hidden');
		removeClass(document.getElementById(additionalHideID),'hidden');
	}
	this.hide=function(element){
		addClass(document.getElementById(additionalID),'hidden');
		addClass(element,'hidden');
		removeClass(document.getElementById(additionalDisplayID),'hidden');
	}
	this.prepare=function(){
		if(!document.getElementsByTagName) return false;
		if(!document.getElementById) return false;
		if(document.getElementById(additionalDisplayID)){
			if(document.getElementById(additionalID).className.indexOf('form_error')>=0){
				removeClass(document.getElementById(additionalHideID),'hidden');
			}else{
				removeClass(document.getElementById(additionalDisplayID),'hidden');
				addClass(document.getElementById(additionalID),'hidden');
			}
			document.getElementById(additionalDisplayID).onclick=function(){
				rooms.show(this);
			}
			document.getElementById(additionalHideID).onclick=function(){
				rooms.hide(this);
			}
			removeClass(document.getElementById(additionalID),'noscript');
		}
		if(document.getElementById('toollist')){
			removeClass(document.getElementById('toollist'),'hidden');
			var liTag=document.getElementById('toollist').getElementsByTagName('li');
			for(var i=0; i<liTag.length; i++){
				if(liTag[i].className.indexOf('print')>=0){
					liTag[i].onclick=function(){
						window.print();
					}
				}else if(liTag[i].className.indexOf('to_favorits')>=0){
					if (window.sidebar || window.external){
						liTag[i].onclick=function(){
							if (window.sidebar) { // Mozilla Firefox Bookmark
								window.sidebar.addPanel(document.title, location.href, '');
							}else if(window.external){ // IE Favorite
								window.external.AddFavorite(location.href, document.title);
							}else if(window.opera && window.print) { // Opera Hotlist
								return true;
							}
							return true;
						}
					}else{
						addClass(liTag[i],'hidden');
					}
				}
			}
		}
		return true;
	}
}
addLoadEvent(function(){
	rooms=new Rooms();
	rooms.prepare();
});
