var brands = $('#brands').val();

function drop_down_list()
{
    brands = $('#brands').val();
    $('#loading_prodtype_drop_down').show(); // Show the Loading...

	$.get(
			"getProductTypes.php?bname="+brands,
			{language: "php", version: 5},
			function(responseText){
				$("#ptypes").html(responseText);
			 	$('#loading_prodtype_drop_down').hide(); // Hide the Loading...
				drop_down_list2();
			},
			"html"
		);

}


$(document).ready(function(){
$("#brands").change(drop_down_list);
});

$(window).load(drop_down_list);

function drop_down_list2()
{
    var brands = $('#brands').val();
    var ptypes = $('#ptypes').val();
	
    $('#loading_subtype_drop_down').show(); // Show the Loading...

	$.get(
			"getProductSubTypes.php?bname="+brands+"&ptype="+ptypes,
			{language: "php", version: 5},
			function(responseText){
				$("#stypes").html(responseText);
			 	$('#loading_subtype_drop_down').hide(); // Hide the Loading...
			    drop_down_list3();
			},
			"html"
		);
}


$(document).ready(function(){
$("#ptypes").change(drop_down_list2);
});

//$(window).load(drop_down_list2);



function drop_down_list3()
{
    var brands = $('#brands').val();
    var ptypes = $('#ptypes').val();
    var stypes = $('#stypes').val();
	
    $('#loading_products').show(); // Show the Loading...
	$.get(
			"getProducts.php?bname="+brands+"&ptype="+ptypes+"&stype="+stypes,
			{language: "php", version: 5},
			function(responseText){
				$("#products").html(responseText);
			 	$('#loading_products').hide(); // Hide the Loading...
				loadProducts();
			},
			"html"
		);

}


$(document).ready(function(){
$("#stypes").change(drop_down_list3);
});

//$(window).load(drop_down_list3);


function loadProducts()
{
    var products = $('#products').val();
	$.get(
			"getAProduct.php?bname="+brands+"&pid="+products,
			{language: "php", version: 5},
			function(responseText){
				$("#maincontent").html(responseText);
			 	$('#loading_products').hide(); // Hide the Loading...

			},
			"html"
		);

}

$(document).ready(function(){
$("#products").change(loadProducts);
});


//$(window).load(loadProducts);

