var myrules = {
	
	/*
	'#tab-home' : function(el){
		el.onclick = function(){
			showTab("home");
			return false;
		}		
	},*/
	
	
	'#tab-flights' : function(el){
		element.onclick = function(){
			showTab("flights");
			return false;
		}		
	},'#tab-hotels' : function(el){
		element.onclick = function(){
			showTab("hotels");
			return false;
		}		
	},'#tab-carhire' : function(el){
		element.onclick = function(){
			showTab("carhire");
			return false;
		}		
	},'#tab-sun' : function(el){
		element.onclick = function(){
			// showTab("sun");
			// return false;
			return true;
		}		
	},'#tab-ski' : function(el){
		element.onclick = function(){
			// showTab("ski");
			// return false;
			return true;
		}		
	},'#tab-cruises' : function(el){
		element.onclick = function(){
			// showTab("cruises");
			return false;
		}		
	}
	
};


Behaviour.register(myrules);


function showTab(className) {
	
	if (!document.getElementById) return;
	
	// Set Body Class Name 
	var theBody = document.body || document.documentElement;
	theBody.className = className;
	// alert(theBody.className); 
   
   
	var tabLinks = document.getElementById("links");
	var allTabLinks = tabLinks.getElementsByTagName("a");
	
	// Reset Tab Links
		for (var i=0; i<allTabLinks.length; i++) {
			// If table has the right classname
			// allTabLinks[i].className = "";
			allTabLinks[i].setAttribute("className", "");
			allTabLinks[i].setAttribute("class", "");
		}
	
	var idName = "tab-" + className;
	//alert(idName);
	var selectedTab = document.getElementById(idName);
	//alert(selectedTab.id);
	selectedTab.setAttribute("className", "selected");
	selectedTab.setAttribute("class", "selected");	
}








function getElementbyClass(rootobj, classname){
	var temparray=new Array()
	var inc=0
	var rootlength=rootobj.length
	for (i=0; i<rootlength; i++){
		if (rootobj[i].className==classname)
			temparray[inc++]=rootobj[i]
		}
	return temparray
}













