/* -----------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
	
	vision.chicodev.com
	File Path: /design/ui/public/javascript/jquery_main.js
	Author: Brent White, chicowebdesign.com
	Version: March 3, 2010
	
--------------------------------------------------------------------------------------
----------------------------------------------------------------------------------- */

// -----------------------------------------------------------------------------------
jQuery(document).ready(function(){ //	START DOCUMENT READY
//------------------------------------------------------------------------------------
	
	// -----------------------------------------------------------------------------------
	initializejQuery(); // INITIALIZE jQUERY
	// -----------------------------------------------------------------------------------
 	
// -----------------------------------------------------------------------------------
}); // END DOCUMENT READY
//------------------------------------------------------------------------------------


// -----------------------------------------------------------------------------------
function initializejQuery() { // START -- INITIALIZE JQUERY
//------------------------------------------------------------------------------------
	
	// -----------------------------------------------------------------------------------
	// LAST CHILD / FIRST CHILD : ADD FIRST / LAST CLASSES
	// -----------------------------------------------------------------------------------
	jQuery('li:last-child').addClass('last');
	jQuery('li:first-child').addClass('first');
	
	/*
	// -----------------------------------------------------------------------------------
	// RESIZE LAYOUT WHEN BROWSER IS GERATER THAN 1200px
	// -----------------------------------------------------------------------------------
	jQuery(window).bind("resize", resizeWindow);
	resizeWindow();
	*/

	// -----------------------------------------------------------------------------------
	// VIDEO PREVIEW
	// -----------------------------------------------------------------------------------
	jQuery("#content #watch_preview").bind("click", function(){
		jQuery("#content #close_preview").css({"display":"block"});
		jQuery("#content #video_preview").css({"display":"block", "opacity":"0"}).stop().fadeTo("slow", 1);
	});
	jQuery("#content #close_preview").bind("click", function(){
		jQuery("#content #video_preview").stop().fadeTo("slow", 0, function(){
			jQuery(this).css({"display":"none"});
		});
		jQuery(this).css({"display":"none"});
	});

	// -----------------------------------------------------------------------------------
	// STARS RATING
	// -----------------------------------------------------------------------------------
	/*
	jQuery(".stars_rating").stars({
	inputType: "select",
	starWidth: 28,
	split: 2,
	captionEl: jQuery(".current_star_rating"),
	oneVoteOnly: true,
	callback: function(ui, type, value) {
		$.getJSON("ratings.php", {rate: value}, function(json) {
			var orgHTML = jQuery(".reviews_count").find("em").html();
			var orgCount = parseFloat(jQuery(".reviews_count").find("strong").html());
			jQuery(".reviews_count").html(value==ui.options.cancelValue ? "Rating removed" : "<em>Thanks for rating!</em>").stop().css("opacity", 1).fadeIn(30);
			setTimeout(function(){ jQuery(".reviews_count").html("<strong>"+(orgCount+1)+"</strong> <em>"+orgHTML+"</em>") }, 2000);
		});
	}
	})
	.find(".button").css({"display":"none"});
	*/
	
	// -----------------------------------------------------------------------------------
	// INPUT -- NUMBERS ONLY
	// -----------------------------------------------------------------------------------
	jQuery('input.numbers_only').bind('keypress', function(e) {
		return ( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)) ? false : true ;
	});
      
	// -----------------------------------------------------------------------------------
	// TABS
	//------------------------------------------------------------------------------------
	//minHeight(".box_style_03 .box_body", 600);
	jQuery("#tabs").tabs(); // this cannot animate
	jQuery(".ui-tabs .ui-tabs-nav li").wrapInner('<span class="ui-tabs-left"><span class="ui-tabs-right"><span class="ui-tabs-middle"></span></span></span>');
	jQuery(".ui-tabs .ui-tabs-nav li a").bind("click", function(){
		jQuery("li").removeClass("ui-tabs-nav-downloads");
	});
	jQuery(".ui-tabs .ui-tabs-nav li a[href='#downloads']").bind("click", function(){
		jQuery(this).parents('.ui-tabs-selected').addClass("ui-tabs-nav-downloads");
	});
	jQuery("#tabs ul li a").click(function(){
		ie6BoxResize();
		ie6ModuleResize();
	});
	
	// -----------------------------------------------------------------------------------
	// BANNER -- SLIDER
	// -----------------------------------------------------------------------------------
	jQuery('#banner .slider').each(function(){
		var slides = jQuery(this).children().length;
		if (slides > 1) {
			jQuery(this)
			.before('<a class="previous" href="#">prev</a>')
			.before('<a class="next" href="#">next</a>');
		}
	})
	.before('<div class="slider_top_left">')
	.before('<div class="slider_top_right">')
	.before('<div class="slider_bottom_left">')
	.before('<div class="slider_bottom_right">')
	.cycle({
		timeout:	8000, // Delay between slides (Changed from 5000 by Travis)
		speed:		1000, // Speed of the slide transition
		delay:		5000, // Delay on the first slide
		sync:		'false',
		pause:		'true',
		prev:		'.previous',
		next:		'.next'
	});
	jQuery('#banner .slider_wrapper .heading').css({"opacity":0.8});

	// -----------------------------------------------------------------------------------
	// MODULE -- SLIDER
	// -----------------------------------------------------------------------------------
	jQuery(".module_body .slider")
	.css({"height":"250px", "overflow":"hidden"})
	.each(function(){
		var slides = jQuery(this).children().length;
		listsize = jQuery("> li", this).size(), perslide = 3;
		var slide_number=1,perslide2=perslide;
		for (var i=0; i<=listsize; i++) {
			if(i>=perslide2) { perslide2+=perslide; slide_number++; }
			var eh = jQuery("> li:eq("+i+")",this);
			eh.addClass("slide_"+ slide_number);
		}
		for (slide_number=1; slide_number<=slides; slide_number++) {
			jQuery(".slide_"+ slide_number, this).appendTo(this).wrapAll('<div class="clear"></div>');
		}
		if (slides > 3) {
			jQuery(this)
			.before('<a class="module_slider_previous" href="#">prev</a>')
			.before('<a class="module_slider_next" href="#">next</a>');
		}
	})
	.cycle({
		fx:			'scrollHorz',
		timeout:	0, // Delay between slides
		speed:		1500, // Speed of the slide transition
		prev:		'.module_slider_previous',
		next:		'.module_slider_next'
	});
	jQuery(".module .slider_body .slider li a span").css({"opacity":0.8});
	
	// -----------------------------------------------------------------------------------
	// MODULE -- SLIDER
	// -----------------------------------------------------------------------------------
	jQuery(".related_products")
	.css({"height":"540px", "overflow":"hidden"})
	.each(function(){
		var slides = jQuery(this).children().length;
		listsize = jQuery("> li", this).size(), perslide = 3;
		var slide_number=1,perslide2=perslide;
		for (var i=0; i<=listsize; i++) {
			if(i>=perslide2) { perslide2+=perslide; slide_number++; }
			var eh = jQuery("> li:eq("+i+")",this);
			eh.addClass("slide_"+ slide_number);
		}
		for (slide_number=1; slide_number<=slides; slide_number++) {
			jQuery(".slide_"+ slide_number, this).appendTo(this).wrapAll('<div class="clear"></div>');
		}
		if (slides > 3) {
			jQuery(this)
			.before('<div class="related_products_paging clear"><a class="related_products_previous" href="#">prev</a><div class="related_products_navigation"></div><a class="related_products_next" href="#">next</a></div>')
			.after('<div class="related_products_paging clear"><a class="related_products_previous" href="#">prev</a><div class="related_products_navigation"></div><a class="related_products_next" href="#">next</a></div>');
		}
	})
	.cycle({
		fx:			'scrollHorz',
		timeout:	0, // Delay between slides
		speed:		1000, // Speed of the slide transition
		prev:		'.related_products_previous',
		next:		'.related_products_next',
		pager:		'.related_products_navigation'
	});
	
	// -----------------------------------------------------------------------------------
	// HEADER -- NAVIGATION
	// -----------------------------------------------------------------------------------
	function HeaderNavigation() {
		headerNavigationObject = this;
		jQuery("#header .navigation *").each(function(){
			jQuery(this).mouseover(function(){
				clearTimeout(headerNavigationObject.windowTimeout);
			})
		});
		jQuery("#header .navigation li").each(function () {
			if (this.parentNode.className == "navigation") {
				jQuery(this).bind("mouseover", function(){
					headerNavigationObject.swapList(this.id);
				});
			};
		});
		
		jQuery("#header .navigation > li")
		.each(function(i){
			jQuery(this).attr("id","main_"+i);
		})
		.each(function(){
			if (jQuery(this).hasClass("active")) {
				headerNavigationObject.main_navigation = this;
			}
		});
		jQuery("#header .navigation").bind("mouseout", function(){
			headerNavigationObject.windowTimeout = window.setTimeout(function(){
				jQuery("#header .navigation li.hover").removeClass("active");
				jQuery("*").removeClass("hover");
				headerNavigationObject.swapList(headerNavigationObject.main_navigation.id);
				jQuery("*").removeClass("hover");
			}, 0)
		});
	}
	HeaderNavigation.prototype.swapList = function(i){
		jQuery("#header .navigation li").each(function(){
			if (this.parentNode.className == "navigation") {
				if (this.id == i) {
					jQuery(this).addClass("active");
					jQuery(this).addClass("hover");
				} else {
					jQuery(this).removeClass("active");
					jQuery(this).removeClass("hover");
				}
			}
		});
		return true;
	};
	headerNavigation = new HeaderNavigation();
	
	/*
	// -----------------------------------------------------------------------------------
	// LEFT COLUMN NAVIGATION EFFECTS
	//------------------------------------------------------------------------------------
	if ($.browser.msie) {
	} else {
		jQuery("#left_column .navigation").each(function(){
			// hover for li
			jQuery(this).children("li")
			.bind("mouseover", function() {
				jQuery(this).addClass("hover").find("a").stop().stop().fadeTo("fast", 1);
			}).bind("mouseout", function(){
				jQuery(this).removeClass("hover").find("a").fadeTo("slow", 0.75);
			});
			// fade out li's that dont have .hover
			jQuery(this).bind("mouseenter", function(){
				jQuery(this).children("li").not(".hover").find("a").fadeTo("fast", 0.75);
			}).bind("mouseleave", function(){
				jQuery(this).find("a").stop().stop().fadeTo("slow", 1);
			});
		});
	};
	*/
	
	
	// -----------------------------------------------------------------------------------
	// SETUP -- SHIPPING OPTIONS
	//------------------------------------------------------------------------------------
	jQuery("input[name=shipping_options]").each(function(){
		jQuery(this).parent().parent("div").find("div").css({"display":"none"});
		jQuery(this).parent("label").click(function(){
			if(jQuery(this).find("input").attr('checked') == true) {
				jQuery(this).parent("div").css({"background":"#c7d9e3"});
				jQuery(this).parent("div").find("div").css({"display":"block"});
			} else {
				jQuery("input[name=shipping_options]").parent().parent("div").css({"background":"none"});
				jQuery("input[name=shipping_options]").parent().parent("div").find("div").css({"display":"none"});
			}
		});
	});

	// -----------------------------------------------------------------------------------
	// HEADER -- NAVIGATION -- SHOP BY CATEGORY -- TURN SINGLE UL INTO MULTIPLE COLUMNS
	// -----------------------------------------------------------------------------------
	jQuery("#header .navigation li.shop_by_category ul").each(function(){
		
		var columns = 4;
	 	var column_count = jQuery(this).children().length;
		var column_width = jQuery(this).width();
		
		jQuery(this).css({"width":(column_width*columns), "left":"50%", "margin-left":(-(column_width*columns)/2)});
		
		if(column_count > 4) {
				
			listsize = jQuery("> li", this).size(), percol = Math.ceil(listsize/columns);
			
			var column_number=1,percol2=percol;
		
			for (var i=0; i<=listsize; i++) {
				if(i>=percol2) { percol2+=percol; column_number++; }
				var eh = jQuery("> li:eq("+i+")",this);
				eh.addClass("li_col"+ column_number);
			}
			for (column_number=1; column_number<=columns; column_number++) {
				jQuery(".li_col"+ column_number, this).appendTo(this).wrapAll('<div style="width: '+(column_width)+'px; float: left;"></div>');
			}
		}
	});
	
	// -----------------------------------------------------------------------------------
	// INPUT FOCUS
	//------------------------------------------------------------------------------------
	inputFocus();
	
	// -----------------------------------------------------------------------------------
	// FIELDSET -- ACCOUNT TYPE -- TAX EXEMPT NUMBER
	// -----------------------------------------------------------------------------------
	if (jQuery("#account_type_home").attr('checked') == true) {
		jQuery(".tax_exempt_number").css({"display":"none"});
	} else {
		jQuery(".tax_exempt_number").css({"display":"block"});
	}
	jQuery("#account_type_home").click(function(){
		if (jQuery(this).attr('checked') == true) {
			jQuery(".tax_exempt_number").stop().fadeTo("slow", 0);
		};
	});
	jQuery("#account_type_organization_business").click(function(){
		if (jQuery(this).attr('checked') == true) {
			jQuery(".tax_exempt_number").stop().fadeTo("slow", 1);
		};
	});
	// -----------------------------------------------------------------------------------
	// FOOTER -- NETWORKING -- SOCIAL ROLLOVER EFFECTS
	// -----------------------------------------------------------------------------------
	jQuery("#footer .networking .social a")
	.bind("mouseover", function() { jQuery(this).parent().children().not(this).stop().fadeTo(".15", 0.25); })
	.bind("mouseout", function() { jQuery(this).parent().children().stop().fadeTo(".15", 1); });
	
	// -----------------------------------------------------------------------------------
	// INITIALIZE HOVER CLASS
	// -----------------------------------------------------------------------------------
	hoverClass("input.button");
	
	// -----------------------------------------------------------------------------------
	// IF INTERNET EXPLORER
	// -----------------------------------------------------------------------------------
	ifInternetExplorer();
	ie6BoxResize();
	
	// -----------------------------------------------------------------------------------
	// SETUP -- COLORBOX
	//------------------------------------------------------------------------------------
	setColorbox("div.colorbox", "800px");
	setColorbox("div.colorbox_small", "600px");
	setColorbox("div.colorbox_x_small", "400px");
	function setColorbox($selector, $width) {
		jQuery($selector).each(function(){
			jQuery(this).css({"width":$width}).wrap('<div class="colorbox_wrapper" style="display: none;"></div>');
			jQuery(this).removeClass('initial-hide'); //added By Travis so login boxes in header work when javascript is enabled
		});
	};
	
	// -----------------------------------------------------------------------------------
	// IF INTERNET EXPLORER
	// -----------------------------------------------------------------------------------
	ie6ModuleResize();
	
	// -----------------------------------------------------------------------------------
	// INITIALIZE -- COLORBOX
	//------------------------------------------------------------------------------------
	jQuery("a.colorbox").each(function(){
		thisREL = jQuery(this).attr("rel");
		thisID = "#" + thisREL;
		jQuery(this).colorbox({inline:true, slideshow:false, photo:false, inline:true, href:thisID});
	});
	
	jQuery("a.colorbox_iframe").each(function(){
		thisHREF = jQuery(this).attr("href");
		thisID = "#" + thisREL;
		jQuery(this).colorbox({iframe:true, slideshow:false, photo:false, iframe:true, href:thisHREF, innerWidth:515, innerHeight:390});
	});
	
	// -----------------------------------------------------------------------------------
	// INITIALIZE -- HOME PAGE TOGGLE TABS (BEN-100304)
	//------------------------------------------------------------------------------------
	jQuery("a.toggle_tab_left").click(function(){
		jQuery(this).addClass("active_left").parent().children("a.toggle_tab_right").removeClass("active_right")
			.parent().children("div.toggle_left").addClass("active")
			.parent().children("div.toggle_right").removeClass("active");
		return false;
	});
	jQuery("a.toggle_tab_right").click(function(){
		jQuery(this).addClass("active_right").parent().children("a.toggle_tab_left").removeClass("active_left")
			.parent().children("div.toggle_right").addClass("active")
			.parent().children("div.toggle_left").removeClass("active");
		return false;
	});
	
	
	// -----------------------------------------------------------------------------------
	// INITIALIZE CART FORMS (TRAVIS-042110)
	//------------------------------------------------------------------------------------
	jQuery('#keep_shopping').click(function(){
		$('#cart_form').attr('action','/vv_add_to_cart.taf?_function=update_cart&submit=shopping');
		});
	jQuery('#continue_to_checkout').click(function(){
		$('#cart_form').attr('action','/vv_add_to_cart.taf?_function=update_cart&submit=checkout');
		});
	jQuery('#update_cart').click(function(){
		$('#cart_form').attr('action','/vv_add_to_cart.taf?_function=update_cart');
		});
		
	
	// -----------------------------------------------------------------------------------
	// INITIALIZE -- HIDE STATE FOR FOREIGN COUNTRIES (TRAVIS-041410)
	//------------------------------------------------------------------------------------
	$(document).ready(function() {
			hideState ('billing_country', 'billing_state') //id of country input; id of state input
		});
		
		$('div#billing_country select').change(function(){
			hideState ('billing_country', 'billing_state');
		});
		
	$(document).ready(function() {
			hideState ('shipping_country', 'shipping_state') //id of country input; id of state input
		});
		
		$('div#shipping_country select').change(function(){
			hideState ('shipping_country', 'shipping_state');
		});
		
	// -----------------------------------------------------------------------------------
	// INITIALIZE -- TOOLTIPS (TRAVIS-041410)
	//------------------------------------------------------------------------------------
	jQuery(".tip_form").tipTip({maxWidth: "auto", edgeOffset: 10, activation: "focus", defaultPosition: "right", delay: 150, fadeIn: 100, fadeOut: 100});
	jQuery(".tip_form_bottom").tipTip({maxWidth: "auto", edgeOffset: 10, activation: "focus", delay: 150, fadeIn: 100, fadeOut: 100});
	
	jQuery(".tip").tipTip({maxWidth: "auto", edgeOffset: 10, defaultPosition: "top", delay: 400, fadeIn: 200, fadeOut: 100});
	jQuery(".tip_bottom").tipTip({maxWidth: "auto", edgeOffset: 10, defaultPosition: "bottom", delay: 400, fadeIn: 200, fadeOut: 100});

	// -----------------------------------------------------------------------------------
	// INITIALIZE -- TEXTAREA LENGTH CONSTRAINT (TRAVIS-052010)
	//------------------------------------------------------------------------------------
	$('textarea[maxlength]').keyup(function(){
		var max = parseInt($(this).attr('maxlength'));
		if($(this).val().length > max){
			$(this).val($(this).val().substr(0, $(this).attr('maxlength')));
		}

		$(this).parent().find('.charsRemaining').html('You have ' + (max - $(this).val().length) + ' characters remaining');

});
	
	
// -----------------------------------------------------------------------------------
}; // END -- INITIALIZE JQUERY
//------------------------------------------------------------------------------------

