$(document).ready(function(){
	
	$('#menu UL LI').each(function(){
		var new_width = parseInt($(this).children('A').children('.hover-bg').width()) + 20;
		if (new_width < 72) new_width = 72;
		$(this).children('A').children('.hover-bg').css({'paddingLeft': '0', 'paddingRight': '0', 'width': new_width+'px'});
		$(this).children('.hover-bottom').css({'left': ((new_width - 70) / 2)+'px', 'display': 'block'});
	});
	
	jQuery('INPUT.auto-hint').click(function(){
		if (jQuery(this).attr('value') == jQuery(this).attr('title')) jQuery(this).attr('value', '');
	});
	jQuery('INPUT.auto-hint').blur(function(){
		if (jQuery(this).attr('value') == '') jQuery(this).attr('value', jQuery(this).attr('title'));
	});
	
	// Select box
	var params = {
		changedEl: "SELECT",
		scrollArrows: false
	}
	cuSel(params);
	
	$(".cusel").each(function(){
	    var w = parseInt(jQuery(this).width()),
	        scrollPanel = jQuery(this).find(".cusel-scroll-pane");
	    if(w>=scrollPanel.width())
	    {
	        jQuery(this).find(".jScrollPaneContainer").width(w);
	        scrollPanel.width(w);
	    }
		if (($.browser.msie) && (parseInt(jQuery.browser.version) == 6)) {
			$(this).find('.cusel-scroll-pane').children('SPAN').hover(function(){
				$(this).css('backgroundColor', '#ccc');
			}, function(){
				$(this).css('backgroundColor', '#fff');
			});
		}
	});	
	
});


