$(document).ready(function() {

    // Slider
        $('.slider').cycle({
            fx: 'fade'
        });
    //---/ End Slider


    // Find A Rep
    $('#RepLink').click(function() {
        var currentHref = $('#RepLink').attr('href');
        var selectedCounty = $('#County').find(':selected').val();
        var selectedDistrict = $('#District').find(':selected').val();
        
        if (selectedDistrict == '0') {
                selectedDistrict = '';
        }
        
        if (selectedCounty == '0') {
            selectedCounty = '';         
        }
        
        currentHref = currentHref + '?County=' + selectedCounty + '&district=' + selectedDistrict;

        $('#RepLink').attr('href', currentHref);
    });
    //---/ End Find A Rep
    
    
    // Find A Rep - Replace | for multiple choice
    /*var arrDistrict = $("#district").text().split("|");       
    $("#district").replaceWith("<span id='district'>" + arrDistrict + "</span>");
    var strList = $("#district").text();
    var strNewList = strList.replace(/\,/g,'<br />');
    $("#district").replaceWith("<span id='district'>" + strNewList + "</span>");*/
    //---/ Find A Rep - Replace | (pipe) for multiple choice
    
    
    // Customer Login
    $("#loginMenu").hover(function() {
        $(".login ul ul").fadeIn('fast');                              
    },function(){
        $(".login ul ul").fadeOut('fast');  
    });
	
	
	$(".column1 #menuElem li").hover(function() {
		$(this).addClass("sfhover");
	}, function() {
		$(this).removeClass("sfhover");	
	});
	
	
	// Remove side nav and breadcrumb links
	$(".column1 #menuElem li").each(function() {
		if($(this).has("ul").length == 1){
			$(this).children("a").contents().unwrap();
		}
	});
	
	$(".breadcrumb a:first-child").contents().unwrap();
	//--/ End Remove side nav and breacrumb links

});
