var hideNav = false;
var rules = {
	'div#navContainer' : function(element){
		setCenter(element);
	},
	'ul.nav_normal li a img' : function(element){
		element.onmouseover = function () {
			nav_mo(this);
		}
		element.onmouseout = function () {
			nav_mo(this);
		}		
	},	
	'.frmField' : function(element){
		element.onfocus = function () {
			if (!this.cleared) 
				clearField(this); 
			this.cleared=true;
			this.style.backgroundColor = '#f4f4f4';
		}	
		element.onblur = function () {
			resetField(this);
			this.style.backgroundColor = '#ffffff';
		}
	},
	'.frmFieldDefault' : function(element){
		element.onfocus = function () {
			if (!this.cleared) 
				clearFieldDefault(this); 
			this.cleared=true;
			this.style.backgroundColor = '#f4f4f4';
		}	
		element.onblur = function () {
			resetField(this);
			this.style.backgroundColor = '#ffffff';
		}
	},	
	'form#frmCmt button' : function(element){
		element.onclick = function () {
			error = checkForm('frmCmt');
			if (error=='')
				$('frmCmt').submit();
			else {
				alert(error);
				return false;
			}					
		}	
		
	},
	'.image' : function(element){
		element.onmouseover = function () {
			imgTitle_mo(this,true);			
		}
		element.onmouseout = function () {
			imgTitle_mo(this,false);			
		}			
	},
	'div#exhibitHome p' : function(element){
	
		//if ()
		if	((element.nextSibling && element.nextSibling.tagName=='SPAN') || (Element.next(element) && Element.next(element).tagName=='SPAN') || (element.nextSibling && element.nextSibling.tagName=='SPAN'))
			element.style.display = 'inline';

	},
	'div#ie6' : function(element){

		bodyElems = $$('body');
		bodyElem = bodyElems[0];
		new Insertion.Top(bodyElem, element);
		
	},	
	'ul.nav_normal' : function(element){
		element.onmouseover = function () {
			hideNav = clearTimeout(hideNav);
			tmp = $$('.subnav');
			tmp[0].style.visibility='visible';
		}
		element.onmouseout = function () {
			hideNav = setTimeout(function() {
				tmp = $$('.subnav');
				tmp[0].style.visibility='hidden';
			},
			200);
			
		}		
	}
};
Behaviour.register(rules);	
