$(function() {

	//IE
	 if($.browser.msie) { $( function() { 
		$('input')
			.filter(':submit, :button').addClass('input_submit').end()
			.filter(':text, :password').addClass('input_text').end()
			.filter(':radio, :checkbox').addClass('input_check');
			

		//First Box
		$('#boxes li').eq(0).addClass('first-child');

		$('#nav > li')
			.mouseover(function() { $('#nav li').removeClass('hover'); $(this).addClass('hover');})
			.mouseout(function() { $(this).removeClass('hover');});
		
		//TABLES
		$('table tbody tr').mouseover(function() { $(this).addClass('hover'); });
		$('table tbody tr').mouseout(function() { $(this).removeClass('hover'); });				
	 })};
	 
	//TREE
	$(".csc-sitemap li").each(function(i) {
		if ($(this).children('ul').size() == 0) $(this).prepend('<img src="fileadmin/images/tree/file.gif" />');
		else $(this).prepend('<img src="fileadmin/images/tree/folder.gif" />');
	});
	$(".csc-sitemap > ul").Treeview({
			speed: "fast",
			collapsed: false,
			unique: false,
			toggle: function() {
				window.console && console.log && console.log("%o was toggled", $(this).parent());
			}
	});
	
	//TABLES
	$('table').not('.not').children('tbody').children('tr:even').addClass('odd');
	
	//Bedrijven Images Alignment
	/*$('#bedrijven .image').each(function(){
		$(this).css('marginTop',eval(($(this).parent().height() - $(this).height())/2));
	});*/
	
	//Photo  Gallery
	$('#gallery li').each(function(i){
		if (i%3 == 2) { $(this).addClass('tri'); }
		
	});
	
	//Submit buttons
	$('input').filter(':submit, :button').each(function(){
		var x = $(this).attr('value')+' >';
		$(this).attr('value',x);
		$(this).mouseover(function(){
			$(this).addClass('hover');
		});
		$(this).mouseout(function(){
			$(this).removeClass('hover');
		});
	});
} );



function checkVooropleiding(obj, obj2_id) {
  var sel = obj.selectedIndex;
  var text = document.getElementById(obj2_id);
  var selText = obj.options[sel].text;
  if (selText == "Anders" || selText == "Other" || selText == 'anders' || selText == 'other')
  {
    text.disabled = false; 
    text.className = '';
    text.focus();
  }
  else
  {
  	text.value = '';
    text.disabled = true;
    text.className = 'disabled';
  }
}

function cateringkosten(obj, obj2_id) {
  var text = document.getElementById(obj2_id);
  if (obj.checked) {
  	  text.disabled = false;
  }
  else {
  	  text.value = '';
  	  text.disabled = true;
  }
}