// JQUERY CONFIGURATION FILE FOR BLACKADMINV2 

$(document).ready(function() {

	
	
	// marcoooooo///////
	
	
	$('#make').change(function(){ 
	
	
							   
	/*var str=$(this).val();
	var valore=str.split(',', 2);	
	alert($.post('/products/listModelByMake/' + $(this).val()));
	*/	
	
		
	
    $.post('/products/listModelByMake/' + $(this).val(), function(data) {
																 
        $("#model").empty().append(data).resetSS();
    }, 'html');
	});
	
	$('#make1').change(function(){ 
	
	
							   
	/*var str=$(this).val();
	var valore=str.split(',', 2);	*/	
	
	//alert($(this).val());
	
	
    $.post('/products/listModelByMake/' + $(this).val(), function(data) {
																//  alert(data);
        $("#model1").empty().append(data).resetSS();
    }, 'html');
	});
	
	
	$('#ProductMarca').change(function(){ 
	var str=$(this).val();
	var valore=str.split(',', 2);							   
	
    $.post('/products/listModelByMake/' + valore, function(data) {
        $("#ProductModello").empty().append(data).resetSS();
		
    }, 'html');
	
});


$('#UserCountryId').change(function(){ 
										
	
    $.post('/users/listRegionByCountry/' + $(this).val(), function(data) {
        $("#UserRegionId").empty().append(data);
    }, 'html');
});
	
	$('#UserRegionId').change(function(){ 
									   
	
    $.post('/users/listDistrictByRegion/' + $(this).val(), function(data) {
        $("#UserDistrictId").empty().append(data).resetSS();
    }, 'html');
});
	
});

$(function() {
		    
		// run the currently selected effect
		function runEffect() {
			
			// run the effect
			$( "#effect" ).show('slide');
		};

		//callback function to bring a hidden box back
		function callback() {
			setTimeout(function() {
				$( "#effect:visible" ).removeAttr( "style" ).fadeOut();
			}, 1000 );
		};

		// set effect from select menu value
		$( "#friends" ).click(function() {
			runEffect();
			return false;
		});
		
		$( "#effect" ).hide();

		
	});

$(function() {

	$( "#close" ).click(function() {
		$( "#effect" ).hide('slide');
	});

});




