jQuery.noConflict();
jQuery(document).ready(function() {
	
	jQuery("select#countrydd").change(function () {

			var countrydocid = jQuery("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('#othersourceWrap').hide();
	jQuery("select#sourceSelect").change(function() {
		
		if(jQuery(this).val() == '10') jQuery('#othersourceWrap').show();
		
	});


});
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].optionValue+'">'+dataarr[i].optionDisplay+'</option>';
	}
	}
	jQuery("select#projecttypedd").html(optionstr);
	
}
