/////////////////////////////
/////////// START ///////////
/////////////////////////////
//jQuery.noConflict();

/////////////////////////////
//////// CHECKBOXES /////////
/////////////////////////////
jQuery.fn.cssCheckbox = function () {

	jQuery("input[@type='checkbox'] + label", this)
		.each( function(){
			if ( jQuery(this).prev()[0].checked )
				jQuery(this).addClass("checked");
				jQuery(this).replaceWith("<a class='checkbox "+this.className+"' href='#'>" + this.innerHTML + "</a>");
		});
	jQuery("input[@type='checkbox'] + a", this)
		.hover( 
			function() { jQuery(this).addClass("over"); },
			function() { jQuery(this).removeClass("over"); }
		)
		.click( function() {
			this.blur();
			jQuery(this)
				.toggleClass("checked")
				.prev()[0].checked = !jQuery(this).prev()[0].checked;
			return false;
		})
		.prev().hide();
}

// input buttons replacement
jQuery.fn.inputButtonReplacement = function(settings) {
	jQuery(this).each(function() {
		if ((jQuery(this).attr('class').indexOf('grayButton') > -1) || (jQuery(this).attr('class') == 'bidButton') || (jQuery(this).val() == 'makeJob')    ) {
		} else {
			jQuery(this).addClass('grayButton');
			jQuery(this).after('<div class="grayButtonEnd"></div>');
		}
	});
}
// input fields replacement
jQuery.fn.inputFieldReplacement = function(settings) {
	jQuery(this).each(function() {
		if (this.id.indexOf('selectBox_') > -1) return;
		if (jQuery(this).attr('class').indexOf('input') > -1) {
		} else {
			if (this.parentNode.nodeName == 'TD') jQuery(this.parentNode).width(jQuery(this.parentNode).width());
			if (this.defaultValue == '' && this.value != '') this.defaultValue = this.value;
			jQuery(this).addClass('input nonactive');
			jQuery(this).bind('click focus', function(){
				// set active state
				jQuery(this).removeClass('nonactive');
			});
			jQuery(this).bind('blur', function(){
				// set normal state
				if (jQuery(this).val() == jQuery(this).attr('defaultValue')) jQuery(this).addClass('nonactive');
			});
			//if (this.style.width == '') {
				if (this.size > 0 && this.style.width == '') {
					jQuery(this).width(this.size * 5);
				} else {
					if (jQuery(this).width()) {
						if (!document.all) jQuery(this).width(jQuery(this).width() - 11);
			//			else jQuery(this).width(jQuery(this).width());
					}
				}
			//}
			debugInfo(this.name + ": " + jQuery(this).width());
			jQuery(this).after('<div class="inputEnd"></div>');
		}
	});
	jQuery('#profile-form input[type=text], #profile-form input[type=password]').each(function() {
		jQuery(this).bind('keyup', function(){
			// change class if current value differs from default value
			if(jQuery(this).val() != jQuery(this).attr('defaultValue')){
				this.className = 'input-active';
				jQuery(this).next('div').addClass('changed');
			} else {
				this.className = 'input';
				jQuery(this).next('div').removeClass('changed');
			}
		})
	});
}

