/*
 * UPDATED: 12.19.07
 *
 * jNice
 * by Sean Mooney (sean@whitespace-creative.com) 
 *
 * To Use: place in the head 
 *  <link href="inc/style/jNice.css" rel="stylesheet" type="text/css" />
 *  <script type="text/javascript" src="inc/js/jquery.jNice.js"></script>
 *
 * And apply the jNice class the form you want to style
 *
 * To Do: Add textareas, Add File upload
 *
 ******************************************** */
(function($){
	$.fn.jNice = function(options){
		var self = this;
		var safari = $.browser.safari; /* We need to check for safari to fix the input:text problem */
	
	
		/* each form */
		this.each(function(){
			/***************************
			  Buttons
			 ***************************/
			var setButton = function(){
				$(this).replaceWith('<button id="'+ this.id +'" name="'+ this.name +'" type="'+ this.type +'" class="'+ this.className +'"><span><span>'+ $(this).attr('value') +'</span></span>');
			};
			$('input:submit, input:reset', this).each(setButton);
			
			
			/***************************
			  Text Field - Browse Page 
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput").wrap('<div class="jNiceInputWrapper"><div class="jNiceInputInner"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.myinput:input:text:visible, .myinput:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceInputWrapper').each(function(){$(this).addClass('jNiceSafari').find('myinput').css});}
			
			
			
			
			/***************************
			  Text Fields - Home Page Login
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput22").wrap('<div class="jNiceInputWrapper22"><div class="jNiceInputInner22"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper22');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.myinput22:input:text:visible, .myinput22:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
				if (safari){$('.jNiceInputWrapper').each(function(){$(this).addClass('jNiceSafari22').find('myinput22').css});}
				
				
				
				
			 /***************************
			  Text Fields - Signup Page
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput33").wrap('<div class="jNiceInputWrapper33"><div class="jNiceInputInner33"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper33');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.myinput33:input:text:visible, .myinput33:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
				if (safari){$('.jNiceInputWrapper').each(function(){$(this).addClass('jNiceSafari33').find('myinput33').css});}
				

			
			
			/***************************
			  Text Field - Mail Form Subject 
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput44").wrap('<div class="jNiceInputWrapper44"><div class="jNiceInputInner44"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper44');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.msubject:input:text:visible, .msubject:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceInputWrapper44').each(function(){$(this).addClass('jNiceSafari44').find('msubject').css});}
			
			
			
			
	         /***************************
			  Text Fields - Club Profile - Directions Address Input
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput55").wrap('<div class="jNiceInputWrapper55"><div class="jNiceInputInner55"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper55');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.myinput55:input:text:visible, .myinput55:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
				if (safari){$('.jNiceInputWrapper55').each(function(){$(this).addClass('jNiceSafari55').find('myinput55').css});}
				
				
				
		     /***************************
			  Text Fields - Club Profile - Directions Address Input
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput66").wrap('<div class="jNiceInputWrapper66"><div class="jNiceInputInner66"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper66');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.myinput66:input:text:visible, .myinput66:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
				if (safari){$('.jNiceInputWrapper66').each(function(){$(this).addClass('jNiceSafari66').find('myinput66').css});}
				
				
				
		     /***************************
			  Text Fields - Club Profile - Directions Zipcode Input
			 ***************************/
			var setText = function(){
				var $input = $(this);
				$input.addClass("jNiceInput77").wrap('<div class="jNiceInputWrapper77"><div class="jNiceInputInner77"><div></div></div></div>');
				var $wrapper = $input.parents('div.jNiceInputWrapper77');
				$wrapper.css("width", $(this).width()+10);
				$input.focus(function(){
					$wrapper.addClass("jNiceInputWrapper_hover");
				}).blur(function(){
					$wrapper.removeClass("jNiceInputWrapper_hover");
				});
			};
			$('.myinput77:input:text:visible, .myinput77:input:password', this).each(setText);
			/* If this is safari we need to add an extra class */
				if (safari){$('.jNiceInputWrapper77').each(function(){$(this).addClass('jNiceSafari77').find('myinput77').css});}
				
				
				
				
			/***************************
			  Check Boxes 
			 ***************************/
			$('.mycheck2:input:checkbox', this).each(function(){
				$(this).addClass('jNiceHidden').wrap('<span></span>');
				var $wrapper = $(this).parent();
				$wrapper.prepend('<a href="#" class="jNiceCheckbox"></a>');
				/* Click Handler */
				$(this).siblings('a.jNiceCheckbox').click(function(){
						var $a = $(this);
						var input = $a.siblings('input')[0];
						if (input.checked===true){
							input.checked = false;
							$a.removeClass('jNiceChecked');
						}
						else {
							input.checked = true;
							$a.addClass('jNiceChecked');
						}
						return false;
				});
				/* set the default state */
				if (this.checked){$('a.jNiceCheckbox', $wrapper).addClass('jNiceChecked');}
			});
			
			
			
			/***************************
			  Check Box For Blacklisting
			 ***************************/
			$('.mycheck:input:checkbox', this).each(function(){
				$(this).addClass('jNiceHidden').wrap('<span></span>');
				var $wrapper = $(this).parent();
				$wrapper.prepend('<a href="#" class="jNiceCheckbox2"></a>');
				/* Click Handler */
				$(this).siblings('a.jNiceCheckbox2').click(function(){
						var $a = $(this);
						var input = $a.siblings('input')[0];
						if (input.checked===true){
							input.checked = false;
							$a.removeClass('jNiceChecked2');
						}
						else {
							input.checked = true;
							$a.addClass('jNiceChecked2');
						}
						return false;
				});
				/* set the default state */
				if (this.checked){$('a.jNiceCheckbox2', $wrapper).addClass('jNiceChecked2');}
			});
			
			

			
			
			
			
			/***************************
			  Radios 
			 ***************************/
			$('input:radio', this).each(function(){
				$input = $(this);
				$input.addClass('jNiceHidden').wrap('<span class="jRadioWrapper"></span>');
				var $wrapper = $input.parent();
				$wrapper.prepend('<a href="#" class="jNiceRadio" rel="'+ this.name +'"></a>');
				/* Click Handler */
				$('a.jNiceRadio', $wrapper).click(function(){
						var $a = $(this);
						$a.siblings('input')[0].checked = true;
						$a.addClass('jNiceChecked');
						/* uncheck all others of same name */
						$('a[rel="'+ $a.attr('rel') +'"]').not($a).each(function(){
							$(this).removeClass('jNiceChecked').siblings('input')[0].checked=false;
						});
						return false;
				});
				/* set the default state */
				if (this.checked){$('a.jNiceRadio', $wrapper).addClass('jNiceChecked');}
			});
	
	
	
			
			
			/***************************
			  Selects 
			 ***************************/
			$('select.myselect2', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper"></div>');
				var $wrapper = $(this).parent().css({zIndex: 100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
			/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper').each(function(){$(this).addClass('jNiceSafari2').find('select').css});}
			
			
			
			
			
			
			
			
			 /***************************
			  Selects 2
			 ***************************/
			$('select.myselect', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper2"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen2"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper2').each(function(){$(this).addClass('jNiceSafari2').find('select').css});}
			
			
			
			
			
			
			 /***************************
			  Selects 3
			 ***************************/
			$('select.myselect3', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper3"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen3"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper3').each(function(){$(this).addClass('jNiceSafari3').find('select').css});}
			
			
			
			
			 /***************************
			  Selects 4
			 ***************************/
			$('select.myselect4', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper4"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen4"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper4').each(function(){$(this).addClass('jNiceSafari4').find('select').css});}
			
			
			
			 /***************************
			  Selects 5
			 ***************************/
			$('select.myselect5', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper5"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen5"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper5').each(function(){$(this).addClass('jNiceSafari5').find('select').css});}
			
			
			
			
			
			 /***************************
			  Selects 6
			 ***************************/
			$('select.myselect6', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper6"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen6"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper6').each(function(){$(this).addClass('jNiceSafari6').find('select').css});}
			
			
			
			
			 /***************************
			  Selects 7
			 ***************************/
			$('select.myselect7', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper7"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen7"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper7').each(function(){$(this).addClass('jNiceSafari7').find('select').css});}
			
			
			
			
			
			
			/***************************
			  Selects 8
			 ***************************/
			$('select.myselect8', this).each(function(index){
				var $select = $(this);
				/* First thing we do is Wrap it */
				$(this).addClass('jNiceHidden').wrap('<div class="jNiceSelectWrapper8"></div>');
				var $wrapper = $(this).parent().css({zIndex:100-index});
				/* Now add the html for the select */
				$wrapper.prepend('<div><span></span><a href="#" class="jNiceSelectOpen8"></a></div><ul></ul>');
				var $ul = $('ul', $wrapper);
				/* Now we add the options */
				$('option', this).each(function(i){
					$ul.append('<li><a href="#" index="'+ i +'">'+ this.text +'</a></li>');
				});
				/* Hide the ul and add click handler to the a */
				$ul.hide().find('a').click(function(){
						$('a.selected', $wrapper).removeClass('selected');
						$(this).addClass('selected');	
						/* Fire the onchange event */
						if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
						$select[0].selectedIndex = $(this).attr('index');
						$('span:eq(0)', $wrapper).html($(this).html());
						$ul.hide();
						return false;
				});
				/* Set the defalut */
				$('a:eq('+ this.selectedIndex +')', $ul).click();
			});/* End select each */
			
				/* If this is safari we need to add an extra class */
			if (safari){$('.jNiceSelectWrapper8').each(function(){$(this).addClass('jNiceSafari8').find('select').css});}
			
			
			
			
			
			
			
			
			
			
			

			
			/* Apply the click handler to the Open */
			$('a.jNiceSelectOpen, a.jNiceSelectOpen2, a.jNiceSelectOpen3, a.jNiceSelectOpen4, a.jNiceSelectOpen5, a.jNiceSelectOpen6, a.jNiceSelectOpen7, a.jNiceSelectOpen8', this).click(function(){
														var $ul = $(this).parent().siblings('ul');
														if ($ul.css('display')=='none'){hideSelect();} /* Check if box is already open to still allow toggle, but close all other selects */
    													$ul.slideToggle();
														var offSet = ($('a.selected', $ul).offset().top - $ul.offset().top);
														$ul.animate({scrollTop: offSet});
														return false;
												});
		
		}); /* End Form each */
		
		
		
		
		
		
		/* Hide all open selects */
		var hideSelect = function(){
			$('.jNiceSelectWrapper ul:visible, .jNiceSelectWrapper2 ul:visible, .jNiceSelectWrapper3 ul:visible, .jNiceSelectWrapper4 ul:visible, .jNiceSelectWrapper5 ul:visible, .jNiceSelectWrapper6 ul:visible, .jNiceSelectWrapper7 ul:visible, .jNiceSelectWrapper8 ul:visible,').hide();
		};
		
		
		
		/* Check for an external click */
		var checkExternalClick = function(event) {
			if ($(event.target).parents('.jNiceSelectWrapper, .jNiceSelectWrapper2, .jNiceSelectWrapper3, .jNiceSelectWrapper4, .jNiceSelectWrapper5, .jNiceSelectWrapper6, , .jNiceSelectWrapper7, .jNiceSelectWrapper8').length === 0) { hideSelect(); }
		};
		
	

		/* Apply document listener */
		$(document).mousedown(checkExternalClick);
		
			
		/* Add a new handler for the reset action */
		var jReset = function(f){
			var sel;
			$('.jNiceSelectWrapper select', f).each(function(){sel = (this.selectedIndex<0) ? 0 : this.selectedIndex; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
			
				$('.jNiceSelectWrapper2 select2', f).each(function(){sel = (this.selectedIndex2<0) ? 0 : this.selectedIndex2; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
				
					$('.jNiceSelectWrapper3 select3', f).each(function(){sel = (this.selectedIndex3<0) ? 0 : this.selectedIndex3; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
					
						$('.jNiceSelectWrapper4 select4', f).each(function(){sel = (this.selectedIndex4<0) ? 0 : this.selectedIndex4; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
						
							$('.jNiceSelectWrapper5 select5', f).each(function(){sel = (this.selectedIndex5<0) ? 0 : this.selectedIndex5; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
							
								$('.jNiceSelectWrapper6 select6', f).each(function(){sel = (this.selectedIndex6<0) ? 0 : this.selectedIndex6; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
								
									$('.jNiceSelectWrapper7 select7', f).each(function(){sel = (this.selectedIndex7<0) ? 0 : this.selectedIndex7; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
									
										$('.jNiceSelectWrapper7 select8', f).each(function(){sel = (this.selectedIndex7<0) ? 0 : this.selectedIndex7; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
				
				
		
			$('a.jNiceCheckbox, a.jNiceRadio', f).removeClass('jNiceChecked');
			$('input:checkbox, input:radio', f).each(function(){if(this.checked){$('a', $(this).parent()).addClass('jNiceChecked');}});
		};
		this.bind('reset',function(){var action = function(){jReset(this);}; window.setTimeout(action, 10);});
		
	};/* End the Plugin */
	
	
	
	
	
	

	/* Automatically apply to any forms with class jNice */
	$(function(){$('form.jNice').jNice();	});
	

})(jQuery);
				   

