jQuery.noConflict();

jQuery(function($) {
	// equal columns
	if($('#leftColumn, #content')[0]){
		$('#leftColumn, #content').equalHeight();
	}
	
	$('#status').change(function() {
	  $('#leftColumn, #content').removeAttr('style').equalHeight();
	});
	
	// file input styling
	if($('input[type=file]')[0]){
		$('input[type=file]').filestyle({ 
			 image: "fileadmin/custom/images/btn_browse.gif",
			 imageheight : 27,
			 imagewidth : 113,
			 width : 223
		 });
	}
	
	// custom selects
	if($('.custom')[0]){
		//$('#leftColumn select').sSelect({ddMaxHeight: '300px'});
		$('.custom').jqTransform();
	}
	
	$('.custom:eq(0) .jqTransformSelectWrapper').removeAttr('style').css({"z-index": "100"});
	$('.custom:eq(1) .jqTransformSelectWrapper').removeAttr('style').css({"z-index": "99"});
	$('.custom:eq(2) .jqTransformSelectWrapper').removeAttr('style').css({"z-index": "98"});
	
	// datepickers
	if($('input.inpDate')[0]){
		jQuery(function($){
			$.datepicker.regional.nl = {
				closeText: 'Sluiten',
				prevText: '?',
				nextText: '?',
				currentText: 'Vandaag',
				monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
				'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
				monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun',
				'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
				dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
				dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
				dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
				weekHeader: 'Wk',
				dateFormat: 'dd/mm/yy',
				firstDay: 1,
				isRTL: false,
				showMonthAfterYear: false,
				yearSuffix: ''};
			$.datepicker.setDefaults($.datepicker.regional.nl);
		});
	
		$('input.inpDate').datepicker({
			showOn: 'button',
			buttonImage: 'fileadmin/custom/images/icon_calendar.gif',
			buttonImageOnly: true,
			dateFormat: 'dd-mm-yy'
		});
	}
	
	// table zebra
	$('table.tableList tr:even').addClass('even');
	$('table.tableList tr:odd').addClass('odd');
	
	//Multiple upload buttons
	$('#addMore').click(function(){
		$(this).parent().siblings('.formLine:hidden:first').slideDown('fast', function() {
			$('#leftColumn, #content').removeAttr('style').equalHeight();
		  });
		return false;
	});
	
});