// select fields replacement
jQuery.fn.selectFieldReplacement = function(settings) {
	jQuery(this).each(function() {
		var childNodes = jQuery(this).children();
		
		var fieldId = jQuery(this).attr('name');
		fieldId = fieldId.replace(/[\[\]]/g, '_');
		//fieldId = fieldId.replace(/\[/g, '_');
		var origFieldId = fieldId;
		var i = 1;
		
		var create = true;
		if (this.style.display == 'none' && document.getElementById('selectBox_'+fieldId + '_boxValue')) {
			debugInfo('field '+fieldId+' allready exists!');
			create = false;
		} 
		
		if (create) {
			while(document.getElementById(fieldId)) fieldId = origFieldId + '_' + i++;
			debugInfo("field "+jQuery(this).attr('name') + ' will have id ' + fieldId);
		}
		

		//alert(childNodes.length);
		var divNodes = Array();
		var idArray = Array();
		var valueArray = Array();
		var divId = '';
		for(var i = 0; i < childNodes.length; i++) {
			divId = 'selectBox_'+fieldId+'_'+i;
			divNodes.push('<div id="'+divId+'" class="dropListOption">'+ (childNodes[i].innerHTML ? childNodes[i].innerHTML : '&nbsp;') +'</div>');
			valueArray.push(childNodes[i].value ? childNodes[i].value : childNodes[i].innerHTML);
			idArray.push(divId);
		}

		var hiddenFieldId = 'selectBox_'+fieldId+'_hidVal';
		hiddenFieldId = hiddenFieldId.replace(/[\[\]]/g, '_');
		//hiddenFieldId = hiddenFieldId.replace('[', '_');		
		if (jQuery(this).attr('id') != '') hiddenFieldId = jQuery(this).attr('id');
		
		jQuery(this).attr('id', hiddenFieldId);
		var selectedValue = jQuery(this).children()[jQuery(this).attr('selectedIndex')].innerHTML;
		if (create) { 
			var selectBoxReplaceMent = Array(
				'<div class="dropList" id="'+fieldId+'"><div class="dropListBody">',
				'<input id="selectBox_'+fieldId+'_boxValue" type="text" value="'+selectedValue+'" readonly="true" />',
				//'<input id="'+hiddenFieldId+'" name="'+jQuery(this).attr('name')+'" type="hidden" value="'+jQuery(this).attr('value')+'" />',
				'</div><div id="selectBox_'+fieldId+'_arrow" class="dropListArrow"></div>',
				'<div id="selectBox_'+fieldId+'_selects" class="dropListOptionsDiv" style="display: none">',
				divNodes.join(''),
				'</div></div>'
			);
			//alert(selectBoxReplaceMent.join(''));
			// prepend it all		
			jQuery(this).before(selectBoxReplaceMent.join(''));
			debugInfo('   selectbox is created');
		} else {
			// fix the children and fill in the selectedNode value
			jQuery('#selectBox_'+fieldId+'_selects').empty().append(divNodes.join(''));
			jQuery('#selectBox_'+fieldId+'_boxValue').attr('value', selectedValue);
		}
		
		//now add the handlers
		jQuery('#selectBox_'+fieldId+'_arrow').get(0).selectsId = 'selectBox_'+fieldId+'_selects';
		jQuery('#selectBox_'+fieldId+'_arrow').get(0).selectsBoxId = 'selectBox_'+fieldId+'_boxValue';
		jQuery('#selectBox_'+fieldId+'_arrow').get(0).hiddenFieldId = hiddenFieldId;
		jQuery('#selectBox_'+fieldId+'_arrow').bind('click', function() { // this is the drop down arrow button
			if (jQuery('#'+this.hiddenFieldId).get(0)) {
				if (jQuery('#'+this.hiddenFieldId).get(0).disabled) return;
				
				if (openedSelectorSelectsBox != '' && openedSelectorSelectsBox != this.selectsId) {
					if (jQuery('#'+openedSelectorSelectsBox).get(0).style.display != 'none') jQuery('#'+openedSelectorSelectsBox).hide();
				}
				jQuery('#'+this.selectsId).toggle();
				if (jQuery('#'+this.selectsId).get(0).style.display != 'none') {
					jQuery('#'+this.selectsId).width(jQuery('#'+this.selectsBoxId).width() + 2);
					if (jQuery('#'+this.selectsId).height() > 100) {
						jQuery('#'+this.selectsId).height(100);
						jQuery('#'+this.selectsId).get(0).style.overflow = 'auto';
					}
					if (jQuery('#'+this.selectsId).get(0).style.overflow == 'auto') jQuery('#'+this.selectsId).width(jQuery('#'+this.selectsBoxId).width() + 19);	// add space for the scrollbar, if applicable.
					jQuery('#'+this.selectsId).get(0).style.marginBottom = '-'+ (jQuery('#'+this.selectsId).height()+1)+'px';
					
					 openedSelectorSelectsBox = this.selectsId;
				}
				else if (openedSelectorSelectsBox == this.selectsId) openedSelectorSelectsBox = '';
			}
		});
		debugInfo('   Arrow onclick initialized');
		if (this.disabled) jQuery('#selectBox_'+fieldId+'_boxValue').get(0).disabled = true;
		jQuery('#selectBox_'+fieldId+'_boxValue').get(0).selectsId = 'selectBox_'+jQuery(this).attr('name')+'_selects';
		jQuery('#selectBox_'+fieldId+'_boxValue').bind('click', function() {
			if (this.disabled) return;
			jQuery('#'+this.selectsId).toggle();
		});
		debugInfo('   After: disabled check');
		
		var func = false;
		if (this.onchange) func = this.onchange;
		var el = '';
		for (var i = 0; i < idArray.length; i++) {
			el = jQuery('#'+idArray[i]);
			if (!el.get(0)) continue;
			//eval('var a = el.get(0); a['+i+'] = Array(); a['+i+'].value = el.get(0).innerHTML;');//ndexKey = i;
			el.get(0).selectsId = 'selectBox_'+fieldId+'_selects';
			el.get(0).inputId = 'selectBox_'+fieldId+'_boxValue';
			el.get(0).inputValueId = hiddenFieldId;
			el.get(0).value = valueArray[i];
			
			jQuery('#'+hiddenFieldId).get(0).parentFunc = func;
			//el.get(0).parentFunc = func;
			
			//alert(el.get(0)[i].value);
			el.get(0).selectedIndex = i;
			el.bind('click', function() {
				jQuery('#'+this.inputId).attr('value', jQuery(this).text());

				switch(jQuery('#'+this.inputValueId).get(0).nodeName) {
					case "INPUT":
						var el = jQuery('#'+this.inputValueId);
						el.attr('value', this.value);
						if (el.get(0).parentFunc) el.get(0).parentFunc();
						break;
					case "SELECT":
						debugInfo("Setting SELECT value from  "+this.inputValueId+" to " + this.value);
						var el = jQuery('#'+this.inputValueId);
						debugInfo(el.attr('id'));
						
						var selOpt = jQuery("#" + el.attr('id') + ' option');
						var wantValue = this.value;
						var runInt = 0;
						var selectedIndex = 0;
						selOpt.each( function() {
							if (this.value == wantValue) {
								this.selected = true;
								selectedIndex = runInt;
								debugInfo("index "+this.nodeName+" val = " + this.value + ' =? ' + wantValue);
							}
							else this.selected = false;
							runInt++;
						});
						debugInfo('selectedIndex ' + selectedIndex);
						el.attr('selectedIndex', selectedIndex);
						el.attr('value', this.value);
						if (el.get(0).parentFunc) el.get(0).parentFunc();
					break;
				}
				

				jQuery('#'+this.selectsId).toggle();
//				if (this.parentFunc) this.parentFunc();
			});
			el.bind('mouseover', function(){
				jQuery(this).toggleClass('dropListOptionHover');
				jQuery(this).toggleClass('dropListOption');
			});
			el.bind('mouseout', function() {
				jQuery(this).toggleClass('dropListOptionHover');
				jQuery(this).toggleClass('dropListOption');
			});
		}
		// adjust width of selectorDiv
		//jQuery('#'+fieldId).width(jQuery(this).width());
		var boxWidth = jQuery(this).width();
		if (jQuery(this).get(0).style.width) boxWidth = parseInt(jQuery(this).get(0).style.width);
		
		if (('console' in window) && ('firebug' in console)) {
//			console.info("NOvAA Logger: boxWidth "+fieldId+" = " + boxWidth);
		}

		jQuery('#selectBox_'+fieldId+'_boxValue').width(boxWidth - 23);
		jQuery('#selectBox_'+fieldId+'_selects').width(jQuery('#selectBox_'+fieldId+'_boxValue').width() + 2);
		if (create) {
			debugInfo('hiding original selectbox ' + this.id);
			jQuery(this).hide();
		}
		//jQuery(this).attr('disabled', 'disabled');
		//jQuery(this).remove();
	});
}
var openedSelectorSelectsBox = '';

