function showsub(element){

   element.className += "hover";

}



function hidesub(element){

   element.className = element.className = "";

}

var old_content = 'grouptabcontents1';

var rules = {

	'.grouptab' : function(elem){

		elem.onclick = function(){
			//changetab(elem.name); 
			//ajax_request(elem.rel, elem.href);

			var li_parent = elem.parentNode;

			li_parent.className = 'active';

			

			var arr = $(li_parent.id).siblings();

			if(arr.length>0){

				arr.each(function(node){

					if(node.className == 'active'){

						node.className = 'inactive';

					}

				});

			}

			

			var index = li_parent.id.substr(8,1);

			

			$(old_content).hide();
			if(!$('grouptabcontents' + index)){
				alert('grouptabcontents' + index);
				return false;			 
			}else{
				$('grouptabcontents' + index).show();
			}
			

			if(index==5){

				var map = $('grouptabcontents' + index);

				map.style.position = 'relative';

				map.style.left = '0px';

				map.style.top = '0px';

			}

			old_content = 'grouptabcontents' + index; 

			

			return false;

		}

		

	}

};  



Behavior.register(rules); 





function ajax_request(id,url){

	$(id).show();

	$(id).innerHTML = '<img src="fileadmin/template/img/indicator.gif"';

	

	var x = new Ajax.Updater(id, url,{asynchronous:true,method: 'GET',contentType: 'text/html',

				onComplete: function() 

							{

								//$(id).scrollTo();

								$(id).show();

								//new Effect.Opacity(id, { to: 1.0, from: 0, duration: 1.2} );

							},

				onSuccess: function() {},

				onFailure: function() {}

				});

}



var CurrentFontSize = 3;

switchFontSize=function(ckname,val){

	var bd = document.body;

//	bd = bd.0;

//	alert(bd);

	switch (val) {

		case 'inc':

			if (CurrentFontSize+1 < 6) {

//				bd.className = 'fs'+CurrentFontSize;

				CurrentFontSize++;

				bd.className = 'fs'+CurrentFontSize;

			}

		break;

		case 'dec':

			if (CurrentFontSize-1 > 0) {

//				bd.removeClassName('fs'+CurrentFontSize);

				CurrentFontSize--;

				bd.className = 'fs'+CurrentFontSize;

//				bd.addClassName('fs'+CurrentFontSize);

			}

		break;

		default:

//			bd.removeClassName('fs'+CurrentFontSize);

			CurrentFontSize = val;

			bd.className = 'fs'+CurrentFontSize;

//			bd.addClassName('fs'+CurrentFontSize);

	}

	//Cookie.set(ckname, CurrentFontSize,{duration:365});

}