/* 
	Product selector 
	- Fires on selecting a product from the dropdown, fires off an ajax call to retrieve the proper
		industry and application for this product.
		It then sets the industry and application dropdowns with this result
*/

function onSelectProduct() {

	var sel = jQuery('#title').val();
	alert (sel);

	jQuery.ajax({
		url : 'http://' + window.location.hostname + '/wp-content/themes/alchemie/includes/php/product_selector_ajax.php',
		type: "POST",
		data: "pref=" + sel,
		success : function(data) {

			if (data.status == "ERROR") {
				alert ('An error has occurred');
			} else if (data.status == "OK") {
				alert ('right');			
			} 
			
		}
	});

}