var debugInfo = function(value, outputAnyway) {
	if (('console' in window) && ('firebug' in console)) {
		if (outputAnyway) ;
		console.info(value);
	}
}

jQuery.fn.checkDisabledFormFields = function(settings) {
	jQuery(this).each(function() {
		if (this.disabled && !jQuery(this).hasClass('disabled')) {
			this.disabledSet = true;
			jQuery(this).addClass('disabled');
			jQuery(this).next('div').addClass('disabled');
			jQuery(this).parent().next('div.dropListArrow').addClass('disabled');
			if (this.id) { 
				debugInfo('label[for='+this.id+']');
				jQuery('label[for='+this.id+']').addClass('disabled');
			}
		}
		if (!this.disabled && this.disabledSet) {
			jQuery(this).removeClass('disabled');
			jQuery(this).next('div').removeClass('disabled');
			jQuery(this).parent().next('div.dropListArrow').removeClass('disabled');
			if (this.id) jQuery('label[for='+this.id+']').removeClass('disabled');
			this.disabledSet = false;
		}
	});
	setTimeout(function () { jQuery('input,select,button').checkDisabledFormFields() }, 500);
}



// textarea replacement
jQuery.fn.textAreaReplacement = function(settings) {
	jQuery(this).each(function() {		
		if (this.parentNode.className == 'ie6FloatBox') return;
		
		var height = jQuery(this).height();
		var width = jQuery(this).width();

		var divTopLeft = Object();
		var divTopRight = Object();
		var divBottomLeft = Object();
		var divBottomRight = Object();
		
		divTopLeft.left = 0;
		divTopLeft.top = (height+2) * -1 - 10;
		divTopRight.left = width - 3 + 10;
		divTopRight.top = divTopLeft.top;
		divBottomLeft.left = divTopLeft.left;
		divBottomLeft.top = -5;
		divBottomRight.left = divTopRight.left;
		divBottomRight.top = divBottomLeft.top;
		jQuery(this).wrap('<div class="ie6FloatBox"></div>');
		jQuery(this).after('<div style="top: '+divTopLeft.top+'px; left: '+divTopLeft.left+'px;" class="textarea-top-left"></div>');
		jQuery(this).after('<div style="top: '+divTopRight.top+'px; left: '+divTopRight.left+'px;" class="textarea-top-right"></div>');
		jQuery(this).after('<div style="top: '+divBottomLeft.top+'px; left: '+divBottomLeft.left+'px;" class="textarea-bottom-left"></div>');
		jQuery(this).after('<div style="top: '+divBottomRight.top+'px; left: '+divBottomRight.left+'px;" class="textarea-bottom-right"></div>');
		
		return;						   
	});
}