/*
// -----------------------------------------------------------------------------------
function resizeWindow() { // START -- RESIZE WINDOW
//------------------------------------------------------------------------------------
	if (jQuery(window).width() >= 1200) {
		jQuery("#header .top, #header .bottom, #banner, #content, #footer .top, #footer .bottom").css({"width": "1190px"});
		jQuery("body").css({"min-width":"1200px"});
	};
	if (jQuery(window).width() <= 1240) {
		jQuery("#header .top, #header .bottom, #banner, #content, #footer .top, #footer .bottom").css({"width": "980px"});
		jQuery("body").css({"min-width":"990px"});
	};
	// -----------------------------------------------------------------------------------
	// IF INTERNET EXPLORER
	// -----------------------------------------------------------------------------------
	ifInternetExplorer();
// -----------------------------------------------------------------------------------
}; // END -- RESIZE WINDOW
//------------------------------------------------------------------------------------
*/

// -----------------------------------------------------------------------------------
function inputFocus() { // START -- INPUT FOCUS
//------------------------------------------------------------------------------------
	sfFocus = function() {
		var sfEls = document.getElementsByTagName("INPUT, TEXTAREA");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onfocus=function() {
				this.className+=" focus";
				this.select();
			};
			sfEls[i].onblur=function() {
				this.className=this.className.replace(new RegExp(" focus\\b"), "");
			};
		};
	};
	if (window.attachEvent) window.attachEvent("onload", sfFocus);
	jQuery("input[type=text]").focus(function(){
	    this.select();
	});
