jQuery.noConflict();
jQuery(document).ready(function() {
	
	//jQuery("#projecttagchooser .searchbtn").hide();
	
	jQuery("#projecttagchooser select#countrydd").change(function () {

			var countrydocid = jQuery("#projecttagchooser select#countrydd").val();
			//jQuery.post("/assets/chunks/gettags.php", { countryid: countrydocid },
				//function(data){
				//process(data);
			//}, "json");
			
			 jQuery.ajax({
			   type: "POST",
			   url: "assets/js/gettags.php",
			   data: "countryid="+countrydocid,
			   success: function(msg){
				 process(msg)
			   },
			   error: function(obj, status, msg){
				   alert( "Error: " + msg );
			   },
			   dataType: "json"
			 });

			
	});
	//jQuery("#projecttagchooser select#projecttypedd").change(function () {
	//	jQuery("#projecttagchooser").submit();
	//});


});
function process(dataarr) {

	var optionstr = '<option value="0">Please choose...</option>';
	
	if(dataarr.length > 0) {
	for(i = 0; i<dataarr.length; i++) {
		optionstr += '<option value="'+dataarr[i].optionDisplay+'">'+dataarr[i].optionDisplay+'</option>';
	}
	}
	jQuery("#projecttagchooser select#projecttypedd").html(optionstr);
	
}