var checkValidity = {
	0 : {
		"bestelform" : {
			"email" : Array("pers_email"),
			"require" : Array("naam", "voorletters", "pers_email"),
			"checkbox" : Array("geslacht"),
			"checkIf" : {}
		}
	},
	1 : {
                "bestelform" : {
                        "email" : Array(),
                        "require" : Array("kantoor", "telefoon", "adres", "postcode", "plaats"),
                        "checkbox" : Array(),
                        "checkIf" : {
                                "type" : "OR",
                                "fields" : {
                                        0 : {"field" : "factuur_adres", "value" : "kantooradres"},
                                        1 : {"field" : "goederen_adres", "value" : "kantooradres"}
                                }
                        }
                }
        },
	2 : {
                "bestelform" : {
                        "email" : Array(),
                        "require" : Array("pers_tel", "pers_adres", "pers_pcode", "pers_plaats"),
                        "checkbox" : Array(),
                        "checkIf" : {
                                "type" : "OR",
                                "fields" : {
                                        0 : {"field" : "factuur_adres", "value" : "prive-adres"},
                                        1 : {"field" : "goederen_adres", "value" : "prive-adres"}
                                }
                        }
                }
        }
}
var emailRegExp = /([:alnum:]+)[@]([:alnum:]+)[.]([:alnum:]+)/i;
var emailRegExp = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i