// -----------------------------------------------------------------------------------
}; // END -- INPUT FOCUS
//------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
function ifInternetExplorer() { // START -- IF INTERNET EXPLORER
//------------------------------------------------------------------------------------
	
	// -----------------------------------------------------------------------------------
	if ($.browser.msie && $.browser.version.substr(0,1)<7) { // IE LESS THAN 7
	//-----------------------------------------------------------------------------------
		
		// -----------------------------------------------------------------------------------
		// BANNER -- SLIDER -- CORNERS
		// -----------------------------------------------------------------------------------
		jQuery("#banner .slider_bottom_right, #banner .slider_bottom_left").css({"bottom":"-13px"});
		jQuery("#banner .slider_top_right, #banner .slider_bottom_right, #banner .next").css({"right":"-1px"});
	
	// -----------------------------------------------------------------------------------
	}; // END IE LESS THAN 7
	// -----------------------------------------------------------------------------------
	
// -----------------------------------------------------------------------------------
}; // END -- IF INTERNET EXPLORER
//------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
function ie6BoxResize() { // START -- IF INTERNET EXPLORER
//------------------------------------------------------------------------------------
	
	// -----------------------------------------------------------------------------------
	if ($.browser.msie && $.browser.version.substr(0,1)<7) { // IE LESS THAN 7
	//-----------------------------------------------------------------------------------
		
		// -----------------------------------------------------------------------------------
		// CONTENT -- BOX
		// -----------------------------------------------------------------------------------
		jQuery(".box_top, .box_bottom, .box_middle").each(function(){
			jQuery(this).css({"width": (jQuery(this).parent().outerWidth() - 10)});
		});
		jQuery(".box_left, .box_right, .box_middle").each(function(){
			jQuery(this).css({"height": (jQuery(this).parent().height() - 50)});
		});
	
	// -----------------------------------------------------------------------------------
	}; // END IE LESS THAN 7
	// -----------------------------------------------------------------------------------
	
// -----------------------------------------------------------------------------------
}; // END -- IF INTERNET EXPLORER
//------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
function ie6ModuleResize() { // START -- IF INTERNET EXPLORER
//------------------------------------------------------------------------------------
	
	// -----------------------------------------------------------------------------------
	if ($.browser.msie && $.browser.version.substr(0,1)<7) { // IE LESS THAN 7
	//-----------------------------------------------------------------------------------
		
		// -----------------------------------------------------------------------------------
		// CONTENT -- MODULE
		// -----------------------------------------------------------------------------------
		jQuery(".module_top, .module_bottom, .module_middle").each(function(){
			jQuery(this).css({"width": (jQuery(this).parent().width() - 30)});
		});
		jQuery(".module_left, .module_right, .module_middle").each(function(){
			jQuery(this).css({"height": (jQuery(this).parent().height() - 130)});
		});
	
		// -----------------------------------------------------------------------------------
		// HEADER -- SEARCH DROPDOWN
		// -----------------------------------------------------------------------------------
		jQuery(".dropdown_top, .dropdown_bottom, .dropdown_middle").each(function(){
			jQuery(this).css({"width": (jQuery(this).parent().width() - 19)});
		});
		jQuery(".dropdown_left, .dropdown_right, .dropdown_middle").each(function(){
			if((jQuery(this).parent().height() - 174 -13 -6 )>0){
				jQuery(this).css({"height": (jQuery(this).parent().height() - 174 -13)});
			}else{
				jQuery(this).css({"display": "none"});
			};
		});
		jQuery(".dropdown_top_left, .dropdown_top_right, .dropdown_top").each(function(){
			jQuery(this).css({"height": (jQuery(this).parent().height() - 13)});
		});
	
	// -----------------------------------------------------------------------------------
	}; // END IE LESS THAN 7
	// -----------------------------------------------------------------------------------
	
// -----------------------------------------------------------------------------------
}; // END -- IF INTERNET EXPLORER
//------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
function hoverClass(selector) { // START -- HOVER CLASS
//------------------------------------------------------------------------------------
	
	jQuery(selector).bind("mouseenter", function(){
		jQuery(this).addClass("hover");
	}).bind("mouseleave", function(){
		jQuery(this).removeClass("hover");
	});
	
// -----------------------------------------------------------------------------------
}; // END -- IF HOVER CLASS
//------------------------------------------------------------------------------------


