/* ================================ +
		 	 BAGDROP
 + ================================ */



/* 
** Made by: Thomas Lievestro
** Email:	info@lstro.com
** Website:	www.lstro.com
*/


/* ================================ +
              Variables
 + ================================ */
 
var TimeOut         = 1;
var TimeOut2        = 1500;
var currentLayer    = null;
var closeTimer      = null;
var currentSubNav   = 'nav1';
var defineHeights 	= '';
var subnav_settings_height = '';
var subnav_page_height = '';
var selected 				= true;


var content_width = '420';
var content_left = '15';
var content_bar_left = '452';
var content_arrow_left = '447';

var content_thumb_left = '451';




// SelectAll Functie om alle rows te selecteren.
function Selectall(form){
	
	var t = $(form).elements;
	for (var i=0; i < t.length; i++){ 
		if (t[i].type == "checkbox"){ 
				t[i].checked = selected;	
		}
	}
	selected = !selected; 
}

//showLoader
function showLoader(){
		if ($('zoek_loading').visible()) {
			$('zoek_loading').hide();
		} else {
			$('zoek_loading').show();
		}
	}


function define_heights(){

	 subnav_settings_height = Element.getHeight('subnav_settings')+"px";
	 subnav_page_height = Element.getHeight('subnav_page')+"px";
	 subnav_agenda_height = Element.getHeight('subnav_agenda')+"px";
	 	
		//hoor in expandchild
		if(defineHeights){
		}else{
			define_heights();
			defineHeights 	= 'true';
		}
	
}

function expandChild(id){

		 
		if (!$(id).visible()) {
			new Effect.BlindDown(id,{duration: 0.3});	
		}
		window.clearTimeout(closeTimer);
		closeTimer = null;
		
		currentSubNav = id;
		
}
	
function collapseChild(id){
	if ($(id).visible()) {
		new Effect.BlindUp(id,{duration: 0.01});
	}
}
	
function mclosetime(id) {
  closeTimer = window.setTimeout("collapseChild(\"" + id + "\")", TimeOut);
}

function mcancelclosetime() {
  if(closeTimer) {
    window.clearTimeout(closeTimer);
    closeTimer = null;
  }
}

function closeAll(){
	var GroupItems = $('menu').getElementsByClassName('subnav');
	for(i=0;i<GroupItems.length;i++){
		if ($(GroupItems[i]).visible()) { 
			if (currentSubNav != GroupItems[i].id) {
				new Effect.BlindUp(GroupItems[i],{duration: 0.01});
			}
		}
	}
}

function HiLite(fieldname) {
	$(fieldname).setStyle({border:'1px solid red'});
}
				
				
				
				
				
				
				
				
/*				
				
				
				
var SearchRules = {

	'#nav2' : function(el) {
			el.onmouseover = function() {
					expandChild('subnav_settings');
					closeAll();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_settings');
					return false;
				}
			}
	,
	'#nav3' : function(el) {
			el.onmouseover = function() {
					expandChild('subnav_page');
					closeAll();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_page');
					return false;
				}
			}
	,
	'#nav4' : function(el) {
			el.onmouseover = function() {
					expandChild('subnav_agenda');
					closeAll();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_agenda');
					return false;
				}
			}
	,
	'#nav5' : function(el) {
			el.onmouseover = function() {
					expandChild('subnav_file');
					closeAll();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_file');
					return false;
				}
			}
	,
	'#nav6' : function(el) {
			el.onmouseover = function() {
					expandChild('subnav_reaction');
					closeAll();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_reaction');
					return false;
				}
			}
	,
	'#nav7' : function(el) {
			el.onmouseover = function() {
					expandChild('subnav_logbook');
					closeAll();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_logbook');
					return false;
				}
			}
	,
	
	
	
	'#subnav_settings' : function(el) {
			el.onmouseover = function() {
					mcancelclosetime();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_settings');
					return false;
				}
			}
	,
	'#subnav_page' : function(el) {
		el.onmouseover = function() {
				mcancelclosetime();
				return false;
			}
		el.onmouseout = function() {
			mclosetime('subnav_page');
				return false;
			}
		}	
	,
	'#subnav_agenda' : function(el) {
			el.onmouseover = function() {
					mcancelclosetime();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_agenda');
					return false;
				}
			}
	,
	'#subnav_file' : function(el) {
			el.onmouseover = function() {
					mcancelclosetime();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_file');
					return false;
				}
			}
	,
	'#subnav_reaction' : function(el) {
			el.onmouseover = function() {
					mcancelclosetime();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_reaction');
					return false;
				}
			}
	,
	'#subnav_logbook' : function(el) {
			el.onmouseover = function() {
					mcancelclosetime();
					return false;
				}
			el.onmouseout = function() {
					mclosetime('subnav_logbook');
					return false;
				}
			}
	,
	'.row_type_1' : function(el) {
			el.onmouseover = function() {
					this.style.backgroundColor= '#BBBBBB';
					return false;
				}
			el.onmouseout = function() {
					this.style.backgroundColor= '#EBEBEB';
					return false;
				}
			}
	,
	'.row_type_2' : function(el) {
			el.onmouseover = function() {
					this.style.backgroundColor= '#BBBBBB';
;
					return false;
				}
			el.onmouseout = function() {
					this.style.backgroundColor= '#D8D8D8';
					return false;
				}
			}
	
}

Behaviour.register(SearchRules);


*/