function checkFormSubmit () {
	var Messages = Array();
	var formRef = this;
	var FormName = '';
	var _fieldCheck = Array();
	if (this.nodeName == 'FORM') FormName = this.name;
	else {
		while (formRef.parentNode && formRef.nodeName != 'FORM') formRef = formRef.parentNode;
		FormName = formRef.name;
	}

	var msgSent = Array();

	for (var num in checkValidity) {
		for (var name in checkValidity[num]) {
			if (name == FormName) {
				var checkInfo = checkValidity[num][name];
				// first check if the checkIf is met
				var check = true;
				if (checkInfo.checkIf.type) {
					var check = false;
					var foundIf = 0; var fieldsChecked = 0;
					for(var i in checkInfo.checkIf.fields) {
						var fieldName = checkInfo.checkIf.fields[i].field;
						var fieldVal = checkInfo.checkIf.fields[i].value;
						if (jQuery("[name="+fieldName+"]", formRef).length > 0) {
							if (jQuery("[name="+fieldName+"]", formRef).val() == fieldVal) foundIf++;
							fieldsChecked++;
						}
					}
					if (foundIf > 0 && checkInfo.checkIf.type == 'OR') check = true;
					if (foundIf == fieldsChecked && checkInfo.checkIf.type == 'AND') check = true;

				}
				if (check) {
					checkFail = false;
					// email check
					for (var i in checkInfo.email) {
						if (parseInt(i) != i) continue;
						var fieldFail = false;
						var field = jQuery('[name=' + checkInfo.email[i] + ']', formRef).get(0);
						if (field) {
							if (!emailRegExp.test(field.value)) { checkFail = true; fieldFail = true; }
							
							_fieldCheck[checkInfo.email[i]] = fieldFail;	
						}
					}
					if (checkFail && !msgSent['email']) {
						Messages.push('Vul a.u.b. een geldig e-mail adres in.');
						msgSent['email'] = true;
					}
					
					// required check
					checkFail = false;
					for(var i in checkInfo.require) {
						if (parseInt(i) != i) continue;

						var fieldFail = false;
						var field = jQuery('[name=' + checkInfo.require[i] + ']', formRef).get(0);
						if (field) {
							if (field.value == "") { checkFail = true; fieldFail = true; }
							
							if (!_fieldCheck[checkInfo.require[i]]) _fieldCheck[checkInfo.require[i]] = fieldFail;
						}
					}
					if (checkFail) 
					if (checkFail && !msgSent['require']) {
						Messages.push('Vul a.u.b. de verplichte velden in.');
						msgSent['require'] = true;
					}
					
					// checkbox check
					checkFail = false;
				} else {
					for (var i in checkInfo.email) if (parseInt(i) == i) {
						if (!_fieldCheck[checkInfo.email[i]]) _fieldCheck[checkInfo.email[i]] = false;
					}
					for (var i in checkInfo.require) if (parseInt(i) == i) {
						if (!_fieldCheck[checkInfo.require[i]]) _fieldCheck[checkInfo.require[i]] = false;
					}
					
				}
			}
		}
	}
	for(var i in _fieldCheck) {
		if (typeof(_fieldCheck[i]) != 'boolean') continue;

		var selector = '[name=' + i + ']';
		var field = jQuery(selector, formRef);

		if (_fieldCheck[i]) {
			field.removeClass('input').addClass('input-active');
			field.next('.inputEnd').addClass('changed');
		} else {
			field.removeClass('input-active').addClass('input');
			field.next('.inputEnd').removeClass('changed');
		}
	}
		

	if (Messages.length > 0) {
		alert(Messages.join("\n"));
		return false;
	}
}