// -----------------------------------------------------------------------------------
function minHeight(selector, minHeight) { // START -- MAX PROPORTIONS
//------------------------------------------------------------------------------------
	jQuery(selector).each(function() {
		var height = $(this).height();
		if (height < minHeight) {
			jQuery(this).css("height", minHeight + "px");
		}
	});
// -----------------------------------------------------------------------------------
}; // END -- MAX PROPORTIONS
//------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
function hideState (countryId, stateId) { // START -- HIDE STATE FOR FOREIGN COUNTRY
//------------------------------------------------------------------------------------
		var country = $('#' + countryId + ' select :selected').text();
		var stateDiv = $('#' + stateId);
		var state = $('#' + stateId + ' select');
		if (country != 'United States' && country != 'Canada' && country != 'Select A Country' )
			{
			jQuery(state).attr('value', '0');
			jQuery(stateDiv).slideUp('fast');
			//$(state).removeClass('required'); //<@Comment>FixLater - Change this to whatever class the validator is looking for, so state is not validated</@Comment>
			}
		else
			{
			//alert ('Country is '+ country);
			jQuery(stateDiv).slideDown('fast');
			//$(state).addClass('required'); //<@Comment>FixLater - Change this to whatever class the validator is looking for, so state is not validated</@Comment>
			}
// -----------------------------------------------------------------------------------
}; // END -- HIDE STATE FOR FOREIGN COUNTRY
//------------------------------------------------------------------------------------