/* Initialise */
jQuery(document).ready(function(){
/*
   if(($.browser.version != '7.0') && ($.browser.msie)) {
	   
   } else {
	   
   }
   */
	//jQuery().cssCheckbox();
	jQuery('input[type=button],button,input[type=submit],input[type=reset]').inputButtonReplacement();
	jQuery('input[type=text], input[type=password]').inputFieldReplacement();
//	jQuery('textarea:visible').textAreaReplacement();
//	jQuery('textarea:hidden').click(function () {jQuery(this).textAreaReplacement(); this.focus(); });
   if(($.browser.version == '7.0') && ($.browser.msie)) {
	   
   } else {
	//	jQuery('select').selectFieldReplacement();
   }
	jQuery('input,select,button').checkDisabledFormFields();
	//jQuery().checkInputValue();

	jQuery('form').bind('submit', checkFormSubmit);
});


/////////////////////////////
////////// RADIO ////////////
/////////////////////////////


jQuery.fn.prettyCheckboxes = function(settings) {
	settings = jQuery.extend({
				checkboxWidth: 17,
				checkboxHeight: 17,
				className : 'prettyCheckbox',
				display: 'list'
			}, settings);
	jQuery(this).each(function(){
		// Find the label
		$label = jQuery('label[for='+jQuery(this).attr('id')+']');

		// Add the checkbox holder to the label
		$label.prepend("<span class='holderWrap'><span class='holder'></span></span>");

		// If the checkbox is checked, display it as checked
		if(jQuery(this).is(':checked')) { $label.addClass('checked'); };

		// Assign the class on the label
		$label.addClass(settings.className).addClass(jQuery(this).attr('type')).addClass(settings.display);

		// Assign the dimensions to the checkbox display
		$label.find('span.holderWrap').width(settings.checkboxWidth).height(settings.checkboxHeight);
		$label.find('span.holder').width(settings.checkboxWidth);

		// Hide the checkbox
		jQuery(this).addClass('hiddenCheckbox');

		// Associate the click event
		$label.bind('click',function(){
			jQuery('input#' + jQuery(this).attr('for')).triggerHandler('click');
			
			if(jQuery('input#' + jQuery(this).attr('for')).is(':checkbox')){
				jQuery(this).toggleClass('checked');
				jQuery('input#' + jQuery(this).attr('for')).checked = true;
			}else{
				$toCheck = jQuery('input#' + jQuery(this).attr('for'));

				// Uncheck all radio
				jQuery('input[name='+jQuerytoCheck.attr('name')+']').each(function(){
					jQuery('label[for=' + jQuery(this).attr('id')+']').removeClass('checked');	
				});

				jQuery(this).addClass('checked');
				$toCheck.checked = true;
			};
		});
		
		jQuery('input#' + $label.attr('for')).bind('keypress',function(e){
			if(e.keyCode == 32){
				if(jQuery.browser.msie){
					jQuery('label[for='+jQuery(this).attr('id')+']').toggleClass("checked");
				}else{
					jQuery(this).trigger('click');
				}
				return false;
			};
		});
	});
};

checkAllPrettyCheckboxes = function(caller, container){
	if(jQuery(caller).is(':checked')){
		// Find the label corresponding to each checkbox and click it
		jQuery(container).find('input[type=checkbox]:not(:checked)').each(function(){
			jQuery('label[for='+jQuery(this).attr('id')+']').trigger('click');
			if(jQuery.browser.msie){
				jQuery(this).attr('checked','checked');
			}else{
				jQuery(this).trigger('click');
			};
		});
	}else{
		jQuery(container).find('input[type=checkbox]:checked').each(function(){
			jQuery('label[for='+jQuery(this).attr('id')+']').trigger('click');
			if(jQuery.browser.msie){
				jQuery(this).attr('checked','');
			}else{
				jQuery(this).trigger('click');
			};
		});
	};
};

$('document').ready(function() {
	$('.dropListOptionsDiv').css('z-index','50');
	$('.dropListOption').css('z-index','50');
	$('.dropListBody').css('z-index','1');
	$('.dropListBody input').css('z-index','1');

})